pseudo-random generator + improvement idea

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

Moderators: Forum Moderators, Developers

User avatar
Nobun
Code Contributor
Posts: 128
Joined: May 4th, 2009, 9:28 pm
Location: Italy

Re: pseudo-random generator + improvement idea

Post by Nobun » January 16th, 2010, 6:25 pm

hmm perhaps it is the right place to ask it, but...

the source module that direct the result of a battle is only "action.cpp" or there are involved other modules?

I am a novice (noob) programmer (only for fun) however I'd like to apply a my personal idea and try to see if I'm able to do it (probably not, but I'd like to try). I am one of people that thinks that, in some situations, luck require balancement and I have some ideas I'd like to try to implement. I'm thinking of a personal little mod (out of official development) that, when finished, should mantain the randomness factor, but with a balancement that avoids that luck system can overpass some limits of balancement (idea compleately different from actual mod for the same purpose... I'd like to remain binded to the original idea of game, without adding extra parameters for players or other strange things).

For this reason, I need only to know what files I have to take care of (wesnoth code is very big xD), if only "action.cpp" or also other ones.
Obliouvsly, IF (I mark if becouse I'm not sure at all I'm able to do this) I finish my work I will release a news in forum, with sourcecode included.

Notes: I post here for several reasons
1) It is not an "user" request but it is related to sourcecode of wesnoth
2) Opeining an other thread for the same subject probably shouldn't be good
3) Even if I'm thinking an external modification (I'm sure it is useless to submit the ideas, becouse you previously showed not interest to code them, so I'd like to try by myself) this is the only place in-topic I found to ask this

Sorry if I posted in the wrong place. I tried to find the place seems to me best for this question

User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: pseudo-random generator + improvement idea

Post by Crab » January 18th, 2010, 10:28 pm

Yes, this is a right place to ask.

src/attack_prediction.cpp is also important if you want the actual chances-to-hit to be displayed correctly in-game. And, this file is *very* important for the ai attack selection code.

And, you are correct, actual attack resolution is in src/actions.cpp

User avatar
Xudo
Posts: 561
Joined: April 3rd, 2009, 5:26 pm

Re: pseudo-random generator + improvement idea

Post by Xudo » April 16th, 2010, 11:40 am

I think Wesnoth RNG good as it is.
If one unit kills other when all his(attackers) strikes are hit at their best Time of day, then this unit is an anti-unit for "other" (at same levels).
For example human Mage vs Ghost in ranged combat at +25% to lawful. Ghost will be dead. Mage is anti-unit for Ghost.

If devs don't want, that some unit should be anti-.. for someone, they should change their defence\hp\type of attack or damage (attacker kills his target, but left too few hp to survive enemy turn).

If RNG provides often long kombos of hit's, gold cost of unit\income and xp, required for lvlup, should be changed, not RNG.

Post Reply