Opened 13 years ago
Last modified 5 years ago
#997 new enhancement
Unit Conversion / Capturing
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Simulation | Keywords: | design |
Cc: | Patch: |
Description (last modified by )
Capturing is defined as one player 'stealing' ownership of an entity from another player. The entities that are capturable in the game are domestic animals, female workers, and some structures (not walls, or towers, or special structures - see #996). Some outdated info from the design doc:
- Entity must be capable of performing capture
- Enemy entity must be within specified capture range
- Enemy entity must stay in capture range for a specified time
- No enemy units have the enemy entity in their LOS
Potential modifications of capture behavior:
- Entity must have hitpoints below a specified percentage value
- Capturer has a 'cooldown' before another capture may be performed
- Capture time (long/short)
- Capture radius (small/big)
- May not be any entities garrisoned within the structure
Change History (18)
comment:1 by , 12 years ago
comment:2 by , 11 years ago
Please come to the forum topic 10848 and lets talk, plan, design and maturate this idea.
comment:3 by , 11 years ago
I think there should be a distinction made between "capturing" which generally requires input from the player (e.g., capturing a building or elephant), and "conversion" which would happen automatically when units are in range of a convert-able unit (herd animals, females).
comment:4 by , 11 years ago
I have added a small patch for converting (not capturing).
Units will automatically be converted by enemy units when there are enough of them (and they have the right class).
In the template, you can choose the range, this is the range in meters where the convertable unit will count the ratio of allies and enemies.
You can choose the needed ratio, that is the ratio between ally and enemy units needed to convert. Note, as you always count yourself as ally, you can never reach the 100% enemies ratio. The ratio should at least be 0.5, to avoid units switching from side over and over again without any movement.
You can define the minimum and maximum time it takes to convert. The maximum time is the time it takes when there are barely enough enemies to convert you, and the minimum time is when it's full of enemies.
You can define the classes of units that are able to convert you, these are the classes counted to calculate the ratio. Note that, even if you're not in the classes, you count always as 1 unit.
There is currently no GUI for it, but you can already see the conversionStatus in the selectionDetails overlay. When the conversionStatus reaches 0, the unit will be converted.
In this patch, some templates are changed for testing. Herded domestic animals can be converted by any unit, females can be converted by soldiers, and infantry can be converted by champions, healers and heroes. Although it takes very long to convert infantry, so that won't happen often.
Problems with this implementation:
- units keep their buildable structures, so if you can convert a female, you can construct an enemy civil center, and thus all the buildings and units an enemy can.
comment:5 by , 11 years ago
Keywords: | patch added |
---|---|
Summary: | Unit Conversion / Capturing → [PATCH] Unit Conversion / Capturing |
comment:7 by , 9 years ago
Keywords: | review added |
---|
comment:8 by , 9 years ago
I've tried this on A17, and have the following remarks:
- Line 74 has a misplaced semicolon
- The function
ApplyTechModificationsToEntity
(lines 270, 279, 290 & 300) was renamed toApplyValueModificationsToEntity
in r14001. - Should Chickens, be affected by this? 'cause they are.
- Sheep can capture other Sheep. And chickens. And vice versa.
- And, more critically, it causes 0AD to crash.
From skimming through the patch, I noticed this, which might be why 0AD crashes:
- Four lines into the
.OnOwnershipChanged
function (line 36):this.rangeQueries
is set to an empty array- Then a few lines later this now empty array is iterated through (or would be if it had anything still in it)
- Before being set for the second time to an empty array.
- My reasoning:
- The array, before it is cleared for the first time, contains Range Queries. (Or more likely references to them.)
- The iteration is supposed to go through the array and "destroy" the queries.
- As the array is empty, the Range Queries are not being destroyed and so presumably keep going.
- Meanwhile, new Range Queries are being created...
- Commenting out the offending line (41) seems to resolve the crashing problem.
comment:9 by , 9 years ago
Keywords: | review removed |
---|
Patch wasn't meant for review yet. Merely as a hint to others who want to work further on it, or test stuff.
comment:10 by , 9 years ago
Ugh, looks like I accidentally deleted my patch. But anyway, a 2 years old patch should be rewritten I guess.
comment:11 by , 9 years ago
Keywords: | capture convert patch removed |
---|---|
Summary: | [PATCH] Unit Conversion / Capturing → Unit Conversion / Capturing |
Removing patch as there is no longer one.
comment:12 by , 8 years ago
Keywords: | design added |
---|---|
Milestone: | Backlog → Alpha 20 |
Bumping for interest.
comment:13 by , 8 years ago
Ok this must be the next step. And is related with many things specially sheeps, mercenary camps and other auto convert.
comment:15 by , 7 years ago
Description: | modified (diff) |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:17 by , 6 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:18 by , 5 years ago
Component: | UI & Simulation → Simulation |
---|
Move tickets to Simulation
as UI & Simulation
got some sub components.
#1310 was a duplicate of this ticket specific to animal capturing, but some relevant info was presented:
Note that animal capturing may not require all the advanced functionality of other types, but it seems cleaner to have one capturing system for everything. It would be reasonable to start implementing capturing with this simplified behavior, provided it is extensible and not an ugly hack :)