A good bit of changes this week, but spread out enough that there isn’t that much to write about for each except for a few topics. Therefore this update will be more a list then an explanation of the bigger changes/additions.
Zoom! Pressing +/- increases the pixel scale, which is a nice feature to have.
Permanent bones. After a mob dies, the blood will dry up but the bones will stay there forever!
Decreased mob spawn chance.
Correct order of rendering. Tiles > Mobs > Entities (Particles/Projectiles) > UI
Changed colors of spell runes to be more obvious when pressed.
Large room generated as last room in level (reserved for a boss battle)
Cool down between shots and after firing. Barely noticeable between shots, but after all shots of a spell are fired, the player is unable to cast another spell for 1/3 of a second.
Pausing. If all players in a level are paused, the level is paused.
Those are the quick changes, here are the changes that deserve some explanation
More efficient rendering
I noticed, when looking at the Level’s rendering method, that the code evaluated whether or not a tile, mob, or entity, would be rendered each frame, even though there was no way that information would change more than the level updated, or even as often as the shadow map updates (which happens 4 times a second).
So I simply added a variable to tiles, mobs, and entities that enables it rendering or not, and then each frame the game would just check if that variable instead of accessing the shadow map and going through several loops. So now the rendering is much faster, I saw a 150% increase in frames per second, which is always awesome to see.
Getting one step closer to leveling up! Experience particles act the same as in most games. They are dropped by enemies on death, and move toward the player, until they are on the same tile as the player, where they are absorbed and the player gains that amount of experience.
I had planned on this week being the “Leveling” update week, but unfortunately I realized there were a few more key features I had to add before I could do that, those features I got to this week will be covered a bit later.
Player Projectiles change
Before, the player had to be locked on to a mob for their projectiles to home toward that mob. But now since mob projectiles always home, that seemed a bit unfair. So now all projectiles players fire home toward the nearest enemy!
Now for the big additions!
All rogue-like have a ton of enemies, so I had to make a way to create mobs, give them names, and give any information needed when creating the mob. So I created a class that holds a static variable for every mob that holds all the custom info for that mob. In addition to the standard info (name, health, experience dropped, occurrence rate, spells it can cast) I also added a new feature to the status bar at the top of the screen. I call these “observations” and they are just a fun little sentence that your character thinks about what they are focused on / locked onto. An example is seen below, with one of my favorite mobs I’ve created, “Long Arm”, represented with the character ‘W’,
Each mob is also given a Type, which holds a few different bits of information. The current types are: Common, Uncommon, Rare, Ultra, Mniboss, Boss.
The type controls it’s occurrence rate, color (the color gets blue depending on how rare it is), and the amount of experience it drops.
Probably the most notable change this week (even though it was added just today), is the new Menu system. Menu’s act like how you would expect, but it took some rearranging of code to make menus work.
In-game, a menu appears as any other UI, but the player cannot move while the menu is open. Right now the only in-game menu is the pause menu, which gives the player the option to resume or exit the game to the main menu, which brings me to the next point…
There is now a main menu!
Instead of the placeholder Java default dialogue box popping up asking if the player wanted to the run the server or join the server, there is now a nice menu when the game is started!
This also allowed a new option that was not as convenient before, joining external servers. There is a sub menu when selecting “Join Server” on the main menu, that lets the player decide if it wants to join a local server or an external server, which then prompts the user to enter the host’s IP address (which pops up one of those placeholder Java default dialogue boxes, but hey, that’s to be fixed another day). Unfortunately I have no idea if joining external servers actually works, as this feature was just added today and I have not been able to join external servers in the short amount of testing I did.
So that’s about it for this week, there were a few small bugs fixed that either aren’t worth mentioning or I forgot I fixed this week (not the greatest at keeping track of things this week).
I am now able to export the game to a runnable jar file, and could put the game up for download if there is anyone interested!