I've been poking around a lot in generate.c and simultaneously thinking about how to implement a monte carlo level simulation.
There are two options to simulation, one is to generate a level as it exists, and then go through manually removing the monsters and logging the treasure. The second simulation winds up being a change of how the level generation is done, this would involve a complete rewrite of generate.c
The advantage of killing all monsters on the level manually is that changes in generate.c will not effect the simulation. The main advantage to rewrite level generation is that the simulation can be done faster, and it's easier to log some specific items.
I'm leaning towards the manually killing monsters approach, with one change to generate.c, new floor designations PIT_FLOOR and NEST_FLOOR, so I can properly log monsters and treasure in these areas. If it turns out this approach is too slow, I'll look at the rewriting generate.c approach.
The main idea will be to go through each square. If you hit a treasure, record it and log it. If you hit a monster, record what treasure it would drop if you were to kill it, log it and the treasure, and remove it from the level.
The big question is what to record. I'm looking at something like this in average value per level:
total monsters
OoD monsters: in vaults: in pits/nests:
total unique monsters: in vaults:
At or OoD unique monsters: in vaults:
Gold:
from monsters
from ground (non vaults)
from vaults
from veins
Items (weapons and armor)
Total:
From ground: in vaults:
From monsters: in vaults: in pits/nests:
From uniques: in vaults:
(repeat for excellent, superb, endgame quality, artifacts, and artifacts with min levels near or above current depth.)
consumables: (i need some input here, what should I log...)
I'm thinking of putting all totals into longs (can I use floats?) and dividing by the sim number after it's done. Longs should be large enough for everything but money, and I can get around that by dividing by 10 or 100 or something.
thoughts/suggestions?
There are two options to simulation, one is to generate a level as it exists, and then go through manually removing the monsters and logging the treasure. The second simulation winds up being a change of how the level generation is done, this would involve a complete rewrite of generate.c
The advantage of killing all monsters on the level manually is that changes in generate.c will not effect the simulation. The main advantage to rewrite level generation is that the simulation can be done faster, and it's easier to log some specific items.
I'm leaning towards the manually killing monsters approach, with one change to generate.c, new floor designations PIT_FLOOR and NEST_FLOOR, so I can properly log monsters and treasure in these areas. If it turns out this approach is too slow, I'll look at the rewriting generate.c approach.
The main idea will be to go through each square. If you hit a treasure, record it and log it. If you hit a monster, record what treasure it would drop if you were to kill it, log it and the treasure, and remove it from the level.
The big question is what to record. I'm looking at something like this in average value per level:
total monsters
OoD monsters: in vaults: in pits/nests:
total unique monsters: in vaults:
At or OoD unique monsters: in vaults:
Gold:
from monsters
from ground (non vaults)
from vaults
from veins
Items (weapons and armor)
Total:
From ground: in vaults:
From monsters: in vaults: in pits/nests:
From uniques: in vaults:
(repeat for excellent, superb, endgame quality, artifacts, and artifacts with min levels near or above current depth.)
consumables: (i need some input here, what should I log...)
I'm thinking of putting all totals into longs (can I use floats?) and dividing by the sim number after it's done. Longs should be large enough for everything but money, and I can get around that by dividing by 10 or 100 or something.
thoughts/suggestions?
Comment