Pick the amount of random you accept

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

Moderator: Forum Moderators

Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Pick the amount of random you accept

Post by Sauron »

UPDATED 01.08.2006
The ideas I posted below resulted in FULLY FUNCTIONAL mod of wesnoth 1.0.2, backward compatibile with 1.0.2.

Project's homepage:
http://saurons-mod.zor.org/
DOWNLOAD WINDOWS EXECUTABLE (replace wesnoth.exe with file from zip archive):
wesnoth.zip (mod version 1.0.5)
DOWNLOAD SOURCE CODE (Just files I modified - you must download the Wesnoth 1.0.2 source code and then replace files in /src with files I supply)
wesnoth_source.zip (mod version 1.0.5)
Mod's thread:
http://www.wesnoth.org/forum/viewtopic.php?t=12337.

_____________________________________________________________

UPDATED 02.08.2006
I think I could experiment with more damage formulas - just for taste of different users - I will add it to the mod if you supply not an idea, but a mathematical formula that takes 1 input number (4-digit, 0 to 9999 integer) maximum 2 non-correletad random input numbers (0 to 99 integers) to generate the damage (floats allowed, to apply must be rounded, floored or ceiled anyway)

We might also "bulk" all unit's attacks in 1 big - and make it hit or not ([ROTFL]) / just joking/ - to allow more complicated formulas (Chi-squared, normal, T-Student) BUT thus we risk situations that both units die in fight (I do not think single blow approach should allow the attacker to avoid defender's counterstrike)- this will force me to completely separate "1.0.2 compliant" code.

Please post your suggestions in this thread: http://www.wesnoth.org/forum/viewtopic.php?t=12337.


_________________________________________________________
Sapient wrote:You appear to be setting damage to a boolean value. Maybe you should type out the formula in english or define some of your terms?

Also, if you are wondering why there is so little response: "the developers feel that randomness is a large part of the game, and that taking the randomness out of the game would be somewhat akin to taking the randomness out of most card games."
I think REDUCTION of randomness is solution - ELIMINATION would result in BORING GAME

Code: Select all

int 
attacker_basic_dmg=getBasicDMG(attacker,defenfer,attack_type,daytime,terrain),
attacker_additional_dmg=getAdditionalDMG(attacker,defenfer,attack_type,daytime,terrain),
defender_basic_dmg=getBasicDMG(defenfer,attacker,attack_type,daytime,terrain),
defender_additional_dmg=getAdditionalDMG(defenfer,attacker,attack_type,daytime,terrain);


for(int i=0;i<attacker->getAttacks();i++)
{
    defender->health-=attacker_basic_dmg+random_0_or_1(distribution_you_picked)*attacker_additional_dmg;
//conditional defender retaliation and other conditional instructions go here
//...
}
//in case defender still has some retaliations to hit - do it now
what spoils game now (IMHO) - is basic_damage==0

Mabye players should have some option of adjusting the split of dmg between basic and additional, as it is with gold, experience an gpv?

Exactly what I mean is

Code: Select all

int
attacker_dmg=getDMG(attacker,defenfer,attack_type,daytime,terrain),
defender_dmg=getDMG(defenfer,attacker,attack_type,daytime,terrain);


for(int i=0;i<attacker->getAttacks();i++)
{
    defender->health-=1+floor(game->split_ratio*(attacker_dmg-1))                  +ceil((1-game->split_ratio)*random_0_or_1(distribution_you_picked)*(attacker_dmg-1));
//conditional defender retaliation and other conditional instructions go here
//...
}
//in case defender still has some retaliations to hit - do it now

They would be able to pick deterministic/random and all possibilities in between. I think this would soon prove, what PLAYERS think of randomness. I think this modification is EXTREMELY EASY to implement and I am pretty amused it was not implemented so far taking into consideration the amount of anti-random feedback on forums.

P.S.
Yes, yes, I've read
http://www.wesnoth.org/forum/viewtopic.php?t=1158
:-)


----------------------------------------------------------------------
It will influence:
-> EV counting formulas
-> Displayed dmg for unit
-> Attack menus
-> ....

Help does NOT need to be influenced - it has to show dmg before dynamically modified split.
____________________________________________________________________________
EDIT:

Now I see some more problems considering this suggestion -
1. Setting split_ratio to high values (above 0.5-0.6) will spoil effects of terrain-defense. Suggestion then is to multiply non-random damage by some ratio dependant on terrain - BUT never lowering the non-random DMG below 1 due to defensive terrain. This would however work great with higher values of split_ratio. Mabye switching to floating point variables for HP would be a nice solution in this case - all round-up problems brought about by integers would disappear making damage formulas MUCH simpler to implement. Of course this requires tweaking precision of displaying HP left. And it is the whole mess it might bring about.

Discrete values are difficult to handle in this particul;ar situation.[/url]
Last edited by Sauron on September 1st, 2006, 4:23 pm, edited 15 times in total.
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Post by JW »

-So that you have a reply ;):

Interesting idea. I would probably try some games with the different luck values to try them out. I was just thinking that it's not really as bad as it seems, only that there are so many battles in one that bad luck is bound to happen in each one.
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

I think main argument agnist this idea would be OAB, it gives too possibilities IMO.
kshinji
Posts: 649
Joined: December 21st, 2005, 7:24 pm
Location: Gdansk, Poland

Post by kshinji »

I have different idea: game should depend on luck, but luck should be shared equally among all players :-)

Its aint KISS, but...
User:Kshinji
Probably there's no point for me posting here, but i'll raise my PC to 1337 before leaving again ;P -- just kidding.
Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Post by Sauron »

kshinji wrote:I have different idea: game should depend on luck, but luck should be shared equally among all players :-)

Its aint KISS, but...
it makes less sense than reducing the random part of dmg. Result would be - you get bad stats - you charge like mad awaiting game to "give you back" your "lost" luck.
Last edited by Sauron on April 18th, 2006, 11:51 am, edited 1 time in total.
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

The code doesn´t say anything to me, because I don´t know c++. So please consider if I´m on the wrong place. :)

What is if the attacker is an iron mauler (20-2, I think) and the defender is an elusivefoot in a castle? With the less random, does he at least one hit, even if he is likely to miss? Or am I wrong? :?
First read, then think. Read again, think again. And then post!
Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Post by Sauron »

toms wrote:The code doesn´t say anything to me, because I don´t know c++. So please consider if I´m on the wrong place. :)

What is if the attacker is an iron mauler (20-2, I think) and the defender is an elusivefoot in a castle? With the less random, does he at least one hit, even if he is likely to miss? Or am I wrong? :?
if you set split_ratio to 0.1 it will do 2 dmg for sure plus 18 if is lucky - all this each hit
If we now take into consideration terrain defense and floating point suggestion:
0.4/*for defense factor is 60%*/ * 2 + 18 if lucky ==
0.8+18 if lucky - all this EACH HIT
Last edited by Sauron on April 18th, 2006, 2:01 pm, edited 2 times in total.
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Thank you, now I understand. Your idea would prevent much anger on not-working killing blows... :wink:
First read, then think. Read again, think again. And then post!
Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Post by Sauron »

toms wrote:Thank you, now I understand. Your idea would prevent much anger on not-working killing blows... :wink:
To some extent I achieved this through WML in Wesnotn 1.1.2 only - see this thread:
http://www.wesnoth.org/forum/viewtopic.php?t=10786

In case we stick to integer-based damage and hitpoints formulas: the non- random part of damage should be a bit adjusted for weak units, so that they do not end up dealing 0 non-random. So some splits would empower low-damage units. Still - I am ready to pay this price.
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
mattyd
Posts: 4
Joined: May 9th, 2006, 2:31 pm
Location: Northern Virginia

Re: Pick the amount of random you accept

Post by mattyd »

Sauron wrote: I think REDUCTION of randomness is solution - ELIMINATION would result in BORING GAME
I don't want a reduction of randomness, I want a better distribution of possible damage. With a unit that can deal 10 damage per strike, I like the idea of being able to deal anywhere between 0 and 10 damage each strike, instead only 0 and 10. But I still think it should be possible to deal 0 or 10 damage - just less likely than it is currently, with the "hit or miss" system. The problem with setting minimum damage like you have done is that in the long run you get units that deal more damage on average (since 10 is still possible, but 0 is not), which I think would have more than a small effect on the game. I want a system that deals the SAME amount of damage on average, but makes 0 and 10 damage less likely, and 5 damage (assuming a 50% chance to hit) most likely. Statistically speaking, this would result in a damage distribution curve that didn't have such fat tails. Terrain is accounted for by centering a normal damage distribution around the value "max damage" * "chance to hit". So, rather than choosing how much randomness I want, I would rather be able to choose to have damage distributed normally (or even, according to a standard deviation of my choice!). I'm sure someone has thought of normal damage distribution before, so I'm going to go dig through the archives now.

As a side note, "side effects" like poision and slow could still be done on a "hit or miss" basis, and you could still have certain units (e.g. trolls and horsemen) deal damage on a hit or miss basis as well, if that unit's attack is seen as a more "reckless" attack.
Kristjan

Post by Kristjan »

The amount of random I accept would be 100%; except magical and marksman - so basically - change nothing in fighting system.
Prognosis
Posts: 3
Joined: June 14th, 2006, 6:55 am

Post by Prognosis »

I like the idea of a distribution centered around the max damage * chance to hit, but maybe the distribution should incorporate the terrain from the perspective of the attacker as well?

What I mean is, say that a an elvish fighter in forest is attacking a merman in shallow water. The elvish fighter defends at 30% in the shallow water, the merman 60%

A weighted average could be used, such as the following:

Total % to account for: 30% Attacker + (100% - 60%) Defender = 70%

([(30/70) * 30%] + [(40/70) * 40%] * 40%) = 35.70%

So 4 damage x 35.70% = 1.430

Using the defender's terrain only, the damage would be centered at 1.6, but this doesn't seem right - a merman and an elf will share the same percent of damage as the base damage, but the elf is at a tremendous disadvantage.

What about further shaping of the distribution, based upon terrain?

For example, in the example above, the distribution is centered at 1.430. The minimum is 0, and the maximum is 4. So there is a range of 1.430 on the low end, and 2.570 on the high end. If the 35.70% value is used to shape the distrubibution, maybe this can be applied to the 1.430 to produce a standard deviation (0.50, in this case)

So a damage of 0 would be 2.8 standard deviations from the mean, and 4 damage would be 5.14 standard deviations
Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Wesnoth 1.0.3 MOD "pick yourself non-random part of dmg

Post by Sauron »

The ideas I posted above resulted in FULLY FUNCTIONAL mod of wesnoth 1.0.2, backward compatibile with 1.0.2.
I have done a lot of good coder's work, for details see this thread:
http://www.wesnoth.org/forum/viewtopic.php?t=12337
and my project's homepage:
http://saurons-mod.zor.org/
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Becephalus
Inactive Developer
Posts: 521
Joined: October 27th, 2005, 5:30 am
Location: St. Paul, Minnesota, USA, Earth

Post by Becephalus »

After a week of extreme luck games that have me contemplating leaving wesnoth (I would say 80% of my last 20 games were decided by luck), I am turning to the dark side on this issue.

Just in last 24 hours I start a game 34/106 141/91 after 1 turn of battle, and game is over, literally a position of no recovery vs a solid player.

Also, lost a game where I had 4 enemy gryphons surrounded by an entire army, lost 4 units and killed 1 gryphon and when odds were 3 dead gryphons and one loss for me. That game was thus over on maybe turn 8?. I also won a game with ISAF that I basically felt embarassed about, as his attacks basically did no dmg and he lost everything on maybe turn 10 or so.

I just played a game with Tonepoet where I went 164/276 and he went 256/276. Two turns of bad luck turned what was a very interesting and close exciting battle into a compete rout. We had almost exactly the same units, mine just decided to go about 20/120 over the course of 2 turns.

I think these are really the two great tradgedies here.

1. Really good and interesting games/situations get completely ruined.
2. Large amounts of time is spent on games which quickly become worhtless (30mins into game you miss your first 14 attacks).
3. Winning or losing in this manner just is not FUN, which is presumably what games are all about.

Anyway not saying this mod is the solution, but wesnoth is REALLY REALLY trying my patience.

I cannot think of a single other strategy game that is good where you can wildly outplay your opponent and get completely obliterated.

Maybe I should start making saves for a luck log, and try to determine exactly what percentage of high quality games are determined by luck.

Myth and I have been talking about how 1v1s between us are basically pointless as whoever the RNG favors wins for example. Its too bad cause myth and I should have fun in 1v1s you would think, but it basically is just sit there and grind until the RNG gives someone a huge break.

anyway just pissed

-bec
There are three roads to ruin: by gambling, which is the quickest; through women, which is the most pleasurable; and through taking the advice of experts, which is the most certain. -de Gaulle
kshinji
Posts: 649
Joined: December 21st, 2005, 7:24 pm
Location: Gdansk, Poland

Post by kshinji »

well, there is one way to avoid losing when you are near to win. Stay defensive for 500 turns, and finish opponent having an ultimate army.

Great idea, huh?

I worship the darkside.
User:Kshinji
Probably there's no point for me posting here, but i'll raise my PC to 1337 before leaving again ;P -- just kidding.
Post Reply