Game Development Community

Terrain Generator-question

by Chris D. Walker · in General Discussion · 03/03/2008 (6:44 am) · 4 replies

Hey folks,
I've been checking up on the best way to make the terrain for our game, and I had come across a forum post stating that using the terrain generator will NOT work in multiplayer, because the files don't transfer across the network. That post, however, was from 2005, and what I need to know, if anyone does know offhand is, is that still the case?
Working in the Torque Game Engine 1.5

Thanks all,
Chris

About the author

Recent Threads


#1
03/03/2008 (10:15 am)
You could always implement one of the file transfer resources.
If you do that, have the game automatically save the terrain under a specific naming convention, like "terrain". That way, if later on another server created terrain with the same seed, the player will already have the same file.
#2
03/03/2008 (10:37 am)
So, it stands to reason that if both machines had the same file, you really wouldn't have to send it I suppose. I thought it sounded a bit weird that it had to be transferred. We were going to do something maybe where it updated the terrain, but that can be later, I really just want to make sure that it's not precluded for some crazy reason that players #2+ can use the same terrain.
#3
03/03/2008 (11:12 am)
You would implement the terrain transfer in the engine's code that checks to see if the client has the terrain file the server is telling it to use. If the filename isn't present, request the server's copy to be sent over. That's why a naming convention would help, 2 people may have generated the same map, but if you allow renaming they could have 2 different names.

If you add a feature to alter the terrain in any way after it has been generated, this system won't work. At that point your best bet would be to just not store the terrain client side beyond the current connection session, and transfer it every time. Store it in a cache terrain file that gets deleted on disconnect.
#4
03/03/2008 (12:23 pm)
Ok, good deal. That is definitely going to be our strategy. Thanks a lot for your help!