Page 1 of 1

Alternate save system

Posted: Mon Jul 01, 2013 12:29 pm
by Zonk
A little experiment. Quite rushed but should work fine, as usual no responsability if this ruins your game...But it really shouldn't.

Basically: this changes how saves affect timed effects.

Default ToMe system
Effect duration is reduced by max(0, (save - power)*5)% then there is a shrugging off chance,
min(50 + (2.5 * save - power), 95)%.

This addon changes it to
Roll the 'shrug off'chance for every potential turn of the effect. Every success reduces the duration by 1.

Also, mention the duration of inflicted status effects in the log - this required basically replacing a whole function but doing it differently would likely have meant spam(extra lines).

Works by superloading actor.lua but should not cause compatibility issues.

Get here http://te4.org/games/addons/tome/alternate-saves/

Re: Alternate save system

Posted: Mon Jul 01, 2013 1:04 pm
by Zonk
There's one issue I noticed, easily fixable: Tooltip on current effects on players will show the reduction from saves properly, but not the maximum/adjusted duration. Easy to fix next release.
For the rest, this seems to work fine and I hope people enjoy it.


Also, two plans if there is enough interest:

Use some interface options to allow different displaying of altered effect durations, and perhaps show the % chance of making each save.

Make status effect resistances more reliable by applying them as a % reduction instead of rolling to fully shrug off. This might be somewhat harder to code...
Basically: 50% stun resist would mean that, rather than being stunned or not at full effect half the time, you would have halved stun durations.

Re: Alternate save system

Posted: Tue Jul 02, 2013 1:26 pm
by Zonk
Actually got resistance to work like this too(INSTEAD of their 'shrug off'chance). And knockback, too. Some polishing and I might release.

Re: Alternate save system

Posted: Tue Jul 02, 2013 4:30 pm
by Hachem_Muche
I posted a suggested change to the save system here http://forums.te4.org/viewtopic.php?f=36&t=36715 (including an addon)
Also see http://forums.te4.org/viewtopic.php?f=42&t=37964 (fixes problems when reapplying detrimental effects.)

The method of rechecking each turn of potential effect with a new save chance achieves almost the same effect I proposed. The difference between what this addon does and what I suggested is that I fixed the problem where small save bonuses become useless later in the game.

Take a look and feel free to steal anything you think might be useful. :wink:

Re: Alternate save system

Posted: Tue Jul 02, 2013 4:42 pm
by Zonk
Hachem_Muche wrote:I posted a suggested change to the save system here http://forums.te4.org/viewtopic.php?f=36&t=36715 (including an addon)
Also see http://forums.te4.org/viewtopic.php?f=42&t=37964 (fixes problems when reapplying detrimental effects.)

The method of rechecking each turn of potential effect with a new save chance achieves almost the same effect I proposed. The difference between what this addon does and what I suggested is that I fixed the problem where small save bonuses become useless later in the game.

Take a look and feel free to steal anything you think might be useful. :wink:
I consider your system a definite improvement on the one in the game currently, but I like my system more, I think it's more, shall we say, intuitive.
As for small bonuses, that might be an issue with tiers and checkHit itself, perhaps?

Also I don't think your system does anything to remove the shrug off chance at the start?

On the randomness side, I *was*considering something like random rounding for resistances too, where, for example, if resistance would shave 3.5 turns off an effect then it's 50% of being 3, 50% of being 4.


I *DO*agree on the stun(for example)overlap issue and have reported it in the past to DarkGod, but I think it's still not fixed :(


Other ways we could play with saves in addons is by keeping checkHit but changing how SAVES are calculated. For example, making stats matters more or less, or giving actors a base equal to their level, and so on.

Re: Alternate save system

Posted: Wed Jul 03, 2013 6:24 pm
by Zonk
Update(no re-release yet): decided to switch from fixed reduction on remaining duration on resistances to resistance giving a % of turning failed saves into successes.
Game tells you the effect duration from both saves and resistancs.

Game example A 8-turn stun effect is incoming, your saves are JUST the same as the apply power(for a save chance is 50%) and your resistance is 25%.
Let's say you get JUST the average of successful saves, that 4. Means 4 failed saves, too. They each a 25% chance of being turned into successes - and thus duration reduction- from your resistance. Let's say you get the average again, so 1.
The game will thus lower the stun duration by 4+1=5, and tell you.


I like this more than just flat-out reducing post-save durations by resistances, although it doesn't (yet)do anything with <0 status resists.
Also, knockback uses the same system.

Will release on Friday after some more clean-up.

Re: Alternate save system

Posted: Fri Jul 05, 2013 1:00 pm
by Zonk
Updated, please test.

Re: Alternate save system

Posted: Thu Jul 11, 2013 2:00 pm
by spiralrazor
Tested extensively.

Working good but leads to some inconsistent results.


IE, i still get poisoned as an Undead with 100% immunity... for the full 8 to 10 turns. And not getting hit by things like Spydric poison is one of the main reasons to play undead.

I think some coding changes need to go into effect when you have 100% resist in a category.

Re: Alternate save system

Posted: Thu Jul 11, 2013 2:14 pm
by Zonk
This is definetely not supposed to happen, there are already special checks for 100% resist...


Does the 100% poison resistance never work, or only sometimes? Is it some specific poisons? Does sub 100% resist work? As long as it's subtype poison, poison_immune SHOULD apply...


By the way, I'm also thinking of 'fixing' the overlapping effects thing(something is stunned for 10 turns, you use a shorter stun..it replaces). Timed effects should not be shortened by re-applying basically.

Re: Alternate save system

Posted: Thu Jul 11, 2013 2:29 pm
by spiralrazor
It also has a bad reaction with spells like epidemic, which ignore resistance entirely.

Re: Alternate save system

Posted: Fri Jul 19, 2013 4:04 pm
by Zonk
spiralrazor wrote:It also has a bad reaction with spells like epidemic, which ignore resistance entirely.
That is interesting too. I should check if they are meant to ignore resistance AND saves...

Re: Alternate save system

Posted: Wed Jul 24, 2013 11:26 pm
by Hellcommander
Found a bug that seems to be related to this mod:
error = "Lua Error: /engine/interface/ActorTalents.lua:173: /engine/interface/ActorTalents.lua:151: /engine/Entity.lua:663: attempt to perform arithmetic on a boolean value\
stack traceback:\
\9/engine/Entity.lua:663: in function 'recursive'\
\9/engine/Entity.lua:680: in function 'addTemporaryValue'\
\9/data/timed_effects/physical.lua:588: in function 'activate'\
\9/mod/addons/alt_saves/superload/mod/class/Actor.lua:107: in function 'setEffect'\
\9/data/damage_types.lua:995: in function 'projector'\
\9/data/damage_types.lua:965: in function 'projector'\
\9/mod/class/interface/Combat.lua:514: in function 'attackTargetWith'\
\9/mod/class/interface/Combat.lua:156: in function 'attackTarget'\
\9/data/talents/misc/misc.lua:71: in function </data/talents/misc/misc.lua:51>\
\9[C]: in function 'xpcall'\
\9/engine/interface/ActorTalents.lua:146: in function </engine/interface/ActorTalents.lua:134>\
At [C]:-1 \
At [C]:-1 error\
At /engine/interface/ActorTalents.lua:173 bumpInto\
At /mod/class/Actor.lua:2674 attack\
At /engine/interface/ActorLife.lua:41 check\
At [string \"return function(self, x, y, what, ...) local ...\"]:1 checkAllEntities\
At /engine/Actor.lua:184 move\
At /mod/class/Actor.lua:994 move\
At /engine/ai//simple.lua:140 runAI\
At /engine/ai//simple.lua:196 runAI\
At /engine/ai//talented.lua:64 doAI\
At /mod/class/NPC.lua:61 act\
At /engine/GameEnergyBased.lua:126 tickLevel\
At /engine/GameEnergyBased.lua:62 tick\
At /engine/GameTurnBased.lua:46 tick\
At /mod/class/Game.lua:1054 "
seen = true
reported = false

Re: Alternate save system

Posted: Thu Jul 25, 2013 11:08 am
by Zonk
Will check that. When did it happen? Was some specific talent/effect used...?
Edit: looks like the effect was 'Frozen'...am I right? Specifically an attack with a freezing weapon...

Re: Alternate save system

Posted: Thu Jul 25, 2013 3:31 pm
by Hellcommander
Maybe one of those frost ants attacked my mirror self as a attacked both the mirror self and the line of enemies