P2P

Post Reply
dark_s0ul
New member
Posts: 5
Joined: Mon Sep 02, 2019 05:54
GitHub: max-pasichnyk

P2P

by dark_s0ul » Post

Does minetest support peer to peer, and if not, how far can it be implemented?

User avatar
Yvanhoe
Member
Posts: 140
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: P2P

by Yvanhoe » Post

What would p2p be used for ? I could see it being useful in the context of the public remote media server but I don't really see other cases.

dark_s0ul
New member
Posts: 5
Joined: Mon Sep 02, 2019 05:54
GitHub: max-pasichnyk

Re: P2P

by dark_s0ul » Post

I mean use p2p instead of client-server architecture for multiplayer

User avatar
mcbits
Member
Posts: 10
Joined: Sat Aug 17, 2019 11:58
GitHub: mcbits

Re: P2P

by mcbits » Post

I'm pretty sure that fully decentralized, real-time, open world gameplay is still uncharted territory.

One thing Minetest could do in theory is host static assets (3D models, textures, sounds) on a p2p platform like IPFS, which would relieve some of the load on a popular server with a lot of new players connecting with empty caches. But the savings wouldn't be much compared to the ongoing gameplay data unless a game's assets amounted to hundreds of megabytes or gigabytes, which won't ever be practical until Minetest supports loading content during gameplay instead of all at once when the client first connects.

User avatar
Yvanhoe
Member
Posts: 140
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: P2P

by Yvanhoe » Post

dark_s0ul wrote:I mean use p2p instead of client-server architecture for multiplayer
Oh please, not that dead horse again...

You are free to experiment, but really in the case of MT, this looks like a solution looking for a problem. You need to maintain consensus over the state of the world. It is easier to do that in a central place than in a network of clients with no central authority. I am not aware of any consensus algorithm that can beat the latency of a classic client/server architecture.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: P2P

by texmex » Post

Yvanhoe wrote:I am not aware of any consensus algorithm that can beat the latency of a classic client/server architecture.
Hmm, what about a Mesecoin based, fossile fueled, GPU-accellerated (it's not like MT takes advantage of the GPU anyway) proof-of-voxel for that delicious carbon release goodness? ;)

dark_s0ul
New member
Posts: 5
Joined: Mon Sep 02, 2019 05:54
GitHub: max-pasichnyk

Re: P2P

by dark_s0ul » Post

What about determinated chunk generation, that looks same on different devices, and not depends on direction of moving of the players?
I'm trying to do that, but the main problem, is that generation depends on direction of moving.
On some devices I can get huge massive of the trees, and small lake, but on other devices I can get huge lake and a few trees.
There is any ideas how it can be implemented?

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: P2P

by texmex » Post

For trees and other decoration, I guess seed based placement needs to replace any random placement algorithm in order to be determinately generated. I'm a bit interested in this too: that the seed dictates everything.

User avatar
Yvanhoe
Member
Posts: 140
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: P2P

by Yvanhoe » Post

I thought the map generation was deterministic? That a given seed would only give the same mapchunks at a given place, whatever the order you generate them?

But note that this is the easy part: making mapgen deterministic does appear to sync clients, but it doable without communication. The problems appear when a client digs a hole and you want to transmit that information to the other clients. Or when a client tries to destroy a protected node and you want to prevent that.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: P2P

by texmex » Post

Yvanhoe wrote:I thought the map generation was deterministic? That a given seed would only give the same mapchunks at a given place, whatever the order you generate them?
The basics are, but decorations may be placed at random within chunks depending on how the decorations are coded, but I believe that they can be put to follow a seed instead.

dark_s0ul
New member
Posts: 5
Joined: Mon Sep 02, 2019 05:54
GitHub: max-pasichnyk

Re: P2P

by dark_s0ul » Post

Decorations are depends on seed and blocks that was placed recently
The problem is in order of chunk generation when using p2p.
Red arrow is player moving direction, blue is water and green is trees
71c5114b-13cd-416c-9a4e-92264d8d8249.png
71c5114b-13cd-416c-9a4e-92264d8d8249.png (43.75 KiB) Viewed 624 times
In first case forest is generated firstly, and later water can't be placed becouse of forest.
In second case lake is generated first, later trees can't be placed on top of water

dark_s0ul
New member
Posts: 5
Joined: Mon Sep 02, 2019 05:54
GitHub: max-pasichnyk

Re: P2P

by dark_s0ul » Post

What about sync generated chunks between all players, and how it will affect on the performance?

Фред Канниг
Member
Posts: 15
Joined: Fri Dec 13, 2019 10:11

Re: P2P

by Фред Канниг » Post

dark_s0ul wrote:
Mon Sep 02, 2019 05:57
Does minetest support peer to peer, and if not, how far can it be implemented?
1. Peer discovery. Develop a peer discovery mechanism that allows MineTest clients to discover and connect to other peers on the network. This can be achieved using a distributed hash table (DHT) or similar decentralized peer discovery protocol.

2. Block synchronization: implement a mechanism for synchronizing the state of the game world between all connected nodes. Each node will need to maintain a local copy of the game world and share updates with other nodes in a decentralized manner. This can be achieved using a distributed ledger or a blockchain-like data structure.

3. Consensus algorithm. Design and implement a consensus algorithm that ensures agreement on the state of the game world among all connected nodes. This algorithm must handle conflicts, such as when multiple nodes try to change the same block at the same time, and resolve them in a decentralized manner.

4. Verification of transactions. Develop a mechanism to verify and verify player actions and transactions in the game world. This could include implementing a decentralized verification protocol or using cryptographic methods such as digital signatures to ensure the integrity of player actions.

5. Security and anti-fraud measures. Take security measures to prevent fraud and ensure the integrity of the gaming world. This may include methods such as peer reputation systems, cryptographic proofs, and grief avoidance mechanisms.

6. User Interface and Features: Modify the MineTest client to support decentralized architecture and provide a seamless user experience. This may include changes to the user interface, networking code, and game logic to accommodate the decentralized nature of the game.

7. Testing and optimization. Thoroughly test your decentralized MineTest implementation to ensure its stability, performance, and scalability. Identify and resolve any bottlenecks or issues that arise during testing.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests