This week there is nothing new… sorry!
I did a bit of optimizing, which involved re-writing some things.
I made the rendering process a bit quicker by combining the coloring method and sprite rendering into the same method (cause there is no good reason why I made them separate to begin with)
I did a little bit of optimizing with mobs, since I removed multiple-sprite mobs a bit ago because of the amount of problems they made and I didn’t really like how they looked (not sure if I put that in a previous dev blog, but a week or two ago I removed them), I changed all the code that dealt with multiple sprites so the code makes sense when always dealing with one sprite instead of running unnecessary code.
But no new features, and that is mostly because I don’t know what to add next. Level generation was the big thing I was waiting to add, and now that that is done, I have a lot of things that are all either annoying to add or not interesting enough to hold my attention. But I will find something to get me back into this project after a short hiatus this week.
Read MoreThis week Monolith took a big leap forward! One thing that is critical to all roguelikes has been properly added, and it looks pretty nice, so without further ado…
I completely redid the level generation this week, and put some time to make it really special. The basic idea of picking a random size and trying to fit the room stayed mostly the same, but now there a ton of more option for each room, but before I get into specifics, here is what a basic 100×100 level looks like now…
As you can see, this is not your father’s dungeon.
So the way this method creates a unique style to the level is that each room has a different type, and the chance of each type appearing on a given level is controlled by the Level type, which is chosen at random based on how high of a chance it has to be chosen.
Example: The ‘Normal’ type level has a 70% chance of being generated. For the Normal level type, a normal level may have a 80% chance of creating a rectangular room as it’s next room, and a 15% chance of creating a circular room as it’s next room. This goes on to every type of room…
On top of just picking a random number for width and height, certain rooms use a type of random number called ‘Perlin Noise’, an example can be seen below:
So as you can see, this creates a random effect that isn’t so random, meaning it has a bit of a pattern, so that a high number (represented by the light color) is not next to a low number (represented by the dark colors) without having to go a few numbers between the two numbers. This is the exact randomness that is perfect for map generation in video games.
There are 6 level types:
The rooms they contain will become fairly obvious as I tell you the room types.
Room Types:
So that’s the level generation, it really adds a nice feel to the game, giving the player a bit more curiosity of what each room contains other than another bunch of baddies to battle… speaking of which…
I added an outline effect to Monolith, meaning that when added, adds a border of whatever color and size the method is passed. I added it to give enemies an outline to make them appear more obvious to the player.
This, however, is not applied to the player. I didn’t like how that looked, so limited the outline to just enemies.
Monolith now has the option to toggle fullscreen by pressing F11 at any time. Unfortunately for the time being only the main display is supported for fullscreen (an error is thrown when trying to turn on fullscreen with the window in a different display).
I added a fun little visual effect, that will render the game with a certain palette that can be set to any colors. It works by finding the difference from the pixel’s color and every color in the palette, and replacing the pixel with the color with the lowest difference (meaning it chooses the most mathematically similar color). The game runs really slow with this effect on (A lot of calculating must go into each pixel in the window, and there are a lot of pixels in the window)
I tried a few palettes, here’s a few examples of the game with different palettes:
Gray-scale and a deep red
Vintage/sepia
Gameboy
That’s all for this week! The game definitely feels a lot more like a game thanks to the new level generation. Thanks for reading!
Read MoreVery short dev blog this week, because most of the work done has been prep work for next week’s update, and there isn’t much to share yet. However, along with this dev blog, there will be a recap of everything done in the 10 weeks of development.
I forgot about the ‘swaying’ effect last week when I added the visual effects, so I added it this week. Several separate sway effects can run at the same time at any position on the screen.
I added a new tile to the level generation, water. The only thing it changes is that it reflects the mob or projectile in the water.
So before, the levels were always 100×100 tiles, and I wanted to increase the size of the level to see what that looked like, but there was a problem. I could not send that much data to the client in one packet… so, I had to re-write the way levels were sent to multiplayer clients…. twice.
Re-write once, shame on me. Re-write twice… still… shame on me…
Anyway, the new way levels are generated, and how they are sent to multiplayer clients are throughseed generation. This means that, when generating the level, the random number generator is set to a specific seed, so that the same random numbers are generated. This way, now only the seed is sent to the client, and it generates the level from that seed.
So now, the level can be any size and still work over multiplayer, and the big levels look really nice.
That’s all for this week, even though there was almost nothing. This is because I am preparing for thenew level generation system. So look for that this upcoming week!
Thanks for reading!
Read MoreThis week overall there were a ton of changes. This week the focus was making the game more visually pleasing and generally more enjoyable.
Background Color
In my apparent quest to replace all numbers in my code with variables, I added the feature to change the background color. With this change I have changed the background from black to a nice gray color. I think the new gray color really complements the visual style of the game.
RGB Split
I had wanted to add this effect for awhile, but I did not know how I would implement RGB split. It actually turned out to be really simple! The method, when called, calculated all the pixels affected, and converts those pixels to a Color object, then it sets the offset component at whatever offset is given, and rewrites the origin pixel as the same color without the offset component (Okay, that sounds a lot more complex than it actually is, but that’s the best way I could explain it).
I also added an option to do the RGB split in a circular area, and added a variable to start a distance from the center. With these two features combined, the RGB split gives a nice ‘force field’ effect that I may use for something later.
Using the RGB effect with entirely random settings made for a really simple ‘glitch’ effect, so I can use that if I ever need to in the future.
Shaking Screen
In the theme of visual improvements, I figured I would add a screen shaking effect. It looks pretty good, and is about as customizable as it could be. Right now I send a quick burst of shakes whenever the player is damaged, and it looks kind of awesome.
Glow
A glow effect was added, that is just a lighting effect in a circle around a point. Pretty simple. I can change the color and opacity of the glow to create a variety of effects. Right now I use it as on projectiles, that just have a light glow, of the same color, around them. The effect actually looks really nice, even though it is subtle unless there are a lot of large sprites around the projectile (like in the image below)
Blood Effects
The blood effect was pretty good before, but the performance tanks whenever there is too much at a time. This is because there is so many particles that demand to be updated and only a handful that are actually rendered, because instead of acting as sprites the blood acts as a lighting effect (this has been explained a past dev blog). So as a temporary fix before I set time aside to optimize particles, I changed the blood effect slightly to increase performance, and I like how it turned out.
Now in addition to the normal blood, there is a “blood spurt” of sprite-type particles that spit out and only stay for a second, and this allowed me to decrease the amount of the ‘resource intensive’ additive-type particles.
Gone Too Far
When you add some cool effect, as a game developer, it’s really hard not to test all of them at their most extreme all at once.
And oh boy…
After playing like this for a second, I knew that it would be impossible to play like this, which is why I knew I had it as a hidden feature. So I added a feature that, depending on the player’s username, activated some effects. Using the following usernames activates the appropriate effect:
Spell Book
For everyone who didn’t write or look at the code, there was no way to know which runes casted which spells. So, I made a spell book, that the player can access anytime from the pause menu. In it, all spells that the player is able to cast, with information such as the name, type, damage, speed, and runes needed.
More Controls for Menus
Menus now support mouse input, so that’s nice to have.
Also, menus now support entering text! I said I would get rid of that terrible looking default pop up dialogue box, and I finally did!
Player Customization
Before the player joins a server, they have the option to change their name and player color. By default, the player’s name is “Player” and are yellow. But they can change their name thanks to the new entering-text-into-menus feature, and can change their color by typing in the RGB code for any color they want, or, or they can type “random” into the color box and they get a randomly generated color!
Colliding Projectiles
I have been unhappy with the way combat has worked. It was pretty much “kill first or be killed first”which is not what I wanted. I knew I needed to add a way to defend yourself other than just hiding by the nearest corner and running into cover whenever a projectile was near. So I added something to help with this issue.
The player’s projectiles now collide with enemy’s projectiles, so that if a projectile was coming toward the player, they can cast the quickest spell they could to stop the projectile before being hit. This is not a great fix, or a permanent one, but I noticed an immediate change in the combat when this was added, for the better.
Return of Rainbows
A feature introduced back in Dev Blog #2 now makes it’s return. I added it so long ago I forgot to implement it for what it was created for. There is now a rainbow effect when the player levels up!
Randomized Rune Placement
Now, at the start the game, the rune placement is randomized. I think this a nice small way to change up the start of each run, and makes the player have to learn the symbols for each rune to cast the right spells.
Hold Your Fire!
Now the player can only fire into open tiles, meaning that the player cannot cast a spell into a wall they are touching. I also added a visual representation of this, the direction UI became gray for directions that the player cannot cast.
Keep Runes
After writing last week’s dev blog, I realized that there was no way to upgrade past level 5 without switching out a rune. Now there is an option to keep the runes that the player has already, if they want to for some reason.
Rewritten classes
I rewrote two classes this week. First, the keyboard input. Before the way I added a new keybinding, I had to create 3-4 variables to get the information I wanted from the input handler. But now I rewrote the class to be much more compact and work just as well as it did before, and allows me to add keybindings much easier than before.
I also rewrote the way Menus were created. Menus are basically a collection of Strings, colors, and options, and I used to take those all in separate arrays. But I created a class that takes in all the info needed per line, and it actually added a few options when creating menus. I can now change the color per-line instead of just changing the overall color. I also can have code run every time a line is hovered over, but I haven’t used this feature for anything yet.
Pesky Pixel Problem
Alliteration beside, for as long as I can remember, there has been this annoying problem with the game rendering, that would cut off a few rows of pixels and it was very noticeable when fully zoomed out. But finally I fixed the problem! The frame just had to be re-packed every time the zoom changed, and magically the game rendered perfectly!
I tested LAN multiplayer this week, and it works! That should mean that all multiplayer works, but I have yet to test cross-network multiplayer.
Also, the multiplayer is surprising fun, I was very happy to see that.
And that’s everything new this week! Thanks for reading!
Read More