{"by":"CaptainOfCoit","descendants":42,"id":38700552,"kids":[38706419,38706742,38706401,38706104,38700584,38704284,38703926],"score":95,"text":"Hello Hacker News! Long time reader but first time poster here...<p>Recently I&#x27;ve been diving into doing mods for Cities: Skylines 2, which been very interesting as it&#x27;s one of the first games that is using ECS and that I also have a deep interest into. I&#x27;ve mainly used ECS via Bevy before, but this time it&#x27;s Unity, but many things still work the same way.<p>In order to help myself and other modders to navigate the ECS Systems and Components from the decompiled code, I created this interactive D3 graph.<p>You can click on nodes to &quot;navigate&quot; to that system&#x2F;component, and once you&#x27;re zoomed in a particular System&#x2F;Component, you get a sidebar with more details. Ctrl+click also removes nodes in case you want to temporarily filter something.<p>This is, in short, how it works:<p>1. A C# program extracts information from decompiled C# code: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;master&#x2F;src&#x2F;cli.cs\">https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;mas...</a><p>2. The program outputs that info as JSON: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;master&#x2F;data&#x2F;Systems.json\">https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;mas...</a><p>3. Render with D3.js: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;master&#x2F;index.js\">https:&#x2F;&#x2F;github.com&#x2F;Captain-Of-Coit&#x2F;cs2-ecs-explorer&#x2F;blob&#x2F;mas...</a><p>Basically it helps people to navigate the Systems and Components references for the game.<p>If you&#x27;re feeling brave, you can also browse the full graph which has something like ~700 nodes and ~1200 links: <a href=\"https:&#x2F;&#x2F;captain-of-coit.github.io&#x2F;cs2-ecs-explorer&#x2F;\" rel=\"nofollow noreferrer\">https:&#x2F;&#x2F;captain-of-coit.github.io&#x2F;cs2-ecs-explorer&#x2F;</a> (it&#x27;ll take a while to first load)<p>A big problem was to figure out how to make the D3 not too messy when there are large graphs, and I don&#x27;t think I&#x27;ve succeeded very well with this, but everything I tried (link distance based on how many connections, clustering based on namespaces and so on) made it even worse.<p>Happy to hear what you think and what I could do better.","time":1703015311,"title":"Show HN: Interactive ECS Systems/Component Explorer for Cities: Skylines 2","type":"story","url":"https://captain-of-coit.github.io/cs2-ecs-explorer/#system/Game.Simulation.ServiceFeeSystem"}