Page 1 of 2
Designing a combat system
Posted: Sun Jan 17, 2010 4:17 pm
by OldRod
I'm ready to start working on a combat system for my PBBG and I'm needing some advice on how to get it set up.
I plan on PvE combat, and there will be some creatures that require more than one person to kill, so I need the ability to have more than one person attack a creature.
I also want PvP combat between the two factions, but I have concerns about that:
1 - how do you handle people who are AFK and get attacked?
2 - how do you handle people who close their browser to keep from getting killed?
My thoughts on #1 are to have certain areas that are PvP-free (like inside cities, or inside certain buildings). Outside of those areas, if you go AFK you are open to be attacked/killed.
#2 - I'm not sure how to handle yet. Anyone got any ideas?
Does anyone know of a game with a combat system similar to this that I could look at?
Re: Designing a combat system
Posted: Sun Jan 17, 2010 4:28 pm
by Last Known Hero
#1 usually has a safe zone or designated area. numver 2 can be avoided by maybe a 15 second logout time where the character will remain logged in until the time is up.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 4:51 pm
by Jackolantern
For a browser-based game where combat is basically turn-based, it would take a lot more than 15 seconds. It would probably be an unreasonable and unusable amount of time that you would have to make logout require to keep people from closing their browser to avoid being killed.
Honestly, if your game values PvP combat in the design, you will likely just have to make every person who logged out during combat die. Since it is browser-based, disconnections are basically a non-issue, and browser-freezes will be almost unheard of. These are the two issues that make it very hard to balance fairness to the attacker vs. fairness to the attacked in client-based MMOs.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 5:23 pm
by Cayle
Both can be handled by using
mob mode. Have the AI shadow the player character, but not actually issue commands (or ignore them if the player is connected). If the player goes afk (zero activity timeout, or some afk switch), then allow the AI to take over. If the player disconnects, do the same. This means that if the player disconnects, his character is still in play.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 5:41 pm
by OldRod
Cayle wrote:Both can be handled by using
mob mode. Have the AI shadow the player character, but not actually issue commands (or ignore them if the player is connected). If the player goes afk (zero activity timeout, or some afk switch), then allow the AI to take over. If the player disconnects, do the same. This means that if the player disconnects, his character is still in play.
I'm working on a text-based browser rpg... that sounds a little advanced for that? Or am I not understanding it?
Re: Designing a combat system
Posted: Sun Jan 17, 2010 6:55 pm
by OldRod
One thing I'm stuck trying to understand - is there a way to tell someone they are under attack (by a player or a monster, either one) without them doing a page refresh?
I haven't looked at crons yet, would a cron be able to do that?
Re: Designing a combat system
Posted: Sun Jan 17, 2010 6:56 pm
by Jackolantern
I believe that pretty much the only time you will get a "disconnection" during a browser-based MMO during combat is if the player logs out to avoid being killed. You aren't having to hold a constant hot connection due to the stop and go connection of the browser. Technically, after every server request, the player is disconnected with no problem. If they close their browser, they should just be allowed to die. Today's browsers almost never freeze-up.
EDIT:
OldRod wrote:One thing I'm stuck trying to understand - is there a way to tell someone they are under attack (by a player or a monster, either one) without them doing a page refresh?
I haven't looked at crons yet, would a cron be able to do that?
I think most browser-based MMOs handle PvP quite differently than other MMOs for that reason. I believe Halls was planning to make a video about it if he has not already.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 8:38 pm
by hallsofvallhalla
correct. In order to have a nice pvp in a server side browser game you must completely forget about client based mmos. The safest and easiest route is the non direct combat. A player can attack anyone they choose and its their attack against the defenders defense. Regardless if they are logged in or not. You then have a field called last attacked by and a events system where the defending player can see who attacked them last or who attacked them since last login or action. They can then choose to attack the player back in the same manner. Real time combat would be insane for a server side browser game and not recommended.
As far as player vs creature cheating like closing the browser instead of trying to run away, you can subract 100 x level from experience when the encounter starts. Make a note on the page that tells the player, if you close the browser or do not properly leave this battle you will lose X amount of exp. When the player defeats the creature add exp from killing creature plus the 110 x level back to the player.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 8:56 pm
by Cayle
The mob mode solution I put forth would work regardless of the UI technology. There is an ongoing thread on the Planeshift forums, discussing what Planeshift would have been like had it been a 2D world. A couple of devs mentioned that originally was. It was a nearly completed 2D world before being converted to 3D and there are a lot of ruleset quirks that are a direct result of this. Also, EQ1 was more or less a text diku with the text interface replaced by a 3D one. In fact, aggro was invented on MUDS because, having a nodal coordinate system, they needed a way for a mob in a room with two characters to choose which one to attack; hence aggro.
Jackolantern wrote:
OldRod wrote:One thing I'm stuck trying to understand - is there a way to tell someone they are under attack (by a player or a monster, either one) without them doing a page refresh?
I haven't looked at crons yet, would a cron be able to do that?
I think most browser-based MMOs handle PvP quite differently than other MMOs for that reason. I believe Halls was planning to make a video about it if he has not already.
I never played with Ajax, but I do believe that it is the solution to your asychronous needs in this case.
Re: Designing a combat system
Posted: Sun Jan 17, 2010 8:58 pm
by OldRod
Good ideas, Halls... but (you knew there had to be a 'but' coming, right?

)
1 - PvP: Since this game has travel - when you logged in and saw "X" had attacked you, he might be on the other side of the world by then, so retaliating would be difficult. I guess if there was no consequence to being killed (no item/money loss, and no experience loss) it might not be so bad to do it that way, but you'd log in to a corpse that you'd have to deal with
2 - PvE: my game has no experience, it's fully skill-based. So that method wouldn't work, but I see what you are saying - make some penalty once combat starts that is removed when combat concludes... interesting idea. I'll have to give that some thought.
Since the first post, I've been giving this some thought, and based on what others have posted, here's what I have come up with so far.
PvP: The only time you see other players is when you are in the same location as they are, and you are both active ('active' means you have done a page refresh/load in the last 15 minutes). If you AFK longer than 15 minutes, you no longer show as active and aren't listed as being in a location. If you close your browser without logging out, or go AFK, and you are within your 15 minute activity window, you are fair game to be attacked by the opposite faction. If you want to be safe after you logout, I could make the logout button do a "camp" procedure. This button logs you out of the world relatively safely, so you are only vulnerable for 10-15 seconds, instead of 15 minutes. But you can't log back in for 15 minutes, to prevent getting out of combat easily and logging right back in. Once you're attacked, combat runs until one of you is dead, or the attacker flees. Is there any way to let the victim flee? Maybe have an AI routine try to let them escape at near-death?
PvE: Since you are initiating combat, turn-based is much easier, but I still have the problem of multiple people fighting the same creature. Not sure how to handle that yet.