rwf93 / Starbound

Starbound source code.
107 stars 31 forks source link

Optimize world generation #5

Open Shadowblitz16 opened 11 months ago

Shadowblitz16 commented 11 months ago

It would be nice if world generation could be optimized. I used to have a pretty powerful computer for its time when starbound was released, however it tended to lag pretty bad.

I haven't played this for a while so i'm unsure if it's still a problem. If that's the case this issue can be closed.

jkotrc commented 10 months ago

A couple of profiler runs suggest that during chunk loading, WorldStorage asks EntityFactory and ServerTile respectively for JSON data of the entity inhabiting the chunk. Some work seems to be done redundantly and the read/write isn't efficient. It doesn't look like core module's database and math functions inline very well, so it may be worthwhile to replace math with something like linalg.h and database functionality with something production grade like mongo. Also look into options for making JSON data more compact / loading mod .paks into a better representation on startup