Re: Food choices and Defender
You make a good point; there are plenty of what looks like percentage calculations in this game. Still, I think the programmers would go pretty far to avoid float point operations. Also, the items you've called attention to have different properties, which allows for different means to reduce or avoid entirely those dreaded float point calculations.
Double Attack doesn't actually need a "base" to multiply off of, and can be implemented as an integer threshold. (Random roll; if under threshold, proc.)
Store TP only needs to be account for when calculating TP per hit, and that only changes on equipment change, job swaps, or gaining a new level of "Store TP". Otherwise, how much TP gain from successful attack is a constant, AFAIK. (i.e. Calculated once, then used many times until getting a "discard" event and recalculate.)
Subtle Blow calculation can use the same shortcut as Store TP.
However, the situation is trickier for "Enmity multiplier"... To start with, it doesn't have a nice, nearly fixed base number as "TP per hit", since amount of enmity gained depends at least in part on how much damage was done. (For this purpose, it's assumed that the exact damage to be done on a particular swing cannot be determined ahead of the time, hence no fixed base.) That means the tricks I would use for Double Attack and TP type calculations won't work.
I suppose it can be implemented as a large lookup table (like the engine control for cars), though I doubt it, since memory space is a premium on servers, and a cache miss is much more expensive than integer operations.
Maybe implemented as two step operation, integer multiply then divide? I guess it's possible, but integer addition/subtraction is still better than integer multiple and divide. (Can shortcut the division with shift operation using 2^^n as divisor, however.)
I dunno... w/out experimental data, I'm not ready to believe the programmers would use a multiply operation over straight addition and subtraction. (And, no, I've no clue on how to perform an experiment sensitive enough to tease out the difference between enmity+5 and enmity+15.) I would admit that after thinking it over, enmity multiplier wouldn't have as bad of a performance hit as I thought originally, if using integer multiply then divide.
* * *
I'm getting enough of both "I didn't use Defender full-time" and "I used Defender full-time" posts to make me think both methods are quite workable. Since Bark Spiders at Lv.50 is over hunting slightly, I guess I should step up things incrementally, starting with Defense Food + Defender, and change tactic and food according to the situation.
That just means inventory crammed full of "alternative" food and gears... So much for making out like bandits off spider webs... /sigh
Thanks everyone for the responses. ^_^
Originally posted by Lmnop
View Post
Double Attack doesn't actually need a "base" to multiply off of, and can be implemented as an integer threshold. (Random roll; if under threshold, proc.)
Store TP only needs to be account for when calculating TP per hit, and that only changes on equipment change, job swaps, or gaining a new level of "Store TP". Otherwise, how much TP gain from successful attack is a constant, AFAIK. (i.e. Calculated once, then used many times until getting a "discard" event and recalculate.)
Subtle Blow calculation can use the same shortcut as Store TP.
However, the situation is trickier for "Enmity multiplier"... To start with, it doesn't have a nice, nearly fixed base number as "TP per hit", since amount of enmity gained depends at least in part on how much damage was done. (For this purpose, it's assumed that the exact damage to be done on a particular swing cannot be determined ahead of the time, hence no fixed base.) That means the tricks I would use for Double Attack and TP type calculations won't work.
I suppose it can be implemented as a large lookup table (like the engine control for cars), though I doubt it, since memory space is a premium on servers, and a cache miss is much more expensive than integer operations.
Maybe implemented as two step operation, integer multiply then divide? I guess it's possible, but integer addition/subtraction is still better than integer multiple and divide. (Can shortcut the division with shift operation using 2^^n as divisor, however.)
I dunno... w/out experimental data, I'm not ready to believe the programmers would use a multiply operation over straight addition and subtraction. (And, no, I've no clue on how to perform an experiment sensitive enough to tease out the difference between enmity+5 and enmity+15.) I would admit that after thinking it over, enmity multiplier wouldn't have as bad of a performance hit as I thought originally, if using integer multiply then divide.
* * *
I'm getting enough of both "I didn't use Defender full-time" and "I used Defender full-time" posts to make me think both methods are quite workable. Since Bark Spiders at Lv.50 is over hunting slightly, I guess I should step up things incrementally, starting with Defense Food + Defender, and change tactic and food according to the situation.
That just means inventory crammed full of "alternative" food and gears... So much for making out like bandits off spider webs... /sigh
Thanks everyone for the responses. ^_^
Comment