so a problem Iv been running into is how to make an optimized serializer for my floor thing.
the main problem is the higher I put the limits for everything the more space each floor takes even if its not being used.
like if the enemy per floor limit is 1000 but there's currently only 1 enemy on the floor it takes the same amount of space in memory as if 1000/1000 enemy slots were active as the size has to be reserved for them ahead of time or else there's out of memory error.
I found a fix that makes it so that even if the max floors is 1000 that if you have only generated like 3 floors the save file will be tiny:
u64 everything_but_floors = offsetof(World, floors);
u64 active_floors = world -> active_floors * sizeof(FloorData);
u64 all_save_data = everything_but_floors + active_floors;
so it only saves the first X floor slots where X is the active floor amount and I think I could do something similar for the enemies and other stuff but it might be tough.
the other problem is that if you do use all 1k floors the save file is still 1 GB or so which seems pretty large.
if any serialize guru's have cooler ways to optimize stuff id be interested.
Another fix I tried to do is to just load one floor at a time as was suggested to me before in a previous q&a, I feel like if I could figure this one out it would be a huge deal.
but i was running to some problems last time I tried implementing the loading one floor at a time thing because serialization is tough for me i guess, I might give it another try soon.