Sign in to follow this  
Servant of the Lord

Hills on 2D tile grid (axis-aligned / non-isometric)

Recommended Posts

This is a tough challenge: How can I have good looking hills in a 2D tile-based game?

My tile grid looks like this: ([size=2]without the 1 pixel line between each tile; placeholder tile[/size])

[img]http://img715.imageshack.us/img715/3305/basicgrid.png[/img]

The lighting comes from the upper-left corner of the screen.

Here's one casual attempt I made:

[img]http://img204.imageshack.us/img204/386/hilla.png[/img]

Using this to multiply with the tiles, to create shadowing:
[img]http://img109.imageshack.us/img109/1851/slopeshading.png[/img]


I mean, it's not bad (well, yes the image is - but the basic idea isn't bad), but I'm thinking I'm going to need better than that. Maybe some yellow tinting on the sides facing the sun, and blueish tinting on the sides facing away.

I'm looking at some photos of hills on Google, but I want real artists' perspectives on it, myself being more of a programmer than designer or artist, and so less in tune with visual trickery.
I'd like to be able to multiply or blend other "mask" images onto regular tiles to create the correct illusion of depth and slope and lighting.

I'm not yet ready to fully start producing the art for this part of my project, but I do need to knock up a few test examples to see whether I can actually create something passable - as I need to know whether hills are actually possible or not in my game, as it'll effect the layout of my game world.

Any wisdom and tips you can give me is much apreciated!

Share this post


Link to post
Share on other sites
Part of the problem I'm having (which I forgot to mention in the previous post) is making the hill look natural (shadow-wise), and not square-ish. Another problem is getting the correct perspective and not being directly overhead or directly in front.

[b]The view angle:[/b]

[img]http://img708.imageshack.us/img708/7209/artperspective.png[/img]

Here's another attempt: (These are put together in PaintShopPro, by the way)

[img]http://img94.imageshack.us/img94/3921/hilltest.png[/img]

It looks too overhead, like you are looking down at a circle.

I want to make masks/layers I can combine to make the hills (2D Flat tiles + 2D Shadow mask + 2D Coloration mask = Nice 2D hill).
I can handle the programming side of it for applying the 2D masks for shadowing and coloration in my engine, but I can't actually visually distort or move the pixels themselves (only lighten/darken or colorize).

I'm looking for advice and examples of how a 2D artist might draw the hill, in terms of shadowing and lighting, if they were doing it manually in photoshop.
Most 2D games just avoid slopes by having cliffs. Cliffs are easy - they are just like indoor walls. Slopes / slanted ground is rather harder, in my opinion.

Share this post


Link to post
Share on other sites
Do you need a few tiles to be 'uphill' (for game bonuses), or do you just need a hilly region?

If you just need hilly area, you can do more of a rolling hills effect - showing a number of round-topped, individual hills on the tile. eg: I sometimes use "Battle for Wesnoth" as a good guide to tile graphics.

[url="http://www.wesnoth.org/images/sshots/wesnoth-1.9.0-4.jpg"]http://www.wesnoth.org/images/sshots/wesnoth-1.9.0-4.jpg[/url]

At the top of this image there's a few steep mountains, but around them are some lower hills. Perhaps if you copied this effect (and made them green) it would be easier.

Share this post


Link to post
Share on other sites
The game is a classical-style RPG, like this:
[url="http://jamingrey.com/wp-content/blogs.dir/OfStrangerFlames/Uploads/Development%20pictures/2011/furniture.png"]http://jamingrey.com/wp-content/blogs.dir/OfStrangerFlames/Uploads/Development%20pictures/2011/furniture.png[/url]
[url="http://jamingrey.com/wp-content/blogs.dir/OfStrangerFlames/Uploads/Development%20pictures/2011/Village%20Scene.png"]http://jamingrey.com/wp-content/blogs.dir/OfStrangerFlames/Uploads/Development%20pictures/2011/Village%20Scene.png[/url]

Except with better, more-detailed, graphics ([size=2]Those are early test shots from over a year ago - I don't have any more recent screenshots though[/size]).

The graphical style isn't "one mountain = one tile". I'm thinking of an entire area, maybe 400 tiles by 400 tiles (or more) of hilly terrain.
Cliffs I can handle, cities and towns even more so. Forests are doable, farms I can manage. But hills... I definitely have a problem with. I can't think of any game like this that has real hills (and not just ledges).

Share this post


Link to post
Share on other sites
Here's another test:

Shadow mask only:
[img]http://img687.imageshack.us/img687/8782/anothertestwithout.png[/img]

Shadow mask + some coloration (light yellow on west slope, light purple on south) + shifted the tiles on the hill a few pixels off-center from the tiles not on the hill:
[img]http://img708.imageshack.us/img708/9052/anothertest.png[/img]

And here's the same thing (shadow + coloration + shifted tiles) with the top of the hill being slightly yellowed and lightened and not just the side.
[img]http://img39.imageshack.us/img39/4751/anothertestwithlighterh.png[/img]

And here's the shadow mask I slapped together in fifteen minutes for testing:
[img]http://img339.imageshack.us/img339/9199/anothertestmask.png[/img]

Couple observations: I think the subtle coloration (warmer yellow coloration + cooler purple coloration) adds quite a bit of importance. I think the offsetting the pixels helps a little, especially with such obviously tiling placeholder tiles; it helped more than I expected. Making the south-facing slope wider than the west-facing slope seems to have helped as well. Brightening and yellowing the top of the hill also helped. All of these helped in subtle ways, and each added a little bit more to trick my eyes into seeing a hill (instead of seeing, as someone else mentioned to me about the previous post's picture, "A coffee cup ring staining a carpet").

What do you think the ratio of the thickness of the sides should be? I'm thinking maybe South = 1, East/West = 2/3rds, North = 1/3rd.
What colors should I best use for ambient outdoor shadows and highlights for the hill? Should I use darker yellow or lighter? Light blue, dark blue, light purple, or deep purple for shadowing?
What should I use for the top of the hill? The same yellow as the west slope, or brighter, or less of it?

What are some other artistic tricks I can use to further help the illusion of perspective and depth? I can't have any vanishing points - the tiles must remain a square axis-aligned grid.

Share this post


Link to post
Share on other sites
Ravyne    14300
I think that last attempt doesn't look so bad. As for the perspective issue you highlighted with the circle, you want the front-facing slope to be wider than the back-facing slope. That' how some of the Zelda games do it, and how I've done it in the past as well.

Share this post


Link to post
Share on other sites
Krom Stern    155
Not sure if this is ontopic, so please ignore if it is. Did you thought about non-rectangular tiles? They are still in 2D, but Y axis is affected by vertices "height". Ligh'n'shadow does the rest of the magic. Thats how we do it in our game (see attachment)

Share this post


Link to post
Share on other sites
Interesting idea, but I'd prefer to keep fully square axis-aligned 2D tiles. My game doesn't have dynamic lighting or shadows, just shadowmaps and lightmaps applied to tiles.

One possibility is perhaps creating 3D models of hills with proper lighting, and then rendering them to an image, and breaking that up into tiles and tilesets. It's something I might look into. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
Ashaman73    13715
[quote name='Servant of the Lord' timestamp='1346699931' post='4976154']
One possibility is perhaps creating 3D models of hills with proper lighting, and then rendering them to an image, and breaking that up into tiles and tilesets. It's something I might look into.
[/quote]
I would sugguest it this way. I've done it to paint my splash/title screen (see below), if you need some basic blender file and help send me an email. You need 15 mins to setup a basic scene with a simple hill, one light source, ortho camera, AO

[img]http://www.gnoblins.net/wp-content/gallery/internal/splash_wip_1_2.png[/img]

Share this post


Link to post
Share on other sites
jefferytitan    2523
It's a tough problem. From a programmer perspective I would note that the repeating tile effect enhances the feeling of flatness. That may be one reason the offset helped. Note that on an angle in 3D, that same texture would look squished, so maybe scale the tiles in the direction of the gradient. Also note that in 3D the closer tiles would appear larger. How one would achieve effects like that in pure 2D without mismatching edges... I have no idea. ;)

Share this post


Link to post
Share on other sites
SH code    102
[quote name='Krom Stern' timestamp='1346698888' post='4976148']
Not sure if this is ontopic, so please ignore if it is. Did you thought about non-rectangular tiles? They are still in 2D, but Y axis is affected by vertices "height". Ligh'n'shadow does the rest of the magic. Thats how we do it in our game (see attachment)
[/quote]
...is that a remake of knights&merchants, or something similar? oh please, do tell me that it's going to have skirmish...

Share this post


Link to post
Share on other sites
Tobl    364
If the light comes from the upper-left corner, why do you darken those edges as well? they should be lighter. also, if you're perspective is a little from the front, the back edge is to be shorter than the front.

Also, I know this isn't the first thing on your mind right now, but once you've got the perspective correct, you might also want to tint the shadows a little. Because of different lightsources and their whitebalances, shadows are never just black or grey. In an earth-like atmosphere the shadows would have a little blue in them (the direct, yellow sunlight gets blocked out, but the indirect blue light, reflected in the atmosphere still reaches the shadowed area). In a very similar manner, the highlighted area would have a light yellow-orange tint.

The result would look look smth like the attached

bw,
Tobl

[attachment=11352:hill.png] [attachment=11354:hill2.png] Edited by Tobl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this