Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Hogwash
Newbie


Joined: 09 Jun 2020
Posts: 2

PostPosted: Tue Jun 09, 2020 4:32 pm   

Advice on scripting strategy
 
Hi,
I'm not a trained coder, but I can manage logic from excel use etc. I'm looking for some advice if I'm on the right track.

I want to work out an NPC's hp when the only info I am given is a damage message that corresponds to a range.
I think I can do it via multiple sampling (ie killing things a lot)

I thought I could do this by:
Trigger on damage message creates an upper and lower damage variable
Repeat summing in the variables
Trigger on death and write the variables to a database
Refine the database over time with a formula field

Before I spend ages trying to write this, can any gurus see a problem?
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Tue Jun 09, 2020 5:01 pm   
 
I know your frustration. I don't think it is possible to gauge such a thing accurately. I tried on a mud. Naked and in combat; slowly killed same mobs and applied buffs and eq but the results varied up and down throughout. Unless you can cajole the bod in charge to cough up base/average damage stats all you can do is guess and that may not be accurate enough to stop you getting walloped.
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Tue Jun 09, 2020 10:16 pm   
 
Just curious but what damage messages are you getting for the NPC's health?

I had done something on a mud that more or less had the same issue... It wasn't perfect but worked well enough for my needs.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Wed Jun 10, 2020 12:56 pm   
 
Assuming you get regular prompts showing you your current HP, this should not be TOO hard.

Code:
#TR {HP: (%d)/(%d)} {
  $newHp=%1
  $hpChange=(@hpCurrent-$newHP)
  #IF ($hpChange>0) {#RAISE onTookDamage $hpChange}
  hpCurrent=%1
  }

#TR {Some damage message} {
  lastDamage=%line //or some unique keyword for the dbVar
  $this=%db(@damageTable, @lastDamage)
  $low=%db($this, "Low")
  $high=%db($this, "High")
  #SAYADD { -- took from $low to $high}
  }

#EVENT onTookDamage {
  $damage=%1
  $key=@lastDamage
  $this=%db(@damageTable, $key)
  #IF (($damage<%db($this, Low)) OR (%db($this, Low)=%null)) {#ADDKEY $this Low $damage}
  #IF (($damage>%db($this, High)) OR (%db($this, High)=%null)) {#ADDKEY $this High $damage}
  #ADDKEY damageTable $key $this
  }
_________________
Discord: Shalimarwildcat
Reply with quote
Hogwash
Newbie


Joined: 09 Jun 2020
Posts: 2

PostPosted: Wed Jun 10, 2020 3:55 pm   
 
Thanks for replies.

@hpoonis 2010 Unless the NPC has dynamic hp the stats will work out eventually. How many samples you need, I can't say because I don't know the damage range compared to the hp. However, given that a lot of MUDS were based off Dungeons and Dragons in some way, dynamic hp based on level x d8 is not a silly thought. In any case, I will find out :)

@chaossdragon The messages are for how damaging the attack is. I believe they are correct after modification for armour and they are not dynamic. So "smashed" always means 10-19 damage, "mangled" always means 20-29 etc.

@shalimar I do get hp at prompt for my character, but that isn't what I want to collect. I just want to collect the upper and lower potential damage ranges done every round until the beasty dies. But thanks for the code! I will take it away and try to work it out.
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Wed Jun 10, 2020 10:42 pm   
 
Ah... then I completely mis-understood what you wanted. :)
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Wed Jul 15, 2020 12:18 pm   
 
Aardmud offers a health% for mobs when in combat. Thus it is easy there to see the health of the opponent.

As for skill/spell damage, as levelling up occurs newer/higher level spells and skills become available, as in every MUD. If you offer your d8 constant v level then all well and good. However, aardwolf may not be using 1d8 or 1dx. Spells and skill affects/damage are also influenced by one or more primary variables (con,str,dex,int,wis) and one more more secondary variables (str,con,dex,int,wis,luck, character tier). Using gmcp data for character stats, figures for the regular stats (str, dex, etc) are available. The character tier can also be gained via a simple gmcp function call.

Obtaining the level at which a skill becomes available is also simple as aard has commands to display all the skills and spells available to a character class. I populate a simple key pair variable with the spell or skill name and the level it becomes available for use, and suffixed each skill or spell (short) name with a _lvl suffix. Thus each skill and spell has three variables: a name, a level, and a damage formula.

Thus I was using the simplest of formulae for each spell.skill:
EG.

Black root
black_tot=(str*pri_stat)+(con*pri_stat)+(luck*sec_stat)+(lvl_stat*skill_lvl)

and I gave pri_stat, sec_stat and lvl_stat simple values of 1, 0.25, and 100.

Oddly, there are two 'bash' skills at level 1 that use the same stats (primary = str and dex, secondary = luck). Thus these two skills would have the same damage totals using my formula. This is, of course, not true in terms of actual damage done. One does more damage than the other and therefore the 'base damage' or 'average damage' cannot be the same.


So without knowing what effect these others have on a skill or spell or, primarily, what the base or average damage figure may be for each spell/skill, everything is just guesswork.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net