project-navigation
Personal tools

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zearro

Pages: [1]
1
Bugs prior to release 2.4 / Re: Soldier Stat Increase System: ABILITY_SPEED
« on: December 28, 2011, 09:41:03 am »
Alright! I think this should be the patch that fixes it. It at least brings the code up to design specification.

Next problem. If a soldier gets Max Speed experience (~6 rounds of full running, only ~4 for crouching), in 100 mission, they get 3 TU. (assuming no changed in armor penalty, which is unlikely.)

2
Bugs prior to release 2.4 / Re: Soldier Stat Increase System: ABILITY_SPEED
« on: December 22, 2011, 02:57:34 pm »
Oh, I guess I better mention how i verified the existence of this.

I got into the battlescape, and had one of my characters move (not crouched) ten TU and use the remaining TUs for reaction fire behind an alien.
Ended my turn, got my reaction fire, and killed the alien.
(you can pull up the console and issue the command debug_listscore to look at the data)
My turn starts, pull up the console, issue the command debug_killteam 7,
Ended the mission, pulled up the console to view the experience gained by skill, and saw 20 xp () instead of the expected 20 + 1 = ( 20 + (int) 12 / 10 ).

I'd suppose you have to spend more than a total 10 TU in reaction fire, or simply firing a weapon for that matter to not get the contribution in question rounded down to zero, and thus undetectable.

I didn't record the numbers exactly, they're from memory, so I'll do it again soon and substitute the real numbers, but this should be close enough to give the idea.

3
Bugs prior to release 2.4 / Soldier Stat Increase System: ABILITY_SPEED
« on: December 22, 2011, 02:34:54 pm »
this is sort of an informal bug report as it doesn't have a solid test case, but i have done an experiment to validate my statements. Please allow me to try and reason it out with a logical argument.

From my incomplete readings of the forum, and the current source code,
I've found that TUs spent firing weapons don't /actually/ increase experience towards ABILITY_SPEED, when it is supposed to.

I've read on the forum,
http://ufoai.ninex.info/forum/index.php/topic,2254.msg13542.html#msg13542
Quote
Speed: 1 point for every space moved. 2 points for every space moved while crouched. 1 point for every 10 TUs spent using weapons.
I've noticed the TUs are stored by skill, and thus the aforementioned calculation must include a loop to sum the TUs spent over the array of skills. The current code does have such a loop statement.
The current source code under src/game/g_match.c in the method static int G_GetEarnedExperience (abilityskills_t skill, character_t *chr)
https://github.com/ufoai/ufoai/blob/master/src/game/g_match.c
Code: [Select]
case ABILITY_SPEED:
experience = chr->scoreMission->movedNormal / 2 + chr->scoreMission->movedCrouched + (chr->scoreMission->firedTUs[skill] + chr->scoreMission->firedSplashTUs[skill]) / 10;
break;
the variable being switched upon is skill, and its value is implicitly ABILITY_SPEED, so it only adds values from firedTUs and firedSplashTUs at the index ABILITY_SPEED, which in my source greping and readings, is never actually written to.

the fix is to add a loop to iterate over the array, summing over each index, in a similar fashion as the next case, ABILITY_ACCURACY.
this should provide the functionality of adding a tenth of all TUs spent firing weapons to the experience for ABILITY_SPEED.

(at first i thought firedTUs[ABILITY_SPEED] was used (or could be) to track TUs spent on reaction fire, but it doesn't seem the case from what i've read.)

I'd be willing to do the work, after this is verified and whatnot. I'm new to contributing to open source projects, and would like the opportunity to help. I still have a lot of reading to do, and observations to make. I have some other ideas to present at a later time related to the concepts and code, but one topic per topic seems a good start.

By the way, not that it should matter, but for completeness sake...
I first noticed this in the 2.4-dev debug version for Mac OS X. I just built the source from the git repo today, and that is when I did my last validation experiment.

If anyone could verify this for me, that would be outstanding. I don't think i'm crazy, but i could be...

Pages: [1]