Darknasia Devlog #2 - Under the Sea
Welcome to week #2 of Darknasia's Devlog.
Last week's focus was on the surface of the game and adding in all the new shops, this week I've been 100% focused on beginning the next area of the game, Subzero Sea.
The first thing I do when I begin working on a new area is create the tileset for it. Tiles in darknasia are stored as 14 image sprite sheets, which when fed into the game automatically tile out depending on where surrounding blocks are. A completed tileset looks like this:
The tile sprite sheet for Subzero Sea:
When they're all rendered into a room based on solid collision positions, they look like this:
A demonstration of the Subzero Sea tiles connecting automatically:
Finally I added a simple water filter over the area to give it that wavy underwater look, as well as making air bubbles appear when the player breathes.
A near final design for the Subzero Sea:
Designing levels for Subzero Sea is still a WIP, it's very unlike the previous two areas in the game, as most of the areas levels take place going vertically rather than horizontally. Though I'm still not ready to show off many of the completed Subzero Sea levels, I will give you a detailed rundown of how my level generation system works.
My level generation system for Darknasia is heavily inspired by another very famous roguelike made in Gamemaker, Spelunky.
Levels start off as 16x9 text dumps of binary.
A blank level generation template:
Each digit in the text gets converted into a room tile, which then depending on the value of the digit will become an object.
For example, 0 = Air, 1 = Solid Block. So the next step in creating a level is to add the solid collisions.
Solids added to the level text, represented by 1s.
When converted it looks like this:
Then finally, I break away from binary to start adding further detail to the levels.
The key my room tiles use is quite simple:
Numbers represent terrain.
- 0 = Air
- 1 = Solid
- 5 = Water
- 6 = Platform
Letters represent enemies.
- A = Snake
- B = Skeleton
- F = Zombie
- H = Sea Urchin
And finally symbols represent traps and special items.
- _ = Treasure Chest
- < = Right facing arrow trap
- ! = Spike Floor
A completed level text:
When rendered it looks like this:
Once I have a completed level text, I remove the line breaks and convert it into a string in Gamemaker.
Then finally, I assign each room tile of the 16x9 grid a character of the string to get it's tile data from.
That's done using two very simple lines of code. One in my room creation object, and another in the room tile object.
Room Creation Code:
The room creation code creates a total of 144 room tiles to cover the 16x9 radius, and then assigns them all an entity based on the character of the 144 character room string to match their position in the room. The string_char_at function allows to me to grab characters from my level text (stored as a temporary readstring variable) individually.
A snippet of the room tile's entity changing code:
Then finally, each room tile individually checks its entity and becomes the appropriate object.
I am aware this isn't the most optimal method of generating levels, but it allows for fast level creations since they're all being drawn out as binary, and it takes up a lot less storage in the game saving each level layout as a string rather than a room.
Next up in creating a new area is to design enemies to inhabit it. Thanks to Burgerlord I was able to come up with some unique enemies and traps for the Subzero Sea.
GIF demonstration a timebomb's explosion:
Timebombs are one of the new traps introduced in the Subzero Sea. They explode about 2 seconds after you step on the trigger for one.
GIF demonstration of water currents in a horizontal room being flooded:
Water currents are the main trap in Subzero Sea, they will push you towards or away from a certain direction depending on the current. Sometimes in the horizontal sections of the area, rooms can be suddenly flooded with water and you will have to react fast to survive as the room's layout changes in seconds.
Some enemies you'll encounter in the Subzero Sea include:
Pufferfish - Expands bigger everytime it's damaged, eventually exploding
Sea Urchin - Explodes violently on impact
The final thing I do when designing an area is create a unique background track for it. For Subzero Sea's background song, I used a lot of sine wave arps, reverb and delay to create a fast paced underwater feel. The song itself draws a lot of inspiration from Castlevania music.
That's all for this week's Darknasia Devlog, sorry there wasn't too much original content to report on as I've been flying over the weekend, but hopefully next week I'll have a lot of progress on Subzero Sea levels to show you!
As always, be sure to follow me on Twitter for more frequent updates throughout the week and to be notified when a new Devlog goes live.
Leave a comment
Log in with itch.io to leave a comment.