Page 2 of 4
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Wed Apr 06, 2016 11:33 am
by syntax
I'm very close, but there needs to be something that adjusts the "AVG # ATTACKS / ROUND" based on the chance the attack has to go off (based off the chance of energy getting used by other attacks and being available or not). Excel file attached / google sheet link available if anyone wants to waste time plugging numbers!
Google Sheet:
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 8:46 am
by syntax
syntax wrote:I'm trying to figure out a formula for MME/NMR that will enable me to easily figure out and display a monster's average damage/round, max damage/round (much easier), and true cast % of each attack. Hoping there may be a math nerd to help me out...
- I figured out that a monster tries to attack up to 6 times a round.
- Each of those 6 times is an independent check to see if it will use that attack, based on the attack % in the dats.
- Then, once it choose an attack, it sees if it has the energy to do it. If it doesn't we move on to the attack attempt out of the 6 attempts.
- If it does have the energy, it attempts to do it.
- If it's a "normal" (physical) attack it will attempt to hit the defender, and based on the monster's attack Accuracy vs the defender's AC/dodge it will either hit or miss. I'm also working on being able to incorporate that if I can figure out the calculations on that (RE: this thread) but I'm more worried about getting this formula figured out first. The important thing here with the physical attack is that no matter if it misses or hits (I assume dodge too but I didn't test it) no energy is returned. So a normal attack always uses its full energy.
- If it's a spell attack, it has a chance to cast or fail based on the attack's cast percentage. If it fails, half the energy is returned.
- We then move on to the next of the 6 attack attempts.
- Once the 6 attempts are exhausted, there is 0 energy (or not enough energy for any of the attacks probably), the remaining energy is added to the next round's energy pool.
Update on this for anyone who cares. I spent many hours debugging the DLL in realtime yesterday and finally found a key piece to this. At the end of a "normal" attack (e.g. not a spell), there is a a check to see if there is enough remaining energy to repeat that attack. If there isn't, then the loop of 6 attacks quits out and the monster is done attacking for that round. With this information my simulator now lines up appropriately.
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 9:20 am
by BearFather
I care, most the math goes over my head, but knowing how it works does help.
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 9:34 am
by syntax
Actually, another piece of info, but irrelevant for the sake of sim'ing, is mud actually goes through the entire attack calculation, pulling the messages and everything, before checking to see if it has the energy to do it

Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 10:35 am
by lucid2310
@Syntax, I am getting ready to start on the combat engine and would love to use what you have gathered here for spells, if you get a chance can you break down how the spell attack sequence works. I was looking at your formula for the swing calculator for melee is this still viable?
*Nevermind, I see your breakdown earlier in the thread on the order of events*
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 1:31 pm
by syntax
syntax wrote:Actually, another piece of info, but irrelevant for the sake of sim'ing, is mud actually goes through the entire attack calculation, pulling the messages and everything, before checking to see if it has the energy to do it

So this actually isn't bad on their part, per se. One reason for this is it checks to see if the monster has the speed ability. Which we assume reduces or increases the energy cost of the attack, which would then effect whether or not it could be used.
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 7:11 pm
by BearFather
syntax wrote:syntax wrote:Actually, another piece of info, but irrelevant for the sake of sim'ing, is mud actually goes through the entire attack calculation, pulling the messages and everything, before checking to see if it has the energy to do it

So this actually isn't bad on their part, per se. One reason for this is it checks to see if the monster has the speed ability. Which we assume reduces or increases the energy cost of the attack, which would then effect whether or not it could be used.
I think it kinda of a waste of cpu and memory, and back in those days it really counts. It would have been faster to check the energy and then do the attack and pull messages after it has been resolved.
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Mon Apr 11, 2016 8:23 pm
by apathy
BearFather wrote:syntax wrote:syntax wrote:Actually, another piece of info, but irrelevant for the sake of sim'ing, is mud actually goes through the entire attack calculation, pulling the messages and everything, before checking to see if it has the energy to do it

So this actually isn't bad on their part, per se. One reason for this is it checks to see if the monster has the speed ability. Which we assume reduces or increases the energy cost of the attack, which would then effect whether or not it could be used.
I think it kinda of a waste of cpu and memory, and back in those days it really counts. It would have been faster to check the energy and then do the attack and pull messages after it has been resolved.
Actually, I think otherwise -- the DB hit was probably the bottleneck. Once you have to go to the DB, pull anything relevant that you're likely to use soon. It's a memory hit, but it says a ton on spinning disk access (especially if the db info is spatially local)
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Tue Apr 12, 2016 1:25 am
by DeathCow
syntax wrote:syntax wrote:Actually, another piece of info, but irrelevant for the sake of sim'ing, is mud actually goes through the entire attack calculation, pulling the messages and everything, before checking to see if it has the energy to do it

So this actually isn't bad on their part, per se. One reason for this is it checks to see if the monster has the speed ability. Which we assume reduces or increases the energy cost of the attack, which would then effect whether or not it could be used.
It also has a very limited number of messages it can have ready to use, this causes monsters to appear to cast ntap on users when they are actually attacking.
Re: Monster Spells - Spell Attack Type -> Cast %
Posted: Wed Apr 13, 2016 3:01 pm
by syntax
FYI-- Items that Monsters drop affect their attacks. I tested +Max Damage, +Accuracy, and +AlterSpDmg. AlterSpDmg had no effect. +Max Damage not only affected the physical attack maxes, but also their mins. So +10 max damage on an item that a monster drops changes a physical attack from 10-20 to 20-30, for example. And +accuracy had the same affect as increasing the accuracy on the attack by the specified amount. None of the abilities had any effect on the spell attacks.
Have to see if it works for the weapon the monster is holding as well, but I would assume it would.