User-hosted redundancy

Started by
4 comments, last by 3TATUK2 10 years, 4 months ago

So, say you have a system where games are mainly user-hosted with a central server listing that does automatic matchmaking...

If the "player" who is really hosting the game quits early, then the whole game crashes..

Any ideas for workarounds to this? My idea is to assign a "backup" host, ie a second user that all clients are aware of who will automatically resume the broadcasting services if the main host quits.

What do you think? :)

Advertisement

Many games that do this will essentially choose a client to become the host. In doing so, the clients' state is the new authority.

How you implement this is rather dependant on your preference. You may wish to support some kind of lobbying system - where each client can register it's game session ID and state that it is looking for the new host, and the matchmaker service can match the client's up. Otherwise, you would be best implementing a peer to peer solution, either with predefined fallback hosts by the original server (so if host is dropped, the clients have a list of who to try, in priority order) or deal with the new host when the situation arises. In the case of the latter, it will require the clients to be aware of "some" connection data about the other clients, whilst having a matchmaker would remove this dependency.

The term is host migration, which should help you in your quest to learn the topic.

There are many approaches, generally they are all variations of each machine running their own copy of the simulation.

hplus0603 ??

Your wisdom ??

laugh.png

Frob already got it -- host migration is the key words you want to look for.

Typically, all clients run the simulation, and thus any one client can take over.

The question is the who becomes host if the main host crashes out.

Options include the initial host pre-selecting the fall-back, or sorting by user id and choosing the lowest-numbered user, or some other consensus mechanism.

Clients obviously also need to establish a connection to the presumptive next host, so clients need to know the networking information about other clients, and NAT punch-through needs to be set up etc.

enum Bool { True, False, FileNotFound };

tyvm :)

This topic is closed to new replies.

Advertisement