ID:154077
 
I need a large number of lists or list substitutes which will be accessed and modified extremely frequently.

  • Lists: I'm afraid of using actual lists because of the large number quite possibly going past the object limit.

  • Linked Datums: I'm afraid of using linked datums because that would allow even less "lists" than using lists (for lists with more than one member).

  • Text: I'm afraid of using text to fake lists because of the processing spent translating.

    Am I stuck with text? Are there any more DM list implementations which might make a better compromise between speed and number of instances?
If the data doesn't need to be accessed too frequently, you could store it all on permanent storage as a database and only read into memory as needed.

-AbyssDragon
In response to AbyssDragon
Thanks, but that's the problem. Hence the phrase extremely frequently. ;)

I can get around the object limits with text, but I don't think it would be fast enough. I'm not sure how the database compares to string manipulation, but I'm guessing string manipulation is faster on relatively small strings. I need both speed and a large number of instances.


Here's my project:

Mainly, I want to be able to define different kinds of damage at runtime. For instance, in ROM this would be things like cold, fire, and slash, but I could define them dynamically. This rules out getting a few static num vars to check.

That which does battle may possibly have defenses against multiple types of damage. It may also possibly do multiple kinds of damage. For each attack, the offender accesses how much damage it does. Then the defender accesses it's defense against each kind of damage it was attacked with. That which does battle may have multiple attacks per round. Rounds may last a second or two. (I could give a little more time, but I'll still want to keep it under 10 seconds.) Multiple things may be engaging in multiple battles.

In other words, there may be lulls, but the lists have to endure heavy loads with quick response times when they are accessed.

I could store things in text outside of battle, convert to lists before the first round of combat, and then store it in text again when the battle was over. That could make the chances of using up all lists at once less likely. Popping in and out of battle quickly might make unnecessary conversions, but it's probably better than text manipulation multiple times a round.

I'm still open to suggestions. =)
In response to ACWraith
ACWraith wrote:
I could store things in text outside of battle, convert to lists before the first round of combat, and then store it in text again when the battle was over. That could make the chances of using up all lists at once less likely. Popping in and out of battle quickly might make unnecessary conversions, but it's probably better than text manipulation multiple times a round.

This is basically your best way to go. The idea is to pull things out of a file and "cache" them in lists for easy access. This can be simpler than it sounds. All you basically need is a check--any time you access it--to see if the list is null, and to load it if it is, then after a while delete the list again.

Lummox JR