Creating a Server in MMF2
Okay, I've been trying various methods of how to code my online game, and have come up with this; can I have your input please network/OINC experts:
Game Overview: 1-4 online RPG (not MMO) the online method will be like Left 4 Dead, i.e. a maximum of 4 players, drop-in drop-out co-op play. Players can join a server and 'host' a game, which others can join, although I'm also catering for localhost for those who want it - the 'host' determines game settings (difficulty, loading, max players, level limits, etc). In one game, there will only ever be a maximum of 4 online players, but the server will have to cater for multiple game instances of course. There is also a dedicated PvP area (the Arena District) which I may attempt to increase the player limit on, but only if I can get it working perfectly.
So, my idea is to actually create a server program separately in MMF2, which I have running permanently, and clients set games up on. The server program controls the game itself, i.e. watches all games that have been set-up, takes all client input and sends it back to all 1-4 remote players, etc. It can also keep lists of games, players, etc, and can log everything that's happened in games. By doing this, it could also automatically run periodic queries to check for any cheating which might occur. The server can also send patches to players (and only allow online play if they're updated) which means it will be easy to update and modify the game.
It could be possible to have multiple instances of the server running on different computers - then when a client attempts to enter the general multiplayer lobby, it will fire a message to each server to see if they're on, how many games are running on each, ping, etc - then the player can join any of them. The server programs could communicate with each other to pass player data between each other, and create a consolidated database of player data running on each.
So, how effective would this be?
Is it worth the effort just to avoid the inevitable cheating from having things done client-side?
Would a server program running in MMF2 be able to cope with the potential demand?
Re: Creating a Server in MMF2
I wouldn't worry about cheating. you could hash/encrypt the data that is sent to the server so it is tamper proof that way if someone does try to cheat they won't be able to because they will have to guess your encryption key/data. This could change on a daily basis. If someone is suspected of cheating then you will have to employ some kind of monitoring to show how fast they level up etc. if they are progressing too fast in the game then ban their account name and IP address. Don't forget to put a disclaimer on the beginning saying cheaters will be banned.
That probably won't stop people just shouting wolf.
The bans can be managed through the server although I haven't yet tested to see if you have to restart the server to check the modified ini.
You could have a private client that acts as a monitor logging and checking all the games.
At the moment creating your own server in OINC is not easy. You have to use POINC and do some python scripting; You shuold be able to handle most things with the client though.
Re: Creating a Server in MMF2
Great info - what I'm thinking is, by creating a server like program in MMF, it avoids the need to learn python, or run SQL, PHP stuff etc as it could all be handled by server-side ini's and jazz like that...
It essentially takes all the effort out of making a server, and allows people who are good with MMF, to actually make use of it.
Also, like I mentioned, it would be really easy to implement anti-cheat algorithms straight into the program. I.e. if level of char changes too quickly in a time-period, if gold increases suddenly by too much, etc, etc.
Am I missing something entirely here - someone hurry up and burst my bubble... because to me this seems like a great solution.
Re: Creating a Server in MMF2
Re: Creating a Server in MMF2
You can use anti cheat from within the client and that's great because it will cut the strain on the server. But for the die hard crackers out there that may want to circumvent your protection schemes they can just Ice your app and patch the security checks on the fly. Anyway Its good to hear people are starting to use OINC for their network projects now.
Jamie is still open to suggestions for the Server side as client changes have been frozen while he irons out current bugs.
It doesn't hurt to ask for changes to the server and he may implement your request if its a good idea.
Of corse we don't want to swamp him with requests that would slow the release of OINC V1 for MMF
Re: Creating a Server in MMF2
Asholay, I can help you out with Poinc if you're going for that :)
Re: Creating a Server in MMF2
Cheers Mathias (I may have to accept your kind offer), but that's exactly what I'm hoping to avoid if I can do something which works just as well in MMF2.
That way I can concentrate all my efforts in getting things working well, instead of learning python (which I've downloaded, but haven't read about yet)
Re: Creating a Server in MMF2
I doubt you would be able to get a server 'working well' in MMF2 (especially when you get to it's obscure corners).
But hey, it's always good to learn something new (right?) ;)
Re: Creating a Server in MMF2
You can create a server in MMF but it's bound to run into problems if you have a lot of activity going on with many users.
Also serverwise, mmf applications are no the best when it comes to memory consumption.
Re: Creating a Server in MMF2
Lol - fair enough Mathias, I'll get out the Python books; as you say, 'tis indeed good to learn something new!!
I think you're probably right, problems will crop up, and multiple users will drink-up the resources of an MMF2 app.