Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to enforce structure limits #409

Merged
merged 2 commits into from Sep 26, 2019

Conversation

topimiettinen
Copy link
Contributor

As a new option, remove structures which exceed structure limits. This
allows use of full bases while still making meaningful limits.

@KJeff01 KJeff01 added this to the 3.4.0 milestone Jun 26, 2019
@topimiettinen
Copy link
Contributor Author

Maybe there should be code to disable this for challenges.

@topimiettinen
Copy link
Contributor Author

Force pushed a new version which disables the buttons if challenge is active.

@topimiettinen
Copy link
Contributor Author

I added a commit to disable AA structures when there can be no VTOLs.

@KJeff01 KJeff01 modified the milestones: 3.4.0, 3.3.1 Sep 15, 2019
@topimiettinen topimiettinen force-pushed the enforce-structure-limits branch 2 times, most recently from a6ef33f to d182441 Compare September 17, 2019 08:35
@topimiettinen
Copy link
Contributor Author

Pushed a fix for Windows build. Earlier I added optimizations to avoid useless research.

@KJeff01
Copy link
Member

KJeff01 commented Sep 21, 2019

I don't think hardcoding what research to disable is a good idea. A stat mod could easily include a ton more research related to VTOLs, cyborgs, lassats, and uplinks.

Perhaps a new key-value JSON pair could be added to all the relevant research and then another function could find all those research items to pass to RecursivelyDisableResearch().

0 = don't disable
1 = disable VTOL
2 = disable cyborg
3 = disable lassat
4 = disable uplink
...

The above just demonstrates an example.

@topimiettinen
Copy link
Contributor Author

Yes, that's better. There's still a special case for Sat Uplink vs. LasSat: can't disable Uplink research if LasSat is not disabled.

@KJeff01
Copy link
Member

KJeff01 commented Sep 25, 2019

Lassat research doesn't disable if Lassat limits are 0.

@topimiettinen
Copy link
Contributor Author

@KJeff01 I could not reproduce this, what was your setup?

@topimiettinen
Copy link
Contributor Author

The research is only disabled if structure limits are enforced at start, because if the map contains for example VTOL factories, the players should be able to research VTOLs and their upgrades and AA should not be disabled. But that rule could be relaxed for Lassat and Uplink: whether the structures exist at start or not does not matter if you can't build replacements and there are no related upgrades. Then the research can be disabled even if there is no enforcing.

@KJeff01 KJeff01 removed the request for review from Forgon2100 September 26, 2019 00:12
@KJeff01
Copy link
Member

KJeff01 commented Sep 26, 2019

@topimiettinen Ah, you're right. I didn't notice that the limits must be enforced for disabling the research.

@topimiettinen
Copy link
Contributor Author

I updated so that LasSat and Uplink research is not conditional to forced limits anymore.

@KJeff01
Copy link
Member

KJeff01 commented Sep 26, 2019

The button to enforce structure limits doesn't disable. If I try to go back to non-enforcement settings it simply stays in the enabled state. At least after pressing the checkmark button, anyway.

Aside from the above, I've tested some skirmishes and a few local multiplayer games and it all looks to be working without issues.

As a new option, remove structures which exceed structure limits. This
allows use of full bases while still making meaningful limits.
If structure limits are enforced and VTOLs are disabled, disable also
AA structures and related research. This improves the AIs in no-VTOL
games. Likewise, disable useless research for no-cyborg, no-lassat and
no-satlink games.

Closes Warzone2100#510.
@topimiettinen
Copy link
Contributor Author

Thanks for testing, should be fixed now.

@KJeff01 KJeff01 merged commit 55d627f into Warzone2100:master Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants