Handling generated terrain?

ppClarity

28-09-2006 15:42:40

I'm doing some research aimed at producing a multiplayer architecture.

I have a couple of requirements. The net protocol must not exceed a certain bandwidth and the client installation on disk must not contain the terrain structure. Effectively this means that the server will send the client some parameters and the the client will generate the terrain in memory. Something like the Ember guys are doing: sending the coords for each corner of a tile and using a Perlin noise function to generate the rest of the mesh.

Can PLSM2 handle this? I imagine having to supply a method that would accept a tile or page reference and a mesh or vertex buffer to fill. Possible?

Thanks.

tuan kuranes

28-09-2006 16:20:02

Ember does use PLSM2, so that's possible.

ppClarity

28-09-2006 19:11:30

True... AFAICT, they modified PLSM2 to do that though and the license is unclear which I've interpreted to mean it uses GPL under the Ember blanket license as opposed to LGPL. The latter is fine for my purposes, the former would require a reimplementation.

Guess I'll ask them to clarify the license on their modification.

EDIT: License block in the header states GPL so looks like the wheel needs to be reinvented >.<

tuan kuranes

28-09-2006 20:16:00

they modified PLSM2 to do that
not that much, if you look at it. You still can do what they do with vanilla PLSM2.

ppClarity

29-09-2006 03:25:25

not that much, if you look at it. You still can do what they do with vanilla PLSM2.
D'oh, yep. Basically they registerred their own Heightfield and Terrain handlers.

OvermindDL1

29-09-2006 16:08:56

What would be nice is if there was a callback function that you could register that took a 2d-point and returned a point (Ogre::Real in both instances, I use double personally) and could be threaded out, that would be perfect. My function is a pure function, ergo, no side effects, would be perfect threaded.

tuan kuranes

02-10-2006 13:17:00

patch welcome, and great idea.

I don't see how it could be threaded out exaclty, and even what could be the benefits of it ?

Best would be user app load/create/get its page data in its own way (a thread if you like) and then call "pageload" that would itself call the delegate.

OvermindDL1

02-10-2006 18:55:29

I like using pure functions to pre-load things in the background, after all, generating a landscape using a noise function is not anywhere near fast, ergo, loading pages in the background from such functions before the land is needed would be nice.

It would be nice to have something like libnoise in PLSM3 though, you would be able to generate terrain at any resolution and detail from a set of modules the programmer would pass in.