Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by p_l on Saturday December 28, 2019 @08:57AM
(#21898909)
There's a game that already did that, Sword of the Stars 2.
Widely panned at release due to being forced to release old code after VCS failure, though I'd argue the only problem after patches were left was that movement logic change didn't play out well (it was a brave attempt though).
Had some bad performance issues but I never tracked down whether they were related to SQLite or issues in their engine.
Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by TeMPOraL on Saturday December 28, 2019 @10:22AM
(#21899313)
Well, of course there is. Here I thought I'm doing something somewhat original...
Fortunately, existence of prior art doesn't invalidate any of the goals I had for this experiment, so I'll just carry on with it.
Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by p_l on Saturday December 28, 2019 @05:47PM
(#21902345)
Of course it does not invalidate your experiment, but I wanted to suggest maybe looking at save files from the game.
Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by billfruit on Saturday December 28, 2019 @10:15AM
(#21899274)
Are you referring to the rougelike Sword Of the Stars:Pit or to the base game itself
Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by p_l on Saturday December 28, 2019 @02:49PM
(#21901252)
No, I'm referring to 4X Sword of the Stars 2 itself. The Pit happened later, on a different engine (SotS2 is heavily windows-specific .NET code with DX10 dependency, iirc)
Re:A Thought Experiment: Using the ECS Pattern Outside of Ga...
by ratww on Saturday December 28, 2019 @07:05AM
(#21898475)
That's super cool. I think that approach is quite scalable, too. Only games with very complex logic would require something faster than SQLite for game logic.
Unrelated, but I also guess that using SQLite for offline data could be a timesaver, since you can leverage web tech to make tooling for your artists and level designers.
FWIW, what I'm doing is storing all the runtime state in in-memory SQLite, instead of writing my own ECS. Components are rows in tables, entity IDs are used as foreign keys, game logic just does regular SQL SELECTs to query the game state, and then UPDATEs, INSERTs or DELETEs stuff as needed.
I came up with this experiment when I was writing yet another implementation of ECS for that game, and in the middle of optimizing it for processing performance I realized that all I'm doing is essentially hand-writing database indexes, so why not use a proper database instead? And it turns out, SQLite is fast enough when used in-memory.