Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2000:
[Freeciv-Dev] Re: [Re: Performance (was: [Re: [OpenGL client (was Re: Re
Home

[Freeciv-Dev] Re: [Re: Performance (was: [Re: [OpenGL client (was Re: Re

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: * <spurius@xxxxxxxxxxxx>
Cc: Franck Guillaud <f.guillaud@xxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Re: Performance (was: [Re: [OpenGL client (was Re: Re: Project)] (fwd)])]
From: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>
Date: Thu, 3 Feb 2000 21:48:42 +0000 (GMT)

[Rob: don't quote entire messages in reply, it's a waste of bandwidth and
hard to read ;-) Quote the bits you're replying to]

On 3 Feb 2000, * wrote:
> Silly me did the math wrong  I was interpreting megs for k  ;)  Its not near
> as bad as previously thought, but I will still want to do disk caching.  Also,
> any ideas on optimizing a 3d landscape?  Obviously, removing polygons that are
> too far away, off the screen, etc for openGL will help.  Also, is there a way
> to define a 3d model, and then just call the model, instead of making
> GL_TRIANGLES each time it draws?  I'm gonna mess around, but suggestions are
> always very helpful/time saving.

I don't know any OpenGL programming, so I'll keep quiet about that.  In
terms of simplifying models, the obvious idea is to only use full detail
(20 triangles/square) for models which are very close to the viewer, and
much less for those further away.

> 
> As to a square needing several triangles, its all about realism.  You ever
> seen a 3d landscape where they used a single plane for the ground (2
> triangles)?  even on flatland, it generally looks somewhat pathetic.  Slight
> normal changes exist in even the most flat lands, and it helps the effect
> immensely (and simplifies the programming).  Now that I realize that the ram
> req's aren't that bad, it isn't a problem.

Yes, of course.  But we're talking, say, 2 or 4 triangle /per square/ of
terrain.  Since I'm imagining each terrain square as subjectively not much
larger than half an inch, I think that's plenty of detail in most cases.

Also, if you sculpt a brilliant mountain height map for a mountain square,
I'm finding it hard to picture how it'll look with a city or a unit on it?

> 
> I'll have screenshots for you soon, I got the terrain working, and it looks
> beautiful (although I haven't done rainfall calcs yet so it can't determine
> what kind of terrain is what, so its all green currently... but it still looks
> beautiful.  I'll probably send pics once I take that into account, and
> generate coastal plains because that should be fairly simple.

I'm looking forward to pics.

> Perhaps most of my performance issues are due to the fact that I have a 2 year
> old laptop, and it undoubtably has no 3d acceleration.  Regardless, even
> without 3d acceleration its fast enough to generate single frames for people
> without too much wait.  I just think it may be a problem when, say, someone is
> trying to move a unit quickly and it has to do a frame for each movement
> (remember, I can't just redraw a part of the screen, at least, don't know how
> to).

It's excellent, because you're coding for the lowest common denominator.
If it works on your laptop, it'll work on anything ;-)

> 
> I also had a... rather nifty idea for saving the landscapes.  You can save an
> entire landscape in just 4 bytes!  (plus saving the dimensions, ruggedness,
> etc).  Just save the random seed number.  Anyone see a problem with this?  One
> that couldn't be gotten around from, say, putting the source code for a random
> number generator in the code?

This is a well known technique.  But, to be honest, if you're talking
around 100K per map, I wouldn't bother.

> 
> It looks like we will be having to make some minor server mods, so there will
> be a gl server also, unless you can think of a better way (fractal terrain
> generation doesn't like being told "there's a mountain here, and a plain
> here...", it likes to make it itself, and thus we'd need to use a true 3d
> model, unless we want to make 3d tiles, which doesn't look near as nice)

The fractal generation algorithms I've seen work perfectly well when you
give them initial data --- they refine it nicely.

It would be a 'cleverer' trick if you could make the GL client display the
map from a normal server, IMO, although I can see why some server
extensions might make your life easier.

Jules

/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@xxxxxxxxxxxxxxx         |  6 Evelyn Rd        |
|  Jules aka     | jules@xxxxxxxxxx              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@xxxxxxxxxxxxxxxx        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/


[Prev in Thread] Current Thread [Next in Thread]