A gigantically enormous list of affs?

by Unknown

Back to Mechanic's Corner.

Unknown2010-01-13 06:15:54
Okay, so my system is going to use a table for afflictions. However, there's one thing: There would be a MASSIVE lag spike whenever combat starts as Mudlet starts to designate memory space for this table. So, I'd like to just set up the afflictions table before the username is even entered, but there's one problem with that:

HELP CURELIST is missing stuff, and I don't have another resource for afflictions. Halp me, Mechanic's Corner!
Atellus2010-01-13 06:32:34
QUOTE (Kyriel @ Jan 12 2010, 10:15 PM) <{POST_SNAPBACK}>
There would be a MASSIVE lag spike whenever combat starts as Mudlet starts to designate memory space for this table.


I know nothing at all about mudlet but this just seems wrong on multiple levels.

As a huge over estimation let us say that Lusternia has 500 affliction messages. Say you save a full sentence of 256 characters for each one. That is 128k bytes, which on any modern system should allocate imperceptibly fast.

These numbers are a gross exaggeration of the total affliction space though so it is not even close to as bad as this.

Finally I do not understand how the time you set up your tables has any impact on getting the full affliction list. You need the full list for any system no matter what you do. I have no idea how up to date they are but you can find such lists in the stickies on the combat section of the boards.
Ssaliss2010-01-13 07:40:59
If you're just looking for the afflictions and not the affliction-lines for it, there's always the wiki.
Xavius2010-01-13 07:45:36
QUOTE (Atellus @ Jan 13 2010, 12:32 AM) <{POST_SNAPBACK}>
I know nothing at all about mudlet but this just seems wrong on multiple levels.

As a huge over estimation let us say that Lusternia has 500 affliction messages. Say you save a full sentence of 256 characters for each one. That is 128k bytes, which on any modern system should allocate imperceptibly fast.

These numbers are a gross exaggeration of the total affliction space though so it is not even close to as bad as this.

Finally I do not understand how the time you set up your tables has any impact on getting the full affliction list. You need the full list for any system no matter what you do. I have no idea how up to date they are but you can find such lists in the stickies on the combat section of the boards.

This is a fair underestimation, actually, but the principle remains the same. The only way that you can lag a computer is by calling things many, many times. Nothing you do once will lag a computer. You just don't write enough for that. Stupid prompt triggers cause lag. Memory allocation for small parallel arrays does not.
Casilu2010-01-13 08:39:45
QUOTE (Xavius @ Jan 12 2010, 11:45 PM) <{POST_SNAPBACK}>
This is a fair underestimation, actually, but the principle remains the same. The only way that you can lag a computer is by calling things many, many times. Nothing you do once will lag a computer. You just don't write enough for that. Stupid prompt triggers cause lag. Memory allocation for small parallel arrays does not.


I once had a single data file big enough to crash my computer. It was in notepad!
Unknown2010-01-13 11:39:18
I have 99% of the affliction lines coded in Treant. It might be the best reference you'll find.
Unknown2010-01-13 19:23:26
QUOTE (Atellus @ Jan 12 2010, 11:32 PM) <{POST_SNAPBACK}>
I know nothing at all about mudlet but this just seems wrong on multiple levels.

As a huge over estimation let us say that Lusternia has 500 affliction messages. Say you save a full sentence of 256 characters for each one. That is 128k bytes, which on any modern system should allocate imperceptibly fast.

These numbers are a gross exaggeration of the total affliction space though so it is not even close to as bad as this.

Finally I do not understand how the time you set up your tables has any impact on getting the full affliction list. You need the full list for any system no matter what you do. I have no idea how up to date they are but you can find such lists in the stickies on the combat section of the boards.


Let's look at it this way, I have an array called promptVars, and I never actually initiate it anywhere until my prompt, which'll do something like this:

promptVars = matches
promptVars = matches
promptVars = matches

This alone would give me upwards to 0.030s of lag on the first prompt, though it would be much faster afterwards.

Now, let's say I have an array called afflictions, and I never initialize it until I'm getting hit by afflictions. Let's say I'm fighting Sawna.
He just put me in a full lock and just gave me about 25 afflictions too, so at a rate of 0.010s of lag per initial memory allocation for the table, I just hit about 2 seconds of lag. Not curing and just standing still for two seconds can mean you aren't alive anymore in a fight.
Unknown2010-01-13 19:31:40
I seriously doubt you're getting that kind of lag from setting Lua variables. Lua is the fastest scripting language I know, and setting a variable is a fast operation in any language regardless.

It's more likely that your timing scripts are lagging or that there's something else you're not considering.

Either way, there are plenty of ways to optimize your code to minimize CPU cycles and memory overhead. For example, rather than looping on all possible afflictions that you could cure, just loop on the afflictions you have currently and lookup the cures in another static table.
Vadi2010-01-13 20:47:27
You're getting your numbers wrong, and keep in mind that the 0.001 - 0.003 number variates (if you'll check it, won't be constant). The OS does caching and etc, so adding 25 affs won't give you 2s lag at all.

Esp. since with Mudlet you can really optimize your triggers and practically make sure that no regexes except your prompt trigger are ever running with the help of gates.
Xavius2010-01-13 21:14:35
Just to give some hard numbers here, I set up an alias to adjust and adjust back every user-configurable variable I could readily find in Treant, which uses Lua just like Mudlet. It's roughly 60 variable writes each time. Even with the system output for some of these adjustments, I can pound away at that alias and never lag more than .05 seconds.
Unknown2010-01-13 21:24:41
QUOTE (Vadi @ Jan 13 2010, 01:47 PM) <{POST_SNAPBACK}>
You're getting your numbers wrong, and keep in mind that the 0.001 - 0.003 number variates (if you'll check it, won't be constant). The OS does caching and etc, so adding 25 affs won't give you 2s lag at all.

Esp. since with Mudlet you can really optimize your triggers and practically make sure that no regexes except your prompt trigger are ever running with the help of gates.


My prompt trigger alone is 0.050-0.100, and it's optimized as much as it possibly can be. Explain, plz?
Xavius2010-01-13 21:26:10
Post that prompt trigger. If it's lagging a whole tenth of a second, you're doing it wrong.
Unknown2010-01-13 23:28:06
^(\\d+)h, (\\d+)m, (\\d+)e, (\\d+)p, (\\d+)en, (\\d+)w(, (\\d+)mo)? (*)(\\<\\>)?-$

It does nothing more than set variables.
Xavius2010-01-13 23:43:01
QUOTE (Kyriel @ Jan 13 2010, 05:28 PM) <{POST_SNAPBACK}>
^(\\d+)h, (\\d+)m, (\\d+)e, (\\d+)p, (\\d+)en, (\\d+)w(, (\\d+)mo)? (*)(\\<\\>)?-$

It does nothing more than set variables.

And not that many of them.

So, our options are:

1) You don't actually lag anywhere close to a tenth of a second on that trigger. What you're actually measuring is network latency.

2) You're running Mudlet on Windows 3.11 in a 486 box.

3) Mudlet isn't ready for public consumption yet.
Unknown2010-01-13 23:50:57
QUOTE (Xavius @ Jan 13 2010, 06:43 PM) <{POST_SNAPBACK}>
And not that many of them.

So, our options are:

1) You don't actually lag anywhere close to a tenth of a second on that trigger. What you're actually measuring is network latency.

2) You're running Mudlet on Windows 3.11 in a 486 box.

3) Mudlet isn't ready for public consumption yet.



It's not mudlet.. I run a complete replacement prompt in its own mini window, with colors, gagging, switches for the info at the end of the normal prompt (IE the x goes dark grey if I don't have balance, is a brighter color when I do)... and that number sits around .002 or less, even if I'm spamming prompts, influencing, chatting while my triggers for influencing run (which all goes to seperate miniconsoles and is gagged from my main buffer) etc... I'm thinking there's something wrong with dude's computer.


ETA: if I make it read as many prompts as lusternia will send me by holding down enter, I'll sometimes get as much as 0.02... but this is also while compiling other things, listening to mp3s, and watching a movie. That sys number in the bottom right corner is how long it took to process the last line received... and that will be effected by anything and everything else you're doing on the box. So maybe if you're encoding DVDs, torrenting, compiling LMTS, and running a heavy resource chat program or something?