#4075: Research was speeded up in master due to wrong research code in rules.ini
-------------------------+-------------------------------------
 Reporter:  crab_        |             Owner:
     Type:  bug          |            Status:  new
 Priority:  normal       |         Milestone:  unspecified
Component:  Data: Stats  |           Version:  git/master
 Keywords:  research     |  Operating System:  All/Non-Specific
-------------------------+-------------------------------------
\
\
 Steps to reproduce:
 1) Run 3.1.0
 2) Start game Sk-Rush FullBases T3
 3) Remember rime ro research "Thermite Bomb Bay" - '''3:00''' (open
 research facility and start research to see time to finish)
 4) Run master
 5) Start game Sk-Rush FullBases T3
 6) See time to research "Thermite Bomb Bay" - '''1:44''' (open research
 facility and start research to see time to finish)

 This is happend because in master version research upgrades now also
 increase power of research module.
 In version 3.1.0 only power of research facility become upgraded.

 3.1.0 formula = lab_power + lab_power*upgrade + lab_module_power
 master formula = lab_power + lab_power*upgrade + lab_module_power*upgrade


 Lets see code in rules.ini.
 This code makes upgrade applied for both research facility and research
 module.

 eventResearched(research, structure, player)

 else if (['ResearchPoints', 'ProductionPoints', 'PowerPoints',
 'RepairPoints', 'RearmPoints'].indexOf(s[0]) >= 0)
                 {
                         for (var i in Upgrades[player].Building)
                         {
                                 if (Stats.Building[i][s[0]] > 0) // only
 applies if building has this stat already
                                 {
                                         Upgrades[player].Building[i][s[0]]
 += Math.ceil(Stats.Building[i][s[0]] * s[1] / 100);
                                         //debug("  upgraded " + i + " to "
 + Upgrades[player].Building[i][s[0]] + " by " +
 Math.ceil(Stats.Building[i][s[0]] * s[1] / 100));
                                 }
                         }
                 }


 This code increases research points for
  - research facility
  - research module (AHTUNG!)
\
\
\

--
Ticket URL: <http://developer.wz2100.net/ticket/4075>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to