The Swapper is an atmospheric 2D puzzle platformer, constructed using clay models and other everyday materials for a uniquely detailed look and feel. The game takes place on an abandoned space station and tackles the implications of the ‘Swapper’ - a device that can clone the user and transfer consciousness between different bodies. Coming Spring 2013!

The Swapper is incoming single- and multiplayer 2d-platformer with heavy emphasis on surreal and scary atmosphere and tricky puzzles. In this article I'm talking about implementing of fog effects into the engine and ranting about Game Maker.

Posted by FacepalmGames on Sep 30th, 2009

The main reason for adding the fog was that it makes it mostly unneeded to separate the shadows from backgrounds that represent objects further away from the player. With fog it doesn't look that weird when shadows are cast into air. And of course it does look good!

It could have been possible and pretty simple to code a mask system that cuts shadows away from areas where they should not be visible. Only problem that makes it hard is that The Swapper is coded using Game Maker. There are some things like simple casual games for which it is a great system, but when it comes to more complex things it really shows it's limits. Using GM it's really important to optimize things as much as possible as it itself is as unoptimized pile of poo as it could be.. That makes some interesting programming challenges. A thing as simple as fog is one of them.

The fog was first implemented using a sort of cellular automaton. The whole map was divided into cells which had a value from 0 to 1. Those values described the position's fog density. Using some predetermited rules the cells slowly transferred their values to each other, so it looked like the fog was floating around. The almost only problem was that because of GM's restrictions it ate CPU's for breakfast..
The current fog system works using huge blended fog particles. They might not be the greatest thing ever made, but they also lack the stupid looking jitteryness of the cellular automaton. Pretty big maps can be filled with fog of varying density's, which really adds to the atmosphere.

That allows some interesting gameplay possibilities especially for the multiplayer. Fog can be a strategical element allowing moving unnoticed. One can hide and camp in fog. There could be fog removing and creation devices.. It allows numerous possibilities and creative ways of use. Only problem is that the fog needs to be completely deterministic, so that each and every player sees it the same way, but that's not really a problem as the fog system is so simple. With pseudorandom numbers the fog can easily be made floating the same way million times.

That said, lets let the video explain things:

Follow the devlog here:
Or follow Facepalm Games on Twitter

Post comment Comments
Silverfisk Oct 1 2009 says:

IMO the fog doesn't look that good, you need to ask yourself if fog really should be a strategic element or just eye candy. You could put out bushes to hide in instead.

+1 vote     reply to comment
FacepalmGames Author
FacepalmGames Oct 1 2009 replied:

I think the same, it doesn't look that good. But first I must say that without the fog the current build of the game itself wouldn't look that good :) For the bad-lookiness there are a few reasons: the particles are Huge, they lack any animation in themselves, only thing they currently do is rotating. In the video the fog is also about twice as fast as it currently is, which makes some pretty big difference. And it's mostly way too dense so the particles show up too well. The particle count is also upped a bit from the video, making it look different, IMO better.

Probably the current fog could be made better looking also by putting there some more randomness. I think it could be a strategic element even while being not so over-visible, and compared to bushes it's dynamic. But there is going to be bushes also, and maps without bushes or fog. Generally the fog is just one gameplay modifier among others, but it's there also for the graphics. I think it's at least a idea worth testing.

Ideal fog in the terms of movement would work more like a thick fluid. I just can't think of a way to simulate it in real time so that it looked good and would also run on some older comps.

+1 vote   reply to comment
Silverfisk Oct 2 2009 replied:

Well, like you say fog behaves a little like water, so having fog in high places looks silly and isn't realistic. If you want to put fog on a certain height level in your map you could have long (maybe animated) fog stripes that could slowly flow back and forth. Just an idea.

+1 vote     reply to comment
Elementalist Oct 1 2009 says:

It's an interesting idea, but I just think there's too MUCH fog. Looks interesting though.

Why GameMaker out of curiosity? Clearly you have programming skill, seems like it'd make more sense to use a better optimized but more technical engine.

+1 vote     reply to comment
FacepalmGames Author
FacepalmGames Oct 1 2009 replied:

I agree. Too much is too much. It's annoying when one collides into the boxes that can't be seen through the fog for example..

About GM, I've asked that myself many times before. Before founding GM I had done some programming, but generally GM the thing that taught me most of my current skills. Only when starting to experiment with the graphically intensive things it started to show it's weak sides. At that point I asked if it really is the right choice, but rather than abandoning the program I took it as a challenge. Another point was that I had already developed an "engine" that used it as a base. It would have taken months to port it to some another system not mentioning all the time spent on learning new stuff.

And I'm not after all the newest graphical glitter. Instead I wan't to focus on bringing enjoyable gameplay with at least decent graphics, not spending all the time doing stuff the harder way. Sure there are talented programmers to whom that's the right way to go but I think I'm not one of them.

However some day in the future I'm going to switch to something else for 99% sure.. Even for the sake of cross-platform compatibility.

+1 vote   reply to comment
NullSoldier Oct 1 2009 says:

Take a look at your fog and perform quality control, do it.

+1 vote     reply to comment
FacepalmGames Author
FacepalmGames Oct 1 2009 replied:


+1 vote   reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

The Swapper
Windows, Mac, Linux
Developed By
Custom Built
Send Message
Official Page
Release Date
Game Watch
Track this game
Post news
Report Abuse
Report article
Related Games
The Swapper
The Swapper Single Player Platformer