Simon Gust
Member
Hello GMC,
I worked on Networking for my game (Eyes of Regret) a while ago and now I came back to it
after a break. I had implemented a working example of UDP networking in a p2p manner,
presented to me by andev.
Since I've never done Networking before and have barely experience, I just jumped into it.
There isn't a problem (yet) but I don't have a background when it comes to judging my design.
To test and develop my Networking I've made it as direct as possible:
Networking is directly handled inside all playable characters. If I press a button, that character creates
their socket. Now As long as anyone knows their ip and port they can join them and will be put in their game
as a dummy client object. Now both host and client have each other in their game.
Since there isn't a real host though, anyone can join any client as long as they know their ip and port.
This way, the game should not end when the person pressing the host button leaves.
The data for the clients are in the dummy clients themselves to make it very simple to find the right client
or quickly send a packet to every client just by calling a with statement.
Now, the insecurities I am running into are: Who handles the flow of the game?
The game spawns enemies which represent the main difficulty.
Should I flag someone as host so that their game handles that and use a type of host-migration when they leave?
Or should I make it client-sided so that each client spawns their own enemies and set them free?
How do I even handle enemies in a non-server environment? I feel like this can cause a lot of traffic.
Any tips?
I worked on Networking for my game (Eyes of Regret) a while ago and now I came back to it
after a break. I had implemented a working example of UDP networking in a p2p manner,
presented to me by andev.
Since I've never done Networking before and have barely experience, I just jumped into it.
There isn't a problem (yet) but I don't have a background when it comes to judging my design.
To test and develop my Networking I've made it as direct as possible:
Networking is directly handled inside all playable characters. If I press a button, that character creates
their socket. Now As long as anyone knows their ip and port they can join them and will be put in their game
as a dummy client object. Now both host and client have each other in their game.
Since there isn't a real host though, anyone can join any client as long as they know their ip and port.
This way, the game should not end when the person pressing the host button leaves.
The data for the clients are in the dummy clients themselves to make it very simple to find the right client
or quickly send a packet to every client just by calling a with statement.
Now, the insecurities I am running into are: Who handles the flow of the game?
The game spawns enemies which represent the main difficulty.
Should I flag someone as host so that their game handles that and use a type of host-migration when they leave?
Or should I make it client-sided so that each client spawns their own enemies and set them free?
How do I even handle enemies in a non-server environment? I feel like this can cause a lot of traffic.
Any tips?