Modified Luck in Source Code
Moderator: Forum Moderators
Modified Luck in Source Code
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.
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Save time - the DIY luck thread post
Just know you can't play Multiplayer.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.
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.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Save time - the DIY luck thread post
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...
- 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
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.
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
- 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
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.thespaceinvader wrote:D_i_u meant to say that you won't be able to play online multiplayer on the official 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
Dr. Rodney McKay
Stargate Atlantis
Runner
Gilberti Industries
scienceguy8
Proud Member of the Marching Salukis
Re: Save time - the DIY luck thread post
Thanks for the information 

Re: Save time - the DIY luck thread post
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.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...
"If gameplay requires it, they can be made to live on Venus." -- scott
Re: Save time - the DIY luck thread post
Thanks to everyone for giving me advice, but I don't have any plans about starting multiplayer games with my version for now.
Re: Modified Luck in Source Code
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
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Save time - the DIY luck thread post
You COULD make your own server, and make it only accepts your version... Assuming you could legally do that?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.
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.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Modified Luck in Source Code
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.
I know. I've messed up and connected a modified version by accident.
CHKDSK has repaired bad sectors in CHKDSK.EXE
Re: Modified Luck in Source Code
May I ask how exactly you modified the game and how quality the gameplay is without randomness?
Re: Modified Luck in Source Code
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
I added
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)
In "actions.cpp", after
Code: Select all
// Resistance modifier.
damage_multiplier *= opp.damage_from(*weapon, !attacking, opp_loc);
Code: Select all
damage_multiplier *= chance_to_hit;
damage_multiplier /= 100;
chance_to_hit = 100;

(Splitting is ok for me, I didn't expect to start such a discussion when I was posting my comment at the luck thread)
-
- Posts: 83
- Joined: March 30th, 2009, 2:17 am
Re: Modified Luck in Source Code
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?
Re: Modified Luck in Source Code
Maybe terrain would give a % damage reduction instead.