HomeWildfire Games

Add a time multiplier for AI levels
AuditedrP21423

Description

Add a time multiplier for AI levels

Differential Revision: https://code.wildfiregames.com/D1350

Details

Auditors
temple
Committed
mimoMar 3 2018, 11:05 AM
Differential Revision
D1350: Add a time multiplier for AI levels
Parents
rP21422: [Windows] Automated build.
Branches
Unknown
Tags
Unknown
Build Status
Buildable 5317
Build 9037: Post-Commit BuildJenkins

Event Timeline

Imarok added a subscriber: Imarok.Mar 3 2018, 11:17 AM

I think it would be good to update the description in binaries/data/mods/public/simulation/ai/petra/data.json which currently says:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%). In addition, the Sandbox level does not expand nor attack."

mimo added a comment.Mar 3 2018, 11:26 AM

I think it would be good to update the description in binaries/data/mods/public/simulation/ai/petra/data.json which currently says:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%). In addition, the Sandbox level does not expand nor attack."

Agree, i didn't do it because i had no good sentence.
"In addition, the Sandbox level does not expand nor attack and the easiest levels have an increased production and building time." ?

Imarok added a comment.EditedMar 3 2018, 11:37 AM
In rP21423#28996, @mimo wrote:

I think it would be good to update the description in binaries/data/mods/public/simulation/ai/petra/data.json which currently says:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%). In addition, the Sandbox level does not expand nor attack."

Agree, i didn't do it because i had no good sentence.
"In addition, the Sandbox level does not expand nor attack and the easiest levels have an increased production and building time." ?

What about:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%) and the easiest levels have a slower production and building rate. In addition, the Sandbox level does not expand nor attack."

mimo added a comment.Mar 3 2018, 11:40 AM
In rP21423#28996, @mimo wrote:

I think it would be good to update the description in binaries/data/mods/public/simulation/ai/petra/data.json which currently says:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%). In addition, the Sandbox level does not expand nor attack."

Agree, i didn't do it because i had no good sentence.
"In addition, the Sandbox level does not expand nor attack and the easiest levels have an increased production and building time." ?

What about:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%) and the easiest levels have a slower production and building rate. In addition, the Sandbox level does not expand nor attack."

i buy it. thanks. I'll commit it later if nobody has any additions.

In rP21423#28999, @mimo wrote:
In rP21423#28996, @mimo wrote:

I think it would be good to update the description in binaries/data/mods/public/simulation/ai/petra/data.json which currently says:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%). In addition, the Sandbox level does not expand nor attack."

Agree, i didn't do it because i had no good sentence.
"In addition, the Sandbox level does not expand nor attack and the easiest levels have an increased production and building time." ?

What about:
"The AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%) and the easiest levels have a slower production and building rate. In addition, the Sandbox level does not expand nor attack."

i buy it. thanks. I'll commit it later if nobody has any additions.

Good and thx for the feature ;P

temple raised a concern with this commit.Mar 31 2018, 10:28 PM
temple added a subscriber: temple.
temple added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
251–254

Gatherers still gather at the normal rate after "gift from the gods", guessing it's related to this?

This commit now has outstanding concerns.Mar 31 2018, 10:28 PM
mimo added inline comments.Apr 1 2018, 12:38 PM
/ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
251–254

Yes, thanks for noticing.
The problem is that ResourceGatherers are not noticed about changes in the cheatTimeChanged, so their cached rates are not updated. two ways to solve that:

  • adds a cheatTimeChanged message broadcasted by Player.js when such a change, which would trigger a recalculateGatherRate
  • do as before, and update the rate for the cheatTimeMultiplier at every call

I suppose the first approach is best for performance as most games won't use such a cheat, but have no strong feeling. Any opinion?

temple accepted this commit.Apr 2 2018, 10:52 PM
All concerns with this commit have now been addressed.Apr 2 2018, 10:52 PM