Showing posts with label brawler. Show all posts
Showing posts with label brawler. Show all posts

Monday, November 7, 2011

Coding Quandary for Brawler Scores

One of the principal challenges in establishing this new brawler scoreboard was establishing the framework for it.  The scoreboard, in the simplest sense, made of a string of individual brawlers and their scores.  As such, it would make sense to attach this information to each brawler's pfile (which is where their stats, equipment, description, et cetera are stored) since brawler scores are just another stat.  At the same time though, pfiles are loaded into the game dynamically--if a character isn't logged in, all of the information stored in his pfile (stats, equipment, description, et cetera) are totally unknown to the game.

Think about it.  Are there any commands that let you get information from another character who isn't logged in?  The only example of this that comes to mind reading notes posted by characters who aren't logged in; this is possible because notes are stored in a fashion similar to areas--they are saved to their own special file that is read in when the game starts up, and then the list of notes just floats in the game's permanent memory forever.  As new notes are posted, they also go into permanent memory, and they are saved to the special note file so that they can be reloaded after the next reboot.

Notes are static though;  once they're up, they really never need to be changed.  Brawler stats, on the other hand, will constantly be changing as people claim victory over each other.  Although these changes will only happen when brawlers are logged in to fight each other, what do we do with their scores when those brawlers log out?  They still need to be accessible by everyone on the scoreboard, and they need to be able to be reloaded after reboots.

This question highlights one of the principal design decisions I had to make in deciding how to actually implement this brawler scoreboard.  On the one hand, brawler scores need to be stored permanently like notes are, but on the other hand, they are fundamentally a stat that is attached to one and only one character.  Furthermore, we may need to be able to modify brawler scores even if the brawlers aren't logged in (e.g., in case of wimpouts or losses that need to be verified by imms).  How can these conflicting ideas be reconciled?  Here are the two options that I first considered:

  1. Store brawler scores in permanent memory, but have players "download" them to their character when they log in and "upload" their new scores when they log out
  2. Store brawler scores in permanent memory AND on the pfile, then keep track of which set of scores (the ones in permanent memory or the ones on the pfile) were updated most recently and use those
Unfortunately, both of these options raise problems with consistency.  Because information gets stored in two places in both cases, it becomes easy to envision a scenario where the information in one place doesn't get updated in the other place and suddenly one brawler has two different sets of scores.  This isn't an issue in 100% bug-free code, but the fact is that the system is not robust; if I (or a future coder) needs to modify the brawler code a few years down the road, we have to remember to make sure that both sets of scores need to be manually synced up or else problems arise.

A better option (and what I wound up doing) is to store brawler stats in permanent memory, and instead of worry about uploading/downloading/syncing those numbers against a pfile when it is loaded, just "attach" each player's brawler score info (still in permanent memory) to the pfile when the character logs in.  When the character logs out, the attachment breaks, but the brawler record is still floating in the permanent memory.

While we still have to make sure that brawler scores are properly attached to characters when they're logged in, this is far less flaky of a process than ensuring data is consistent across two places since it's trivial to perform the attachment.  So, in addition to checking for attachment when a character logs in, we can check for attachment at other critical points in the code such as when a brawler gets thrown out of brawler or scores another kill.

Speaking of getting thrown out of brawler, the reason why I bring this all up is because Stage 2 will include a new "leavebrawler" command that players can use to voluntarily quit.  However, quitting Brawler will also ban you from re-joining it for thirty real-life days.  Because we store brawler scores in permanent memory rather than on the pfile, this ban has the unintentional (but fortuitous) effect of persisting across recreates.  Even though a player may have deleted and re-created his character, that character's brawler record is stored in permanent memory and cannot be deleted by the player.

This might sound a bit trivial ("It'll take 30 days to level back up to 50 anyway!"), but a more powerful result of this is that immortals will have the ability to ban characters from brawler for life (such as may be necessary if they are caught abusing brawler perks).  Recreating won't circumvent that ban, which imposes an interesting incentive for players to not try to get cheap healing in a real fight by cheating the system.  A ban from brawler will truly be a ban for life.

Friday, November 4, 2011

Brawler Scoreboard Stage 2

We're moving forward with implementing the next stage of our new Brawler system, and based on our original ideas and some suggestions and observations from Stage 1, I think we're looking at rolling out features some fun new features.

A major component that we're currently lacking is the ability for the game to know that a particular fight is a brawl as it's happening; right now, brawls only become brawls when the victory command is used. To address this best, we're planning to add a command that will act as an "opening move" to initiate a brawl called "clobber."

We envision this clobber command functioning like backstab, where one Brawler uses it to tag another Brawler, and thereafter, both combatants are identified as brawling each other.  This establishes a nice framework where we can implement some features exclusive to brawls to make it easier, safer, and cheaper to learn PK as a brawler.

One of the significant (and controversial) features we'd like to include immediately is ultra-low-cost healing for brawls.  This has the benefit of letting people get up and running in PK without having to grind for gold, and really turns brawling into its own minigame within Dark Risings.  However, there are a lot of potential issues here:

PROS:
  1. no grinding for gold if you just want to pk for fun
  2. potentially attracts new players who may start out just looking for a good PK mud (but get sucked into RP in search for a vamp, etc)
  3. cements in PK as a distinct minigame within Dark Risings
CONS:
  1. less of a need for pure-PK players to actually play the game since they don't need to worry about collecting gold
  2. LOTS of potential for abuse if not coded properly
I think the pros are self-evident, but let's look at the cons a little more closely.

1. Less of a Need for Pure-PK Players to Actually Play the Game

"and stay IC" should be tacked on to the end of this con, and it's one of the bigger reservations I have.  Catering to PK-only players draws in a bigger pbase, and as long as they aren't disruptive to the rest of the game, I don't really mind.   However, I like to think that the process of getting money can often involve RP (e.g., collecting people to go kill mobs for equipment), and if we obviate the need for pure-PK players to get gold, it's easy to envision them having no reason to bother trying to roleplay at all.

Realistically though, gold farming has become the norm these days, and there's really no RP involved in that process anyway.  So I guess the damage has already been done, and giving Brawlers cheap healing won't cause too much more trouble.  It's just that the nightmare scenario for me is having a game full of players used to pure-PK MUDs who log in and are totally OOC in says, tells, over the brawler channel, etc, and generally degrade the quality of the game.  I absolutely do not want this, and I hope catering to PKers in this way won't effect that.

2. LOTS of Potential for Abuse

Of course, this is the most immediately problematic, because there are a number of ways this healing discount can be abused.  Here are a few scenarios.

  1. An Inferno named Jane jumps Bob the Brawler who has a contract on his head.  The Bob the Brawler just initiates a brawl against Jane so that Brawler rules (and cheap healing) are in effect and Jane can no longer loot on KO, etc.
  2. In a real PK, player Bob is getting attacked by player Jane.  He has a buddy, Harry, initiate a brawl against him so that Bob gets discounted healing since the game thinks he's brawling Harry when in fact he's fighting for his life against Jane.
  3. The opposite happens, and Bob initiates a brawl to get discounted healing, then jumps Jane.
Unfortunately, I really only see two solutions to these sorts of abuses.  The first one, which perhaps is what many players would immediately think, is to have an immortal arbitrate cases of abuse like this, and have stiff punishments for people who do this sort of thing.  This is a possibility, but we don't really have the staffing manpower to be micromanaging brawls and this is not really a good solution.

The second solution is to make it so that this "clobber" command to start a brawl can only be used when both participants are not in PK fightlag.  This solves the issues of people initiating brawls mid-fight to abuse the perks of brawling, but it also means that if you forget to make your initial tag with clobber, you have to flee safe before you can correct the issue and re-tag to initiate the brawl.  In practice, I suspect this might get annoying.

Another idea would be to create the opposite command of "clobber" and have it be something like "nobrawl."  If Jane wants to jump Bob for real, she can issue the "nobrawl" command on him after tagging him to lock Bob (and Jane) out of initiating brawls until they leave fightlag.  This is getting a bit complicated though, as Jane would have to remember to keep issuing nobrawl throughout the fight in case Bob momentarily got out of fightlag.  It also all operates under the assumption that Bob is definitely going to cheat to get out of getting KO'ed by Jane, which should be a pretty remote possibility to begin with.  Throwing a ton of complicated code at such a narrow problem is not something I like doing.

At any rate, for stage 2, the only brawler perk we're looking to put in would be this discounted healing. However, we might also consider features such as...
  • people flagged as being in brawls never leave fightlag (this was suggested a few times)
  • people flagged as being in brawls cannot be looted (by either anyone, or their brawling opponent) once they are KO'ed
  • announcements over the Brawler channel that Bob and Jane have begun brawling
For right now though, just figuring out how to prevent people from spuriously declaring brawls mid-fight to get out of a real PK is challenging enough.  Tying it to fight lag is tricky because there may be times when brawlers get out of fightlag but aren't actually done fighting (running to heal, running for a trap, etc), but we're not quite ready to force brawlers to remain in fightlag until someone gets KO'ed.

Comments, ideas, or suggestions are welcome.  Since this post won't fit into a note in the game, it's probably best to leave replies (anonymously or otherwise) as comments to the blog here.

Sunday, October 23, 2011

Brawler Scoreboard Update

I've been working on getting this Brawler scoreboard system up and running, and at the present pace, it seems like we're going to likely implement this in stages.  Right now the basics are working, but Team Admin(tm) will probably have to decide how to pretty it all up before we can roll out this first stage.

Right now, the general process is that you knock out another Brawler and use the "victory" command on their unconscious body (much like murder or loot) which registers the victory.  To the loser, the process would look something like this:


Parviane utters the words, 'xahzf barh'.
Parviane sends a blast of water at you.
Parviane's blast of water <*>_MORTALLY WOUNDS_<*> you!
You are unconscious.


1<1729> 1012<1012> 394<394> <0g 5s> <NEW:FIGHTLAG>


Parviane has claimed victory over you!

These victories get added to a global scoreboard which can be accessed via some command (currently called "scoreboard," but this is just a work-in-progress name...it's apt to change).  The current rough draft of the scoreboard then looks like this:

        Name         Wins       Losses     Wimpouts      K/D     K/D*
   Muristang         1(1)         5(2)         0(0)    0.200    0.500
    Parviane         5(2)         0(0)         0(0)    5.000    2.000
   Suqlaheru         1(1)         2(2)         0(0)    0.500    0.500

The statistics presented are pretty straightforward; the reason there are two numbers under wins/losses/wimpouts is because the game will keep track of unique wins/losses/wimpouts in addition to overall total.  So, in the above example, Parviane beat Muristang four times and Suqlaheru once.  This is a total of five wins, but since they were against only two people, there are only two unique wins registered...hence the 5(2) under the Wins column.  This should help make obvious cases where one person is racking up a lot of wins by fighting the same opponent.

The K/D and K/D* columns are the standard kill/deaths ratio and the unique kills/unique deaths ratio, respectively.

Under the hood, this system actually keeps a record of every fight (registered by the "victory" command), so brawlers can access a list of their fights using the tentatively named "brawllist" command.  If Muristang was to use this command, it would look like this:

1729<1729> 1012<1012> 394<394> <0g 5s> <NEW:>
brawllist
[  1]  Oct 23 2011: Loss against Parviane
[  2]  Oct 23 2011: Loss against Suqlaheru
[  3]  Oct 23 2011: Win against Suqlaheru
[  4]  Oct 23 2011: Loss against Parviane
[  5]  Oct 23 2011: Loss against Parviane
[  6]  Oct 23 2011: Loss against Parviane

At present, these records really don't contain a lot of data other than the date of the fight, the two combatants, and the outcome.  However, it does leave the door open to a number of possibilities in the future such as amount of damage done by each side, the duration of the fight, number of times blinded, et cetera.  The system is robust enough to allow for the easy addition of features as we move forward.

Anyway, this is just a preview of the first draft of how the brawler scoreboard system will work.  Nothing is finalized, and a lot of features are missing.  In fact, some core features may still be missing when we decide to roll out the first stage; we haven't discussed whether it'd be better to let you all play with this system live before everything is prim, or to wait until the entire system is done before we release it.  Specifically, the following features are currently wholly absent:
  • any way to sort the scoreboard
  • the entire wimpout reporting system
  • any way for immortals to arbitrate fight outcomes and change the scoreboard
  • monthly cycling of the scoreboard and retention of each month's top scorers
  • automatic monitoring of inactive brawlers
  • any diagnostics for admins to make sure the system behaves itself
However, the framework is complete and it's quite flexible and expandable.  All in all, I'm quite pleased with the progress and am excited to see how it gets used once Stage 1 is out.