Skip to content

Instantly share code, notes, and snippets.

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

@belzecue
belzecue / RingBufferDic.gd
Created February 24, 2022 15:54
Godot ring buffer using Dictionary. Can pop FIFO or LIFO.
class_name RingBufferDic extends Node
enum PopMode {LIFO, FIFO}
export(int) var maxHistoryEntries := 32
var history := {}
var hwm := 0 # high water mark
var LIFO := -1 # -1 means buffer empty
var FIFO := -1 # -1 means buffer empty
var pop_counter := 0
@Jesuszilla
Jesuszilla / cvs2_pushback.cns
Last active September 1, 2023 09:32
CvS2 Pushback System for M.U.G.E.N
; -- HITDEF ARRAY SEQUENCE (NORMAL SPEED) ------------------------------ X DIST -- DESCRIPTION ----------------------- HITDEF ID -
; 6, 5, 4, 4, 3, 2, 2, 1, 1, 1, 1 30 Ground Light/Air Medium/Heavy (ID 1)
; 6, 6, 6, 5, 5, 5, 4, 4, 3, 3, 2, 1, 1, 1, 1, 1 54 Ground Medium (ID 2)
; 8, 8, 8, 7, 7, 7, 6, 5, 5, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1 78 Ground Heavy (ID 3)
; 4, 4, 4, 4, 3, 3, 3, 2, 1, 1, 1 30 Alternate Light Pushback (ID 4)
; 2, 2, 2, 1, 1 10 Super Light Pushback (ID 5)
; 9, 9, 9, 8, 8, 8, 7, 6, 6, 5, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1 102 Manchester Gold (ID 6)
; 6, 5, 4, 4, 3, 3, 3, 2, 1 31 Air Light (ID 7)
; 3, 3, 3, 3, 2, 2, 2, 1, 1 20 Rolling Buckler (ID 8)
; 3, 2, 2, 2, 1, 1, 1 12 Ground CC Light/Air Medium/Heavy (ID 11)
Readme: In the following pseudo code, [] indicates a subroutine.
Sometimes I choose to write the subroutine inline under the [] in order to maintain context.
One important fact about the way rollbacks are handled here is that we are storing state for every frame.
In any real implementation you only need to store one game state at a time. Storing a game
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones.
==Constants==
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing.
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
-- Basic ring buffer utility, to spare the hassle.
local ringbuffer = {}
local ringbuffer_mt = {}
local function new(_items)
local t = {
items = _items or {},
current = 1
}
return setmetatable(t, ringbuffer_mt)
@baines
baines / freetype-atlas.c
Created July 15, 2016 13:32
minimal freetype texture atlas example
#include <stdio.h>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#define NUM_GLYPHS 128
struct glyph_info {
int x0, y0, x1, y1; // coords of glyph in the texture atlas
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active May 5, 2024 18:07
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>
#include <stdexcept>
#include <cmath>
#include <vector>
#include <Windows.h>
#include <Psapi.h>
#include <detours.h>
#include <d3d9.h>
#include <d3dx9.h>
#define PI 3.14159F