Implement xcom funding and weekly reports#980
Conversation
JonnyH
left a comment
There was a problem hiding this comment.
generally looks cool, some serialization issues (IE you need to modify the xml if you alter GameState or any child classes), some things probably should be modd-able instead of constants in-code (but that can wait to be fixed later), and I love the const keyword a little too much.
game/state/rules/agenttype.h
Outdated
| namespace OpenApoc | ||
| { | ||
|
|
||
| static const int HIRE_COST_SOLDIER = 600; |
There was a problem hiding this comment.
I know you just moved these, but again these should be under the GameState somewhere to allow mods to change it
There was a problem hiding this comment.
Potential problem here is that old saves won't have any values in them. Then I have to hardcode the check in GameState::initState() which will look something like this:
if (this->agent_salary.empty())
{
this->agent_salary = {{AgentType::Role::Soldier, 600},
{AgentType::Role::BioChemist, 800},
{AgentType::Role::Physicist, 800},
{AgentType::Role::Engineer, 800}};
}
There was a problem hiding this comment.
TBH, we're at Alpha, whilst it would be nice to have those values; they're not going to come from nowhere
For testing and bug-whacking, users should be starting a new game everytime a feature is added to trunk anyway
Once merged, I'm tempted to say we bump to the Alpha 0.3 series and tell all users to start new games just to reinforce that mindset
Thanks for all your effort with this by the way
I'll review the code fully once I've finished with the current sprite stuff I'm testing for our 3D modellers
There was a problem hiding this comment.
I certainly don't worry about save compatibility right now - especially for values that aren't really useful for mods (as mods are just 'saves' we load on top of the base state, but stuff like this is new info exposed so no current modding stuff could use it anyway)
It doesn't seem out of the question to have a "save version" - maybe increment a number every time we /know/ we've broken something terrible and tell the user, but I fear people will take that as a "If the number hasn't incremented I expect saves to work", which isn't really something I want to put work into right now.
Maybe post-1.0 we can do better trying to keep this stable, but right now I wouldn't put any effort into compatibility.
There was a problem hiding this comment.
Alright, I'll keep it in mind in the future. Regarding this particular PR I already added defaults to gamestate init. We can remove them in the future.
|
Feedback addressed, moved all hardcoded values to serialized game state. Don't forget to re-run DataExtractor before testing the change. |
|
Spent the day trying to break it, and not errors encountered other than those already listed in other issues Many thanks for your work @idshibanov |
Player organization now will receive government funding based on it's weekly rating. Funding is adjusted based on OG formula. Added a weekly funding assessment screen.
Weekly score now reset at the start of every week.
Also fixed weekly loop as it was running on Tuesday morning instead of Monday.