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
hpoonis2010
Apprentice


Joined: 18 Jun 2019
Posts: 188

PostPosted: Thu Mar 25, 2021 10:57 am   

Do you like the new threads?
 
So...previous post which referred to processing lag trying to capture data etc. while using @vars in the data trigger patterns.

Eg., #TR grab_statmods {({@statmodlist}) %s ({@statmodlist})} {do stuff}

I switched back to a bunch of messy triggers and SWITCH statements as it was faster to capture the equipment data (identifying).

Given the layout of the equipment, EG., (probably busiest item)
Code:
+-----------------------------------------------------------------+
| Keywords   : armor aardwolf breastplate aardwolfarmor (412417)  |
| Name       : Aardwolf Breastplate of Magic Resistance           |
| Id         : 2317230865                                         |
| Type       : Armor                     Level  :   231           |
| Worth      : 2,000                     Weight :    10           |
| Wearable   : torso                                              |
| Score      : 594                                                |
| Flags      : unique, glow, hum, magic, held, burn-proof, V3,    |
|            : precious                                           |
| Owned By   : Dhalsim                                            |
| Found at   : Immortal Homes                                     |
+-----------------------------------------------------------------+
| Stat Mods  : Luck         : +2       Constitution : +2          |
|              Wisdom       : +2       Dexterity    : +2          |
|              Strength     : +2       Intelligence : +2          |
|              Hit points   : +125     Mana         : +125        |
|              Moves        : +125     Damage roll  : +46         |
|              Hit roll     : +46                                 |
+-----------------------------------------------------------------+
| Resist Mods: Acid         : +100     Air          : +100        |
|              Cold         : +100     Earth        : +100        |
|              Energy       : +100     Fire         : +100        |
|              Holy         : +100     Light        : +100        |
|              Electric     : +100     Mental       : +100        |
|              Negative     : +100     Sonic        : +100        |
|              Shadow       : +100     Water        : +100        |
|              Magic        : +100     All physical : +58         |
+-----------------------------------------------------------------+


...and given that I currently have a bunch of TEMP triggers that end capture for various things and many of them look like #TEMP endblah {+-----} {do stuff},

I was wondering if using threads might speed up the capture to match the mud output but, given that there are a few triggers of similar pattern, running multiple threads is likely to cause triggers to fire at the wrong time, yes?
Reply with quote
shalimar
GURU


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

PostPosted: Fri Mar 26, 2021 2:14 am   
 
Rather then using #TEMP triggers, try adding a new trigger state to handle the cleanup.

As to #THREADS unless they are accessing/setting variable data, there is little to get out of order or to be gained.
Threads are mainly (in my experience) for scripts that might otherwise cause CMUD to hang.
If you put those in a thread, then the rest of the program still runs while it computes.
_________________
Discord: Shalimar#3679
Reply with quote
hpoonis2010
Apprentice


Joined: 18 Jun 2019
Posts: 188

PostPosted: Fri Mar 26, 2021 6:40 am   
 
Thanks.

It is not the 'cleanup' it is the lag between performing string-list lookups and using rigidly defined trigger patterns. I had things like (in the example) 'Stat mods' and Resist Mods' triggering on a

~| Stat Mods%s:%s({@stringlist})%s:%s({@stringlist})

and (to capture the subsequent lines)

~|%s({@stringlist})%s:%s({@stringlist})

pair of trigger patterns but this proves to be too much effort for cmud to keep up with what is sent. A series of 10 identifies had varying success. One-at-a-time (ie., manually fired) had no problems but go to a store and try to auto-list/auto identify and the results varied from 8/10 to as low as 4/10. So, despite having a spiffy Ryzen, I am still limited to 80286-type processing speeds.

I was hoping for a way to get the software to keep up with the data delivery. I don't believe there is a MUD site that has a way to implement deliberate sending delays, and this stuff is not bound to gmcp/etc (as far as I am aware).

It's a shame as this is a more elegant way of doing things. Now I am back to this (working) mess:
Code:
get_item_data/temp_resists=""
#T+ resistmods

#SWITCH (%trim(%1))
    ("Acid") {#ADDKEY get_item_data/temp_resists ACID %2}
    ("Air") {#ADDKEY get_item_data/temp_resists AIR %2}
    ("All magic") {#ADDKEY get_item_data/temp_resists ALLMAG %2}
    ("All physical") {#ADDKEY get_item_data/temp_resists ALLPHY %2}
    ("Bash") {#ADDKEY get_item_data/temp_resists BASH %2}
    ("Cold") {#ADDKEY get_item_data/temp_resists COLD %2}
    ("Disease") {#ADDKEY get_item_data/temp_resists DISEASE %2}
    ("Earth") {#ADDKEY get_item_data/temp_resists EARTH %2}
    ("Electric") {#ADDKEY get_item_data/temp_resists ELECT %2}
    ("Energy") {#ADDKEY get_item_data/temp_resists ENERGY %2}
    ("Fire") {#ADDKEY get_item_data/temp_resists FIRE %2}
    ("Holy") {#ADDKEY get_item_data/temp_resists HOLY %2}
    ("Light") {#ADDKEY get_item_data/temp_resists LIGHT %2}
    ("Magic") {#ADDKEY get_item_data/temp_resists MAGIC %2}
    ("Mental") {#ADDKEY get_item_data/temp_resists MENTAL %2}
    ("Negative") {#ADDKEY get_item_data/temp_resists NEGAT %2}
    ("Pierce") {#ADDKEY get_item_data/temp_resists PIERCE %2}
    ("Poison") {#ADDKEY get_item_data/temp_resists POISON %2}
    ("Shadow") {#ADDKEY get_item_data/temp_resists SHADOW %2}
    ("Slash") {#ADDKEY get_item_data/temp_resists SLASH %2}
    ("Sonic") {#ADDKEY get_item_data/temp_resists SONIC %2}
    ("Water") {#ADDKEY get_item_data/temp_resists WATER %2}

#SWITCH (%trim(%3))
    ("Acid") {#ADDKEY get_item_data/temp_resists ACID %4}
    ("Air") {#ADDKEY get_item_data/temp_resists AIR %4}
    ("All magic") {#ADDKEY get_item_data/temp_resists ALLMAG %4}
    ("All physical") {#ADDKEY get_item_data/temp_resists ALLPHY %4}
    ("Bash") {#ADDKEY get_item_data/temp_resists BASH %4}
    ("Cold") {#ADDKEY get_item_data/temp_resists COLD %4}
    ("Disease") {#ADDKEY get_item_data/temp_resists DISEASE %4}
    ("Earth") {#ADDKEY get_item_data/temp_resists EARTH %4}
    ("Electric") {#ADDKEY get_item_data/temp_resists ELECT %4}
    ("Energy") {#ADDKEY get_item_data/temp_resists ENERGY %4}
    ("Fire") {#ADDKEY get_item_data/temp_resists FIRE %4}
    ("Holy") {#ADDKEY get_item_data/temp_resists HOLY %4}
    ("Light") {#ADDKEY get_item_data/temp_resists LIGHT %4}
    ("Magic") {#ADDKEY get_item_data/temp_resists MAGIC %4}
    ("Mental") {#ADDKEY get_item_data/temp_resists MENTAL %4}
    ("Negative") {#ADDKEY get_item_data/temp_resists NEGAT %4}
    ("Pierce") {#ADDKEY get_item_data/temp_resists PIERCE %4}
    ("Poison") {#ADDKEY get_item_data/temp_resists POISON %4}
    ("Shadow") {#ADDKEY get_item_data/temp_resists SHADOW %4}
    ("Slash") {#ADDKEY get_item_data/temp_resists SLASH %4}
    ("Sonic") {#ADDKEY get_item_data/temp_resists SONIC %4}
    ("Water") {#ADDKEY get_item_data/temp_resists WATER %4}
Reply with quote
shalimar
GURU


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

PostPosted: Fri Mar 26, 2021 8:46 pm   
 
sound like its always doing:

#ADDKEY get_item_data/temp_resists %upper(%replace(%1, " ")) %2
#ADDKEY get_item_data/temp_resists %upper(%replace(%3, " ")) %4
_________________
Discord: Shalimar#3679
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