I'm not really sure what happened last month, but I didn't post anything. Oops! In the beginning of the month I was quite busy with school activities, but I started to pick up development towards the end of the month, forgetting about the blog... sorry about that guys! So... here's everything I've been working on/am still working on!
I was experiencing severe lag spikes when going from chunk to chunk. I did a bit of debugging and found that the source of the lag was saving the chunks. To optimize it, I made sure that the chunk had been modified for it to save to assure I'm not just saving the same exact thing.
After receiving help on the GMC, it was deduced that the GameMaker function ds_grid_write was slowing the game down immensely, so I tried using buffers (a faster way of saving/loading in short). It worked perfectly except for the fact that I was getting some weird bugs with it so I switched back. I will probably try to get this working again in the future.
Saving objects within chunks
I have also been working on being able to save objects within chunks. These objects are created when the chunks are initially loaded and then deleted when the chunk is unloaded. I am having trouble deleting them when the chunk is unloading, but I think I can get this working by tomorrow or the next day.
As you know, severe lag spikes happen when crossing into other chunks. I optimized it a tad by making it so that chunks had to be different than what's already saved for them to be saved again. By preloading all of the chunks, it eliminates pretty much all the lag, which is awesome.
Cellular automata caves
Today, I completed underground cave generation using cellular automata (4-5 rule)! It needs tweaking, but it's a great start. I'm excited to start adding vines, stalactites and stalagmites, and pockets of ore.
I also did some minor things:
Sorry for the lack of posts recently - I've been busy with schoolwork (yes, it's that time already). Today I perfected background blocks and made it so that separate chunks are generated for the biome, creating interesting background terrain. Check it out!
I also created lightmaps - essentially, they're grids that store light data (chunk cells that can either be 0 or 1, depending on whether there's a block there). This allowed me to incorporate background blocks with lighting and it also allowed me to create light blocks - more on this tomorrow. However, with all the new additions, I've noticed a surprising drop in framerate. I plan to fill next month with optimizations (or the remainder of this month).
In the screenshots you can also see that the player rig is in complete disarray... still working on it. After I sort the rig out I'll focus on incorporating light blocks & optimizing the game. I'm also going to be implementing water in the near future.
Until next time!
I have spent the last four days organizing data structures a lot of the messy code in the game, making it easier to create new content. I also made an adjustment to chunk saving to allow for more data to be saved - chunks are now saved within ini files. This allows me to save other things like metadata and multiple chunk layers within the same file. Metadata is also something I have really wanted to incorporate with the chunk system, because there are still objects that cannot be saved as tiles - chests, crafting tables, etc.
I made a separate ds_grid for background blocks and also am going to make a separate grid for metadata - not sure if this is the most efficient way of doing this, but I'll try. Here's a screenshot of the background blocks -
Not the best showcase, but I wanted to have some kind of screenshot for you guys... haven't posted anything interesting for a while.
Until next time!
This isn't going to be a very interesting post, but I spent most of my time today re-organizing various biome attributes. Previously, I had a system that looked like this:
I had a script with a ridiculous number of arguments - and GameMaker has an argument limit... and I don't like limits. I wanted to do more biome improvements (among those improvements biome transitions).
The transitions between biomes aren't particularly smooth. While the biomes are aligned by temperature, there's no smooth transition in blocks between biomes. If a desert is next to a mountain, the sand will instantly change to stone. I wanted to fix that today, but I found that I had reached the argument limit with my chunk generation script! The solution? Enums (enumerators)!
I set up a huge list of enums for all of the different biomes, and then modified the generation script to only require 3 arguments (allowing me to set an indefinite amount of parameters for biomes without using any more arguments).
Until next time!
Today (and yesterday) I've been working on perfecting the system that replaces alarms as well as armor. I'll talk about the alarms first. The system I'm working on consists of a variable called 'step' that increases every tick of the game, working as a timer. I can then use this variable to count when the block breaking animation should advance a frame. There are a few complications with this system that I'm still trying to work out.
Aside from the alarm system, I'm starting work on the revamped Spine model... starting with armor!
This creature here is a 'lizman', one of the races that I'm working on. In this screenshot you can also see how bones are set up. Bones can be moved to manipulate the model.
Until next time!
February's task is to improve the combat system and create a system for enemies and their AI.
The author of the blog is Niften, or Sour Apple. He posts weekly, usually on the weekends on Saturday.