Showing posts with label level design. Show all posts
Showing posts with label level design. Show all posts

Friday, September 12, 2014

Design/graphics cheat #2 - Mobile gaming

Mobile gaming is all the rage now, and companies are showing their latest phones, tablets, phones the size of slippers and chipsets for 3D graphics on-the-go.
Everybody are now showing off some awesome looking shaders, effects and high polygon (for mobile) models making sure you realize that it's rendering in real time. There's something that they don't show a lot though and that's real time - level wide shadowing. And there's a good reason for it as well; it's probably one of the more resource intensive stuff to pull off well enough, so people making games are resorting to all sorts of trickery like "baking" lighting, drawing the details in the textures instead, using shadow "blobs" for stuff that's moving... in general cut using realtime shadows in mobile gaming as much as possible.
(It can be done of course, but most of the time you'd be better off faking it and pushing your savings on making the game run at more fps or implementing some more resources into your enemies.)

So where am i going with it? 
Be smart in hiding things and using simple geometry to make shadows. Like the image on the right; those two things are just some of the obstacles in a game i'm trying to make that spew snow balls. 
I really wanted to have some slight shadowing/ darkening effect in those barrels. Light mapping wouldn't work of course because ... that's not how it works... and real time shadowing would be no-no. 


On a game you are trying to include as many devices as possible after-all to potentially have a larger install base. So it's back to old-school tricks, back to basics if you like. The barrels simply have 3 simple planes, with just 2 polygons each, and a simple black texture. Then the texture's alpha channel is set as semitransparent. Each plane will progressively make it look as if it's darker and darker the deeper you look. Of course this will only work for stuff that aren't out in the open.

For things that are out in the open, what someone could do is mark areas with simple trigger boxes that are placed in shadowy areas. Then have a simple script that would smoothly make the texture of the object that enters the box's volume darker, and lighter as the object exits. A poor man's light probe if you like. These things do require tweaking though, but the plus is that your game's speed won't suffer and you'll get some nice looking stuff.

Monday, June 10, 2013

Visual cues

Since we don't have radar or distance sensors embedded in our brains yet, we need to rely on our eyes and ears for cues on where something is, and this is even more important on video games since unless you use a 3D monitor, the view you are seeing is 2D. (Yes, even with 3D games. The monitor is still a flat 2D plane where everything is squashed into a single,flat view, so there goes your stereo vision)

So what can be done visually wise? Shadows someone might say. Well yeah, that is number one in the list but it's not just that. There are a couple things more that can be done in the levels themselves to show the spatial relationship of things. (Spatial relationship, bet that made me look smarter than what i am). Take a look at the image below for an example.

The image shows a level from a game that you have to stop the blue balls from falling in the pit, a pretty basic premise with no story behind it. The top part has the shadows disabled. It looks as if the balls are just pasted on top with little to tell you the distance from the ground at a glance and you don't really have time to observe because that thing is coming at you and you need to throw it back. The bottom half has the shadows enabled and the player can see exactly where on the playing field the ball is and how high.

But that's not the only cue. The pit is textured in a checkerboard like pattern. That makes it even easier to tell where the ball is going to be the in the future (since the balls fall towards the centre, you can use the pattern as a guide) and give you time to turn the paddle at that angle to throw the ball back. There is also a trail effect. That not only shows the general direction of the ball but also if the ball is going up or falling down, its angle and its speed.


(The shadow may look as if it's a bit ahead of the ball but actually it's right under it. The camera used is wide so it makes it look like that, a tiny bit - sort of - fisheyed).

P.S. Since this is for a mobile game, the shadows are not real time.The shading on the level and glove/paddle are baked (drawn) into the texture and the blob under the balls is from a script solution from Unity's Asset store.