glest-source icon indicating copy to clipboard operation
glest-source copied to clipboard

Unit capturing

Open MirceaKitsune opened this issue 7 years ago • 4 comments

(Note added by Andy: please hit "thumbs-up" on this post if you would like this feature.)

This is a feature I've long wanted in MegaGlest, to at least use with my own factions if not in any of the default ZetaGlest units. I believe it would make the game a whole lot more fun, while adding an extra element of strategy to it. You can find my original thread about this on the MegaGlest forums:

https://forum.megaglest.org/index.php?topic=9878.0

I'd like to suggest an implementation for unit capturing, which would basically do the following: If you defeat an enemy unit, there's a chance that instead of it dying it becomes one of your own units. This can be used both on troops, who instead of choosing death may desert to you and join you... as well as for buildings, which instead of crumbling to the ground can be taken over and re-purposed so you can use them yourself. Only certain victim units are possible to capture, and they can only be captured by certain aggressor units or attacks (when they deal the capturing blow).

I know what everyone must be thinking: What if the killed unit is part of a different faction from the killer unit? If for instance you're playing the Tech faction, you cannot make an acolyte from an enemy Magic faction desert to you, as you can't play a Magic unit in the Tech faction! My suggestion for this is allowing every unit to define a capture unit for every other tech in the same tech tree, in case it plans to allow members of that tech to capture it. In this case, the acolyte from the Magic faction can say the following: If the enemy tech killing me is also part of the Magic faction, I just become an acolyte for them... but if the enemy unit dealing the killing blow is part of the Tech faction, I instead turn into a worker (the closest thing). This does create inter-unit dependencies, as some units will need to point to units in techs other than their own... however I see no issue with that personally.

Implementing this shouldn't be difficult, as the code would only need to preform a few basic tasks: When an unit is damaged, simply check the identity of the attacker unit, remove the victim unit, then spawn a new unit for the attacker at the exact same position and rotation as the victim unit: This will flawlessly appear as if the damaged unit put on a change of clothes and joined you! Here is an example of how the definition could look like:

<captures>
	<capture>
		<faction type="tech"/>
		<unit type="worker"/>
		<health-threshold value="10%"/>
		<health value="25%"/>
		<probability value="50%"/>
	</capture>
	<capture>
		<faction type="magic"/>
		<unit type="acolyte"/>
		<health-threshold value="0%"/>
		<health value="50%"/>
		<probability value="25%"/>
	</capture>
</captures>

Let's say I put that paragraph into the worker unit, because I want the worker from the Tech faction possible to capture by both Magic and Tech: If the unit is hit by an enemy that's also part of the Tech faction, while its health is below 10%, there's a 50% probability that it will become an unit of type worker (remains the same unit type) for the attacker, with 25% of the unit's normal health. However if the unit is damaged by an enemy from the Magic faction, while its health is 0% (the unit died), there's a 25% possibility that it becomes an acolyte for the attacker, with 50% of the acolyte's normal health.

MirceaKitsune avatar May 04 '18 12:05 MirceaKitsune

Thank you. I believe this can be balanced properly, especially if the chance of capturing isn't all that high (eg: roughly 1 unit captured per 10 killed). This should obviously be configured to work both ways, so if an enemy can capture your units you can also capture some of their units... if not the tech that can't capture should have other advantages that make it stronger to balance things out.

I don't believe a checkbox to disable it would make sense: This would be a core feature of how units work, thus it would only make sense if there were similar options for other unit capabilities (gaining resources from killed units, heroes giving nearby troops stat boosts, etc). Some techs would also lose advantages over other tech if this was disabled, as not all techs would necessarily implement capturing... the advantage / disadvantage thus wouldn't scale proportionally, so toggling the option would break the balance between units.

MirceaKitsune avatar May 04 '18 12:05 MirceaKitsune

I really believe that once we implement some of these, we should implement them in factions already present in the zetapack. I really want to see some priest convert a unit lmao

KeithSammut avatar May 04 '18 13:05 KeithSammut

Unit-capturing would be an interesting feature, no doubt. But I'm not sure if it's within the scope of this project yet (see https://groups.google.com/d/topic/zetaglest/C_J9dX2xutM/discussion for more info). We'll need more feedback.

Users who are interested in this please hit "thumbs-up" on the first post in this thread.

andy5995 avatar May 12 '18 16:05 andy5995