Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
P2P & Games #413716
12/16/12 19:14
12/16/12 19:14
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
So... I started playing around with multiplayer some years ago and recently I'm getting back into having some fun with it when I got a new idea I would like to test for fun.

As the title says "peer2peer" connections popped in my mind and I would like to test if this is even possible for realtime multiplayer gaming. I'm not planning on making a game, just a tool for others to use. I just want to experiment with the concept and (if it works) polish it into a usable tool.

If it works the idea is aimed as a free tool for indies in general that might want to take on something more ambitious than basic multiplayer, but cant afford massive server/bandwith costs.
Normally indie games cant afford anything past traditional de-centralized client/server multiplayer environments. And at most a centralized serverlist.

As the number of clients grows, so does the costs of a centralized server farm. Subscription fees are a great way to pay for these costs but clients wont usually be inclined to pay a subscription fee unless it is the next big AAA title on the market so that isnt really an option for indies.

The advantage of a P2P networking solution would be that as the client base grows, so does the network. The main idea is that all clients would at the same time form part of the server farm while they are connected. So as the player base grows so does the bandwidth and size of the server farm. And at no cost for the indie developers!

This idea came to me during a programming course I am attending when we started to work with connections. It was the first time I had worked with connections that returned a "connection pointer" that would allow for multiple connections at the same time.

I would like a couple of suggestions to point me in the right direction to get started. In gaming environment the only experience I have is with gamestudio. And in multiplayer the only experience I have was at first with built-in gamestudio multiplayer, and then moved on to use Anet a few years ago. The problem with these two is that none of their connection functions return pointers, so they cannot handle multiple simultaneous connections. If anyone could point me to a tool for 3DGS that would allow multiple connections it would be great to get me started. My plan is (after some initial experimentation) create an opensource project that would be a great tool for indie developers to use! (if I can get this idea to work)

Any thoughts/comments/suggestions?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: P2P & Games [Re: Carlos3DGS] #415041
01/13/13 00:00
01/13/13 00:00
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
my only thought is problems with data tamporing and the difficult measures it'd take to gaurd against it.

Re: P2P & Games [Re: lostclimate] #415170
01/14/13 17:21
01/14/13 17:21
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
One big problem would be, that you have to do port forwarding on every client. You can avoid this by using a technique called NAT punsh-through but this requires also a central server. Also you could us UPNP but this isn't supported/enabled on every router.

Another big problem would be that P2P games would be "cheater" friendly tongue
And that's the main point why P2P isn't used in MP games. You always need a server that monitors the game so that every client has the same chances. It's better and easier to have a central point that manages the whole game and keeps every thing synchron. I can imagine that it would be a nightmare in P2P application to keep everything synchron.

The latest ANet version uses P2P for it's voice chat feature. The change to P2P reduces the traffic dramatically. But for a game itself, I would never use P2P because it hasn't really advantages compared to a server-client based architecture!

Quote:
And in multiplayer the only experience I have was at first with built-in gamestudio multiplayer, and then moved on to use Anet a few years ago. The problem with these two is that none of their connection functions return pointers, so they cannot handle multiple simultaneous connections.


When you use the ANet socket functions, you can create unlimited connections. These functions return a handle to the connection. With the ENet functions you can only create Server-Client applications.


To summerize everything: There are good reason why P2P is not used in MP games! Although I'm sure you will have fun playing around with socket functions and make your own experiences wink


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: P2P & Games [Re: Dark_samurai] #416972
02/06/13 17:37
02/06/13 17:37
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Firstly, thankyou for your thoughts.
And it looks like I really needed to update my old ANet ^^

Designing this really is a nightmare but a fun challenge. I have been thinking about cheating problems for this and am designing an idea I would like to hear your thoughts on.

The basic idea is since it is a P2P environment, every client checks the "validity" of the results for incoming data from the other peers as if they were servers. Basic checks like when updating a position checking the distance/time from the previous known position to make sure he didnt travel too far too fast, when recieving "attack" data they check the time since the last "attack" to make sure they are not too frequent, etc... When any client detects "un-authorized" behaviour incoming from another peer in it's "zone" it sends a special message to all other peers in the zone stating an "illegal" action was detected from player X. When any clients recieve "illegal-playerX" messages from more than half of the peer in the zone, they add that player ID to their own internal "ignore list". Kind of like an automated voting system. So if a player is voted "cheater" by the majority all peers in the network "sever" the connection with the cheater, add them to their ignore list, ignore any further data recieved or connection attempts from that player, and no longer send any data to the "cheater" either.

A problem I saw with this system would be new players entering the zone. Creating an ignore list based on another peer's list could be dangerous, as it would leave the system vulnerable to griefers sending malicious "fake" ignore lists that include all players in the zone, leaving the game un-playable because everyone would ignore everyone else except the cheater. But not recieving an ignore list from other peers when connecting would cause problems too. Since they are all "ignoring" the cheater, the other peers are ignoring his incoming data, therefore they do not check his data and dont issue "cheater votes". So the new player would be the only one voting resulting in less than half of the network voting the cheater as "guilty".

So I thought that any player entering the network (zone) initially assumes all peers to be "trustworthy", if they find a peer to be breaking the rules they issue their "vote" as normal, any peer recieving this vote/warning also checks his ignore list and if the cheater is on his list he sends a "cheater vote" automatically.

Since it is a P2P network and there is no centralized server this system does not "enforce" any rules. Instead it is designed to just "isolate" cheaters from the P2P network. Essentially leaving cheaters alone in the dark with nobody to cheat on.
You cannot cheat on anybody if there is nobody to cheat on...

What do you guys think about this idea? Do you see any other potencial problems I have not that would need to be taken into consideration?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: P2P & Games [Re: Carlos3DGS] #417075
02/08/13 08:19
02/08/13 08:19
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Hmmmm... could be possible. But I'm pretty sure that it's still not as save/stable as using a centralized server. But I think it's worth a try wink


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: P2P & Games [Re: Dark_samurai] #417108
02/08/13 13:51
02/08/13 13:51
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Yeah, it is definately not as safe. This would be only be good for detecting erratic movement/attacking/etc...

But is not suitable for any a game with items/gear/resources that should carry on the progression from one session to another (or rpg type character skill advancement), because withought a centralized server peers can only check if what happened during the current session is valid, but on connection they have no idea if the items/stats brought into the session from a previous session are valid or not.

So this work-around is valid only for certain types of games that dont require "permanent advancement" game mechanics that carry on from one session to another. However this does not completely discard progression based generes like rts or rpg, it just restricts these generes to session-limited advancement. For example a starcraft style rts if you remove the ladder system should be fine. Or a moba type rpg because each session you have a fresh start.

Synchronization and stability are a completely different matter though, but one step at a time I guess, hehehe. Meanwhile, back to research! I hope I crack this nut, but even if I don't at least I am learning alot in the process.


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1