P2P LAN online multiplayer using UDP #3285
Open
+941
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have implemented a P2P connection over LAN using UDP to enable online multiplayer functionality in SuperTux. This feature allows multiple players to connect directly to each other without requiring a central server.
To do this we added some variables to the Config, added a new Controller that serves as a dummy for the online handling of the character, added a new menu, a new class for ip management and another for sending and receiving messages.
This messages use the UDP protocol and threads to make a peer to peer connection for the handling of the LAN communication.
We only did LAN communication as other types of communication would require a server and this would require money or other resourses that we dont think the suppertux community wants, although there is a way to use this program for true online multiplayer, all it takes is putting the public ip of the host and both who is joining and who is hosting need to forward their routters to their computers.
To access online multiplayer you have to go to the multiplayer menu where the new option is added, then just host and another person writes your ip as join and you're ready to play together.