A ton of stuff was accomplished today. My goal today was to merge the inventory and the chunk systems and make them work flawlessly together. I'm happy to say that that plus a few more things were accomplished.
For some reason, when I opened the inventory project for the first time in several months, it was a bit bugged - some of the scripts were messed up. I'm not entirely sure how, but I fixed them. After not working on the inventory system for so long, I forgot how many of the components of the system worked, so I had to refresh my memory by looking at all of the scripts. Once the scripts were fixed I optimized the inventory system by stopping it from loading the inventory files every tick (which is very heavy on the performance). I still think that it can be optimized further, but it's fine for now.
After the optimizations, I imported all of the chunk scripts/objects into the inventory project. For any long-time readers, you may recall that in March I created an object-based block system. So, when I imported the chunk system, I had to program the inventory system to be able to handle the tile-based block system. It all works flawlessly now, with tiles having the same capabilities as the object-based blocks. The only object-blocks that cannot be converted to tiles are interfaces: chests, furnaces, etc. I still need to work on being able to save those.
I also noticed that checking for collisions with tiles can be very resource intensive, so I created a few scripts that can check collisions way faster but at the cost of accuracy. For example, items and the like don't need extremely precise collisions, so they can utilize the fast collision scripts. However, objects like the player need very precise collisions to move properly.
In addition to the merge, I also added rarity tiers for items. You can see the rarity of an item by hovering over it in the inventory. Check it out!
July Monthly Recap
This is the post that was meant for yesterday... I'll post again today. Sorry! Today I completed full interaction with the tiles so that they seem like regular blocks. The player can now collide with the tiles like any other blocks. This was a bit tricky because I had to play around with the bbox object variables, which deal with the collision mask. However, I've noticed that its had some impact on performance, but not really a noticeable impact. I've sent copies of the game to several people to test its performance on their computers.
Other than finishing the collisions, I've also been making modifications to the inventory system, and I've noticed a few bugs and a huge flaw in the way it was made. The inventory opens and checks the ini files that store its information every tick of the game. For those that don't know, checking files isn't a light task. The chunk system saves/loads from its files whenever you leave/enter a new chunk. That's how the inventory should be - it should save when an inventory is closed and loaded when an inventory is opened. There's no need for it to update every tick. This has a serious impact on performance, and fps can drop below a hundred. I don't think a full rewrite will be necessary, but I will rewrite the portions of the inventory system that need to be rewritten. It's still a very flexible system but it needs optimizations for it to be the optimal system in the new Crevis, which is centered around performance.
Until next time (later today)!
The chunk system is pretty much done. Right now, I'm working on optimizing the system, and I've been having some troubles, hence why I have not posted in a few days. The game starts off completely lag-free, and as time goes on the fps tanks. This is most likely due to a memory leak or something of the sort, and I'm still trying to fix it. It's definitely not an issue with the way I'm handling chunkloading, because I'm sure using ds_grids is the fastest way to do something like this. Other than working on optimizations I've also been prepping the chunk system for the move over to the engine, because I've been working on the chunk system on a separate project. Part of preparation was getting textures slapped onto those blocks. I still have to add foliage but it looks pretty good so far.
I have also completed several scripts that are key to collisions with tiles:
If any are familiar with GameMaker's language GML, these two scripts act like the function place_meeting. Overall, I'm very happy with the progress I've made this month on the chunk system, and hopefully next month I can fully integrate the system and start creating biomes.
Until next time!
Today I perfected the tile_create and tile_destroy scripts, and now they work properly! I have also made a few more scripts in preparation for the move back to the actual game project. A cool fact about the create and destroy scripts is that I can create and destroy tiles in an unloaded chunk! This allows for many different possibilities, and I can't wait to put it to use.
Not only did I perfect the create and destroy scripts, but I also fully implemented block lighting (Mytino's engine)!
The lighting works flawlessly. Now, I'm optimizing the system and then I will port it to the base game. In addition to the lighting and various scripts, I also created chunkloaders. Chunkloaders follow specific objects and load the chunks that they are in. This makes it easy to load the chunks around multiple players.
Until next time!
I made a video outlining the chunk system and explaining how it works and the issues I currently have with it, complete with commentary.
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 Alec. He posts weekly, usually on the weekends on Saturday.