Monday, 29 May 2017

Devlog #2 - Bullets, Collision and Upgrades


Before anything else, I have a new microphone so those of you watching the video format of this post are going to have a great listening experience.

Since the last update video, I've made a few changes. Enemies no longer collide with each other, for a start. I genuinely don't know why I ever even considered allowing them to collide, because it doesn't really make any sense at all. In addition, it bogged down the pathfinding algorithm with unnecessary checks and requirements.


However, this new system did come with some issues. The largest issue it caused was that bullets would hit multiple enemies at once if they were standing close enough.

My fix for this was... not pretty, at best.

The main idea is that each bullet has a flag named "deadly". By default, this flag is set to true. Once the bullet deals damage to any one enemy, the flag is false and it cannot deal damage again.

Unfortunately, Godot doesn't like dealing with multiple instances of the same script while processing different variables for each. In effect, this means that I had to create a new instance of the script for each new bullet that gets fired. I'm unsure as to the rammifications(heh) of this on memory usage, since I'm not sure if duplicated resources actually free themselves up when they're done being used.

Either way, let's move onto something a bit more accessible for the rest of you, or at least for anyone who isn't particularly familiar with Godot's management of resources.

I added a new map. It uses the same tileset as the previous one and it's not exactly expertly crafted but it does help to be able to test the pathfinding on a one-floor room. Fortunately, I ran into no problems with this one. This is actually my first Godot project using tilesets, and I'm very pleased with the results. I'm able to quickly create a map without having to painstakingly go through each area manually. Hooray!

Also, I've added a rudimentary upgrade system. Well, the skeleton for one at least. Right now, it's just a button to press which increases the enemies' HP value and writes it to a file, which they can then read from. Using text files(or ConfigFiles) to store either save data or data collected during each playthrough rather than loading it into RAM is something which a few games have done, including Risk of Rain.

My rationalization for having done this is that since these values only need to be loaded once per wave, it's permissible enough to not try to load them into RAM.

Unfortunately, that's pretty much all that I've done in the past few days. I would have liked to do more, and hopefully I'll get that opportunity in the coming week since I don't have any exams during that period. Of course, this is provided that I don't have a spell of being lazy for a week, which is a possibility.

On the to-do list over the next week is to make the enemies actually hurt the player. If I don't do this by the 5th of June, feel free to leave angry and indignant comments.

Thanks for reading, and stay tuned for even more updates on my video game as well as miscellaneous tangentially related musings on other video games.


No comments :

Post a Comment