Up to Main Index Up to Journal for December, 2019 JOURNAL FOR MONDAY 23RD DECEMBER, 2019 ______________________________________________________________________________ SUBJECT: Feeling healthy? DATE: Mon 23 Dec 18:54:53 GMT 2019 I've started work on all of the things needed to introduce combat to WolfMUD. Well sort of. I've had to do some work cleaning up the prompt handling for players first so that I can add some basic stats to the prompt. Examples of a brief (current default), short and long prompt: >/prompt short Prompt set to short. H:25/30>/prompt long Prompt set to long. Health: 25/30 > I've used the backslash '/' prefix for out of band player commands. The hash '#' prefix is reserved for admin commands and the dollar sign '$' prefix is reserved for scripting commands. For testing I've edited my player file directly to add a health attribute, which looks like this: Health: MAX=30 CURRENT=25 I'll need to fix up existing player files to add the new attribute to all players. Do I inspect the player file when it is loaded or introduce a separate 'upgrade' command that processes all files up front? I've modified the recordjar decoder and encoder so that they understand signed integer values. This is so that we can have stat modifiers. For example a ring of health that increases the wearer's maximum health by 5 points and a potion of healing that increases the drinker's current health (up to the maximum) by 15 points: Name: a ring Alias: +COPPER:RING Health: MAX=+5 Description: This is a small finger ring made of copper. %% Name: a glass vial Alias: +GLASS:VIAL Health: CURRENT=+15 Description: This is a small glass vial filled with a faintly pink liquid. Of course I can't test the items as players can't wear items or drink yet :( I'm not sure yet how I want to implement stat regeneration. My first thought was to add a player pulse Go routine that fired every so often. This was how it was implemented in the Java version using a pulse thread per player and mobile. I'd rather not add another Go routine per player if I can help it. Although using the current events package would make handling health, mana, hunger, thirst, spell durations and the like very, very simple. I could hook into the existing player Go routine for network communication. It already has a timeout for detecting idle connections. I could shorten the timeout then if we have x consecutive timeouts (based on the configuration setting Server.IdleTimeout still) the connection is idle, but now after each timeout we could trigger the player's pulse handling code⦠As everything is up in the air and a bit broken at the moment I've not committed any changes to the public dev branch yet :( -- Diddymus Up to Main Index Up to Journal for December, 2019