Skip to content

Implement xcom funding and weekly reports#980

Merged
FilmBoy84 merged 17 commits intoOpenApoc:masterfrom
idshibanov:implement_xcom_funding
Feb 5, 2021
Merged

Implement xcom funding and weekly reports#980
FilmBoy84 merged 17 commits intoOpenApoc:masterfrom
idshibanov:implement_xcom_funding

Conversation

@idshibanov
Copy link
Collaborator

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.

image

@idshibanov idshibanov added Enhancement This is a request for something that makes OpenApoc work better or more intuitively Not Yet Implemented This fix or feature is not yet implemented or merged with trunk labels Jan 30, 2021
@idshibanov idshibanov self-assigned this Jan 30, 2021
Copy link
Collaborator

@JonnyH JonnyH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

namespace OpenApoc
{

static const int HIRE_COST_SOLDIER = 600;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you just moved these, but again these should be under the GameState somewhere to allow mods to change it

Copy link
Collaborator Author

@idshibanov idshibanov Jan 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}};
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@idshibanov
Copy link
Collaborator Author

Feedback addressed, moved all hardcoded values to serialized game state. Don't forget to re-run DataExtractor before testing the change.

@FilmBoy84 FilmBoy84 merged commit 6cfa4d5 into OpenApoc:master Feb 5, 2021
@FilmBoy84
Copy link
Collaborator

Spent the day trying to break it, and not errors encountered other than those already listed in other issues
Merging; if anything arises; we can try to fix then

Many thanks for your work @idshibanov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement This is a request for something that makes OpenApoc work better or more intuitively Not Yet Implemented This fix or feature is not yet implemented or merged with trunk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants