Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 31 August 2012 - 11:40 AM

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

My tile grid looks like this: (without the 1 pixel line between each tile; placeholder tile)

Posted Image

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

Here's one casual attempt I made:

Posted Image

Using this to multiply with the tiles, to create shadowing:
Posted Image


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!
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


Sponsor:

#2 The Great Radio   Members   -  Reputation: 131

Like
1Likes
Like

Posted 31 August 2012 - 03:07 PM

Without the tinting, how does it look when you brighten the hill-side facing the light source?

#3 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 31 August 2012 - 05:10 PM

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.

The view angle:

Posted Image

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

Posted Image

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.
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#4 NapoleonicMonkey   Members   -  Reputation: 147

Like
1Likes
Like

Posted 31 August 2012 - 05:43 PM

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.

http://www.wesnoth.org/images/sshots/wesnoth-1.9.0-4.jpg

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.

#5 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 31 August 2012 - 07:51 PM

The game is a classical-style RPG, like this:
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/Village%20Scene.png

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

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).
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#6 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 31 August 2012 - 10:27 PM

Here's another test:

Shadow mask only:
Posted Image

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:
Posted Image

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.
Posted Image

And here's the shadow mask I slapped together in fifteen minutes for testing:
Posted Image

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.
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#7 Ravyne   Crossbones+   -  Reputation: 7133

Like
1Likes
Like

Posted 01 September 2012 - 12:25 AM

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.

#8 Krom Stern   Members   -  Reputation: 117

Like
1Likes
Like

Posted 03 September 2012 - 01:01 PM

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)

Attached Thumbnails

  • PvvTT.jpg


#9 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 03 September 2012 - 01:18 PM

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, 03 September 2012 - 01:19 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#10 Ashaman73   Crossbones+   -  Reputation: 7235

Like
0Likes
Like

Posted 03 September 2012 - 11:28 PM

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.

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

Posted Image

#11 jefferytitan   Crossbones+   -  Reputation: 2032

Like
1Likes
Like

Posted 04 September 2012 - 12:20 AM

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. ;)

#12 SH code   Members   -  Reputation: 102

Like
0Likes
Like

Posted 17 September 2012 - 11:10 PM

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)

...is that a remake of knights&merchants, or something similar? oh please, do tell me that it's going to have skirmish...

#13 Tobl   Members   -  Reputation: 363

Like
1Likes
Like

Posted 19 September 2012 - 05:55 AM

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

hill.png hill2.png

Edited by Tobl, 19 September 2012 - 06:33 AM.

Think my post was helpful? Want to thank me? Nothing easier than that: I sure am are a sucker for reputation, so just give it a little keycode 38 if you like. ^^

#14 Servant of the Lord   Crossbones+   -  Reputation: 18735

Like
0Likes
Like

Posted 19 September 2012 - 11:27 AM

I was shadowing the sunlit side because I just couldn't get it to look right.
That does look better, I'll keep that in mind while working on it - thanks!
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS