#88378 - Lazy1 - Mon Jun 19, 2006 3:50 am
I have 2 16 color backgrounds in mode 0, the first one is clouds and the second one is mountains.
I guess some darker colours were set to black during the conversion of the mountain image which is causing holes which show the sky behind the mountain.
Demo of this in action:
http://lazyone.drunkencoders.com/2d.nds
Another issue is where to get/how to make ground tiles.
Think terrain viewed from the side, but with hills instead of being completely flat.
I cheated by using a gimp filter for the clouds and terragen for the mountain background, but I have no idea how I'd make a sidescroller terrain.
Any thoughts are appreciated.
#88381 - tepples - Mon Jun 19, 2006 4:07 am
Lazy1 wrote: |
I have no idea how I'd make a sidescroller terrain. |
Go play some NES platformers for a while. Then go play one of the Sonic games for Mega Drive/Genesis or the Donkey Kong Country games for Super NES.
Give us a screenshot of what you want the terrain to look like, and we might be able to show you how to draw it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#88382 - Lazy1 - Mon Jun 19, 2006 4:09 am
Thats exactly what I'm looking for, sonic the hedgehog style ground.
#88384 - tepples - Mon Jun 19, 2006 4:18 am
The underlying terrain in Sonic 2 consists of 16x16 pixel squares, each with its own collision data.
This illustration will get your mind working on various algorithms. From left to right: - Curved surface from a Sonic game.
- The 16x16 squares that make up this surface.
- An approximation of this surface with line segments.
- The line segments alone.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#88385 - Lazy1 - Mon Jun 19, 2006 4:26 am
Ok, I'll have to think about how I'm going to draw that then.
But are there any solutions to the transparency problems I'm having?
#88386 - tepples - Mon Jun 19, 2006 4:27 am
Render a pink sky behind the mountain, and then move pink to color 0.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#88402 - PeterM - Mon Jun 19, 2006 9:26 am
tepples wrote: |
The underlying terrain in Sonic 2 consists of 16x16 pixel squares, each with its own collision data.
This illustration will get your mind working on various algorithms. From left to right: - Curved surface from a Sonic game.
- The 16x16 squares that make up this surface.
- An approximation of this surface with line segments.
- The line segments alone.
|
Thanks for the picture - I was pondering how to do curves in a future game and it helped me out.
_________________
http://aaiiee.wordpress.com/
#88427 - Lazy1 - Mon Jun 19, 2006 1:20 pm
tepples wrote: |
Render a pink sky behind the mountain, and then move pink to color 0. |
Isn't that really hacky?
I already tried something like that but didn't like the way it turned out.
Since I want to have multiple maps, map specific hacks aren't going to work here.
#88428 - PeterM - Mon Jun 19, 2006 1:26 pm
Maybe I've missed the point, but it's not a map-specific hack. It's a standard way of doing color-key transparency.
_________________
http://aaiiee.wordpress.com/
#88447 - Lazy1 - Mon Jun 19, 2006 4:19 pm
I don't understand what he means by moving pink to colour 0.
I can't just add another colour to the palette, It looks like crap when only 15 colours can be used for the sky. The 1 additional colour makes a huge difference.
#88453 - wintermute - Mon Jun 19, 2006 5:18 pm
You can still use 16 colors for the sky since it will be the lowest priority background. Index 0 of each palette is transparent, where all pixels in one screen position are index 0 then it will show as palette 0, index 0.
The standard way of dealing with this is to use rgb(255,0,255) as your transparent color when creating art assets.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#88469 - tepples - Mon Jun 19, 2006 6:04 pm
Or you could separate the sky into multiple horizontal bands and then use either separate palettes or mid-frame palette rewriting to change it. A lot of Super NES games just used color 0 for most of the sky and then pointed an hblank DMA channel at it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#88485 - Lazy1 - Mon Jun 19, 2006 6:44 pm
Ok I understand now, what I need to know now is how to have the gimp make 255 0 255 the first entry in the palette, since it seems to put the darkest colour there instead.