SAVING AND LOADING


saving saving saving. we never think about it. same thing with loading. well, at least I don't.


Here's a problem for you, let's say you have a grid- not just any grid, a grid full of numbers. each cell of the grid contains a number (0-9) that represents what picture should draw there. It's cool! It works! and it's fast! So we just shove all these numbers, in order, into a save file, right? then we can just read that file, and copy back the numbers to their cells in the grid! super simple! well, what happens when you have two digit numbers? What if someone slides a cheeky little 10 in there, just to really muck up the gears?

well, if you don't keep the numbers separated in some way, bad things happen, and tiles _definitely_ do not load properly. this causes borked maps that people may have worked forever on, and also some really cool modern art to boot.


well, it's fixed now. saving and loading BOTH have been completely rewritten (it needed to be anyways, the map was just saved to a text file. oops haha) Now the map is saved to a JSON file, and loads from that JSON file. it's quick, it's easy, and now it'll load those beautiful custom tiles!


for testing purposes, I have added a line drawing tool to the sprite editor. it's not great, but it works. I learned a lot about the Bresenham algorithm to make it too, and yet it still took less time to implement than the damned paint fill tool! lol. It may miss the last tile you are drawing on, and it isn't perfect but it definitely draws a line properly. Hope you guys enjoy! next, I hope to start adding more entities and try to get some emergent behaviour out of this world! I'd love to see little people cutting trees and making houses, or a giant ant walking around eating tiles. That's where the time is going to go though, art is not my strong suit!

Files

WORLDSIM.zip 35 MB
Oct 01, 2023

Get WORLDSIM

Leave a comment

Log in with itch.io to leave a comment.