2week project reportback
these two weeks ended up being kind of a grab-bag of stuff. still didn't get around to implementing Basic Farming, but i did get a bunch of related stuff done.
i made a git repo for this a while back and now i can just refer back to my old commit messages to see what i actually did in this 2-week chunk. that's good b/c otherwise i'd totally lose track of time.
i added a pixel offset for tile materials, so now stepping onto tilled ground lowers the pc & cursor, which is a nice little graphics effect. i also made the 'height border hilight' color a material value rather than it being a single hardcoded color, so now they look a little better.
i fixed (i think) the major crashing bug, which was that sometimes when you were moving around, usually when you were crossing over two chunk boundaries in very close proximity, there'd be some error in the loading code that would totally crash the 'main loop' of the game. i tracked it down to being an issue with the chunk unloading code, which currently only runs in very specific conditions. it turns out that code was totally busted and in addition to causing a crash it also destroyed the entire load queue due to a backwards logic check (when a chunk was unloaded, it erased the load info for all chunks aside from itself, instead of erasing the load info for itself). so i fixed that up enough that i think i fixed the bug, but since i'm still not calling the unload chunk code ever i can't be sure it's actually robust. but it seems to work for now, so that's a big improvement
i added item action callbacks! it's all still very simple so far, but if you open the inventory, press a keyboard number while hovering over an item to put it on the hotbar, and then close the inventory and select that hotbar item, and then you click on the ground, it'll run the 'terrain action' callback for that item, if one exists. currently the only one that exists is for the hand hoe, which will till moondust into tilled tiles. (there's also currently no distance limitation or animation for this) so it's primitive but it does work.
(this involved a huge rewrite of the rendering code btw, since previously chunks were rendered 'all in one' and changing any tile would require rerendering the entire chunk. i really wanted to avoid that, so i wrote this whole indexing system, that lets me update/overwrite old tile data as necessary. then, after i finished it all i saw some people talking elsewhere about implementing instanced rendering and i was like "oh yeah it would've been a much better idea to handle this by just making all the rendering indexed". so that kind of sucked the wind from my sails a little, but, oh well i can instance the geometry later, and in the mean time i don't really have to think about it.)
probably the most noticeable change is that i fixed a bug where i allocated the render buffers to be 10x the size they needed to be. this reduces the initial 'load time' of the game drastically. whoops.
i also tweaked the worldgen -- i had been pretty unsatisfied with the other tiles i was using, and i wanted something that fit in more than random splotches of half-finished tiles. so i made a 'dark' tile type and i made that generate in big splotches, and then i added in some rudimentary blending/overlay code so that nearby tiles got some overlay sprites attached. i have some screenshots of that on my code screenshots tumblr.
i also just today tweaked the interface code a little -- there's a persistent issue with picking form elements that i won't get into the details of since it's a thicket of interface stuff. suffice to say i fixed one of the major issues with the interface code, but there are still two other major ones that make them frustrating to use.
so all-in-all between the render and the interaction changes i've set myself up for being able to easily add in tile occupants soon, which should be nice. feeling a little burnt out on this project right now though, since i still don't really have a coherent vision of what the actual gameplay loops should look like, so it's hard to see a path forward from what i have into a 'fun' 'game'. but i guess if i keep working on it i'll probably get somewhere
i'm still uploading the draft versions online, so, the latest version is now up over here if you want to see what i have so far.
these two weeks ended up being kind of a grab-bag of stuff. still didn't get around to implementing Basic Farming, but i did get a bunch of related stuff done.
i made a git repo for this a while back and now i can just refer back to my old commit messages to see what i actually did in this 2-week chunk. that's good b/c otherwise i'd totally lose track of time.
i added a pixel offset for tile materials, so now stepping onto tilled ground lowers the pc & cursor, which is a nice little graphics effect. i also made the 'height border hilight' color a material value rather than it being a single hardcoded color, so now they look a little better.
i fixed (i think) the major crashing bug, which was that sometimes when you were moving around, usually when you were crossing over two chunk boundaries in very close proximity, there'd be some error in the loading code that would totally crash the 'main loop' of the game. i tracked it down to being an issue with the chunk unloading code, which currently only runs in very specific conditions. it turns out that code was totally busted and in addition to causing a crash it also destroyed the entire load queue due to a backwards logic check (when a chunk was unloaded, it erased the load info for all chunks aside from itself, instead of erasing the load info for itself). so i fixed that up enough that i think i fixed the bug, but since i'm still not calling the unload chunk code ever i can't be sure it's actually robust. but it seems to work for now, so that's a big improvement
i added item action callbacks! it's all still very simple so far, but if you open the inventory, press a keyboard number while hovering over an item to put it on the hotbar, and then close the inventory and select that hotbar item, and then you click on the ground, it'll run the 'terrain action' callback for that item, if one exists. currently the only one that exists is for the hand hoe, which will till moondust into tilled tiles. (there's also currently no distance limitation or animation for this) so it's primitive but it does work.
(this involved a huge rewrite of the rendering code btw, since previously chunks were rendered 'all in one' and changing any tile would require rerendering the entire chunk. i really wanted to avoid that, so i wrote this whole indexing system, that lets me update/overwrite old tile data as necessary. then, after i finished it all i saw some people talking elsewhere about implementing instanced rendering and i was like "oh yeah it would've been a much better idea to handle this by just making all the rendering indexed". so that kind of sucked the wind from my sails a little, but, oh well i can instance the geometry later, and in the mean time i don't really have to think about it.)
probably the most noticeable change is that i fixed a bug where i allocated the render buffers to be 10x the size they needed to be. this reduces the initial 'load time' of the game drastically. whoops.
i also tweaked the worldgen -- i had been pretty unsatisfied with the other tiles i was using, and i wanted something that fit in more than random splotches of half-finished tiles. so i made a 'dark' tile type and i made that generate in big splotches, and then i added in some rudimentary blending/overlay code so that nearby tiles got some overlay sprites attached. i have some screenshots of that on my code screenshots tumblr.
i also just today tweaked the interface code a little -- there's a persistent issue with picking form elements that i won't get into the details of since it's a thicket of interface stuff. suffice to say i fixed one of the major issues with the interface code, but there are still two other major ones that make them frustrating to use.
so all-in-all between the render and the interaction changes i've set myself up for being able to easily add in tile occupants soon, which should be nice. feeling a little burnt out on this project right now though, since i still don't really have a coherent vision of what the actual gameplay loops should look like, so it's hard to see a path forward from what i have into a 'fun' 'game'. but i guess if i keep working on it i'll probably get somewhere
i'm still uploading the draft versions online, so, the latest version is now up over here if you want to see what i have so far.