#1700 closed defect (fixed)
Persian architecture bug ?
Reported by: | mimo | Owned by: | Yves |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 12 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
With the new technology Persian architecture, buildings are no more fully built.
For example, houses before the tech have health 1200; and after the tech, their max health is increased to 1500, but they are only built up to 1200. You have to reoder your builders to finish it to reach 1500 (houses built before the tech are them automatically upgraded to 1500).
I'm on build 12759 from 0ad.dev/ubuntu
Attachments (1)
Change History (9)
comment:1 by , 12 years ago
follow-up: 4 comment:2 by , 12 years ago
I've made a patch for the first problem. I think it's intended that existing buildings only increase their maxHitpoints because it is more logical and makes sense for gameplay (otherwise it wouldn't make any sense to get this tech before you're under attack).
comment:3 by , 12 years ago
We had a discussion on IRC. http://irclogs.wildfiregames.com/2012-11-18-QuakeNet-%230ad-dev.log To sum it up: OnTechnologyModification in Health.js already contains much or all of the required functionality. I think the consensus was to also remove the "build-time"-modification and increase the cost for this technology. Increased build-time is bad for the very beginning of the game and makes the decision about when the tech should be researched a "fake-decision". If you get full health with less build-time, why should you ever research it early?
comment:4 by , 11 years ago
Replying to Yves:
I've made a patch for the first problem. I think it's intended that existing buildings only increase their maxHitpoints because it is more logical and makes sense for gameplay (otherwise it wouldn't make any sense to get this tech before you're under attack).
Can you clarify this? It doesn't sound like something we intended but I may be misunderstanding.
About the patch: there's a reason that tech modifications aren't applied in GetMaxHitpoints
, namely that in order to handle maintaining current health level when the Health/Max tech is researched, you need to know the pre-modified max hitpoints. By the time you call that function, it's too late. This is why the logic is all in Health.OnTechnologyModification
which handles both newly created entities and existing entities when the tech is researched. Both functions can't have the tech modifications logic, or you accidentally apply the modification twice.
#1410 goes into detail on the reasoning behind the current design, though the fact it doesn't work for foundations is an oversight.
by , 11 years ago
Attachment: | persian_architecture_patch_v2.diff added |
---|
comment:5 by , 11 years ago
I've added another patch. It only fixes the problem that the modified max-health wasn't applied correctly. It doesn't change any other behaviour that was suggested in this thread.
The problems were:
- As mimo said Foundations were filtered in OnGlobalOwnershipChanged. As far as I understand the classes count and such is used for requirements like "you need x buildings of type y". Foundations shouldn't be counted there because the buildings should actually be built before they count to the required number of buildings. However the foundations have to be taken into account for technology modifications.
- Foundation.js cached the max-health which is not necessary IMO and caused problems because that cache wasn't refreshed with the tech-modifications
- Foundation.js used a value "addedHitpoints" for hitpoints that have been added in the build-process. But this value became faulty when the added hitpoints changed to keep the percentage after the max-hitpoints were increased.
comment:6 by , 11 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 12 |
Owner: | set to |
Status: | new → assigned |
comment:8 by , 11 years ago
Component: | Core engine → UI & Simulation |
---|---|
Keywords: | review removed |
if (Engine.QueryInterface(msg.entity, IID_Foundation)) return;