#724 closed defect (fixed)
[PATCH] Units should not move out of enemy construction zones
Reported by: | Kieran P | Owned by: | Andrew |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 6 |
Component: | Core engine | Keywords: | |
Cc: | Andrew | Patch: |
Description
When you place a building, enemy units will politely move out of the way so you can build it.
Only ally units and animals should move away.
Attachments (1)
Change History (13)
comment:1 by , 13 years ago
Summary: | Units should be polite in moving out of construction zones that belong to an enemy → Units should not move out of enemy construction zones |
---|
comment:2 by , 13 years ago
Milestone: | Alpha 4 → Alpha 5 |
---|
by , 13 years ago
Attachment: | diffContstruction.patch added |
---|
follow-up: 6 comment:3 by , 13 years ago
Keywords: | review added |
---|
comment:4 by , 13 years ago
Summary: | Units should not move out of enemy construction zones → [PATCH] Units should not move out of enemy construction zones |
---|
comment:5 by , 13 years ago
Priority: | Nice to Have → Must Have |
---|
follow-up: 7 comment:6 by , 13 years ago
Replying to Stork:
About your comment in the patch, in UnitAI.js line 1859. Are you referring to animal corpses? If so, maybe a check for gaia owned units would be enough. I think the order should not even be added to the queue if it's invalid (i.e. non-gaia players who are not friendly to the requesting player).
comment:7 by , 13 years ago
Replying to historic_bruno:
I was referring to any corpses. The bodies of invaders should not prevent me from trying to build a wall to keep them out. I wasn't sure how to check for states outside of the state machine to see if it was in a corpse state, and didn't think that it was the proper way of using states anyway.
comment:8 by , 13 years ago
Normal unit corpses have their Obstruction
component inactivated, so they should never block the foundation (GetConstructionCollisions
won't return them) and they don't need to be explicitly ignored. Only animal corpses remain as real obstructions (so you can still gather food from them) and need the special deletion behaviour.
In the current UnitAI
, the validity check needs to be done in IDLE
and REPAIR
states, so it should probably be extracted into a separate method and called from both of them, instead of putting it directly in the IDLE
one.
Rather than using the diplomacy array data directly, I think we really need some helper functions to abstract it out. Probably could go in helpers/Player.js
with a function like IsOwnedByAlly(this.entity, msg.data.target)
.
(Instead of using sendingFoundation.entity
you can just use msg.data.target
directly since that's already the entity ID of the foundation entity.)
The "TODO: we should verify this is a friendly foundation" comment should be removed since it's being verified now. (I think it makes sense to do the check in the FSM like in this patch, not where that comment is, since animal FSM states don't want the check.)
comment:9 by , 13 years ago
Cc: | added |
---|---|
Owner: | set to |
comment:10 by , 13 years ago
Milestone: | Alpha 5 → Alpha 6 |
---|
comment:11 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:12 by , 8 years ago
Keywords: | review removed |
---|
fixes some issues with diplomacy; units do not move out of the way for their enemies' constructions