Adding netplay to an existing game .. your thoughts?


skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,063
Website
www.codejedi.com
I'm planning on someday adding a head to head mode in one of my existing games. Its on my action list, but a lot of other things come up first since I've always rather filed this under 'nice to have' and 'a lot of peopel want it, but wouldn't actually do it, due to limited access to wifi while on the go and hard to find people at the right times' and such. Still, with panda having built in easy wifi, its a lot more feasible than on the earlier machines (and with iphone and such, also easy for that platform..)

If I proceed, then a first cut would be a very naive netplay .. for a turn based wargame, its essentially batch up the game state, send it across wire, they do their turn, and send the state back, etc. Essentially could use the serialization code in the existing save-game system.

Thats brute force, and naive (Assuming people are not trying to cheat), but should be relatively easy and doable.

For 'real games', netcode tends to be very complex.. validating people are using 'official' binaries (checksum, random code checks, code comparison between players), encrypting traffic, verifying datafiles seem unhacked (avoid item duping and making, etc), and so on. I really have no interest in combatting that sort of thing.. too much effort.

Some questions..

- is netplay a 'big thing' that peopel really want, and actually use? (as opposed to really want, and don't actually use)
- can I get away with a naive approach, or will people right away get into the xml/plaintext datafiles and h4x0r it all up?
- can you get away with 'enter your mates IP here', or do you need a basic matching system day one?
- can I get away without worrying about people 'gaming the system'; set up two versions and 'play themselves' so they can get 'free experience and lootz'? ie: In my world, if people want to cheat themselves, feal free. If they want to cheat the other guy, the other guy can pick better friends :)

For now, my thought is simple single-matchup play; you fire up the game, load up your save, go to the 'lets go online' option and enter a target IP for another guy in the same mode (he selects Wait-mode while you selected Startup-mode, whatever) and then do a single match. Afgter match is over, maybe an option to 'do another match', to save you reconnecting again.

*shrug*

jeff

For that matter, I should add netplay to an ST emu so we can all play Empire head to head. Then again, mnaybe DOSBox would run Empire Deluxe with netplay.. oh man, the glee!
 
grin well ill chime in since vrs fighters and strat/war games are my faves followed by rpgs ,,

heres what ive experienced in my online games , in the stratagy/wargame arena 90% are hard core play by the rules and abuse the rules as long as you dont "cheat" types .. and the few that do get ran out of the community right quick..

vrs fighters allways have some cheaters or greifers not much you can do about it other than try n make it hard for cheaters as well as empower users to deal with them somehow..

RPGS are a whole mess since if its a party kinda thing cheaters can throw the whole community out of whack in a hurry depending on the type so carefull atention needs to be paid there if its a rpg based around community tradeing or highly gear related..

just my personal experiences in those areas ...take what ya will from it
 
I dread coding netplay for the very same reason. Netplay anti-cheating sounds awfully similar to copy-protection, as in it's a boring and ultimately useless thing to work on... I say assume the world is nice, and do your part. Cheaters will show up at every corner no matter what you do, and unless they're getting anything other than self-satisfaction in return, more power to them...
 
Leave taking care of cheaters to server admins. people in the gp32x and pandora community, assuming that is what you are developing on, are mostly honest, and it wont be 12 year olds who just found out how to use speed engine or cheat engine or that other garbage. not to mention, realtime hex editing like in cheat engine is impossible on a linux kernel, at least in x86.
 
Anti-cheating controls depend on the client-server relationship of the game. Basically, the more the server controls the game, the less intrusive anti-cheating controls need be. When the server controls what the client is able to do and what the client is able to see, hacking the client becomes less useful in simple situations. This is why cheats in MMOs are generally limited to bug exploitation and interface related cheats (like bots).
 
In terms of whether I'd use a netplay feature... depends on whether there were other people discoverable online with low effort. Which basically means that for me to use it, some kind of matching system would be necessary. POND might well cover that, though, if AirtTamStorm finishes it (touch wood).

Anti-cheating, though, I don't really care too much about. Most people in the world are nice, those who aren't... well, with a matching system you can always block them.

The only time cheating is likely to interfere, in any event (outside of MMORPGS, of course, where trading matters muchly) is in online scorecharts. That is partially dealable with, though, in a fairly non-intrusive manner. In particular, with an honour-rating system. After a match, any participating player would be asked of the person they were playing against "do you believe X cheated in this match?" The ratio becomes visible after around 30 votes from different players. Anyone who cheats should become obvious fairly quickly. If they aren't, then they can't have been cheating too badly anyway. Presumably, in the case of repeat matches between people, the most recent vote counts.

Of course, such a system would still be gameable, but it would take a lot more effort than most could be bothered to put in to do it. Only worth doing, though, if you're actually planning on using online scorecharts across different players. Otherwise, just stick with the naive method; most people, after all, are nice when it coms down to it.
 
Last edited by a moderator:
Dealing with cheating is actually very simple; never trust the client (in a dedicated server game - if it's not DS, trust the host but not the client). This means, among other things, only send data to the player that he or she is supposed to be seeing. Do it on a need-to-know basis. Of course, the theory is simple, implementation is bloody hard... ;)
 
yeah yeah I know the obvious, I've done this before ;)

The trick here is a pure client to client game, where the game was not really designed as a multiplayer game (though I left hookd in it for adding it later should I want to..) -- so it shouldn't be hard ot drop a naive system in, but its certainly not server based.

(On the one hand, its not hard to add a man-in-the-middle; could toss up a matching service or even a website-for-pandora-browser to set up matches, and have all client data pass through it and add some server filtering, or even server control .. but really, my time isn't so copious as it used to be, so I'll probably just go for dumb-client-to-dumb-client.)

With dumb-client to client, you end up with a lot more trust than you like to include in a protocol.

Hell, fo rfirst cut I'll probably just have it serialize out a full game save to buffer (Rather than SD card), and send the lot to the other guy, and have the receiver do a 'game load' on it; ie: leverage most of the well proven existing code. Easy to totally crack and destroy, but I think I'll err on the side of trust and worry about growing it later.

jeff
 
PoisonedV said:
Leave taking care of cheaters to server admins. people in the gp32x and pandora community, assuming that is what you are developing on, are mostly honest, and it wont be 12 year olds who just found out how to use speed engine or cheat engine or that other garbage. not to mention, realtime hex editing like in cheat engine is impossible on a linux kernel, at least in x86.

hu, didn't know that. I was quite sure that I read tutorials on that topic. I don't see why it wouldn't work neither
I did alot of that under Windows and thought there was a similar way under Linux.

//Edit: Yes, netplay is important to me. However: You should make a serverbrowser and/or cross-plattform (PC / Pandora / Wiz / PSP / ..) in order to get enough possible players at once.

Haven't looked at requirements, but:
http://www.linuxmanpages.com/man2/ptrace.2.php
 
Back
Top