Time for another bi-weekly update
This bi-weekly changes:
- Full map saving in pure C++ (implemented this from scratch in less than 24h, was easier than I expected, should be bug-free already according to the diffs I've run)
- Realots circle.dat parsing of file + used for spells implemented, giving perfect Realots circular spell shapes. (I thought previously I already had the formula down by dividing the radius by 1.2, but in fact after noticing a bug with UE shape and many hours of investigation, there IS NO FORMULA for Realots spell shapes, they're custom made; Euclidean, Chebyshev, Taxicab and Minkowski distance does not provide the Realots circle spell shapes, nor any other known math formula. Instead the only way to get perfect shapes is by manually creating shapes for every spell, or using circles.dat)
- Fixed several segfaults and infinite loops by learning to use GDB (this was fun now that I'm more of an experienced developer I think)
- Fixed line of sight; spell splash no longer go through/comes out the other side of the wall and stuff, in fact it's seemingly just like Realots line of sight now
- Serious (about a week of) internal cleanup/fixing class methods/implement more old scripted functions in C++, added C++ header files to every CPP file so I can include any file I want without compiler errors, etc, still more to do though
- Many other more "minor" issues, for example monsters were fleeing slowly and summons were autowalking towards master slowly, these and many others have been fixed
Other details/stats worth mentioning:
- Map loading takes 12s on a high end $1000 budget laptop (good CPU, mediocre NVME drive, my Desktop's drive is much faster, and my Desktop's drive is not the fastest of NVME drives out there, PCI-e 3.0 instead of 4.0, among the cheaper NVME drives for a Desktop per GB, etc)
- Map saving takes 6s on the same laptop
- g++ standard used: c++23
- Optimization level: -O1
- Code generation time: 6-7s
- Compilation time: 44s with just 1 CPU thread/core (can't be parallelized yet)
- I've dropped Windows support for now, might be added back later (this happened a while ago)
- Memory usage without any players cached: exactly 1.0GB (same as Realots)
- Memory usage with all players cached (necessary for now to be able to log into player files): 1.6GB
- Other deps: fmtlib for C++ and one or two scripting modules for the scripting language
Here's some screenshots:
I wrote some fun tools, like packet crafting from DEC numbers, map diff checker, and this spell tool trying to figure out a formula for the Realots circle spell shapes
Saved map (to drive) stats comparisons (bytes at top, lines at bot)
How it looks like when you Ctrl+C the server after boot has finished, including time elapse for saving SEC file to drive from memory
I'm also considering making a public git repository for this server with a tool I wrote that cleans all the code and just leaves the Header and empty CPP functions and methods.
It won't be very useful for running, as it won't compile, and if purely hypothetically you could compile it (you can't, because there's missing scripted code), it wouldn't do anything because the CPP files are cleared of code, BUT it's a nice way of learning a little more about my server and how to make your own server from scratch by looking at my server engine design.
Let me know if you're interested in me making the public git repo with empty code (just Header files intact and "empty"/cleared CPP files (no code, just signatures)).
Oh, and I forgot to mention,
I will probably also include the map saving code (the only exception, nothing else) in the public git repo if people are interested.
Again, this code won't be useful for anyone else except for learning engineering/code designing/curiosity, etc, as the code can't even be compiled without the rest of the codebase.
Cheers!