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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Fri Aug 19, 2005 4:44 pm   

Fight Evaluator script
 
Ok, I wrote a script to "evaluate" fights a while back for Aardwolf. Tracks damage dealt by yourself and one groupie, and does comparisons. The script is not particuarly well written, but it's way too big to rewrite.. however, it's a VERY big drain on zMUD if you don't have enough RAM. I've done what I could to tweak the useage down, and have somewhat, but the problem remains that to make the script work, I need between 15-50 triggers (for EACH of 8 sections) similar to this:

Code:
#action {^Your acidic bite (*) ~[(%d)~]} {#if {%2 = 0} {} {
  #ad totalhits 1
  #ad totaldamage %2
  }}


Where it says "acidic bite" it can be either 1 word, or two. I've tried many variations of 1-2 simplified triggers here (in place of 40+ for that section of the script), to and several I got to work for a few seconds, but they always wind up crashing zMUD.

The basics of the single trigger are simple. Capture the damage type (in this case, acidic bite), check it against a string list of possible damage types, and if it matches, run the above #if result. If it doesn't, no action.

Is the problem simply that zMUD can't handle the load? Running the check (during fights) 3-10 times per 4 seconds against an 86 item string list is just overwhelming zMUD? Or was there a likely flaw in my code?

Having gone through dozens of different types of triggers, I won't post any of the failed codes here.. if anyone feels they can make this trigger work better tho, here is a sample variable to check against:
Code:
#var damtypes {slice|stab|slash|whip|claw|blast|pound|crush|grep|bite|pierce|suction|beating|digestion|charge|slap|punch|wrath|divine power|cleave|scratch|peck|chop|sting|smash|shocking bite|flaming bite|freezing bite|acidic bite|chomp|drain|thrust|slime|shock|thwack|flame|chill|mental energy|mind force|decaying touch|friction|earth|air}


That's incomplete (I couldn't find the most recent one) but accurate.

A copy of the complete script can be had at:
http://www.freewebs.com/atreidess1/Fight_Evaluator_2.41.rar

Thanks a lot if anyone can help with this!

PS: Some of the really advanced functions of zMUD, I've noticed, seem to take a few seconds to operate ... in an average fight, this script's can activate (depending on level and char power) anywhere from 20-150 times in a 10-60 second fight.. I don't care if the script is always a few seconds behind, but if it lags 3 seconds on each trigger, and the lag is cumulative, after a few hours it could be days behind :P
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri Aug 19, 2005 7:16 pm   
 
Perhaps its just me but =) I cant help poking my head in on this one.

One way to simplify the script (and speed it up alot) would be to ditch the list check. Just assume you want all stats and sort out the ones you want/ dont want at a later time when your done. Something like the below. At the end you will end up with a variable for each @DamType done and a running average if you like can be added.

#TRIGGER {^Your (@DamType) * ~[(%d)~]} {#add %1 %2}
etc...
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Aug 19, 2005 8:00 pm   
 
Mael, what Atreides failed to mention is that he wanted all damtypes covered because he distributes the code.
Also, the damtypes are both weapons and spells.
So, editing out those that he don't want don't work because what he likes, i don't and vice versa.
_________________
http://www.Aardwolf.com
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Aug 19, 2005 9:00 pm   
 
Use the string list directly in the trigger pattern.
#action {^Your {@damtypes} (*) ~[(%d)~]} {#if {%2 = 0} {} {
#ad totalhits 1
#ad totaldamage %2
}}

Possibly you might get a little more speed by splitting the dam types into a few variable and using more triggers; but start with this one, since it covers verification of the damage type sooner then using an %ismemeber check would.

If you supply a goodly number of actual combat lines we might be able to suggest ways to refine the trigger to eliminate that *, and gain just a little more speed. Beyond that there isn't much speed to be gain from the script you presented. I have done general combat trackers before, and had no problems with speed, the main thing to do it is to put processor heavy items in a position such that they are done while no new inputs will occur.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sat Aug 20, 2005 2:13 am   
 
The script covers multiple sections for combat... backstab is easy (just a cpl of triggers)... for melee, it can look like:

Your cleave <-:-><-:-*-:-><-*-> SUPERNOVAS <-*-><-:-*-:-><-:-> A Sunrise warrior! [581]
Your earth <-=-><-:-*-:-><*--*> METEORITES <*--*><-:-*-:-><-=-> A Sunrise warrior! [550]
Your cleave does UNSPEAKABLE things to A Sunrise archer! [601]

Spells can look like:
Your life draining touch <->*<=> WASTES <=>*<-> A Sunrise archer! [220]
Your miasma of pain does UNTHINKABLE things to A Sunrise archer! [823]


I did try the damtype list directly in the trigger before I ever moved to more complex triggers... but that was a LONG time ago (a few versions of zMUD, and countless versions of this script)... at the time it did not work...

I just tried it again, both as:
Your @damtypes and Your (@damtypes)

neither recognized the string

I then tested it a bit further. I tried using Cleave and Earth damtype weapons, and tested it 2 more ways.

Code:
#var damtypes {cleave}
#var damtypes {cleave|earth}


The first one DID work... with just the one entry in the variable. The second one did not work. This does make it possible to create a system that would be less useage-intensive (2 triggers with changeable variables, changed each time I change weapons). However, that 2 turns into more like 10-15 after all sections of the script are factored in, and that becomes a lot of work since damtypes and spells get changed reguarly.

I'd still like to find a system that will always work without requiring routine updates...
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Aug 20, 2005 10:29 am   
 
Are you set to display "damage 1"?

way less system hungry on my script with it set to 1.

I still use:
Your (*) ({@damages}) (*)~! ~[(%d)~]$
(*)'s (*) ({@damages}) (*){~!|.} ~[(%d)~]$
(*)' (*) ({@damages}) (*){~!|.} ~[(%d)~]$

hadda add ~'s to the variable:

misses|tickles|bruises|scratches|grazes|nicks|scars|hits|injures|wounds|mauls|maims|mangles|mars|LACERATES|DECIMATES|DEVASTATES|ERADICATES|OBLITERATES|EXTIRPATES|INCINERATES|MUTILATES|DISEMBOWELS|MASSACRES|DISMEMBERS|RENDS|- BLASTS -|-= DEMOLISHES =-|** SHREDS **|**** DESTROYS ****|***** PULVERIZES *****|-=- VAPORIZES -=-|~<-==-~> ATOMIZES ~<-==-~>|~<-:-~> ASPHYXIATES ~<-:-~>|~<-*-~> RAVAGES ~<-*-~>|~<~>*~<~> FISSURES ~<~>*~<~>|~<*~>~<*~> LIQUIDATES ~<*~>~<*~>|~<*~>~<*~>~<*~> EVAPORATES ~<*~>~<*~>~<*~>|~<-=-~> SUNDERS ~<-=-~>|~<=-=~>~<=-=~> TEARS INTO ~<=-=~>~<=-=~>|~<-~>*~<=~> WASTES ~<=~>*~<-~>|~<-+-~>~<-*-~> CREMATES ~<-*-~>~<-+-~>|~<*~>~<*~>~<*~>~<*~> ANNIHILATES ~<*~>~<*~>~<*~>~<*~>|~<--*--~>~<--*--~> IMPLODES ~<--*--~>~<--*--~>|~<-~>~<-=-~>~<-~> EXTERMINATES ~<-~>~<-=-~>~<-~>|~<-==-~>~<-==-~> SHATTERS ~<-==-~>~<-==-~>|~<*~>~<-:-~>~<*~> SLAUGHTERS ~<*~>~<-:-~>~<*~>|~<-*-~>~<-~>~<-*-~> RUPTURES ~<-*-~>~<-~>~<-*-~>|~<-*-~>~<*~>~<-*-~> NUKES ~<-*-~>~<*~>~<-*-~>|-~<~[=-+-=~]~<:::~<~>:::~> GLACIATES ~<:::~<~>:::~>~[=-+-=~]~>-|~<-=-~>~<-:-*-:-~>~<*--*~> METEORITES ~<*--*~>~<-:-*-:-~>~<-=-~>|~<-:-~>~<-:-*-:-~>~<-*-~> SUPERNOVAS ~<-*-~>~<-:-*-:-~>~<-:-~>|does UNSPEAKABLE things to|does UNTHINKABLE things to|does UNIMAGINABLE things to|does UNBELIEVABLE things to|pimpslaps

man that's an unrurly variable.

P.S. I didnt have to add the ~ tildes till sometime after 7.05, not sure which broke it.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sat Aug 20, 2005 1:06 pm   
 
Private, he's tracking Damage types, not damage msgs ;-)
Now go update yer sons picture archive ;-P
_________________
http://www.Aardwolf.com
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sat Aug 20, 2005 3:45 pm   
 
Well, Private didn't answer my original question, but I thought his comments might at least still help... so I tried it. I couldn't get it to work, but I didn't try very long because the second I set it up, my zMUD started moving at about 1/3rd of it's prior speed :P Appreciate the help private, and maybe I just messed something up, but that seemed to slow me down massively...
Reply with quote
Ikyu
Beginner


Joined: 27 Feb 2005
Posts: 24

PostPosted: Sat Aug 20, 2005 5:54 pm   
 
wouldn't this work for totalhits and damage?
I know it has a * in it, but i am not experiencing any real lag with it.

Code:
#TRIGGER {^Your * ~[(%d)~]$} {#ADD totalhits 1;#ADD totaldamage %1}
#TRIGGER {^~[(%d)~] Your * ~[(%d)~]$} {#ADD totalhits %1;#ADD totaldamage %2}
Reply with quote
Ikyu
Beginner


Joined: 27 Feb 2005
Posts: 24

PostPosted: Sat Aug 20, 2005 6:01 pm   
 
Ikyu wrote:
wouldn't this work for totalhits and damage?
I know it has a * in it, but i am not experiencing any real lag with it.

Code:
#TRIGGER {^Your * ~[(%d)~]$} {#ADD totalhits 1;#ADD totaldamage %1}
#TRIGGER {^~[(%d)~] Your * ~[(%d)~]$} {#ADD totalhits %1;#ADD totaldamage %2}


ok after talking atreidess i realized this isn't gonna work.
The idea was to split weapon and spell damage.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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