The Eternal War Between Light and Darkness

Hi everyone, welcome to another installment of me sitting in a corner thinking about what I did then writing about it.

I wanted to push out a blog post sooner, complete with a new gameplay video. However, the day after I uploaded it on Youtube, I made some major changes to the graphics and I was no longer satisfied with the video. So I had to make a new one and then start writing about that.

Before I go through it in detail, I’m just going to show you the new gameplay video and see if you can spot the changes:

 

Can you see what has changed. Go ahead, I’ll give you some time to think about it.

… … …

Ready? Alright, here we go:

Redundancy eliminated in graphics pipeline. Productivity up, but many lines of code now out of work

This first one is a bit unfair since it’s imperceptible: I rewrote the lighting rendering pipeline so that it works with GameMaker: Studio‘s native graphics pipeline rather than against it. This switch resulted in a 25% boost in framerate, though it’s not perceptible on my dev machine since it is able to render the game at over 60 fps. However, this might help some lower end machines run the game at the full framerate so they don’t have to cap it at 30.

Light and dark embrace more extremist positions

The way light and shadow are blended with the scene was also changed. In the old method, light and shadow were blended in using multiply blending implemented with GameMaker‘s built-in customizable blend modes. The new method uses overlay blending by means of a shader (there was no easy way of configuring GameMaker to draw using overlay blending). Below is a comparison of both methods:

Left: Old lighting using multiply blending | Right: New lighting using overlay blending

If you’re familiar with image editing programs like Photoshop or GIMP, then you should already know the differences between multiply and overlay blending and what they do. If not, then you can click on the links to get the technical explanation, or you can just look at the pretty pictures. The game now has access to a greater range of brightness values by using overlay blending; this not only makes bright areas look brighter but also makes dark areas darker, creating a a more striking contrast between the two:

The increased brightness also allowed me to enhance certain particle effects, such as making the fairy dust created by Réiltín look actually sparkly.

Increasing number of young lights join the occult

I fixed a long-standing problem with how the simple lights were drawn. In my engine, simple lights are lightweight (no pun intended) light sources that don’t cast shadows. They are used for things like lamps, muzzle and explosion flashes, and glow effects. Originally, these simple lights were drawn in post-processing, i.e. simply added on top of the regular (shadow-casting) light source. This had the effect of those lights shining through opaque objects when they should be occluded.

Should be. Could be. Would be. ARE:

In the screenshot above, the spiky hit flashes are properly occluded by the tree trunk in front of them. I left in the option of allowing simple lights to be drawn in post-processing, as demonstrated by the dead, flashing red monsters being drawn through the tree trunk.

Better minimap, better know a district

The minimap in the top-right is a fairly old feature, but before it only revealed the location of items relative to the Reiltin. In this update, it now also shows the location of enemies, walls, gates, decoys and proximity mines:

For proximity mines, the minimap also shows their activation range when primed and their area of effect when they explode:

Click to see full animation

I realize that giving all this information to the player really makes the game’s theme of obscuring things in the dark moot, but in the final game the player won’t have all this info all the time. They will have to use certain items or tools to get additional pieces of information.

 

Next time, on Feast for the Senses

And here’s some leftover stuff I haven’t finished yet but still want to mention:

Non-rectangular levels: it’s not hip to be square

Up until this point, all the levels I had created for Feast for the Senses were rectangular, whether they be levels for the Arena, free roam exploration, or linear exploration. But what if I didn’t make them rectangular? Here is a irregularly-shaped linear-type level I’ve started working on:

It might not be apparent from this screenshot, but this level is huge. It’s the largest room I’ve ever created in GameMaker. I had to make the sections wide enough to accommodate gunfights and the entire level long enough so that the player doesn’t just blaze through it too quickly.

Birth of a new tileset, the miracle of… uh… graphic design?

I’m starting to get bored of seeing both tilesets that are currently in the game, you know what that means: it’s time to add a new one to the family! The one I have in mine is a little more involved than the others. It makes use of dynamic graphics…

The undulations are almost hypnotic. Yes…

Updates: Mostly Graphical, Some Audio, Some AI

A summary of the updates to Feast for the Senses from the past month. If you have been following along my Twitter, then most of this might already be familiar to you.

The Full Gathering of the Senses

So I finally got off my butt and finished implementing all five sense monster classes: Sight, Hearing, Taste, Smell, and Touch. I renamed the Bearer-class (who’s only job is to hold items until the player destroys them) to “Pain-class” to fit it in with the whole sense theme. Each class of monster now has their own set of vocalizations. I’d like to thank the contributors at freesound.org for letting me demonize their voices. 😛

Monster 2
Rogues gallery

Each monster type has it own way of detecting its victims, so they all have their unique behaviours. I will go into more detail in a future post:

Oh, that video also spoils the next two things I want to talk about:

Weapon Wheel

As I have been adding more and more weapons and items to the game, I found it awkward to switch between them using the d-pad. I know and played a few games that do this out of necessity because the right stick is mapped to a more important function, but then I realized I wasn’t using the right stick for anything. So, I changed the weapon/item selection system to a weapon wheel.

weapon wheel 30
Click for a slightly better version

Since now every weapon and item is access via the weapon wheel, there is no longer any distinction between main and sub weapons, but since only a handful of people actually playtested the game during that phase of development, we can pretend it never happened. 😉

Refined Tileset

I also redesigned my tilesets to remove or tone down the detailed skeuomorphic elements, which were clashing with the simpler flat elements. Something bugged me about how I designed my tileset for a long time, and I think this might be the reason why. I also bumped up the vibrance of the colours a bit too, as I thought the levels were looking a bit too dreary, and that I know has been bugging me recently.

Grassy tileset
Marble tileset

And for comparison, the old Grassy tileset…

…and the new Grassy tileset…

At first I was worried that having the grass as huge areas of flat green would make it look boring or make it hard to get a frame of reference when moving, but those grass tuft tiles that hug the sides walls, ground tiles and randomly strewn around everywhere really help make it look much better. Curiously, I don’t have any good screenshots of the old Marble tileset. They’re all either too small or animated GIFs. Because of that, I can’t do a fair comparison of the old and new Marble tilesets. Oh well.

Update on Feast for the Senses

I didn’t have a substantial amount of stuff to talk about in the past month, that is until last week came along and really pushed that amount over the top. So here’s my long post updating you on the progress of Feast for the Senses:

New Monster Types: Taste-class and Smell-class

The game’s title “Feast for the Senses” came from the idea of all the enemies being based on the five traditional senses (sight, hearing, taste, smell, and touch). I had finished implementing the Sight- and Hearing-class monsters for a long time now and demoed them in my various gameplay test videos. However, I got sidetracked by working on other features of the game and left making the rest of the enemy types on the back burner, especially the poor, half-done Taste-class monster.

Taste Testing

The Taste-class monster is immobile, so it relies on spread a network of detectors to find the player. My initial implementation had it growing a maze-like network of tongue-like appendages to detect the player’s location and shoot directly at that spot hoping to hit them. Unfortunately, I encountered many bugs and other issues with how the tongue-growing algorithm (it was essential a maze-generating algorithm running inside an already labyrinth environment YO DAWG, I HERD U LIKE MAZES…) and decided to put it on the shelf so I could focus on other things. After several months, I eventually got around to working on them again and re-worked them with a simpler detector-spreading algorithm. Instead of tongue-like appendages, they now spread “buds” in a haphazard fashion around themselves. They do the exact same job, but with better and less buggy coverage. I also changed their method of attack from a straight shot to a lobbed shot. Their buds can potentially grow around walls, in places where the monster would not have direct line-of-sight (er, line-of-shot?) with the player. Lobbing the shots would outcome this problem.

Click to see an animated version

Stop and Smell the Réiltín

This past week I’ve worked on the beginnings of the Smell-class monster. They use a simpler, modified potential field algorithm to find the player’s position, inspired by some similar techniques used for some monsters who track the player by scent in traditional roguelikes I found by trawling the internet.

The map is divided into a grid of nodes; each node has a value representing the strength of the player’s scent. Every step, the node the player is floating above is incremented by a constant; the surrounding nodes are also incremented but by a smaller number. Then, at the end of every step, the scent at every node undergoes decay; reduced by a certain percentage. If an idle Smell-class monster is standing on a node above a certain threshold, it would go into chase mode. In this mode, the monster will check all neighbouring nodes and move towards the one with the highest scent value, until it reaches the player and goes into attack mode or loses the scent and goes back to idle mode. Compared to the Sight-, Hearing-, and Bearer-class monsters, who all use GameMaker:Studio‘s potential field algorithm for pathfinding, the movement of Smell-class are clumsier and more predictable, but (to my surprise) they are able to track the player over longer distances and behind obstacles much better.

Click to see animated version

 

For an extended look at the tests, watch the following video:

Transitions and Other Interface Improvements

On the interface side, I made some additions:

  • For all menus, I added some simple fade-to-and-from-black transitions between menus and the game rooms to visually ease the switching between and added some sound effects to that play when interacting with the menus. All in the name of feedback principles, UX design, etc., blah blah blah.
  • A new menu was added where you choose the level you want to play in Arena mode, now separate from the main menu. Each level now has weapon restrictions or loadouts, represented by the icons on the right side of the screen.
  • Finally, I added a pause feature during gameplay. This was necessitated by the newly-added transitions mentioned in the first point. Otherwise, the game would behave weirdly when moving from a game room back to the arena menu. In the video above, the reason I’m pausing seemingly willy-nilly is to make sure the audio cuts and resumes properly and that nothing disappears or breaks during the pause.

Gamma/Brightness Correction

When I took a look at the histogram of a screenshot of the game in Photoshop, I noticed that the range of luminance values was narrower than I expected. For a long time I had thought the game’s graphics were a bit dull, possibly due to all the colour mixing that goes on with the lighting engine. That inspired me to add a simple shader that changes the gamma level of the application surface. I’m experimenting with it to see if increasing the default gamma a bit will make the game look better or ruin the atmosphere. So far it seems like an improvement.

Left: Original gamma level (1.0). Right: Modified gamma level (1.2).

WHAT THE DUCK- BOOM


Has it been three weeks already? Well, fear not, as I have come bearing you good tidings and a new update on Feast for the Senses.

I have added a new category of sub-weapons to Réiltín’s arsenal. I felt that the game needed more close-range combat options and more ways to engage with multiple enemies at the same time besides using the grenade launcher.

The first of these new sub-weapons is the landmine. (Click on any of the images below to see an animated version.)

When set on the ground, it takes a few moments for it to arm itself. When it does, it beeps and becomes fully invisible, leaving behind only a pulsing ring that indicates it’s activation range.

When an enemy wanders into the ring, the mine reveals itself, flashing and beeping. After a short while, it explodes with a blast strength and radius greater than that of a grenade. Réiltín cannot set off her own mines by moving near it, but she can set them off by using the explosion of a grenade or another mine.

The second sub-weapon is the decoy. Not knowing how to depict the decoy, I just Google Image searched for “decoy”. The topmost results I got were all duck decoys used for duck hunting. I just said to myself, “Why not?” Fairies do have a reputation of being weird and inscrutable.

When set down, the decoy will jump around, quack a song, and be all-around conspicuous and annoying, attracting the attention of nearby enemies. Since the enemy monsters are in-universe rely on their individual senses to track the player down, I thought the decoy should be some sort of an annoying and obvious sensory experience. Also, I just wanted an excuse to put the Flea Waltz in a game.

The decoy has more drawing power than Réiltín herself, meaning she can drop one while being pursued and sneak away unnoticed, or get up close and attack without fear of retaliation.

Obligatory video showing how the graphics and sound tie together:

A Gift of GIFs

I was planning on putting out a demo of Feast for the Senses last week, seeing how it was Hallowe’en and all, but there was a lot more to be done than I previously thought. Now I’m not sure when the demo will come out. In the meantime, here are some GIFs of some new stuff.

When you move behind a wall or certain obstacles, an outlined sprite of your character now appears over it.

This solves a lot of the visibility issues in cramped and narrow spaces that made me favour putting a lot of open areas in my levels. The method used is basically a hybrid between the techniques of drawing silhouettes behind walls and drawing outlined text, combined with my lighting engine.

I added gate sprites for the marble + glass tileset (which was missing when I showed it last time) and also refined their opening animations:

I think I’m getting addicted to using sinusoidal interpolation over linear.

As I’ve been playtesting, I’ve noticed that placing powerful ammo (i.e. shotgun, grenades) behind locked doors wasn’t a big enough incentive for my playtesters or even myself to waste spend valuable time finding the keys to unlock them in Arena mode. That’s went I realized that I need to up the reward. Up the ante.

So I began to place these behind the locked doors. What’s inside the box?

If you’re more of a dog person, don’t worry, you won’t be left out. 😉

As mentioned earlier, draw the player’s outline when they are behind walls now makes navigating small spaces less frustrating. Because of that, I had been holding back showing one of my levels until now. It is made entirely out of narrow, twisty passages. I found this level to be more action-packed than the more wide-open levels since its labyrinthine quality makes most of the enemy encounters up close and personal.

Interior Decorating

I made quite a few changes this week:

Lighting

I’m not as gung-ho about hiding stuff in total darkness anymore, so I made some changes to the player’s light to make things easier to see:

  • Larger light radius – so you can detect enemies sooner and have more time to whip out your gun.
  • Small amount of ambient lighting – it makes the edges of the light circle a bit nicer.
  • Tracers are now lit through the darkness – so you can see if your magic missiles successfully attacked the darkness or not.

boomThis is my Boomstick

New marble and glass tileset

For a large part of the development of this game, I’ve been using the Grass Maze tileset to playtest my game:

While I have made improvements to it over time, I still got tired of looking at it and decided that the game needed a makeover. Below are some screenshots of the different features of this tileset:

Diamond tiles

Roll out the red carpet

Sunken carpet


Sunken waterway

Miscellaneous additions

I added a bunch of new sound effects and fixed a bug in the countdown timer. If there is anything else I added this week that I forgot to mention, it will be in this video:

Eaten by Some Linux Redux

One day as I was switching between build targets in GameMaker: Studio, I noticed that an entry labeled “Ubuntu (Linux) (YYC)” was on the list of targets. I have exported previous projects to Ubuntu before (e.g. Gonna Catcha) and have been building Feast for the Senses with the Yoyo Compiler whenever I go out to show the game and playtest it with other people. But doing both at the same time? Do I dare to cross these categories? The answer was “yes”.

Come to think of it, I don’t even know when this option (and the “Mac OS X (YYC)” target) was released. I must have missed the memo.

Anyway, I was eager to try it out, since I do want to eventually distribute Feast for the Senses on multiple plaforms and tests have shown that it does benefit from being built with the YYC (e.g. it gets a higher max framerate, so less chance of slowdown or needing cap the framerate at 30 on lower-spec machines). First, I tried to build and run it on my Linux Mint virtual machine, but the compile would failed every time. I eventually learned that the YYC wasn’t supported on Mint and that I should be using plain old Ubuntu.

After creating an Ubuntu VM and much “sudo apt-get”ing, I finally got it to work:

Full-sized screenshot:

The game seems to run fine, though sometimes it can’t maintain 60fps, but that just might be the fact that it’s running on a low-spec VM.

I also got a bricked SteamOS VM out of the experience, but that’s another story. And by another story, I mean:

Next on the agenda, I’m working on a new tileset, because the grass maze tileset is starting to wear out its welcome. This one uses various layered tiles…

…and animated tiles.

It’s still a work in progress, as the tileset has many clashing elements to its design. (Note to self: get new interior decorator.)

Lastly, I’ve implemented areal dialog triggers. This enables Réiltín to comment on areas she enters:

Spicing up the Ooey-Gooey GUI

I finally got around to figuring out this 60fps GIF business. OK, I knew sites like Gfycat existed, but I just didn’t know how to convert my Fraps recordings into GIFs in the first place. But that’s all in the past now. No more awkward 25fps GIFs for me, now it’s 60 all the way… or 30 if some sites won’t let me have fun.

Let’s start off this high-quality GIF thing with some improvements to the GUI. Until recently, I never focused much on the UI; it was mostly there to show me numbers and junk to tell me my game is working properly and not lagging. In the last week or so, I decided to give it a bit of love.


By adding various transforms to the GUI elements, they now “react” to things happening in the game beyond changing values:

  • The health meter shakes upon taking damage; the higher the damage, the more it shakes.
  • The score counter goes nuts whenever it gets incremented.
  • The timer pulses every second when time is running out.
  • The ammo counter also pulses like the timer, but it pulses inward when ammo is being consumed and outward when it is replenished.

The following GIF shows changes I made to the walls:

I redid the wall sprite because for a long time I didn’t like the old rough stone texture I generated in Photoshop; it was too detailed to fit in with the art style. In addition to that, I added in some wall lamps to help modestly pierce through the darkness. I haven’t made any animations for the lamp’s flame yet; that will come next week.

The lighting engine which Feast for the Senses grew out of has two different types of lights: regular and simple. Regular lights cause walls, enemies and other obstacles to cast shadows and are relatively computationally expensive, while simple lights don’t cause objects to cast shadows and are cheap to process. Simple lights were only used for muzzle flashes and grenade explosions before, but then I figured I so get more mileage out of them and uses them for other purposes.

Oh right, I almost forgot. I also added a dialog box to the GUI. Now Réiltín can now speak her mind about what she encounters:

OK, now it’s movie time. Here is how all the changes look in the context of gameplay.

Feast for the Senses: An introduction

This will be my first post for my latest project: Feast for the Senses. This project started as an experiment in real-time light and shadow for 2D orthographic-perspective games. After working on it since the beginning of this year, it has since become two projects in one: the lighting engine itself and the game.

About the Game

Feast for the Senses

Feast for the Senses is an orthographic maze crawler/shooter where you play as Réiltín, an weird-now-hardened fairy woman who is out to find her lost friend. They were separated after a sudden and violent invasion of deadly and belligerent monsters, and a dark cloud that has turned the land of the fairies from a cheerful, colourful world into a somber land of shadows.

Réiltín is equipped with her personal arsenal of firearms: a pistol, a submachine gun, a shotgun, and a grenade launcher. She also uses a star wand as a melee/emergency weapon.

My current plan is to have two gameplay modes for Feast for the Senses. The first is the “Arena“, where players are given a set time limit to hunt as many monsters as possible. Below is a video showing this mode currently in development:

The second is “Story“, which will follow the plot described above. I don’t have a current video showing off this mode, but the videos and screenshots I’ve posted here and on Twitter in the past showed earlier versions of it. “Story” mode will contain different mission types, ranging from navigating labyrinths to find a way out to holding ground and protecting a target.

I’ll try to post my updates here more often, so stay tuned for more.

Shotgun Blast