new strike mechanism

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

new strike mechanism

Post by wbr »

ok i solved the bugs.. damn c and float integer and other stuff
so the basic mechanism is one random per round... it works it is brutal 1 of 4 times beserker killed elf hero and that 3 times hero survives had 4-10 hp left :)

ok u all try it and i will start to work on implementation with old (unadecvate) engine

still random have lot of influence but is less frustrating

tnx all for help

new random look like this

(ran_num%1oo / defender defence) * strikes/2

round on higest integer
that how much u hit

thant he decide based on old random when he hit

it works later i will upload excel tables
Attachments
actions.cpp.tar.gz
new strike mechanism
(20.85 KiB) Downloaded 368 times
Kuciwalker
Posts: 9
Joined: July 6th, 2009, 9:26 am

Re: new strike mechanism

Post by Kuciwalker »

You realize this is a fundamental change to the entire combat model of the game, right?
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

Kuciwalker wrote:You realize this is a fundamental change to the entire combat model of the game, right?

no it is not... if you calculate chanses to hit you see that units with 1 strike have to got same random number like old engine to hit... units with more strikes ... well they cust hit 1 or 2 times (sometimes 0 ) when its logical to hit... like elf attacking spearman... elf will hit from 2 -3 times sperman on open... spermen will hit 0- 2 elf in wood ... yes you need to update strategy magic attack are more brutal ... but non magic are brutal too :)

it can be nicely played...

so wbr's game pass strike and dont forget to recompile file if u want to have some chance... :D
User avatar
Zarel
Posts: 700
Joined: July 15th, 2009, 8:24 am
Location: Minnesota, USA
Contact:

Re: corrections from the author of the idea

Post by Zarel »

newworldorder wrote:this story started with me going crazy with luck mechanism and especially appalled and disgusted with the main developers opinion about this subject.
newworldorder wrote:however, knowing the main developer's opinion on this subject (the opinion that makes me appalled and disgusted) i can predict that this new mechanism will not enter the game.
it would be great if i were wrong, and you put it in there as an option. that would be a miracle i'm not prepared to believe in.
Oh, man, insulting developers is a great way to get your patch accepted! I'm glad you're so good at it!

That said, if the developers wanted to change the luck system, they could easily do so, and with a better understanding of what's going on than "now, don't ask me why dividing with 2, it just turned out to be the right number. we tried with 1,75 but it gave too many hits in our opinion." You seem to understand why they don't, so submitting a patch isn't going to change that at all.

The reason they don't is well understood, and it is obvious to everyone why the luck system is in place. If you dislike it, feel free to fork Wesnoth and maintain your own version of it.
Proud creator of the :whistle: smiley | I prefer the CC-0 license.
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

that why i work to implement both mechanism in game ;) so comunity will decide... its no funny when somebody hit you on 60% defence 5 times.. and you miss 4 times on 30% that just stupid ... and if u look the engine u see that u have strait line of reality.... that its important.. but random still have lot of influence...
ilor
Inactive Developer
Posts: 129
Joined: March 24th, 2008, 9:05 pm

Re: new strike mechanism

Post by ilor »

You're just increasing the chance of hitting behind the scenes. What you call "brutal" is just the result of the "algorithm" favoring more hits. Much easier to just go through the WML and make all attacks more likely to hit.
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

ilor wrote:You're just increasing the chance of hitting behind the scenes. What you call "brutal" is just the result of the "algorithm" favoring more hits. Much easier to just go through the WML and make all attacks more likely to hit.

no im not favoring more hits its basicly show real to hit ratio... look i played about 15 games... on ALL sides statistic was about -5 0 +5 % that is realism... u canot tell that official random is random.. for god sake i died onissar cross 8 units in 3 turns... they striked about 3 times.... elf in wood die like on open... all hits for what is defence if u calaculate hit

random > defence ? ... ?????? what is random ???

random does not exsist in whole universe.. fractal maybe but fractals are not random
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

newworldshithole you did not know how to compile wesnoth until i showed u how.... :P
and u will maintain something ? yes and man are right dont insult developers they MADE THIS GAME
Kuciwalker
Posts: 9
Joined: July 6th, 2009, 9:26 am

Re: new strike mechanism

Post by Kuciwalker »

wbr wrote:that why i work to implement both mechanism in game ;) so comunity will decide... its no funny when somebody hit you on 60% defence 5 times.. and you miss 4 times on 30% that just stupid ... and if u look the engine u see that u have strait line of reality.... that its important.. but random still have lot of influence...
Both of those happen with the exact probability you would expect them to happen if you actually understood probability.
User avatar
Zarel
Posts: 700
Joined: July 15th, 2009, 8:24 am
Location: Minnesota, USA
Contact:

Re: corrections from the author of the idea

Post by Zarel »

newworldorder wrote:1. i don't know where you saw insults in what i've said. you should read the text carefully before you comment it. and if you don't understand, ask for clarifications instead of making stupid remarks. you didn't even realize that i didn't submit any patch, and that only idea is mine, and wbr made the changes and submit the patch.
You say "especially appalled and disgusted with the main developers opinion". That constitutes a fairly direct insult.
newworldorder wrote:2. if developers needed spokesman or attorney, they would find one. this is coder's corner, are you a coder? of you are, are you speaking in your name or in the name of all coders? or you just felt urge to defend developers from what you felt was my vicious attack?
I am a coder (and a balancer, for that matter), but that is irrelevant. You are clearly not a coder, and yet you are here, are you not? "Coder's Corner" doesn't mean "Only coders can be here", it means "We talk about coding here". Regardless, I speak for myself.

I merely did four things:
- Advise you to be more polite when submitting a patch.
- Advise you not to ask for a patch to be accepted when you don't even understand how the patch works.
- Advise you not to ask for a patch to be accepted because the only reason what it implements hasn't been implemented is developer consensus that it would be a bad thing.
- Advise you to fork the game if it really is that big of a deal.

You are free to refuse my advise, but there's no need to act like I defended any developers when I did nothing of the sort.
newworldorder wrote:3. forking game is exactly my idea, except i'm waiting for wbr's idealism to blow off.
In all honesty, wbr seems to be more sane than you.
Proud creator of the :whistle: smiley | I prefer the CC-0 license.
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

here is tables for 1 2 3 4 strikes... 0.5 is round factor ... everithing is rounded on integer canot strike more than he has strikes soo look at the charts

1.0 - 1.49 means 1 strike 1.5 - 2.49 2 stikes... etc ...

please try it..
please i see that someone dowloaded excel tables and actions cpp can u post or send on pp some fedback ?
Attachments
random.zip
(5.63 KiB) Downloaded 558 times
Last edited by wbr on August 21st, 2009, 11:55 am, edited 1 time in total.
lmelior
Posts: 116
Joined: June 16th, 2009, 3:30 am

Re: new strike mechanism

Post by lmelior »

Okay, so after reviewing the code I understand what you meant. Maybe my explanation will help others. In a battle between two characters, there is one random draw for the attacker and one for the defender that determine how many hits each one gets. They will always get exactly that many hits (unless one dies), but the round in which they land their hits is still random.

As for the code, it would need to be cleaned up considerably in order to be an acceptable patch. There is an unused variable and an empty else statement, and the variable names are not very good. Also, I noticed you disabled the out-of-sync checks, were you getting errors? That wouldn't go over well.

But more importantly, what does it mean for the game?
:eng:
Let's look at a table of sample cases:

Attacker with 2, 3, and 4 strikes against a defender with 30%, 50%, and 70% defense:

Code: Select all

                   30% defense                   50% defense                     70% defense           
           Current     Modified            Current     Modified            Current     Modified    
0 hits        9.0%       14.5%               25.0%        25.0%              49.0%         34.5%     
1 hit        42.0%       30.0%               50.0%        50.0%              42.0%         65.5%     
2 hits       49.0%       55.5%               25.0%        25.0%               9.0%          0.0%     


                   30% defense                   50% defense                     70% defense           
           Current     Modified            Current     Modified            Current     Modified 
0 hits        2.7%        9.5%               12.5%        16.5%              34.3%         23.5%
1 hit        18.9%       20.0%               37.5%        33.5%              44.1%         46.0%
2 hits       44.1%       20.0%               37.5%        33.5%              18.9%         30.5%
3 hits       34.3%       50.5%               12.5%        16.5%               2.7%          0.0%


                   30% defense                   50% defense                     70% defense           
           Current     Modified            Current     Modified            Current     Modified 
0 hits        0.81%       7.5%                6.25%       12.5%              24.01%        17.5%        
1 hit         7.56%      15.0%               25.00%       25.0%              41.16%        35.0%        
2 hits       24.46%      15.0%               37.50%       25.0%              24.46%        35.0%        
3 hits       41.16%      15.0%               25.00%       25.0%               7.56%        12.5%        
4 hits       24.01%      47.5%                6.25%       12.5%               0.81%         0.0%
Note: this isn't showing up as monospace in my browser, so the formatting might not be too good.

It is pretty difficult to find a pattern there, but if you take some statistics you can see that the average number of hits is slightly increased against a defender with low defense, unchanged against a defender with 50% defense, and increased significantly against a defender with high defense. The higher number of possible hits, the higher the increase of the average. So, 4 possible hits against 70% defense will land 1.16 hits with the current system, and 1.425 hits with the modification - an increase of 23%!

Therefore, my conclusion is that the balance will be tipped towards units with low to medium defense and a high number of hits (like duelists and units on horses), because the high defense units with a lower number of hits will suffer (like footpads and thieves).
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

hmmm first time first... if u look for unused varible... ti was only for debugging ... i need to know results for hits becouse of some bugs with defender... therefore i will subimit clean code

serilization trow an error... i need to understand it before i make patch... i will do this on weekend

so your error is 1.45 new code and 1.25 old code is same number... 1.45 is still one

pattern you can see on my tables... u can clearly see line with non decimal number i dont know english word for integer values on my language its called nature nubers (bulk translation) so if u look at tables u see that 4 hits on 70 % will newer give result of 4 3 is mac what is real becouse it 70 % :D
for result on random 100 on 70% is 2,85 .. it mean its 3... :)

on other hand u can and will strike minimum 2 times unit in water .. so that is ok

i know problem with more strikes i work on math to make imperial constant (strikes /2) more suitable for survivals


it will be nice that someone of developers post something... or look on idea
have someone played with new strike ?
User avatar
Daxion
Posts: 66
Joined: July 24th, 2009, 9:23 am

Re: new strike mechanism

Post by Daxion »

I've tried looking at the code, but it's still a little confusing. Never really worked with code in Wesnoth. In other words: I wasn't able to check if my following statment is correctly represented in the code. I might be wrong.

I believe newworldorder stated (not readable anymore), that after the maximum hit number is reached, a miss will be turned into a hit, and a hit into a miss.

This means that a unit with 70% def, will after it is hit with the "mean number" of hits, suddenly get a def rating of only 30%. Subsequently being hit more often.
For a unit with 30% def, this will turn into 70% def.
This is consistend with the posted table by Imelior.

Actually, eventhough you wanted to make extreme cases less rare, I think you actually achieved the opposite, however with a higher hit probablility (but this under hand and not visible). The real bad thing is that this is not clear to the player, or strikly speaking: not logical.

When fiddling with the hit mechanism, I believe it is important to retain the mean damage dealt, as well as the variation.
I get the feeling that most people don't like the variation of strikes (specially the lower end of the distribution). The variation is only controlled via the number of strikes (inceases the statistics). This might be a too rough control over it, however I do not see a easy and transparent (most important: not overly complicated) way to change that.
wbr
Posts: 12
Joined: September 14th, 2008, 3:06 pm

Re: new strike mechanism

Post by wbr »

no... actualy it is chance to hit in original wesnoth code ... 100 - defence so i calculate defence by 100 - chance to hit :)=

code to resolve strike order is like this

if strikes larger than 0
than random%100 < chance to hit /from old code this IS old mechanisam to strike

hits = true
hits --
else

if number of hits equal or greather of number of remining hits and hits is false
hits = true


with formula random/hits * strikes/2 u just calalculate how many hits you hit per round
Post Reply