Skip to content

Instantly share code, notes, and snippets.

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active April 18, 2026 17:19
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

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](https:

@davesteele
davesteele / cache_dict.py
Last active June 6, 2025 18:03
Python LRU Caching Dictionary - a dict with a limited number of entries, removing LRU elements as necessary
from collections import OrderedDict
# >>> import cache_dict
# >>> c = cache_dict.CacheDict(cache_len=2)
# >>> c[1] = 1
# >>> c[2] = 2
# >>> c[3] = 3
# >>> c
# CacheDict([(2, 2), (3, 3)])
# >>> c[2]
@BigRoy
BigRoy / usdviewport_qt.py
Last active December 5, 2025 06:26
Example of how to embed a simple USD viewport in Qt application
"""
MIT License
Copyright (c) 2019 Roy Nieterau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@mbinna
mbinna / effective_modern_cmake.md
Last active April 2, 2026 07:57
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@Kif11
Kif11 / obj_in_frust.py
Created June 7, 2017 17:11
Maya script to find if object located within camera frustum
import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
import math
# Find if object located within camera frustum
# Usage:
# from obj_in_frust import in_frustum
# in_frustum('camera1', 'pCube1')
class Plane(object):
@borgfriend
borgfriend / maya2017install.sh
Last active December 26, 2025 02:05
Maya 2017 Installation on Ubuntu 16.04
#!/bin/bash
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!
exit
fi
#Check for 64-bit arch
if [uname -m != x86_64]; then
@arseniy-panfilov
arseniy-panfilov / exr_to_srgb.py
Last active May 20, 2025 18:48
Convert .EXR image to pillow's `Image` with gamma encoding
from PIL import Image
import OpenEXR
import Imath
import numpy
import numexpr as ne
FLOAT = Imath.PixelType(Imath.PixelType.FLOAT)
def exr_to_array(exrfile):
@AndrewHazelden
AndrewHazelden / check_batch_mode.py
Last active May 9, 2023 07:38
A python script to check if Maya is running in Batch mode or with a GUI
# Check if Maya is running in Batch mode or with a GUI
# A return value of 1 means Batch Mode, 0 means GUI mode
def checkMayaGuiBatchMode():
"""
Maya tip on detecting Maya Batch mode is from Michael Scarpa's blog post "MEL Sillyness":
http://www.scarpa.name/2010/12/16/mel-sillyness/
"""
# Check if Maya is running in batch mode or with a GUI
import maya.OpenMaya
@zed
zed / binary16.py
Last active July 30, 2022 00:19
IEEE 754 floating-point binary16
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Support for IEEE 754 half-precision binary floating-point format: binary16.
>>> [binary16(f) for f in [0.006534, -.1232]] == [b'\xb0\x1e', b'\xe2\xaf']
True
"""
from __future__ import division
import struct
from math import copysign, frexp, isinf, isnan, trunc