Thank you for your kind words!
I would give this project a B, maybe a B+ in terms of structure and build system. About Godot's level, good enough that I don't mind building it, but not perfect enough that I fetishize it like my own code. For that reason, keeping the Emscripten version up-to-date makes me feel better about the project, because it is playable almost effortlessly on all the platforms that would potentially be supported.
What do you suggest to make the buildsystem better? With conan, building is a breeze now
Without conan, it works as every normal open source project.
I didn't commit my emscripten changes yet, because the conan build is not working yet. (still working for the conan team to fix a few of the remaining issues i've submitted). We'll need to add libnoise, when we merge the terrainGen branch, and tbh i have no idea how to get that working with emscripten :- /
I too use Emscripten, and I try to keep things working on my lowest-common-denominator Falkon browser that is slow, buggy, and currently lacks support for WASM and WebGL 2. That way even Internet Explorer users can play my games. Dunno what your philosophy is on this; better men have called me crazy as a result of my oldskool browser obsession, but it's something to keep in mind. Browsers are hard to maintain and I'd hate for everyone to be forced into Chrome/Firefox/Edge just like I'd hate for everyone to be forced into Windows/Mac.
For now, i use emscripten more as a showcase. it doesn't support save / load game yet, and i don't know yet how to get the fullscreen button working (fullscreen works if you activate it through the gui though). I have almost no knowledge about emscripten, just followed their documentation and i was very happy when i got it working
Thanks for your flags! i use -O3 though and some other performance flags too. I think i create a second version without WASM. According to my hoster, WASM mime type is not supported. Also, the iPhone doesn't have WASM support and it's very slow there, so a non-WASM version might help.
If you like to help me out here with emscripten, that'd be very welcome, as i said, i have no experience with emscripten or webstuff at all...
However, having now tested Cytopia in Chromium on a mid-range laptop that is somewhat old, I can confirm that it runs slooooooooow, so that, in my opinion, should be a higher priority. At a glance it's easy to see what could be causing the slowness: Lots of small tiles means lots of GL calls. Each GL call ties up the computer by crossing "the bridge" to the GPU. You need either sprite batching or render-to-texture for this kind of game.
Your renderer is sprite.cxx and it uses SDL_RenderCopy, which internally calls a glDraw command. Because you are not using OpenGL directly, your only optimization option (aside from zooming way into the map such that fewer tiles are rendered) is to render most of the tiles to a texture whenever the map is updated and just render that larger texture once per frame the rest of the time. You can overlay things like highlighted tiles on top of that.
Before i implemented display resolution i spent quite some time, implementing a method to only call the render function of visible tiles. then i noticed that at 1080p / max zoom level almost everything is visible and removed that again....
I also talked to the guys in the SDL discord about rendering to one big texture. they suggested that it's a bad idea because of the graphics memory usage (maybe they just got me wrong?) idk... never tried it though.
For now, i'm still waiting for the next SDL2 release, as they finally added sprite batching. I've build the latest master and tried it. On linux, this tremendously improves performance. on windows, it crashes very often so i didn't add that to deployment yet.
OpenGL renderer is an option though that's something we'll work on (much?) later unless someone comes along and helps us out with that.
There are still quite a lot of things i have to add to the engine before we can release 0.2.
After the that release, i'd like to focus on adding some gameplay mechanics, improving road placement, adding zones. And finally start working on the UI design i have in mind. Let's get rid of those red X'es and replace them with the actual sprites of images
Btw, it also lags in emscripten with max zoom level on my brandnew laptop... :