Devlog #2: Chunk system and player movement


Progress has been kind of slow today, but I did manage to pretty much achieve what I wanted to. I have got the chunk system so the map is essentially infinite and player movement.

The latter it pretty self explanatory, but the chunk system has a little more to it. I want to be able to randomly generate paths as the player moves around and into new areas, which is cool, just generate a chunk when they get close to it. However, this means that the sprite chosen for a path tile might not fit once the tile next to it has been generated. My solution to this was just to generate the chunks in a 5x5 square around the player, but only set the path tile sprites in the chunks within a 3x3 square. You can see this in the image on the right. As the player moves, it will loop over every chunk in the 5x5 to make sure it is loaded, then afterwards loop through the 3x3 to make sure the sprites have been set. It can't happen at the same time because then we just get the previous issue all over again. It is pretty unoptimised, but it's fine for now.

Also, I realised that I can just make a project and itch has a tab for devlogs there, so that is pretty handy, as opposed to having a million different posts by the time this is done ahaha.

For tomorrow I want to create an algorithm for random paths. Then I want to create a simple enemy or two and come up with some interesting ways for players to escape them. If I have time, I'll start working on putting corpses around the map, but we will see how we go. 

Just realised the step after that will be UI for corpse info and player inventory... yeah not really looking forward to UI stuff, but oh well.

Okay, goodnight and see you guys later. Thanks for reading.

Leave a comment

Log in with itch.io to leave a comment.