Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Any introductions to Photon Engine with procedural terrain?

$
0
0
Hey

I'm new to Photon Engine, but not to coding or procedural generation.

Could you point me to posts or tutorials that show or explain the following topics?

For simplification, let's assume an "infinite" top-down 2D procedural game with an "infinite" 2D plane (x/y) that consists of "tiles". Each tile is basically a rectangle, so to speak, nothing fancy. It is clear that the world terrain tiles/chunks base on a "seed", that I can sync share this "seed" between clients.

a) This works for a procedural readonly/static world. But how would you update single tiles that the player changes?

b) The Viking Demo Project. When you open a standalone client and a Unity Editor client, you can manipulate the terrain object itself inside the editor. When you alter the position of the terrain object, the standalone client syncs wrong positions. I suppose, it is by design and that I have to tell -- in such a case -- the terrain object to be synced too, right? But we do not want to do it for all or numerous "terrain tiles", right? Only for those that were moved?

c) In our top-down examples, tiles are constantly destroyed (actually, the game objects are not, they are put back in a tile cache) and "recreated" when the player changes his position (much like a viewport movement that adds tiles on the left, when you move left). When the player moves to the left by 2, 2 tiles are removed on the right and 2 tiles are added on the left.

What do you do when Player A and Player B are in completely different areas, with distances of 1000-10000 between them? Do you suggest to store the changes on the server? Are you taking care of it, when: Player A makes a change at the position (50, 50), but Player B is at position (10000,10000) and not able to see the change, so it does not affect him. Do you tell Player B when he is close to (50, 50)? If, how? Or, do I have to implement it?

d) So far, most examples are about player input. When we assume dozens AI characters per sene -- I suppose it is the same as player chars?

e) Sometimes a tree that is idle suddenly gets active, does something, i.e. drops "loot", "fruits" or changes into a new character. I suppose that this too is connected to a) and d), right?

Any help is much appreciated. The sooner I can jump into your framework, the better. I do not mind 2D or 3D examples.

Of course it is about efficiency, and as compact and as rare sync updates as possible.

Viewing all articles
Browse latest Browse all 15755

Trending Articles