#3406 closed defect (fixed)
[PATCH] Units attack farms instead of capturing/ignoring them
Reported by: | Stan | Owned by: | otero |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | mimo, otero_xd@… | Patch: |
Description (last modified by )
Attachments (6)
Change History (33)
by , 9 years ago
Attachment: | commands.txt added |
---|
comment:1 by , 9 years ago
Do you mean farmstead ? or fields ? I guess fields as the AI do capture farmsteads. But then, this proposition is invalid as fields are not capturables presently. That feature can be changed, but that's more a design choice rather than an AI defect.
comment:2 by , 9 years ago
I meant fields. Oh I thought you could, It made sense to me. Anyway, for the time being i don't think they should attack fields.
comment:3 by , 9 years ago
Component: | AI → UI & Simulation |
---|
Well, it depends if you are raiding and want to destroy the enemy economy. Otherwise, most of the time, the units attacking a field are idle units nearby an enemy field which are automatically made attacking the field by UnitAI.
But I also did not liked this behaviour and had some thought about it, but never came to something really finalized:
- a simple solution would be to change the owner of the fields when constructed and make them gaia. UnitAI would then no more attack them automatically, and that would reflect more the fact that all players can gather on it.
- another possibility would be to change radically the way fields are used. We could make them non-attackable, but any fields without gatherers would health-decay while fields with gatherers would slowly regain health (that would represent the fact that fields not worked on become uncultivated land). So when raiding, killing or making flee the gatherers would make the field decay. And to make these raids more useful, the gathering rate would be scaled by the health ratio of the field, so that after a raid the field will take some time to be fully efficient again.
comment:5 by , 9 years ago
One more vote for 2).
It would make the game more interesting, as unused fields are penalized, more efficient build orders promoted and raids becoming more viable.
comment:8 by , 8 years ago
Keywords: | design added |
---|
by , 8 years ago
Attachment: | t3406_prevent_attacking_field_WIP_v1.patch added |
---|
Doesn't work for mirages and we should implement an attackable
attribute for structures.
by , 8 years ago
Attachment: | field_haters.gif added |
---|
After capturing a CC, the first thing the units do is attacking the fields, no matter if they are attacked by 6 towers and a fortress (aggressive stance, which is the default).
comment:9 by , 8 years ago
Description: | modified (diff) |
---|
comment:10 by , 8 years ago
Vote for 2. Even if you plan to destroy the enemy economy, the fields have the lowest priority. Better attack farmstead, storehouse, traders and women. Attacking fields waists too much time in a very stressy situation. Every other task after capturing/destroying the cc is more appropriate (attacking units, capture towers or other structures).
comment:11 by , 8 years ago
Milestone: | Backlog → Alpha 20 |
---|
comment:13 by , 8 years ago
With #3741, the originally reported problem issue with fields is addressed. Should we make a clean ticket for the automatically-decaying fields and gatherrate-adaption?
comment:14 by , 8 years ago
Keywords: | patch review added |
---|---|
Owner: | set to |
Summary: | Units attack farms instead of capturing/ignoring them → [PATCH]Units attack farms instead of capturing/ignoring them |
I solved the problem of farm fields with decaying health when the field doesn't have gatherers. I submit my first attempt which takes a few considerations:
- Buildings can be divided in two Militar and Civil. Militar means that the building has the possibility to attack an enemy while a Civil can't.
- The decaying of the field starts 15 seconds after the number of gatherers reaches zero, and the process is stopped one the gatherers return. Also it take 15 seconds for a field to decay completely, the rate of decaying is given by a tag inside the Health tag of the field as is the amount of points.
I don't know if it's the most efficient way to solve the problem, but I found it works and doesn't make worse the performance of the game. Any way if there is a problem let me know, I wanted to create a new thread but I thought I'll just add it here.
The patch includes some minor changes also, like transformation of var into let and some white spaces eliminated.
by , 8 years ago
Attachment: | decay_field_v1.patch added |
---|
comment:15 by , 8 years ago
Milestone: | Backlog → Alpha 21 |
---|
comment:16 by , 8 years ago
Cc: | added |
---|
comment:19 by , 8 years ago
With r17654 the fields belong to whom the terrain owns. So hostile units still will attack fields before attacking towers or fortresses.
comment:20 by , 8 years ago
Fixed the mistake of Militar to Military, and fixed a little problem when the state machine of some entities is faster creating race conditions.
by , 8 years ago
Attachment: | decay_field_v2.patch added |
---|
comment:21 by , 8 years ago
BuildingAI specifically deals with buildings shooting arrows, so that component shouldn't be (ab)used for other purposes.
Instead (when following your proposal of improving UnitAI target selection), it would be better to let the UnitAI just test if there's a BuildingAI on the target, and how many arrows it shoots.
And that decay isn't needed I think, since fields now already autoconvert to the territory owner. So making UnitAI more clever would be enough.
comment:22 by , 8 years ago
Keywords: | review removed |
---|
comment:25 by , 7 years ago
Keywords: | design removed |
---|---|
Milestone: | Alpha 22 → Alpha 20 |
Priority: | Must Have → Should Have |
Resolution: | → fixed |
Status: | new → closed |
Summary: | [PATCH]Units attack farms instead of capturing/ignoring them → [PATCH] Units attack farms instead of capturing/ignoring them |
Calling this ticket fixed by r17654 and #4194. Fields will switch to the new territory owner immediately. Attacking units will first kill other units running around before doing anything to buildings or fields.
oteros patch implements decay for fields which are not gathered from. The implementation is not too nice as it comes with hardcoding of the field type in UnitAI, while the template should specify things. I'm not against the idea of decay of gathered resources, for example animals could also decay if they are not gathered from (or decay regardless). If so, this should be done in a new ticket and we should find at least 2 team members who endorse the design (candidates: mimo, fatherbushido, scythetwirler, Yves).
Related commands