Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Terrain  (Read 2653 times)
0 Members and 1 Guest are viewing this topic.
Offline inigmas

Junior Newbie





« Posted 2003-02-09 22:32:37 »

I'm trying to write a sprite-based 2D game using Java 1.4 and I was wondering if you guys have any ideas on how to make 3D looking terrain (with hills, valleys, ect...) in a 2D world.  I'm really looking for a programatical solution though.  i.e - I dont want to have a giant bitmap with meta data to represent the terrain.

Thanks,
  Inigmas

Tam Mercurio Quam Marti
Offline snak

Senior Newbie




Eu não falo o português


« Reply #1 - Posted 2003-02-10 13:45:46 »

What do you mean by the bitmap comment?  That you don't want to have to draw your terrain by hand, or that you don't want to have to dedicate a lot of storage to the details of the terrain at runtime?

What perspective are you using?  Isometric?
Offline Stuart Still

Senior Newbie





« Reply #2 - Posted 2003-02-10 14:06:47 »

Do you mean like C&C Tiberian Sun, where they had faked 3D terrain by having shaded tiles that looked kind of sloped, and by moving the unit 'up' the slope in addition to they way they were moving already (if you catch my drift).  If so then I have no idea how to do it, maybe someone else will Smiley

Stu
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline inigmas

Junior Newbie





« Reply #3 - Posted 2003-02-10 18:00:18 »

The first one Snak... I don't want to have to draw out a map by hand, and load a giant picture with metadata associated with it for the height.  However, the storage of terrain details at runtime should be quite acceptable.  Also, the engine will be in the Isometric view point, mainly to help with the illusion of 3D buildings, people and other objects.  

Yes Stustill, I'm going for a similar effect as the C&C terrain, but closer to the ground than the bird's eye view of C&C.

Thanks,
  Inigmas

Tam Mercurio Quam Marti
mbw
Guest
« Reply #4 - Posted 2003-02-11 08:10:41 »

Remember Populous ? (written like that ?!)

The terrain-system was kind of 3d, but all in all it was an isometric game, with additional tiles for height-differences...

That could be a good starting point

mbw Grin
Offline Stuart Still

Senior Newbie





« Reply #5 - Posted 2003-02-11 11:15:49 »

Sorry I can't help, but good luck with it Smiley

Maybe you could post some screenshots when you are further into it Smiley

Stu
Offline snak

Senior Newbie




Eu não falo o português


« Reply #6 - Posted 2003-02-11 17:56:55 »

Are you familiar with fractal terrain?  It sounds like a good fit for your needs.  There are many different techniques that fall under the umbrella of fractal terrain, but they generally all use rather simple algorithms, repeated many times to produce a 2D array of elevations that look very realistic.

Another technique that will work if you will have a set of predefined maps is to use a decent paint program.  Most of the good ones can create 'plasma clouds'.  These can be saved to a file and again read as 2D arrays of elevations.  Nice thing here is you can edit the heightmap by hand.  If you have Gimp, check out Filters/Render/Clouds/Solid Noise.  

In either case, the tricky part is then to 'decorate' the terrain.  I've been able to generate good looking terrain, but when it comes to placing buildings, forests, roads, vegetation, etc, I don't have any advice to offer.
Offline inigmas

Junior Newbie





« Reply #7 - Posted 2003-02-11 23:19:42 »

Thanks for pointing me in the right direction.  Now that I know what I should be looking for I can get started on something.

Thanks,
  Inigmas

Tam Mercurio Quam Marti
Offline inigmas

Junior Newbie





« Reply #8 - Posted 2003-02-13 21:51:54 »

Hey... I started looking at fractal algorithms in regard to terrain, but they all seem to use 3D engines for rendering the results... If you know where I can find 2D (one that trys to look 3D - i.e C&C) example, that would be great.

Thanks,
  Inigmas

Tam Mercurio Quam Marti
Offline snak

Senior Newbie




Eu não falo o português


« Reply #9 - Posted 2003-02-18 18:28:06 »

The three common pseudo-3D techniques I know of are isometric tile-based engines, ray casting engines (ala wolfenstein/doom), and voxels.  the ray casting engines are realy designed for indoor settings, so you can probably ignore them.

Isometric tile-based engines are reasonably easy to write.  Someone mentioned populous, I think they used this model.  The older XCom games also used this to good effect.  Basically, you draw your tiles with an offset along the (screen) y-axis based on how 'high' the tile is.  The trick is to make the altitude transitions look nice, no staircase effect.  I think gamedev.net has a whole forum dedicated to isometric engines.

Another pseudo 3D technique you could look into is voxels.  The nice thing about voxels is they can be very smooth & good looking.  But they have lots of problems - they are memory and CPU hungry, and CPU usage scales very quickly as you increase your image resolution.  I spent months trying to get a decent voxel engine running in Java and it was pretty tough.  My final results were pretty good looking (IMNSHO), but it ran too slow to use in a game (~20 fps on a 1.2 Ghz machine).  That's not to say it's impossible, just probably not worth the effort.

Sorry I never played C&C so I can't comment on that.  From some screenshots it looks like the 3d appearance just comes from the way the artists drew the maps.  If elevation affects combat they probably store a second bitmap (heightmap) with the elevation at each point on the map.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline qonjure

Junior Newbie




When nature calls we all shall drown.


« Reply #10 - Posted 2003-02-18 20:53:11 »

I suppose snak means so called "voxel heightfields" and I found one game written in java that uses that. Can be found here http://eicart.free.fr/stalker/Stalker.htm. Other examples (non-java) are Outcast and Delta Force both excellent games IMO but thats OT  Wink
kul_th_las
Guest
« Reply #11 - Posted 2003-02-25 17:52:49 »

Played Diablo II? If you play it enough you'll notice that they use differing altitudes, but it's a trick of the art - they don't have to store altitude data at all. It looks like you're changing altitudes, but you're actually not.

The way you make a stairway (in Diablo II for example) look like you're moving up or down, is by slowing the player down when they traverse the stairway tile.

Make sense? Check out www.blizzard.com and look for screen shots that show differences in elevation. By simply slowing the character down when they pass over the staircase tile (the elevation transition tile) it gives the effect that the player is travelling up or downhill.

StarCraft uses the same technique.
Offline inigmas

Junior Newbie





« Reply #12 - Posted 2003-02-27 02:20:01 »

Is that all they do?  Wow.  I thought that there was actual height data in the game for some reason.  I'll have to look into making that technique work.

Thanks,
  Inigmas

Tam Mercurio Quam Marti
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (32 views)
2014-07-18 06:55:21

Zero Volt (28 views)
2014-07-17 23:47:54

danieldean (24 views)
2014-07-17 23:41:23

MustardPeter (25 views)
2014-07-16 23:30:00

Cero (40 views)
2014-07-16 00:42:17

Riven (42 views)
2014-07-14 18:02:53

OpenGLShaders (29 views)
2014-07-14 16:23:47

Riven (29 views)
2014-07-14 11:51:35

quew8 (26 views)
2014-07-13 13:57:52

SHC (63 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!