Archived

This topic is now archived and is closed to further replies.

gimp

Landscape Terrain Engines

Recommended Posts

I''ve been looking around at the current crop of landscape engines and non of them are really focused on what I want to do (or they are slow or look ugly). So of course like a doe in a cars headlights I decided that I should just code by own. (Besides it''d be cool ...) Frankly, nothing in the game I''m producing has scared me as much as considering doing my own graphics engine. So I''ve a few questions for anyone who may know better than me. - Is it all really that hard? I mean I''m pretty impressed with some of my other code and am feeling increasing more confident by the day. I, however am sadly lacking in mathematical skills. Basically high school was 10 years ago, and though I''m smart I remember almost nothing of it. -My plans are for an outdoors terrain engine that treats both the hilly terrain and buildings the same way when it comes to visibility culling. So a flat wall should block the hill behind it. My vague idea is to use a combination of a polygon and raytracing engine. The raytracing would determine what is visible and what is not. I was planning on using the DDG toolkit as my guide with portions of flightgear as inspiration. I''ve read the Filpcode tutorial and have read some other basic data on voxel engines, which I think would be the best choice for vis culling. For polygon drawing I was going to use opengl. Does anyone have and information or link they think I should know about before embarking? My goal is to have high terrain + structure integration with an unlimited viewable distance (or at least not a typical fog out, cop out). What things should I know well before hitting the keyboard? Should I develop a bunch of small test apps , if so what should they do? I''m still trying to understand what the important consideration are. I want to do this the right way... Many thanks. Chris ''gimp'' Brodie

Share this post


Link to post
Share on other sites
The best place for all your terrain programming needs would be at the Logbow Digital Arts message boards.Goto:

http://www.longbowdigitalarts.com/ubb-cgi/Ultimate.cgi

and post your questions there.You''ll get tons of help.

Share this post


Link to post
Share on other sites
You''ll need math, definetly, but if u''re half intelligent, u''ll spend a couple of hours, may be days, and u''ll get it to work.

I don''t think that raytracing would be a good idea. Keep in mind, that''s my opinion, I may be wrong (God knows I have been wrong before ), but make sure u do more research. How do u want ur game to work? Do u want walls on the terrain, or u want a terrain, a building on it, and a bunch of rooms in the building?

If it''s terrain and buildings, u need a terrain engine (may I suggest ROAM?) and a portal engine for buildings.

If u need terrain and random walls, it will require some customized thinking I would think about using bsp trees, and a terrain engine, but I''m not sure if they''ll work...

I guess this wasn''t very informative, but I just wanted to warn you about the raytracing, I really doubt that they will answer ur questions, because if u want 6 degrees of freedom, ray tracing will be slow, and it will be really hard to implement with ROAM.

Share this post


Link to post
Share on other sites
You gotta learn recursion and know it cold.

There are three kinds of programmers. Those who don''t know recusion, those who think they know recursion, but don''t, and those who know recursion.

Make sure you''re not one or two. I suspect quite a few fall into category two.

I hated math in high school. I blew it off. Bite the bullet and learn it.

Share this post


Link to post
Share on other sites
Errr...

Well... the idea was that as my experince grew the scope of the engine would grow. Initially I just want a nice looking terrain that''ll allow me to drive a tank off in to the distance until it''s just a little blob but still see the blob. Then I''d add trees\domesky. Buildings were going to be added. Initially I was just going to get ddg and add model support and use that but without building a full engine myself I don''t think I''d be able to work out how modify it anyway.

So, yes, eventially I''ll need a portal engine. My background is Q2 mapping so I have quite a good head for how the portal engine should work\be used. I''m not entirely sure of how the two would be integrated however.

I''m not above just ripping of PD code and using that but I''d really have to understand what someones code does before I''d use it. I''m currently playing with SimpleROAM which I found at Longbow. It looks like a fairly simple example to start with...

At some point I''d get to a point where I''ll be wanting to place non heighfield things in my levels like portal based area''s. In these area''s I''ll have to use some kind of interior engine and the ability to simple produce maps(in photoshop) disappears. Rather than waste my time creating my own editor are there any free, open, editors that use some kind of standard for me to confirm to? Or should I just do as everyone else does and just use .map format and use a quake editor(despite the fact that it cant load the actual terrain heightmap)

Thanks

gimp

Share this post


Link to post
Share on other sites
I always make my editor first.

The 'engine' for the editor is sort of a try out for the game engine. (At least for the graphical part).

You see, this is my first 3d project I'm working on and I use the editor to try out all the techniques I'm going to use in the game.

Now after a few days of programming I realize I should have done that different or I see that there is a better way of doing something. Only I've come so far in development that it would take ages to fix it.

So I leave the unperfect code alone and write down what should be done better.

This way I'll have an engine that can do what I want it to do.
It just hasn't got the best code.

Then when the editor is finished I'll re-write the whole thing (read: "copy code from the other engine") only it will be better since I'll get all the mistakes out.


I don't know if this is the best way for doing things
(I'm quite sure it isn't).
But I hate writing everything to paper first.

The Rock
-BAD software-


BTW, if you want to see my editor. I've got some screenshots in the current projects section.


Edited by - glROCKs(); on July 20, 2000 3:49:00 PM

Share this post


Link to post
Share on other sites
Thats actually quite good Rock, how long did it take to learn to write your engine?

Right now I''m flipping between modifying DDG and writing my own engine. The main reason right now I guess is that i''d really want the satisfaction of doing it myself..., of course I don''t want to spend the next year writing something that''ll be totally sub par, so, how long did it take you?

gimp

Share this post


Link to post
Share on other sites
glRocks, my god!!! How did you right something like that??!!! I understand how to write an opengl/graphics game...but how in the hell would I write a 3d modeling app!!! It just boggles my mind thinking of how something like that would even be written...oh well I got a long way to go...maybe 2 years from now once I get to college I might start learning more about that!


-blide
blide@mail.com

Share this post


Link to post
Share on other sites
check out my game demo at this URL -
http://server35.hypermart.net/raptorentertainment/RoughTerrain.zip
It is a strategy game based engine which shows some landscapes created out of a height map.
Let me know how good it is as well!


Share this post


Link to post
Share on other sites
Hey, thank you guys. I''m glad you like it.

Anyways,

I just ended my first year in college.
The only thing I knew before going to college was Visual Basic.

So, when school started I learned some directdraw/sound/input
and made a wrapper for it.

After a half a year I was still stuck to doing just 2d; I mean the only 3d app I made was the spinning cube, and most of the code wasn''t even my own.

But Dave (he''s the modeler) was already making models in studio max.
So I decided to finally start 3d.
I got The Red & Blue book and started reading.

After a few months I was working on 3ditor.
I learned alot on this project because I was faced with
stuff I never done before. i.e. how do you select a point in 3d space or how can I freely add and romave poly''s (I never heard of linked list before this project)?

Now don''t think it has all been easy for me, I mean there were days that I was banging my head against the wall (poor wall).

About a month before finals I started on a new project called canyon reaper.
You basically had to fly through a canyon (duh!).
The only problem was that it was always straight ahead and I found it too constricting; so I canceled it and started on a new engine a 2 weeks after finals.

So, I''m now working on the editor for the game.
I ''ve now come to a point were I''ll have to put my nose in some collision detection and after that I should be able to start on the game.

Well gimp I guess the answer to your question is about a year.

Now for blide.

I to expected alot from college. I don''t know what they give in your country.
But the only thing we learned was c++ for dos and COBOL.
The worst thing is that COBOL will be our main course next your
and that sucks big time.

The only advise I can give you is: don''t wait for school/anyone to teach you haw to do stuff. Because the only thing you learn is the basics. In the end it''s all up to yourself.

And I must say I''m probably the only guy who mist classes or fell a sleep during classes because he was programming whole night.
But I got through my first year and I know a lot more than my fellow students.


Well hope I could help.

CU

The Rock
-BAD software-

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster

Recursion bad. Big stack pushes every call. Use iteration.


You bonehead. Recursion is one of the fundamental aspects of complex data structures and algorithms. If you don''t understand it, you''re lost.

Share this post


Link to post
Share on other sites
Don''t expect to learn a lot in the way of programming from college. Most good coders that I know taught themselves. Actually, all good coders I know taught themselves. You get to learn boring things like COBOL and FORTRAN in college.

glROCKs: Have fun with the collision detection... I finally got mine working. I guess I should have made the editor myself, I was loading in files from 3DS MAX. That screwed me up beyond belief. When cross products no longer follow the right hand rule you know you have problems. Nice modeller though, I''m about to start work on one. You use doc / view for that right?

-BacksideSnap-

Share this post


Link to post
Share on other sites
bishop_pass he meant not to throw out the idea of recursion, but simply implement it through iteration.

The *idea* of recursion can be implmented through iteration. Now sometimes it''s not as easy as just using straight recursion, however depending on what your doing you *can* take a significant performance hit.

For more information check out the following great book: (Probably the best book written on Algorithm Design and Analysis)

Introduction to Algorithms by Cormen, Leiserson and Rivest. Published by McGraw Hill.

Share this post


Link to post
Share on other sites

-BacksideSnap- : I don''t really now what you mean by doc/view.
The editor uses OpenGL for rendering and
DirectX for input.
When I started this editor, the only windows
programming I knew was setting up the window.
I''m not using MFC, just some windows api''s

The Rock
-BAD software-

Share this post


Link to post
Share on other sites
quote:
Original post by glROCKs();


-BacksideSnap- : I don''t really now what you mean by doc/view.
The editor uses OpenGL for rendering and
DirectX for input.
When I started this editor, the only windows
programming I knew was setting up the window.
I''m not using MFC, just some windows api''s

The Rock
-BAD software-




Ahh... That answers my question. Doc/View is an MFC architecture.

-BacksideSnap-

Share this post


Link to post
Share on other sites