Hey there folks! It’s been a bit since the last post but that’s what happens when you go though the process of getting vaccinated and then trying to take advantage of said vaccination as much as possible. Now that I’m back to being a homebody, I’ve got some stuff done!
First off, the Stalker enemy that I previewed in the last post is almost done!
Their animations still need a little work and they still can’t damage the player but they’re fully capable of wandering around and being creepy as hell… speaking of wandering…
Wandering! Enemies can now wander based on a few settings and a new system I created to give them locations and potentially routes to… wander between.
Here’s an example of how it looks in the editor with its incredibly temporary but hilarious icons. Ground only enemies can also wander with similar objects which also follow the Wildberry poptart color scheme seen below:
Some of those up in the air are only for enemies that fly… speaking of which… New flying enemy!
The Drone is a flying enemy specifically in the TANGENT faction. TANGENT is a paramilitary group which shows up on the Idaho and for some reason wants to make you and your team hyper dead. Don’t let them do that. Dealing with their drone fighters will be easy but they will be a harbinger of tougher smarter foes nearby. The drones are not 100% either, they still need wander and combat AI beyond following, as well as some animations for firing, but that’s a relatively short and easy process to set up.
Now with all this new stuff I’ve had to make things run smoother. MUCH smoother. For example, the fire pipes that block progress when the air is active. Having more than one on a stage causes some issues and having more than 3-4 outright breaks in some cases. Here’s an example of their CPU usage and broken nature:
Each tile with pipe in it should be making fire, but they aren’t, and they look rough, and they’re using a good deal of CPU… so that had to be fixed.
The new version uses the new particle system in BYOND as well as using a singular visual source for each which is duplicated across the locations which need them. For reference, the game has about 5% CPU usage baseline and the old versions added about 3-5% each. The new versions add… basically nothing and look much better (in my opinion)!
That’s not even a bad offender though, the worst offender in the game so far is the Plasma Caster weapon. Here’s the original:
YIKES. Hitting 80% CPU usage is ridiculous! Now keep in mind the CPU usage is just a measurement of how much a single core is being implemented and the game doesn’t start to see slowdowns until the number hits well over 100% Even so that’s still really bad. So, I worked on it a bit.
The “fixed” version also uses the new particle system and is MUCH more efficient. About 1/4 the total cpu usage of the first example in its best case scenario. In its worse case it could cause the game to slow down by itself.The biggest culprit of the cpu hogging is the splashing plasma that comes off the projectiles. I tuned down the spawn rate massively but it’s still pretty bad and I need to find a better way to program those effects.
Under the hood there’s been a lot of other efficiencies made, for projectiles in general, I’ve made a system where they don’t bother checking collision with items based on type rather than looking into the objects’ other variables and seeing if they collide or not. It saves a ton of processing in cases where a single tile has a lot of objects in it, even if they’re not normally collide-able. Frankly, I should have set that up that way originally but at the time I was just trying to get things to work without much care to whether or not they were efficient. For tiles, each ground tile used to have shading applied to it as separate objects which displayed atop of the tile. Now, there’s 47 source objects which just get duplicated over the other tiles that need them. This saves a ton on load time for levels, and the game overall has to manage a LOT less objects. On a 200×200 map, I could expect 50% of those tiles to have objects for shading. That’s 20K objects which came down to just 47. Nice!
That’s all that’s changed for now but I’ll be putting together a lot more now that I’m back into the swing of things. I’m hoping to finish up the enemies as well as the one teased in the last article, as well as pushing some more efficiencies into the game in general to get things even smoother.
Until next time, stay in the light!