Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2877 closed defect (fixed)

[PATCH] Entity limit depending on tech

Reported by: mimo Owned by:
Priority: Nice to Have Milestone: Alpha 18
Component: UI & Simulation Keywords:
Cc: Patch:

Description

It may-be useful to have entity limits which are removed when a technology is researched. A typical use case would be a CivCenter limit of 1 which is removed when the town_phase is researched (instead of the present requirement on town_phase). That would allow for scenarios without starting CivCenter. This would also give a lot of additional possibilities for mods.

Here is a patch with such a limit on CivCenter. This is still a WIP as the cases of ptol and sele need more thinking: presently they start with a civcenter and can build only military colonies. For such a patch to be consistent with this behaviour, they should be able to build a civcenter if they have none, and colonies if they already have a civcenter. But before continuing on it, I'd like to know what people think of this approach.

Attachments (5)

limit.diff (5.8 KB ) - added by mimo 10 years ago.
limit-v2.diff (29.4 KB ) - added by mimo 10 years ago.
newlimit-v3.diff (26.5 KB ) - added by mimo 9 years ago.
newlimit-v4.diff (31.8 KB ) - added by mimo 9 years ago.
latest version which also support loading and reloading of players with different player template
newlimit-v5.diff (24.4 KB ) - added by mimo 9 years ago.
New version, after removal of the player template part commited in r16092

Download all attachments as: .zip

Change History (13)

by mimo, 10 years ago

Attachment: limit.diff added

comment:1 by Itms, 10 years ago

I really like the idea and the way it would allow to solve the no-cc-at-game-start situation. Please go on, I have no problem either with the implementation you propose which is plain and clear IMO.

comment:2 by agentx, 10 years ago

Great idea. I started working on a island map and wanted the players to start with a ship only, so searching a good place for a CC is part of the game. This proposal would eliminate a lot of template hacks.

by mimo, 10 years ago

Attachment: limit-v2.diff added

comment:3 by mimo, 10 years ago

Keywords: patch review added
Summary: Entity limit depending on tech[PATCH] Entity limit depending on tech

Here is an updated working patch which features:

  • the number of civcentre is limited to 1 at village phase, and no limits for other phases.
  • the number of militarycolony is limited to 0 at village phase, and no limits for other phases.
  • for civs with colony, builders can only build civcentre if there is no civcentre, and only colony if there is already one or more civcenters, while heroes can still build additional civcentre as presently
  • all these limits can be changed in the templates

So the behaviour should be identical to the one we have now, but with the additional possibility to build (or rebuild if destroyed) one civcenter at village phase and more flexibility for mods.

comment:4 by mimo, 9 years ago

Here is a much cleaner implementation of the limit removal.

by mimo, 9 years ago

Attachment: newlimit-v3.diff added

by mimo, 9 years ago

Attachment: newlimit-v4.diff added

latest version which also support loading and reloading of players with different player template

comment:5 by mimo, 9 years ago

In 16092:

add support for civ specific player template, see #2877

by mimo, 9 years ago

Attachment: newlimit-v5.diff added

New version, after removal of the player template part commited in r16092

comment:6 by mimo, 9 years ago

Keywords: review removed
Resolution: fixed
Status: newclosed

Commited in r16097 which missed the link to this ticket. This will allow to start games without cc, though some changes are now needed to adapt Petra.

comment:7 by leper, 9 years ago

In 16099:

Clean up LoadPlayerSettings.

Include gaia to make iteration easier.
Add TemplateExists() to the TemplateLoader. Refs #2877.

comment:8 by Stan, 9 years ago

Keywords: patch removed
Milestone: BacklogAlpha 18
Note: See TracTickets for help on using tickets.