Biased Random Damage Mod

A place where unusual ideas find their home, not intended for mainline development discussions!

Moderators: Developers, Forum Moderators

Forum rules
If this is your first time in this section, you must read the following thread:

Biased Random Damage Mod

Postby Crow_T » August 31st, 2014, 7:27 pm

*edit: This is now on the 1.11 and 1.10 addons servers.*

What is it?

This is a mod that when installed in addons can be accessed from the in-game right click menu. It affects the battle damage system in that damage is no longer simply a full on hit or a miss- it uses a bell curve to determine the probability of how much damage will be inflicted based on 2 things,* the chance to hit and the damage. If the chance to hit is 30% and a unit does 10 damage, expect the damage per hit to be 3, more than likely 2-4, and occasionally higher or lower. If the CTH is 50%, expect the damage to be 5, more likely 4-6, and again occasionally higher or lower. The spirit of randomness is kept in that there is no real guarantee of the damage numbers, but instead they are biased toward a particular result.

Poison and slow use the stock RNG system to determine if they take effect- a poison dart can do damage but may not inflict poison unless it counts as a hit in Wesnoth's usual battle system, same goes for slow.

*there is also a calculation to give a bonus/penalty when attacking a unit of a different level- If a L2 unit attacks a L1 unit they get +1 damage. A L3 attacking a L1 gets +2, and the opposite is true, the L1 gets -2. This can be disabled by commenting out line 233 of damage_distribution_mod.lua like so (I consider this to be experimental still in terms of gameplay):

Code: Select all
--result_damage = result_damage - defender_code.level + attacker_code.level



There is another adjustment available as well- in the first line of the damage_distribution_mod.lua there is a "steepness" value- this can be changed to affect the shape of the bell curve that determines the damage value percentages. A lower number makes it steeper (less random), a higher number makes it flatter (more random).

What is the gameplay like?

In my experience, because of the amount of actual hitting happening, I find myself save loading much less. I've been playing through TROW on normal and have been on the high end of turns to get through scenarios (the PRNG mod is so aggressive I'd get through scenarios pretty quickly). You still get misses and the big hits, and it seems more "realistic" in that not every blow is a perfectly solid one. Is the original balance preserved? Probably not, but I found this system to be pretty fun anyway.

Any feedback on the above customizable settings would be appreciated :)

***A big thanks to the Mad Coding Genius Dugi for the code***

Enjoy!
Attachments
Damage_Distribution_Mod.tar.gz
(2.65 KiB) Downloaded 291 times
Last edited by Crow_T on October 15th, 2014, 9:04 pm, edited 1 time in total.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby pauxlo » August 31st, 2014, 7:51 pm

I did not (yet) try this, so just one question:

Does the battle preview "Damage calculation" dialog know about your system, and can calculate the right information?
User avatar
pauxlo
Forum Regular
 
Posts: 982
Joined: September 19th, 2006, 8:54 pm

Re: Biased Random Damage Mod

Postby Crow_T » August 31st, 2014, 8:13 pm

pauxlo wrote:I did not (yet) try this, so just one question:

Does the battle preview "Damage calculation" dialog know about your system, and can calculate the right information?


No, it's not that "deep" code-wise, I'm not sure you'd be able to to that with lua as opposed to a C code patch :hmm:
Looking at it in game it looks like it is totally fried :lol: I don't use that feature because IMO those numbers are irrelevant- the RNG will do what the RNG wants. Unless you are going to do several takes at one attack then those numbers will start to make sense.
Edit:Also I imagine since this system has so many combinations of outcomes the current code doesn't handle it well.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby optimother » September 7th, 2014, 5:02 pm

Crow_T, congrats you finally got your idea working :) I played couple of games, damages seem to be quite close to estimations.
optimother
 
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Biased Random Damage Mod

Postby Crow_T » September 8th, 2014, 3:55 pm

optimother wrote:Crow_T, congrats you finally got your idea working :) I played couple of games, damages seem to be quite close to estimations.


Thanks for trying this out :) Yes I've been playing on a slower speed and sort of keeping track mentally of the damage that happens, it seems a good balance of expected/random enough to keep it interesting.

This is now on the 1.11 and 1.10 addons servers.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby Chief_Chasso » November 2nd, 2014, 2:45 am

Hey, I've been trying this mod out. However, poison and slow doesn't seem to work. I did comment out the level bonus/penalty... I'm not sure if that has anything to do with it?
SP Campaign: Rally For Roanic
User avatar
Chief_Chasso
 
Posts: 132
Joined: December 15th, 2012, 2:36 am

Re: Biased Random Damage Mod

Postby Crow_T » November 2nd, 2014, 8:18 pm

Hmmm, do you mean they never take effect? It's set up to utilize the stock Wesnoth RNG to determine if the actual effect of poison/slow takes place while using the mod for actual damage, the idea being that poison/slow wouldn't be a guaranteed effect.

One thing I've noticed happening on occasion is that if a unit misses the first hit they will miss all the rest, have you noticed that at all? Generally I see it with thugs and their higher levels, probably because there are 4 swings.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby Chief_Chasso » November 3rd, 2014, 12:08 am

Yeah, I meant poison/slow never seem to take effect. Maybe it's just been a string of bad/good luck,
One thing I've noticed happening on occasion is that if a unit misses the first hit they will miss all the rest, have you noticed that at all?

Actually, that seems to be true, but I'll make sure to look for a pattern. It seems like WC's seem to miss a lot too. I had 3 WC's in a row miss all their hits.
SP Campaign: Rally For Roanic
User avatar
Chief_Chasso
 
Posts: 132
Joined: December 15th, 2012, 2:36 am

Re: Biased Random Damage Mod

Postby Crow_T » November 22nd, 2014, 7:57 pm

There is a new version uploaded to the 1.10 and 1.11 servers, the constant miss bug should be fixed.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby Krolan » January 6th, 2015, 5:42 pm

Is there a new version for 1.12, too,? :)

Thanks for directing me here, I like that system ^^ makes it more realistic, that is for sure. Though, the -1 -2 damage on level-difference is worrying me because of Lvl5 Lvl6 and Lvl7 units in some campaigns. My lvl 1 units would get a -6 damage penelity, combine it with the unit having good resistance against the attack, and the damage will result in 0 (or maybe 1 if there is a minimum damage thingy going on). A lvl1 physical damage unit against a lvl 3 ghost seems also to have an not so nice gap.
I do GPE(Genuine Playing Experience), Screenshot-reinforced and detailed Bug-Reports for Campaigns. If you want me to check yours, be it Pre-Alpha, Alpha, Beta or finished, let me know. Since I don't know anything about coding, I'll be unable to tell you why something bad happens though. PM me.
Krolan
 
Posts: 28
Joined: November 23rd, 2014, 7:12 pm

Re: Biased Random Damage Mod

Postby Crow_T » January 6th, 2015, 10:07 pm

It should be on the 1.12 addon server- let me know if it isn't :geek:

In the first post I describe how to disable the level difference bonus, which would be a good idea if you are playing campaigns with high-level custom units.
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby Crow_T » February 23rd, 2015, 2:06 am

A new version with some fixes is out, from Dugi:
I have made an update to the biased random damage mod. It fixes the multiplayer desynch issue (uses the WML random number generator instead of the lua one as before, because the WML one is synched and the lua one isn't). I have also added support for most custom weapon specials (so simpler things like set chance to hit to 80 when defending or increase chance to hit by 20 should work, but stuff like decrease the opponent's chance to hit by 20 if he's an orc standing in swamp will not).
User avatar
Crow_T
 
Posts: 830
Joined: February 24th, 2011, 4:20 am

Re: Biased Random Damage Mod

Postby WhiteWolf » December 11th, 2016, 10:17 pm

- couldn't find it -
EDIT: Sorry, my bad, found it. Ignore my comment :D
Really cool idea :)
Author of the Underness Series, consisting of V parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now published!
User avatar
WhiteWolf
 
Posts: 267
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Biased Random Damage Mod

Postby ExtraAnchovies » January 26th, 2017, 2:31 am

I'm playing on 1.12.6, and I've been noticing a quirk of the system which is a bit bothersome. It seems that retaliation damage is only calculated once; that is, if a unit is attacked, they will strike back for the same amount of damage with each of their retaliation attacks. This adds a bit of swingy randomness to combat which isn't present in vanilla BfW, because an unusually high or low roll has its effects multiplied over however many retaliation attacks the defending unit has. Overall this mod is great - I, too, am much less prone to impulsive save-loading with it active, and I like how it makes combat outcomes more granular than vanilla where e.g. an attacking spearman would always deal 7, 14, or 21 damage - but the one-shared-result retaliation attack thing has stuck out every now and then and I wanted to bring it to the add-on devs' attention and/or hear from them on it.

It also sorta seems like the system favors numerous smaller attacks over fewer large attacks, but I haven't done any detailed tracking of that so it may just be me seeing a pattern where there isn't one.
ExtraAnchovies
 
Posts: 2
Joined: January 26th, 2017, 1:48 am


Return to Experimental Corner

Who is online

Users browsing this forum: No registered users and 1 guest