Advertisement

Resources to learn setting up a gameserver

Started by August 11, 2015 10:36 PM
2 comments, last by Argha 9 years, 3 months ago

Hi guys,

I got the following working atm:

C++ Game using SFML. Multiple players can connect, if they press W/A/S/D the new coordinate will be send to a specific IP address (will be the server) via UDP.

The server broadcasts the coordinates of all players at specific times.

Question is:

I want to save e.g. where a player logged of. I guess I could send a package with playername, X, Y when he disconnects. But what then? Do I save the received information into a database on the server and as soon as he logs in he gets the information back?

Second: All of my things work well for my little 2D game with a few persons. But imagine some sort of enemy, unlocked weapons etc. All this information has to be send via UDP, isnt that a hell of a data stream? Of course most of it has to be send one time per new player and session in general, but still.

Do you know any resources where I can learn how to save data on a gameserver and send them well? Or maybe even books about networking if that helps.

Multiplayer in general is new to me

(And offtopic: What happens if someone just bombards the server udp port with thousands of 0's or other useless data?)

Do I save the received information into a database on the server and as soon as he logs in he gets the information back?


Yes.

isnt that a hell of a data stream?


I don't know. What is your definition of "a hell of a data stream"? How much data will you actually send to update users of these entities? Is the second more or less than the first?

Do you know any resources where I can learn how to save data on a gameserver and send them well?


The FAQ at the top of the networking & multiplayer forum has questions, answers, and links. Most of the links still work.

What happens if someone just bombards the server udp port with thousands of 0's or other useless data?


If they have a bigger network pipe than you have, and you do not have arrangements with a DDoS mitigation company, then they successfully DDoS your server.
enum Bool { True, False, FileNotFound };
Advertisement

"I want to save e.g. where a player logged off"

You might want to expand that 'save' functionality to include when their connection goes dead - which would require some periodic asynchronous location logging in your game to have a 'near enough' last point (or the server used last known position on a connection lost event). Thus a more general mechanism would cover your initial case.

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

Thank you :)

This topic is closed to new replies.

Advertisement