Modified Luck in Source Code

General feedback and discussion of the game.

Moderator: Forum Moderators

User avatar
PawelS
Posts: 31
Joined: March 28th, 2009, 12:15 pm
Location: Poland, EU

Modified Luck in Source Code

Post by PawelS »

I'm one of those who think that there is too much randomness in this game. But it's open source, so, instead of complaining, I made a small change in the source code that eliminates the luck factor.
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Save time - the DIY luck thread post

Post by DEATH_is_undead »

PawelS wrote:I'm one of those who think that there is too much randomness in this game. But it's open source, so, instead of complaining, I made a small change in the source code that eliminates the luck factor.
Just know you can't play Multiplayer.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
User avatar
PawelS
Posts: 31
Joined: March 28th, 2009, 12:15 pm
Location: Poland, EU

Re: Save time - the DIY luck thread post

Post by PawelS »

Currently I play single player only, but if I find some other people who like to play the same version as me in multiplayer, I guess there won't be problems...
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Save time - the DIY luck thread post

Post by thespaceinvader »

D_i_u meant to say that you won't be able to play online multiplayer on the official server =)
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
scienceguy8
Posts: 226
Joined: June 27th, 2007, 2:54 pm
Location: Middle of Nowhere, U.S.A.
Contact:

Re: Save time - the DIY luck thread post

Post by scienceguy8 »

thespaceinvader wrote:D_i_u meant to say that you won't be able to play online multiplayer on the official server =)
Just to clarify, when you connect to the server, it checks your software and compares it to an official copy. If the engine differs in any way from the official version, you will be booted off. If you want to play your version with someone else, you will need to distribute it and possibly set up your own multiplayer server.
"You can't kill an unarmed, upside down man!"
Dr. Rodney McKay
Stargate Atlantis
Runner

Gilberti Industries
scienceguy8
Proud Member of the Marching Salukis
User avatar
PawelS
Posts: 31
Joined: March 28th, 2009, 12:15 pm
Location: Poland, EU

Re: Save time - the DIY luck thread post

Post by PawelS »

Thanks for the information :)
Soliton
Site Administrator
Posts: 1732
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Save time - the DIY luck thread post

Post by Soliton »

PawelS wrote:Currently I play single player only, but if I find some other people who like to play the same version as me in multiplayer, I guess there won't be problems...
Indeed that will work just fine and of course you can play that on the official multiplayer server. You should mention it in your game title though so others don't get confused when observing and getting OOS.
"If gameplay requires it, they can be made to live on Venus." -- scott
User avatar
PawelS
Posts: 31
Joined: March 28th, 2009, 12:15 pm
Location: Poland, EU

Re: Save time - the DIY luck thread post

Post by PawelS »

Thanks to everyone for giving me advice, but I don't have any plans about starting multiplayer games with my version for now.
User avatar
Turuk
Sithslayer
Posts: 5283
Joined: February 28th, 2007, 8:58 pm
Contact:

Re: Modified Luck in Source Code

Post by Turuk »

Split to avoid derailing the luck thread, as if had not been enough already. Nothing personal.
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Save time - the DIY luck thread post

Post by DEATH_is_undead »

PawelS wrote:Thanks to everyone for giving me advice, but I don't have any plans about starting multiplayer games with my version for now.
You COULD make your own server, and make it only accepts your version... Assuming you could legally do that?
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
joshudson
Posts: 501
Joined: January 17th, 2006, 8:04 pm
Contact:

Re: Modified Luck in Source Code

Post by joshudson »

You could bypass the checks. Don't bother. It will let you play but all games you are in will get Out of Sync messages fairly quickly.

I know. I've messed up and connected a modified version by accident.
CHKDSK has repaired bad sectors in CHKDSK.EXE
Dalkor
Posts: 8
Joined: March 27th, 2009, 8:04 pm

Re: Modified Luck in Source Code

Post by Dalkor »

May I ask how exactly you modified the game and how quality the gameplay is without randomness?
User avatar
PawelS
Posts: 31
Joined: March 28th, 2009, 12:15 pm
Location: Poland, EU

Re: Modified Luck in Source Code

Post by PawelS »

My change is pretty simple: the combat damage is multiplied by the chance to hit, and then the chance to hit is set to 100%. So it eliminates luck from combat entirely - I wouldn't mind a bit luck, but it was easier for me to eliminate it altogether than to reduce it. I'm aware that it makes slow and poison attacks more powerful (because they always hit and apply their effects to the victim), so there may be balance problems if it's used in multiplayer. There are still some random factors in the game outside of combat, like getting random traits when recruiting a unit, and some events in the campaign scenarios.

In "actions.cpp", after

Code: Select all

// Resistance modifier.
damage_multiplier *= opp.damage_from(*weapon, !attacking, opp_loc);
I added

Code: Select all

damage_multiplier *= chance_to_hit;
damage_multiplier /= 100;
chance_to_hit = 100;
Currently I'm playing the official campaigns and it works well, the combat prediction is displayed correctly (only one possible outcome with 100% chance), and the AI doesn't seem to have problems with it. I like the gameplay with this change because it makes careful planning more important, and it eliminates frustration caused by unfavorable random results ;) Some people may dislike the situation where everything is predictable, but I like it.

(Splitting is ok for me, I didn't expect to start such a discussion when I was posting my comment at the luck thread)
Euthanatos93
Posts: 83
Joined: March 30th, 2009, 2:17 am

Re: Modified Luck in Source Code

Post by Euthanatos93 »

I like this idea. Makes wesnoth more chess-like. Still, it completely invalidates terrain combat modifiers. Maybe terrain might affect a different aspect of combat to compensate for this?
innocuous
Posts: 7
Joined: March 28th, 2008, 11:49 pm

Re: Modified Luck in Source Code

Post by innocuous »

Maybe terrain would give a % damage reduction instead.
Post Reply