Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    C

    Cowboy Programming

    cowboyprogramming.com · Personal blog · on HN since 2007

    Mick West, a veteran game programmer, writes about game development, programming practice, and engine design.

    Visit blogHN submissions
    GamesProgrammingSystems & Performance
    What HN says

    HN links it for his 2007 article 'Evolve Your Hierarchy', which many credit as an early introduction to entity component system ideas.

    Stats for nerds
    31HN people shared it
    20linked in comments
    309story points
    Nov 2023last shared
    2009people per year2023

    Top posts on HN

    1. 1
      1995 Programming on the Sega Saturn
      3 people · 157 points · first shared 2016 · 31 comments on HN
    2. 2
      The Seven Stages of the Programmer
      2 people · 57 points · first shared 2009 · 22 comments on HN
    3. 3
      Evolve your hierarchy
      13 people · 30 points · first shared 2009 · 10 comments on HN
    4. 4
      Mature Optimization
      2 people · 24 points · first shared 2007 · 5 comments on HN
    5. 5
      Fluid Mechanics in Game Programming
      1 person · 19 points · first shared 2008 · 3 comments on HN
    6. 6
      My coding practices in 1991
      3 people · 12 points · first shared 2008 · 1 comments on HN
    7. 7
      Programming Poker AI
      2 people · 3 points · first shared 2008 · Discussion on HN
    8. 8
      Debugging Heisenbugs
      1 person · 3 points · first shared 2008 · Discussion on HN
    9. 9
      Practical Hash IDs (2005)
      1 person · 2 points · first shared 2015 · Discussion on HN
    10. 10
      Pushing Buttons: Resolving Ambiguity in Video Game Controls
      1 person · 1 points · first shared 2022 · Discussion on HN

    What HN people wrote when they linked it

    • derefrMay 2017

      To me, Win32 was already falling away from the more intriguing model, which was Win16.

      Effectively, a Win16 system is/was basically exactly equivalent to an Erlang node, but one where your "processes" just happened to be paired, component-wise†, with handles to structs of GUI properties held in window-manager memory.

      Like an Erlang node, Win16 is/was:

      • green-threaded — i.e. they both have very low-overhead in-memory structures containing a tiny heap/arena and a reference to an in-memory delegate code module, through which execution would pass in turn. In Erlang, these are "processes"; in Win16, these are windows—i.e. actual windows, but also "controls" in the controls library.

      • cooperatively-scheduled (yes, Erlang is cooperatively scheduled—when you're writing C NIFs. When you're executing HLL bytecode in the Erlang VM, this fact is papered over by the call/ret instructions implicitly checking reduction-count and yielding; but if you're writing native code—like in Win16—you do that yourself.)

      • Message-passing, with every process having a message inbox holding dynamically-typed message-structs that must be matched on and decoded, or discarded.

      • Offering facilities to register and hold system-wide handles to large static data-blobs (Erlang large-binaries, Win16 rsrc handles);

      • Capable of doing IPC only by having processes post messages to another process's queue, and then putting themselves into a mode that waits for a response;

      • Based on a supervision hierarchy:…

    • drblastJun 2018

      A few years ago I wanted to make a shoot-em-up game using C# and XNA I could play with my kids on an Xbox. It worked fine except for slight pauses for GC every once in a while which ruined the experience.

      The best solution I found was to get rid of objects and allocation entirely and instead store the state of the game in per-type tables like in this article.

      Then I realized that I didn't need per-type tables at all, and if I used what amounted to a union of all types I could store all the game state in a single table, excluding graphical data and textures.

      Next I realized that since most objects had properties like position and velocity, I could update those with a single method by iterating through the table.

      That led to each "object" being a collection of various properties acted on by independent methods which were things like gravity and collision detection. I could specify that a particular game entity was subject to gravity or not, etc.

      The resulting performance was fantastic and I found I could have many thousands of on-screen objects at the time with no hiccups. The design also made it really easy to save and replay game state; just save or serialize the single state table and input for each frame.

      The final optimization would have been to write a language that would define game entities in terms of the game components they were subject to and automatically generate the single class that was union of all possible types and would be a "row" in the table. I…

    • MaulingMonkeySep 2021

      A lot of us - possibly yourself included - were exposed to ~ECS by this 2007 article: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/

      Archetypes are a conceptually simple implementation optimization (group similarly-populated objects) not unique to ECSes - e.g. v8 organizes javascript objects based on their "shape" (again, grouping similarly-populated objects, based on their "properties" instead of their "components") (2017 article: https://v8.dev/blog/fast-properties .)

      You can add all kinds of automagic parallelizing and filtering libraries (which I imagine have some overlap with database query optimization and scheduling in their fundamentals), but the basics are incredibly trivial - to the point where you might re-invent it by accident without knowing it has a name.

    • jaberwocky333Oct 2019

      Sounds like almost exactly where I started from.
      Depends on the game your making but be careful of libraries. Game programming is very different from other types of development. SDL is a good place to start. Godot seems find as well.
      You'll want some form of architecture that updates components of entities all at once rather than foreach entity object updating its physics, then sound, then tracking etc
      This is for performance and debugging reasons.

      This is a good start
      http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/

      Source - Just finishing up this game https://store.steampowered.com/app/1058510/Zunius/
      Art, code, music and sound done by me

      Drop me a line a leonf at coafresearch if you want to chat further

    • mrspeakerJul 2021

      I think originally it was primarily about developer ergonomics - here's the first thing I ever read about them in 2007 where they tested it on Tony Hawk Pro Skater (http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/). The CPU/memory management has been an on-going discussion ever since! Being able to process domains as flat arrays helps with cache misses - but there is a lot of other overhead, depending on how you designed everything.

      Making it performant was one of the big problems initially, and it seems like the `Component Graph System` this thread is about trying to answer "how do systems efficiently process components?"... But I don't really get how it answers that actually.

    • trentonstrongJun 2012

      It might be worthwhile to take a look at certain types of game engine architectures.

      Since modularity is one of the keypoints of how this editor/game engine work so well together, it's probably a good idea to have some idea of how to structure game components to lessen the 'ball of mud' feeling.

      I've been pretty fascinated with data-oriented "entity/component" systems for a while, as opposed to heavily inheritance based models. There's a decent introduction here: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/

      It seems like a lot of modern game engines (one example would be Unity) utilize this approach to varying degree.

    Related

    Herb Suttergotw.ca84 people

    Ritchie, Stroustrup, and Gosling interview

    Herb Sutter
    Personal · last shared 2026
    Interplay of Lightinterplayoflight.wordpress.com17 people

    How Unreal Renders a Frame

    Interplay of Light
    Personal · last shared 2026
    Doug Sevendougseven.com30 people

    Knightmare: A DevOps Cautionary Tale (2014)

    Doug Seven
    Personal · last shared 2024
    Mr Speakermrspeaker.net18 people

    "Diff for HN": Update and highlight changes

    Mr Speaker
    Personal · last shared 2022
    Havoc Penningtonblog.ometer.com44 people

    Professional Corner-Cutting (2016)

    Havoc Pennington
    Personal · last shared 2026
    Chad Fowlerchadfowler.com46 people

    Your Most Important Skill: Empathy

    Chad Fowler
    Personal · last shared 2022
    #AltDevBlogADayaltdevblogaday.com163 people

    John Carmack on the importance of Static Code Analysis

    #AltDevBlogADay
    Publication · last shared 2023
    CellPerformancecellperformance.beyond3d.com19 people

    Three Big Lies (2008)

    CellPerformance
    Personal · last shared 2025