Modified Luck in Source Code
Moderator: Forum Moderators
Re: Modified Luck in Source Code
Uhm... guys, no it doesn't. Re-read PawelS's first sentence:
So, a 5-4 attack with 50% CTH will do a flat 10 damage, every time; a 5-4 attack with a 70%CTH will do 14 damage, every time. Terrain defenses are taken into account.PawelS wrote: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%.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
Re: Modified Luck in Source Code
It should be fairly easy to make it have some luck. Just make it that each attack has a 'guaranteed' component. This damage is inflicted whether the hit lands or not. The remainder is calculated based on whether it hits or not.PawelS wrote:I wouldn't mind a bit luck, but it was easier for me to eliminate it altogether than to reduce it.
Then you can scale what the guaranteed component is. e.g. 50% of damage could be dealt in 'guaranteed' doses, and 50% based on whether hits land or not.
David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Re: Modified Luck in Source Code
Yes, that's how it works.turin wrote:So, a 5-4 attack with 50% CTH will do a flat 10 damage, every time; a 5-4 attack with a 70%CTH will do 14 damage, every time. Terrain defenses are taken into account.
Good idea, but it's a bit more complicated to implement than just adding a few lines of code.Dave wrote:It should be fairly easy to make it have some luck. Just make it that each attack has a 'guaranteed' component. This damage is inflicted whether the hit lands or not. The remainder is calculated based on whether it hits or not.
Then you can scale what the guaranteed component is. e.g. 50% of damage could be dealt in 'guaranteed' doses, and 50% based on whether hits land or not.
Speaking of gameplay, I noticed that the campaigns are a little easier with this change (compared to unmodified game without reloading), because it's easier to control which units get experience, and to avoid losing units. So it's better to play the campaigns at higher difficulty levels.
- thespaceinvader
- Retired Art Director
- Posts: 8414
- Joined: August 25th, 2007, 10:12 am
- Location: Oxford, UK
- Contact:
Re: Modified Luck in Source Code
I'd like to add: I'm extremely pleased to see someone who doesn't like the current luck system actually put his code where his mouth is and mod the game to make a luckless version.
Is there any chance that you could upload the relevant files somewhere along with instructions for the less technically-minded to include them in their game? It would save an awful lot of flamewars if we could, instead of telling people 'it's not going to happen in mainline, so mod the game if you want it', tell them 'it's not going to happen in mainline, but follow the instructions in this linked post to do it'.
Is there any chance that you could upload the relevant files somewhere along with instructions for the less technically-minded to include them in their game? It would save an awful lot of flamewars if we could, instead of telling people 'it's not going to happen in mainline, so mod the game if you want it', tell them 'it's not going to happen in mainline, but follow the instructions in this linked post to do it'.
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.
Re: Modified Luck in Source Code
I'm not sure what should I upload (and where). Modifying the actions.cpp file shouldn't be a problem for someone who knows how to compile the game (there are threads about compiling on different systems in the "Release Announcements, Compiling, and Installation" section). Someone who doesn't know how to compile would need the executable. I have a Windows executable with my change added (version 1.6, compiled using CodeBlocks), but I don't know where to upload it (it's over 12 MB).
Re: Modified Luck in Source Code
There will be a WML-based era identical to this one (each hit deals damage according to the opponent's defense with 100% CtH) when 1.6.1 comes out.
EDIT: In case anyone would interpret the above wording as meaning that the era would ever be mainline, don't.
EDIT: In case anyone would interpret the above wording as meaning that the era would ever be mainline, don't.
- thespaceinvader
- Retired Art Director
- Posts: 8414
- Joined: August 25th, 2007, 10:12 am
- Location: Oxford, UK
- Contact:
Re: Modified Luck in Source Code
Ah, that makes life much easier =)
I'm showing my level of technical nous, here, aren't i - I completely forgot about that little intermediate 'compiling' stage before you can apply changes like this >.<
I'm showing my level of technical nous, here, aren't i - I completely forgot about that little intermediate 'compiling' stage before you can apply changes like this >.<
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.
Re: Modified Luck in Source Code
Great! An easy way to try out a no luck mod! I'll look forward to that.
Good is simply that which is willed. - Eugene Halliday
Re: Modified Luck in Source Code
Obviously this is what is already occuring, since he's multiplying by chance to hit.
So if you had a 10-2 attack against a unit on 50% terrain, you'd do 5-2, or 10 damage.
So if you had a 10-2 attack against a unit on 50% terrain, you'd do 5-2, or 10 damage.
Re: Modified Luck in Source Code
@Jozrael: Seems you have read only the first page of this thread before posting
Re: Modified Luck in Source Code
i wounder if that's always the case. some scenarios where i put e.g footpads on terrain where they have 70% defense to delay a big army. there's a good (more or less calculable) chance that some of them level (which further adds to the delay tactics). shouldn't the ai have a better chance than to get rid of them?PawelS wrote:Speaking of gameplay, I noticed that the campaigns are a little easier with this change (compared to unmodified game without reloading), because it's easier to control which units get experience, and to avoid losing units. So it's better to play the campaigns at higher difficulty levels.
Re: Modified Luck in Source Code
In some cases this may be true, although units that have 70% defense don't take much damage, so in combination with healers and/or army rotation they often can be used for defense effectively.
Re: Modified Luck in Source Code
I am glad to see that someone, with "code" knowledge, tries to make something with the fighting system!
Cheer up PawelS!
If I can help you in any way (except technical one), to test your setup, just PM me when you want...
Cheer up PawelS!
If I can help you in any way (except technical one), to test your setup, just PM me when you want...
"Of course His Majesty is a pacifist. When I told him that to initiate war was a mistake, he agreed.Thus, gradually, he began to lead toward war."-Emperor Shòwa (Enlightened Peace)'s chief cabinet secretary
Re: Modified Luck in Source Code
I did it basically to be able to play the campaigns in "deterministic mode" myself, so I don't need any more testing. Of course you're free to make the same change, test it, and post your impressions here (if you don't know how to compile and want to get the Windows executable from me, contact me by PM).
Btw I noticed a bug: sometimes when a unit has two attacks, and is able to kill the enemy with any of them, the one that makes my unit take some damage is selected as default instead of the one that allows my unit to remain unscratched. I don't know if this is caused by my change or a bug in the standard version of Wesnoth.
Btw I noticed a bug: sometimes when a unit has two attacks, and is able to kill the enemy with any of them, the one that makes my unit take some damage is selected as default instead of the one that allows my unit to remain unscratched. I don't know if this is caused by my change or a bug in the standard version of Wesnoth.
Re: Modified Luck in Source Code
Is poison involved? If so that's fixed in the next version.PawelS wrote:Btw I noticed a bug: sometimes when a unit has two attacks, and is able to kill the enemy with any of them, the one that makes my unit take some damage is selected as default instead of the one that allows my unit to remain unscratched.
"If gameplay requires it, they can be made to live on Venus." -- scott