#633 closed defect (fixed)
[PATCH] Building and Ship Repair
Reported by: | Michael D. Hafer | Owned by: | mimo |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
Repair is currently taking the value from:
<Builder>
<Rate>1.0</Rate>
</Builder>
And interpreting that as a repair rate of 1 Health/Hitpoint per second. This is bad for a few reasons:
- It takes one value and uses it for two different things. Originally this value was (and still is) used as a base value for building x the BuildTime value of the structure being built.
- If we want to change a unit's Build rate, but not the Repair rate, then we can't do it.
- 1 hitpoint per second is painfully slow. To change the value would also be changing doubling, tripling, or quadrupling the build rate (inverse of point no. 2).
These values need to be separated. A separate "repair" tag and value need to be implemented. It could be done one of two ways:
- In the unit templates
- In the building templates
The benefits and pitfalls of each need to be discussed before choosing the implementation.
OR
We can just link Repair with Building at a 1:1 ratio so that repairing gives the structure the same amount of health per second as building it does. Also, any "cost" associated with repairing a building is the same cost as constructing it. Say, if the building is damaged by 25%, then it take 25% of the build cost to repair it.
Attachments (4)
Change History (13)
comment:1 by , 14 years ago
comment:2 by , 11 years ago
Keywords: | design added |
---|
by , 10 years ago
Attachment: | repair.diff added |
---|
comment:3 by , 10 years ago
Keywords: | patch added |
---|---|
Summary: | Building and Ship Repair → [PATCH] Building and Ship Repair |
Patch adds a RepairTime and RepairRate to resp. repairable ents and builders. Similar to the BuildTime and existing Rate. Both are optional, and when undefined, the behaviour is the same (i.e. RepairTime defaults to the max health, and RepairRate defaults to the existing Rate).
Ready for inclusion if anyone wants to use it. But as long as it's not used, it'd better be not in the code (as the working of it will be forgotten).
by , 9 years ago
Attachment: | repair-v2.diff added |
---|
comment:4 by , 9 years ago
Keywords: | review added |
---|
I propose a new patch for this, creating a new Repairable component. One advantage is to be able to record builders repairing an entity, and so to be able to decrease the rate when several builders (as for building foundations). Also, instead of defining a new repairTime as in the previous patch, this patch uses a ratio of repairTime/buildTime.
comment:6 by , 9 years ago
There was no reason to have the repairable false attribute (the rest is only fixing the alignment).
comment:7 by , 9 years ago
2.
or 4.
would be nicer as 2.0
or 4.0
in the XMLs and schema. The Engine.QueryInterface()
calls for IID_Foundation
or IID_Repairable
are strange. Either we should have some helper function to abstract that difference (similar to Mirages), or just have Foundations provide a repairable component.
Add some ()
for the multiple divisions, also in case you divide by 0 you'll end up with strange values. It'd be better to check for that case (or rather sanity of the resulting value) explicitly.
Apart from that the patch looks good.
by , 9 years ago
Attachment: | repair-v4.diff added |
---|
some cleanings + add number of repairing units in gui
comment:9 by , 9 years ago
Keywords: | design review removed |
---|---|
Milestone: | Backlog → Alpha 19 |
See: http://www.wildfiregames.com/forum/index.php?showtopic=13676&hl= for discussion