Monday, May 27, 2013

VYDE : A Whole New Game

In most immersive sims, plenty of importance is given to playstyle and choice, they make it a point to provide players with an arsenal of options at ever step which empowers them in ways other games don't. Most examples I can think of can be classified as stealth games, or at least games that allow you to sneak around in the world. While other (inferior in my opinion) stealth games don't stress on playstyle all that much and only work with this thing designers like to call 'second stage mechanics'. The one and a half minute after Snake is spotted and enemies are searching for him is when the dynamics of the world have been changed momentarily, everything from enemy behavior to the player's goals change instantly for a short duration, which can introduce the much needed variety in gameplay.

I call VYDE a stealth game yet it has none of these characteristics, nothing in the game is actually simulated, enemies follow strict paths and there are no second stage mechanics to speak of since detection leads to instant failure.What then is that one thing in VYDE that makes it good, if at all? Is it the color-hiding gimmick or the abstract squarish minimal look, both of which actually make the game harder to understand. Players tackle every level in a two pass process - identification of the correct route to the exit which is apparent from the colors, and then the actual performance of that plan. The identification happens almost instantly at first glance, the difference between the cells that are safe and those that aren't is made clear from their colors and enemy patterns are quite obvious. Since it's not encouraged to start moving before you have a set plan in your head, the level isn't learnt by actually exploring it through the act of playing, but rather a passive calculation which doesn't involve interacting with the world in any way. What this creates is the kind of experience that I found extremely boring. Once I've calculated the route I'm going to take, the rest of level is just a test of my dexterity, or how well I can function the awkward controls that aren't best suited for touch screens anyway.

Apart from not having enough space to allow more fleshed out levels, there wasn't really any scope of introducing more variety in gameplay. I tried smoke bombs and traps but they were too cumbersome to use, making the already difficult to comprehend control scheme even more complicated. The question I asked myself then was - if I can't add anything to the game, what could I possibly change or remove that could make it better? A week ago I was toying around with some levels and I prepared this obnoxious mess of a room, with random shades of red thrown around and enemies with movement patters long enough to never remain synchronized with each other - and suddenly I had a whole new game with me.

I increased the percentage of safe cells on the map allowing the player to roam freely, effectively increasing the size of the map. This sudden boost in freedom was then complemented by more enemies with longer routes, which were less predictable to chart out. These changes eliminated the first problem we were having, players could no longer analyse and find an effective solution to the problem by just staring at the level because enemy positions as a function of time were no longer obvious. This solution only partly solved our problem, players need to be encouraged to explore the level and that would only happen if I wasn't pushing them back for the smallest of mistakes. Levels are too small and they finish quickly, the average play time never exceeds ten seconds which is not right. How do you make the levels bigger and also introduce enough room for players to recover from those errors without actually restarting? I'm ashamed it took me almost a year to solve this one.

We decrease the game speed! If both the enemies and Bob together move slower than maybe half an inch per second, the player can extrapolate enemy positions with enough time to evade an impending collision. If I can now guarantee an opportunity for the player to avoid being detected and recover from a mistake without being thrown back, I've successfully encouraged the player to find a solution to the given problem by actually PLAYING the level. The process of understanding enemy movement patterns to identify a safe route is now intertwined with the act of roaming the map, both of which can no longer exist effectively  on their own. The question of whether or not Bob is going to be safe on a particular cell will be answered when you actually show up there and not before that. From a two pass process we've turned it into a continuous feedback loop where the study of enemy movement patterns and your own position allow evasive maneuvers that constantly change the variables to the function that describes what comes next. I feel the maps are more exciting now, the difficulty level is more effective and feels fair. Earlier the trial and error felt more like hitting your head against a wall, you weren't exercising your brain to come up with a solution because you already knew it. Now the levels are long enough for every attempt to produce this kind of tension, accumulating a cost for every second invested in playing which pays off if you're able to actually complete it. It's amazing how ten seconds could add so much.
I removed most of the levels that I wasn't happy with and replaced them with new ones which learn from all that we've discussed above. Even though it falls short on many fronts when it comes to the kind of stealth game it was trying to be, I'll just say it's a different sort of fun and I'm happy with it.

Okay, who wants to play?

Wednesday, May 22, 2013

VYDE : Game Screen

While the main menu went through quite a lot of makeovers and more than one complete redesign, the actual game screen, not so much. The problems with the game scene became apparent after we first had it play-tested after which I had to start considering the possibility of introducing some major design changes.

I couldn't really entertain those ideas for too long since some design errors were hard-wired into the way the game wanted to work, taking it apart after having spent almost a year on it didn't sound like a great idea. So before I knew it, I was holding my head sitting in front of another partially completed game with a list of awfully glaring issues that I regret were not handled earlier.

If you haven't been following these articles, VYDE is a stealth game with over 80 (yes 81) levels where each room consists of a 6x4 map of flat shaded tiles of solid color. It's got an abstract, arty, minimal look or whatever you might like to call it with no sprites or graphics of any kind. Your character aptly named Bob, like all the patrolling guards, is shown as a flat shaded box with a square nose. The original version of the game on which I created the first half of the levels looked bare, it was at that stage where you'd call it too simple to look polished or even complete.

My solution to problems of this kind, unfortunately never involved going to an artist for help. With most of my own games that I've worked on in the past, I've had two options out of which one involves programmer art, so that doesn't count. With an elementary knowledge of programmable graphics pipelines I looked at a few shaders to somehow throw a little life into the colorful but flat shaded world. If I can code my way through another problem, why not?

Programming and playing around with full-screen post processing effects to me is like the feeling you get the first time you discover image filters in Photoshop, but unfortunately nothing acceptable came out of that exercise. I had to get the characters to stand out somehow while also warning the player of Bob's current visibility in each cell. I put a small shadow under each character and masked it with the cell visibility on a per pixel basis. Part of the box that was inside its safe cell didn't drop a shadow while the rest did. Although a drop shadow of this kind does have a physical significance to it (of depth), I liked the Ambient-Occlusion-y look it gave while still keeping things minimal the way I wanted them. A vignette was later added to produce the same kind of shadow on the edges of the screen.

Each level has a record time and a briefcase as secondary objectives. The status of the player's progress is saved and presented each time a level is started. Initially, we tried to convey all of this symbolically using icons and numbers only, we found there was too much information to be shown and that our symbols looked too cryptic to make any sense. This end game screen now uses a few lines of text to convey all of that information before and after each attempt is made.

I discussed previously how the game had some horrible conveyance issues, players never understood what character they're supposed to control or who spotted them or how they failed . Still being hell bent on keeping with the minimal interface and the original aesthetic style of the presentation, these seemingly trivial problems were a lot more difficult to solve. So instead of littering the screen with an overlay of jarring outlines and arrows, I took on each of those problem separately. The color of the cell on which Bob spawns at the beginning of each level is now given more contrast than before making it easier to spot.

A cloud of dust animates over the starting cell each time a level is reset as an attempt at immediately drawing the players attention.With the new auto restart feature, the game encourages players to fail, reset and try again over and over till they're able to understand and analyse the level and find an effective way to defeat it. We initially weren't revealing enemy locations at all, guards hidden in cells that matched their color perfectly were never shown. The game now has no levels where enemies aren't revealed at all and on detection the scene halts for exactly one second and zooms into that particular enemy before it resets automatically for the player to have another go. I'm relying on this fast transition back into the game to trivialize the event of having a failed attempt, effectively removing all the discouragement that came with it.

There was this one other issue in the list where I complained about the linearity of the levels and their puzzle like structure. Well the great news is that I've cracked that one too, a detailed explanation would have to wait till the next post.

Sunday, May 5, 2013

VYDE : Main Menu

There was a point during the development of VYDE when we were stuck with forty untested levels and a horrible main menu populated with text labels for each level. It was all too convenient, the text labels fit perfectly with the name 'VYDE' occupying all of the 6x4=24 tiles on the screen. I needed a reason to fix it up so I decided to double the number of levels in the game.

Initially, I wasn't going to tell the players that they're actually descending a building until the last level, but it seemed like a great idea to have an illustration of the building on the main menu itself. An eighty story building didn't make much sense so we decided to group similar levels into floors where each level becomes a room on a particular floor. Some floors have five to six rooms whereas some have just one. We had with us a list of rooms for each floor, so we decided to paint the building with floor numbers and show the rooms expanded horizontally to the right.

Parallax Scrolling

A building on its own wouldn't look nice, to complete the scene, a set of mountains, a sun and some trees were added. All the sprites are given a depth value which is used to calculate their location on screen as a function of the camera position. So the mountains and the sun are given almost infinite depth, whereas the building and menu items are kept nearer to the camera. New positions are calculated every frame when the camera is moved to give a smooth transition as the user swipes between the main menu and level selection screens.


As you progress through the game, the time of day changes from very early morning (around 3 a.m) to daytime (8 a.m) as you make your way to the ground floor. The moon starts from being high up in the sky and disappears slowly into the top edge of the screen while the sun makes its way up from behind the mountains. All the images are being lit up with OpenGL Blend Mode magic, I darken the sprites at night and make them brighter in the day. The sun wasn't brighter than all the other elements on the screen, which I could have solved with a simple Bloom shader, but we figured the flat shaded sprites actually agree better with the aesthetic style of the game. Right now, I'm modulating the opacity of a plain white image overlay on the screen to simulate a cheap tone mapping effect. The overlay goes invisible as the sun is hidden behind the building, and then spikes and comes down back to zero using a logarithmic function over time when the sun is revealed immediately.

Level Tiles

All the levels in the game are stored as text files which detail the color for each of the 24 cells, along with enemy and player colors too. On loading a level, the level background image is compiled using a render texture. Now we thought it would be only right that players are able to see the levels on the selection screen so they can recognize it. Compiling and storing textures for all the levels wouldn't be feasible (memory) and compiling the textures for each room when a particular floor is selected would be quite a pain (too much work). The solution to the problem was simple, since the levels are made of six by four flat colored cells, each level texture could be represented by exactly 24 pixels in memory. Cocos2D allows sprites to share a target texture and reveal only a part of the memory using spriteFrames. So the game bakes all the levels onto one small texture when it starts up and the eighty sprites are made with sprite frames of the size of 6x4 pixels. Those sprites are then scaled up to the required size of a clickable tile item on the menu.

Framebuffer Objects - Parallax Scrolling - Faked Lighting - Fun.