Skip to content

Instantly share code, notes, and snippets.

@mrkybe
mrkybe / what_a_tile_map_api_could_look_like.md
Last active February 25, 2026 04:40
What I actually want a Game Engine to handle for me: ie, make it easy to do the right thing, make it hard to block the render thread

What I actually want a Game Engine to handle for me: ie, make it easy to do the right thing, make it hard to block the render thread

Core Abstraction: Grid Layers

The central type is a GridLayer — a chunk-partitioned spatial data structure, generic over cell type, that the engine manages the lifecycle of. Each layer declares its tradeoff profile upfront so the engine can make scheduling decisions.

app.register_grid_layer::<Terrain>(GridLayerConfig {
    chunk_size: UVec2::new(16, 16),
    density: Density::Dense,
@mrkybe
mrkybe / tile_maps_arent_a_thing.md
Last active February 25, 2026 04:20
Tile Maps Aren't A Thing

edited by me, written mostly by Claude - maybe useful, helped me crystalize some concepts.


a quick justification

AI write good but AI write a lot.

Readers different contexts, skill levels, experience. esp in game dev.

So over-explain and hit on head good?

@mrkybe
mrkybe / lib.rs
Created February 21, 2026 00:55
//! A proc-macro that automatically splits Bevy system functions with more than //! 15 parameters into `#[derive(SystemParam)]` structs, working around Bevy's //! 16-parameter tuple limit.
//! # bevy_auto_split
//!
//! A proc-macro that automatically splits Bevy system functions with more than
//! 15 parameters into `#[derive(SystemParam)]` structs, working around Bevy's
//! 16-parameter tuple limit.
//!
//! ## Usage
//!
//! ```rust,ignore
//! use bevy_auto_split::auto_split_params;
using Animancer;
using Assets;
using System;
using System.Collections.Generic;
using UnityEngine;
public struct InputState
{
public Vector2 MovementDirection;
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class MobController : EntController
{
[SerializeField]
public float MovementSpeed;
using Drawing;
using FX;
using Sirenix.OdinInspector;
using Unity.Collections;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.RenderGraphModule;
using UnityEngine.Rendering.Universal;
Shader "Custom/SpriteColor"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[HideInInspector] _Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1)
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
using System;
using System.Runtime.CompilerServices;
using UnityEngine;
// Marker Types
public class WorldFrame { }
public class GasFrame { }
public class ShipFrame { }
[Serializable]
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class ShipCoordinator : MonoBehaviour
{
private Dictionary<System, NowOrEvent> State = new Dictionary<System, NowOrEvent>();
[Flags]
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
using UnityEditor;
using UnityEngine;
public class StateMachineDebugWindow : OdinEditorWindow
{
[MenuItem("Tools/State Machine Debug Window")]