View Full Version : Play-By-email.(PBEM) with spacefleets. What could go wrong?
cliffski
05-27-2009, 10:26 AM
I need the advice of the QT3 game-geek hive mind.
I've never played any PBEM games, and yet I am sort of making one, so I'm sure I'm missing some really big design or playability issues or something similar.
Essentially I'm doing a tower-defence game with spaceships (screens etc (http://www.gratuitousspacebattles.com)), which looks a bit like an RTS. Anyway, the multiplayer aspect of all this is a sort of play-by-email system where once you have built the most uber-space-fleet-ever, you can click a button and challenge another player of the game to beat it.
That then uploads the data for your fleet to my server, and pops a note in the database saying there is a new challenge for player 'Bob'. The system includes the option to send a suitable text taunt to your enemy along with the fleet.
At their leisure, they then click refresh in their copy of the game, see the challenge, and can download and play against the fleet, presumably eventually sending a return fleet as a victorious counter-challenge.
One thing I'm not worrying about too much is being really anal about cheat-prevention. Tbh, it's almost impossible, because you are trusting the client to run the battle anyway, so any anti-cheating is doomed to failure. My assumption is that the direct-challenge method, where you need the username of your opponent, means you will play against friends, rather than random match-making and being beaten by l33t haxx0rs.
I'm looking at it as a more convenient way to 'sort-of' mod the game, in that you have an endless stream of new fleets to play against, and those fleets are designed by other players, kind of like spores massively-singleplayer thing.
Any thoughts? Does this sound lame or cool? will it work? will it die because people who buy the game wont know other buyers? Any big huge fucking obvious gotchas that have not occurred to me? I'm doing all this with php and MySQL on my own dedicated linux server, I use some WinInet at the client side, and I'm a n00b at most things web-codewise.
Thanks in advance etc etc.
Tim James
05-27-2009, 10:37 AM
Didn't you say this was some sort of WEGO game where players can influence a few things and then watch the battle unfold? Might want to look at how those type of PBEM games work.
Sepiche
05-27-2009, 10:45 AM
I've always been partial to the way Dominions handles battles in PBEM. You organize and position your units on the battlefield, give each unit basic orders (Attack Closest, Attack Cavalry, Cast Spells, etc.), and the server takes each players orders and decides how the battle turned out.
That gives the player some ability to control things and strategize, but cuts down on their ability to game the system too much, and they don't need to be there in person for the battle to commence.
cliffski
05-27-2009, 10:48 AM
well the other headache I have is that the games are not entirely deterministic, so if I play my fleet against your fleet on my PC, it might have me win, and if you play the same battle, it *might* be that your fleet wins, if a lucky shot early on has big ripple effects later.
I'm hoping I can promote it as more being a nice add-on to the game that gives you endless enemies to battle against rather than some vitally important high-score driven on-line MMO style thing where it really matters that X cheated or that Y finds different results to Z.
The thing is, will people accept it as that? or will they demand that it works some other way?
Kraaze
05-27-2009, 10:53 AM
well the other headache I have is that the games are not entirely deterministic, so if I play my fleet against your fleet on my PC, it might have me win, and if you play the same battle, it *might* be that your fleet wins, if a lucky shot early on has big ripple effects later.
Fix that. It should be deterministic. If necessary fudge it and seed your RNG with some value hashed out all the stats of all the ships in the fleet or similar.
Tim James
05-27-2009, 10:53 AM
I believe the way it works in WEGO is that one person handles running the battle and sends the results to the other player along with his next turn's commands. I don't know if this has any parallel to your game.
balut
05-27-2009, 10:54 AM
well the other headache I have is that the games are not entirely deterministic, so if I play my fleet against your fleet on my PC, it might have me win, and if you play the same battle, it *might* be that your fleet wins, if a lucky shot early on has big ripple effects later.
I'm hoping I can promote it as more being a nice add-on to the game that gives you endless enemies to battle against rather than some vitally important high-score driven on-line MMO style thing where it really matters that X cheated or that Y finds different results to Z.
The thing is, will people accept it as that? or will they demand that it works some other way?
People won't have issues if they know up front that there's some random variation in the battle simulations. It would also encourage head-to-head fleet battles that might be "best of 3" or "best of 5" to factor in for this and find the true victor.
Brendan
05-27-2009, 10:56 AM
WHat was that old Robot Wars game in which you would write your robot AI in a basic programming language and send them into an arena to do battle? I think this is the perfect platform for something like that.
cliffski
05-27-2009, 10:57 AM
People will definitely be up in arms if the results vary from system to system.
Bah.
Although I can see that you may be right, getting a game that is effectively an RTS with a million things happening at once to be deterministic is *not* trivial. At least, it might be if that's your only job, but for me, this is a nightmare :(
I have a centralised random number generator, and can lock the frame rate, but I'm sure it still isn't going to be deterministic. Not without a ton of work.
I'd have to have two random generators, one for gameplay-vital stuff like damage chances, and another for stuff that's variable graphically, like particles.
Hmmm.
balut
05-27-2009, 10:59 AM
WHat was that old Robot Wars game in which you would write your robot AI in a basic programming language and send them into an arena to do battle? I think this is the perfect platform for something like that.
Armored Core: Formula Front for the PSP worked like this, and it was fantastic.
balut
05-27-2009, 10:59 AM
Bah.
Although I can see that you may be right, getting a game that is effectively an RTS with a million things happening at once to be deterministic is *not* trivial. At least, it might be if that's your only job, but for me, this is a nightmare :(
I have a centralised random number generator, and can lock the frame rate, but I'm sure it still isn't going to be deterministic. Not without a ton of work.
I'd have to have two random generators, one for gameplay-vital stuff like damage chances, and another for stuff that's variable graphically, like particles.
Hmmm.
I edited my previous post, but you replied too quickly. :p
cliffski
05-27-2009, 11:01 AM
People won't have issues if they know up front that there's some random variation in the battle simulations. It would also encourage head-to-head fleet battles that might be "best of 3" or "best of 5" to factor in for this and find the true victor.
Indeed. I was hoping people would have that sort of approach. I can always act as ultimate judge by simply running both fleets on my own machine :D
My template for the customers I'm aiming at are me and my buddy tom. We play Company of heroes a lot, and the idea that we would cheat, or complain about whether or not it was a fair battle or who lost just seems silly. Ultimately, its just a game, and its like playing with toys. I'm hoping nobody will take it too seriously. It is called Gratuitous Space Battles...
WarrenM
05-27-2009, 11:36 AM
If you can seed the random number generator with the same value for both machines it SHOULD be deterministic shouldn't it? Outside of random numbers, what else could throw it off? Are you using a physics engine for the shot collisions or something?
Yeah, in the Age games we had a number of different parallel RNGs that we use for a mix of synchronous and non-synchronous effects. You also have to capture the results of any external inputs, like if you trigger something based on when a sound finishes playing, or the position of a bone that could be interpolating. We used a separate simulation rate and rendering rate to aid in a lot of that. That whole simulation, multiplayer, and record game system is dependant on being able to reconstruct the game simulation precisely, so we built a lot of tools to aid in that -- it is definitely not a trivial undertaking.
Alan Au
05-27-2009, 11:50 AM
I guess some of this depends on the underlying model, and whether or not you can simulate outcomes without having to actually render things. That is, does the simulation drive the rendering (a hit is calculated, so I'll show the sprites colliding), or does the rendering drive the simulation (oh those sprites collided, so I'll register a hit)?
As for cheating, you could come up with some checksum to determine whether players are using "default" parts, or at least using the *same* set of modified parts.
- Alan
Grifman
05-27-2009, 11:52 AM
Essentially I'm doing a tower-defence game with spaceships (screens etc (http://www.gratuitousspacebattles.com)),
The video looks pretty cool. I like how the ships move ponderously slow rather than zipping all over the place. Nice look and neat weapons effects.
ckessel
05-27-2009, 11:54 AM
Outside of random numbers, what else could throw it off?
I suppose if one was 64bit and one 32 bit, they might truncate floating point numbers different or some such.
I think the reality is, cliffski, that you'll want to follow the paths laid down by other PBM games, which basically means 1 server to run the turns. You can do "simulations" on your PC as part of your turn, but you won't know what really happens until the host system runs the turn. Where "host" may be used somewhat loosely. You could have 5 people in a game and have someone different run the turn each time just as long as the entire turn is computed on a single system.
Therlun
05-27-2009, 12:51 PM
Wasn't there some duel-focused flash game game not too long go which was very random but still had many fans?
Brute something.
nixon66
05-27-2009, 12:55 PM
True, but it allowed for playbacks of your fights. I'm fine with random outcomes, but it'd be great to be able to playback those epic near wins when your friend gloats about how his fleet just blasted yours away.
Damien Neil
05-27-2009, 01:09 PM
Make the outcome of battles deterministic. You'll get a lot of good things out of it: Fewer worries about cheating, smaller replay file size (fleet composition + random seed), easier synchronization of battles.
Don't make the game rely on knowing the people you fight against. Let me just hit a button and instantly fight a battle against a random stranger, if that's what I want.
Obviously, make it easy to fight a specific person as well.
Less obviously, add good community features. Let me join a "Qt3" group and fight battles against other random members of it. Have team battles: Let me hit a button and fight a battle with several random Qt3ers on my side and a random collection of enemies on the other.
Don't make community rely on a giant forum thread with people posting their names/accounts/DNA sequences.
Make it easy to share battle results. Give me a code or URL after each battle that I can share to show off the results. For extra awesome, offer an easy way to share replays on YouTube or some such, so that people who don't have the game can join in the fun. (And get hooked, and buy the game.)
Include some sort of progression, where playing/winning battles unlocks new parts or larger fleets.
nixon66
05-27-2009, 01:26 PM
Less obviously, add good community features. Let me join a "Qt3" group and fight battles against other random members of it. Have team battles: Let me hit a button and fight a battle with several random Qt3ers on my side and a random collection of enemies on the other.
This. I would love to be able to fight against other Qt3ers easily. The My Brute thread lasted as long as it did because of the ability for us to fight each other easily and to post about the fights afterwords with the results, which in turn quickly brought more players to the game.
Warren
05-27-2009, 01:32 PM
I agree about wanting to see the playbacks. I think I'd prefer some non-determinism as well. I also agree that putting a lot of effort into the anti-cheating is wasted effort as I don't think that your target audience is prone to that; you're an indie and seems to me your return on investment on worrying about cheats is low.
Therlun
05-27-2009, 01:53 PM
What's up with the determinism campaign?
IMO random factors would benefit the game as far as I understand the concept.
Jasper
05-27-2009, 01:58 PM
Bah.
Although I can see that you may be right, getting a game that is effectively an RTS with a million things happening at once to be deterministic is *not* trivial. At least, it might be if that's your only job, but for me, this is a nightmare :(
I have a centralised random number generator, and can lock the frame rate, but I'm sure it still isn't going to be deterministic. Not without a ton of work.
I'd have to have two random generators, one for gameplay-vital stuff like damage chances, and another for stuff that's variable graphically, like particles.
Hmmm.
The posters who are saying deterministic/repeatable is better are right, but they are largely underestimating how much of a pain in the ass this can be -- in particular note Xemu's warning after having actually done it.
As an independent developer, you have to ask yourself whether you really have the time for such chrome? I think your initial hunch is right, and you should stick with it. At any rate, as you've already architected for a centralized random number generator, you can defer this decision for later, when you'll have a better idea of how much time you can afford to spend on chrome.
Also, on a bit of a tangent, IMHO the primary benefit of a more tightly controlled number generator is repeatable testing. On a larger project, this alone might convince you to bite the bullet.
Jasper
05-27-2009, 01:59 PM
What's up with the determinism campaign?
IMO random factors would benefit the game as far as I understand the concept.
Making the random factors deterministic doesn't make the resulting battles any less random -- it just means that you can repeat them given the same random number seed. Results could still be generated with a random seed.
Damien Neil
05-27-2009, 02:44 PM
The posters who are saying deterministic/repeatable is better are right, but they are largely underestimating how much of a pain in the ass this can be -- in particular note Xemu's warning after having actually done it.
It sounds as if the battles are non-interactive--you set up the battle, and then sit back and watch as it plays out. If that's true, then determinism really shouldn't be all that difficult; it's just a matter of storing a random seed, using that source of randomness for the simulation (and only for the simulation), and playing the simulation out using a predictable time step. Not utterly trivial, but not particularly complicated either.
As a bonus, determinism makes regression testing much simpler. Of course, if cliffski was doing regression testing, he'd probably already have a deterministic simulation. :>
Quitch
05-27-2009, 03:28 PM
Well the video was awesome and if this is, as I understand it, a game where you build ships and then plug AI into them in the form of some set of orders, I'm already wetting my pants with excitement.
The whole PBEM sounds like a big pain in the ass though, it would be much better if I upload my fleet to your server, then people play it as and when they feel like it without me getting involved at all from that point on. Then you can track fleet losses, victories, etc. and have people challenging the best ones for the greatest challenge. Still, I suspect that means more resources, more money, etc.
cliffski
05-27-2009, 04:32 PM
I think I might direct a bit of time (which is the only real cost) into at least trying to make the games 'more' deterministic, if not absolute, just to make things more reliable than they are now. It distresses me that if I pit identical fleets against each other, its not a close fight, because that makes things look a bit too random.
Having said that, I don't think totally deterministic replays are the core focus of the game, which is on configurable space battles that look cool in 2D. It's not really a big multiplayer game in the starcraft sense, but more of a game like the Sims, Spore or Rollercoaster tycoon, in that people who enjoy the game will want to share content they create (fleets) with each other.
If post-launch it seems obvious that people primarily play the game for the challenge aspect rather than vs AI, I can always patch it and expand on it. I'm hoping to make a game with some decent shelf life, so with luck it will evolve through beta and release and beyond in the same way games like Mount N Blade and Dwarf Fortress have done.
Cheers for the feedback guys, it's a real big help.
Alan Au
05-27-2009, 04:58 PM
Having said that, I don't think totally deterministic replays are the core focus of the game, which is on configurable space battles that look cool in 2D. It's not really a big multiplayer game in the starcraft sense, but more of a game like the Sims, Spore or Rollercoaster tycoon, in that people who enjoy the game will want to share content they create (fleets) with each other.
So the question I have is whether you plan on storing the replays as video files, or as proprietary "replay" files, or some sort of human-readable markup files (to allow scripting), or what. I guess you could do all of those, but consistent replayability is important with those latter options.
- Alan
cliffski
05-28-2009, 01:32 AM
well I'm not even sure about storing replays at this stage, but I certainly wouldn't be doing it as video files. They would be colossal, especially given my ambition to support some pretty big screen resolutions.
DavidKaye
05-28-2009, 01:46 AM
Make the outcome of battles deterministic. You'll get a lot of good things out of it: Fewer worries about cheating, smaller replay file size (fleet composition + random seed), easier synchronization of battles.
Don't make the game rely on knowing the people you fight against. Let me just hit a button and instantly fight a battle against a random stranger, if that's what I want.
Obviously, make it easy to fight a specific person as well.
Less obviously, add good community features. Let me join a "Qt3" group and fight battles against other random members of it. Have team battles: Let me hit a button and fight a battle with several random Qt3ers on my side and a random collection of enemies on the other.
Don't make community rely on a giant forum thread with people posting their names/accounts/DNA sequences.
Make it easy to share battle results. Give me a code or URL after each battle that I can share to show off the results. For extra awesome, offer an easy way to share replays on YouTube or some such, so that people who don't have the game can join in the fun. (And get hooked, and buy the game.)
Include some sort of progression, where playing/winning battles unlocks new parts or larger fleets.
This is fantastic advice. You should also strongly consider implementing Facebook Connect (http://developers.facebook.com/connect.php), which will allow the game to plug into each player's social network so they can easily find their friends, challenge them and so on. You can also do cool stuff like post notifications about game outcomes back into the player's Facebook stream, where all their friends will see it.
The way you handle the community/online side of things is going to be the biggest determinant of this game's success or failure, I promise you. Feel free to drop me a PM if you want some more input - this stuff is my day job :)
cliffski
05-28-2009, 05:32 AM
I'll PM you in 2023 when I've finally got the game to behave in a deterministic fashion :D
Separating GUI from Simulation randoms was easy. I have other, more structural issues. For example, the order of code is thus:
Ship A moves. Ship A fires at ship B ship B takes damage
Ship B moves Ship B fires back...
(note this is a real-time simulation, not turn based, this is *within* a single frame or process tick.)
All dandy, but if you send your fleet to your buddy, your fleet is no longer the first fleet, but the second, and the order ships get processed in will thus change.
Clearly I could force the challenging fleet to always be Fleet 'B', but when its spanked by fleet A, and fleet A gets sent to the maker of fleet B, he *might* find that fleet B defeats fleet A now he has switched roles.
This is all a bit anal perhaps, but I just phear claiming deterministic outcomes when it's a real time simulation.
I'm considering re-designing the internal ship simulation stuff to be a more 'wego' system to account for all this. Whether or not I do it depends how many circles of hell it would seem to involve.
rezaf
05-28-2009, 06:14 AM
Well, all that seems to be missing is for each ship to have its own initiative value by which when it fires is determined. Problem solved.
_____
rezaf
Morberis
05-28-2009, 07:08 AM
This is fantastic advice. You should also strongly consider implementing Facebook Connect (http://developers.facebook.com/connect.php), which will allow the game to plug into each player's social network so they can easily find their friends, challenge them and so on. You can also do cool stuff like post notifications about game outcomes back into the player's Facebook stream, where all their friends will see it.
The way you handle the community/online side of things is going to be the biggest determinant of this game's success or failure, I promise you. Feel free to drop me a PM if you want some more input - this stuff is my day job :)
Holy hell yes, that would be awesome.
Wader
05-28-2009, 07:19 AM
Well, all that seems to be missing is for each ship to have its own initiative value by which when it fires is determined. Problem solved.
_____
rezaf
Or simply tell the players its happening, and that one player is the designated attacker, and the other defender. You could even let them pick which they want to be, and let that choice determine the fire first order. And potential other things as well.
Damien Neil
05-28-2009, 12:22 PM
All dandy, but if you send your fleet to your buddy, your fleet is no longer the first fleet, but the second, and the order ships get processed in will thus change.
Clearly I could force the challenging fleet to always be Fleet 'B', but when its spanked by fleet A, and fleet A gets sent to the maker of fleet B, he *might* find that fleet B defeats fleet A now he has switched roles.
Are there any random factors at all? Random chances of weapons hitting, random scatter of projectiles, random damage amounts? If so, which fleet moves first is probably going to be the least of the factors determining who wins.
roBurky
05-28-2009, 12:32 PM
Couldn't you make which fleet goes first dependent on some attribute of the fleet? So fastest ship goes first, or most expensive ship goes first, or something.
Quitch
05-28-2009, 12:47 PM
If post-launch it seems obvious that people primarily play the game for the challenge aspect rather than vs AI, I can always patch it and expand on it. I'm hoping to make a game with some decent shelf life
That sounds like a contradiction to me, and I say that as a single-player gamer.
PS That video has me totally stoked for this game.
cliffski
05-28-2009, 04:25 PM
Are there any random factors at all? Random chances of weapons hitting, random scatter of projectiles, random damage amounts? If so, which fleet moves first is probably going to be the least of the factors determining who wins.
There are all of these things, although they are now seperate from the gui fluff, so its a lot closer to being deterministic. In fact, tests I run now with matched fleets show pretty close results, so I think it is fair to say that the 'who-shoots' first problem is minor compared to the compound effect of a few lucky shots happening to take out shields of an enemy and tip the balance.
BTW, all the videos look a bit crap in comparison to how it looks at proper resolution with all the latest improvements and fixes.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.