0
\$\begingroup\$

I'm messing around with unity3d free, trying to figure out if i can get away with using its readymade graphic engine. I have some problems figuring out how maps should be implemented/handled

(the graphics are 3d, like diablo, but essentialy game is only X/Y movement)

Case 1. Model a "3d" map within Unity scenes, then model a 2d version of it for serverside calculations (line of sight, positioning, movement and spawning of objects). How to keep them in sync the easiest? Are there any tools for this purpose?

Case 2. Feed a tile based map to Unity client, making it render it from small pieces (tiles). Essentialy use the 2d server version to render the pretty 3d client version. Is that possible at all within unity?

I would love to be able to generate terrain randomly, so solving case two would be most beneficial...

Probably both my cases are a good deal off the "correct" approach, so please give me some hints on the industry standards ;-)

\$\endgroup\$
1
\$\begingroup\$

Case 1: unity has built in networking code to handle this in full 3d if need be.

Case 2: there are likely a ton of solutions to this already on the unity store for cheap or free.

Personally if i was building diablo I would do something like this:

When kicking off a new game my custom server would pick a random "seed" value. Any clients that join the game would be sent this seed value.

Using the seed value I would use a 2d perlin / simplex noise based generator to build the tiles / chunks of the map that are in view and generate more as needed.

All clients would then be able to gen the same map and not need to have map data sent from server.

I would then add unities built in networking scripting to any moveable object I choose to add to my game so all clients in the same area see the same behaviour from them.

Seems like a pretty standard unity game to me.

\$\endgroup\$
  • \$\begingroup\$ seed idea is nice, in unity scripting docs i found info on instantiating objects. Looks like im all set, thank you \$\endgroup\$ – strzelecki.maciek Feb 26 '15 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.