Skip to content

Instantly share code, notes, and snippets.

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active October 24, 2024 16:16
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@xavierfoucrier
xavierfoucrier / gpg-signing.md
Last active October 23, 2024 02:56
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key
@munificent
munificent / generate.c
Last active September 15, 2024 03:16
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@jspohr
jspohr / microsecs.c
Last active September 1, 2024 21:55
Avoid overflow when converting time to microseconds
// Taken from the Rust code base: https://github.com/rust-lang/rust/blob/3809bbf47c8557bd149b3e52ceb47434ca8378d5/src/libstd/sys_common/mod.rs#L124
// Computes (value*numer)/denom without overflow, as long as both
// (numer*denom) and the overall result fit into i64 (which is the case
// for our time conversions).
int64_t int64MulDiv(int64_t value, int64_t numer, int64_t denom) {
int64_t q = value / denom;
int64_t r = value % denom;
// Decompose value as (value/denom*denom + value%denom),
// substitute into (value*numer)/denom and simplify.
// r < denom, so (denom*numer) is the upper bound of (r*numer)
@mrcdk
mrcdk / MacroEnum.hx
Last active December 24, 2015 11:43
abstract enum toString() macro
package ;
#if macro
import haxe.macro.Context;
import haxe.macro.Printer;
import haxe.macro.Expr;
class MacroEnum {
macro public static function buildToString():Array<Field> {
@urraka
urraka / stb.c
Last active September 16, 2024 17:12
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#include "stb_image.h"
#include "stb_image_write.h"
@kelvinn
kelvinn / gist:512f72bf1015047af945
Created June 6, 2014 13:01
Recursively Change Line Endings (Windows)
REM On Unix you would do this: find ./ -type f -exec dos2unix {} \;
REM After installing dos2unix.exe in Windows, you can create a small bat script with the below in it to
REM recursively change the line endings. Careful if you have any hidden directories (e.g. .git)
for /f "tokens=* delims=" %%a in ('dir "C:\Users\username\path\to\directory" /s /b') do (
"C:\Program Files\unix2dos.exe" %%a
)
@rygorous
rygorous / gist:8908164
Created February 10, 2014 00:16
Game changer.
static __m128i const shuffles[16] = {
#define _ -1 // for readability
{ _,_,_,_, _,_,_,_, _,_,_,_, _,_,_,_ }, // 0000
{ 0,1,_,_, _,_,_,_, _,_,_,_, _,_,_,_ }, // 0001
{ _,_,_,_, 0,1,_,_, _,_,_,_, _,_,_,_ }, // 0010
{ 0,1,_,_, 2,3,_,_, _,_,_,_, _,_,_,_ }, // 0011
{ _,_,_,_, _,_,_,_, 0,1,_,_, _,_,_,_ }, // 0100
{ 0,1,_,_, _,_,_,_, 2,3,_,_, _,_,_,_ }, // 0101
{ _,_,_,_, 0,1,_,_, 2,3,_,_, _,_,_,_ }, // 0110
{ 0,1,_,_, 2,3,_,_, 4,5,_,_, _,_,_,_ }, // 0111