MegaGlest Forum

MegaGlest => Feature requests => Topic started by: zilviuz on 18 February 2013, 12:38:02

Title: Suggestion: conquer enemy's building instead of burning them down
Post by: zilviuz on 18 February 2013, 12:38:02
I suggest that it be possible to conquer enemy's buildings or estates rather than simply burning them down, similarly to what happens in real warfare.
A percentage threshold could be set on survivor troops defending a castle, for instance, under which troops would resign and pass to the conqueror.
Conquered estates would enhance both conqueror's strength and army.
This would in turn favor more a more realistic balance of power and complex strategies, also because players would need to spread more buildings all around and explore the space more thoroughly, in order for them not to be taken all by the enemy.

zilviuz

Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Omega on 18 February 2013, 14:37:26
The problem is that "captured" buildings might not be in the same faction.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: zilviuz on 18 February 2013, 18:23:04
This is true, but I think that a "correspondence table" between buildings of different factions could be set up: if not one-to-one, at least an approximate one. A balance could be achieved by adding, or subtracting, a few workers or soldiers from the conquered building.

zilviuz
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Coldfusionstorm on 9 April 2013, 17:25:47
So what?. That's the interesting thing about it, You can create new crazy unit compositions, No need for a corospondence table, in rare cases there can be proble, but let it be on a tryout mode. We should try these things in SVN.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: ElimiNator on 9 April 2013, 18:39:10
There are certain "classes" that units are placed in, for example a slave is a worker unit, a swordman is a melee fighter, a barracks is a fighter producer/upgrading building, ect.

So when I destroy a barracker and I'm Norsemen it can try to put a building that produces army and has upgrades, if there's not one it looks for just army (if there's more army commands) then it looks for upgrades. If all else fails it give army men, workers, or resources.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Coldfusionstorm on 10 April 2013, 15:32:07
There are certain "classes" that units are placed in, for example a slave is a worker unit, a swordman is a melee fighter, a barracks is a fighter producer/upgrading building, ect.

So when I destroy a barracker and I'm Norsemen it can try to put a building that produces army and has upgrades, if there's not one it looks for just army (if there's more army commands) then it looks for upgrades. If all else fails it give army men, workers, or resources.

Im not sure i know what you mean...

What do you mean exactly?
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: ElimiNator on 10 April 2013, 16:47:00
I suggest that it be possible to conquer enemy's buildings or estates rather than simply burning them down, similarly to what happens in real warfare.
A percentage threshold could be set on survivor troops defending a castle, for instance, under which troops would resign and pass to the conqueror.
Conquered estates would enhance both conqueror's strength and army.
This would in turn favor more a more realistic balance of power and complex strategies, also because players would need to spread more buildings all around and explore the space more thoroughly, in order for them not to be taken all by the enemy.

zilviuz
I mean this could work fine.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Coldfusionstorm on 10 April 2013, 17:00:26
A simple capture function would be fine imo.

fx.

Capture upon unit enter building.
Caption upon Ability/command finishes. (a ability that can overturn buildings.).
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: MoLAoS on 10 April 2013, 18:08:14
Faction type is an artificial check. There wouldn't be a significant change required to have a faction control units of a different faction type.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: ElimiNator on 10 April 2013, 18:28:05
Faction type is an artificial check. There wouldn't be a significant change required to have a faction control units of a different faction type.

Actually Softcoder and I were looking into a capture other units type thing a while ago and it not as easy as it seems.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: MoLAoS on 10 April 2013, 18:35:58
Faction type is an artificial check. There wouldn't be a significant change required to have a faction control units of a different faction type.

Actually Softcoder and I were looking into a capture other units type thing a while ago and it not as easy as it seems.

Maybe your code is different. I have an option right now, working, to create units from other factions and have them create other things, assuming its a unit with a produce skill of course. As far as capturing specifically, I haven't tried directly changing the ownership of a unit, but you can kill a unit with no animation and have a new unit tied to the appropriate faction instantly appear, and if you want you could probably get it to have all its data set identically to the unit captured, health, energy, and so forth, although I didn't bother with that.

There is somewhat of an issue in that the faction/faction type/player system wasn't set up by the Glest team to be easily extensible to things like capturing. But gameplay logic is probably the easiest thing to handle in an engine.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: will on 11 April 2013, 05:55:00
Capturing buildings and brain-washing units would be a very interesting new game dynamic for modders to enable.

It goes all the way back to Dune 2.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Omega on 11 April 2013, 08:00:24
I personally worry that capturing buildings would be extremely overpowered: the strong get stronger. After all, if magic captures a castle, they can build the entire techtree. Well, kinda. They'd have to capture a farm as well. No farm? You won't make a single unit. Same thing for tech capturing magic. No energy source? No production. I don't really think it's a good idea to let a faction capture the main buildings, though. However, without the food-style resource, it might be impossible to create a single unit from the captured buildings. As a result, capturing should not be a default option, but something that must be enabled on a techtree level.

Concept



What I think would work best is giving buildings a <capturable> parameter. There's a few things we need to configure to make a captured building any use. First of all, we have to have a resource requirements tag. This is the same as the existing resource cost for units. Presumably we'd normally use it to give negative amounts of food or energy. For example, suppose I gave the barracks a negative -10 food. As a result, capturing a barracks would allow producing up to ten units from it. Without that food bonus, I wouldn't be able to produce anything if I was playing as magic (or any other faction that doesn't use food). A possible problem is the lack of storage for food. The simplest solution would be to simply give the building the ability to store some food (as can already be done in the unit's parameters). It's not like most players ever run out of storage for food, anyway. Alternatively, we could have another option to change the storage parameter when a building is captured, but that might overcomplicate things (for the programmer).

Anyway, we'd also need a way to determine what happens to the building's health when captured. I think we should simply allow the modder to state the health as a percentage (a decimal value from zero to one). So a captured building might default to half health. Or maybe 10% of the health or full health, at the modder's discretion.

And should capturing be permitted if there are other units or buildings nearby? It seems very unusual to me to attack a base and capture a building while enemies are still swarming around you. Not to mention it'd just paint that building as a big bullseye. I think there should be a parameter that states how many enemy units can be within a specific radius before the building can be captured. For example, maybe I can only capture buildings if there's less than three enemies around? Or maybe there has to be no enemies around.

We probably should also set a capture rate. Do we capture this building 100% of the time? Or 50%, 80%, or what?

Should capturing a building allow upgrades to be performed? I'd make that an option as well. Upgrades are a bit problematic. We don't want the capturing player to be too powerful, not to mention many upgrades apply for different types of buildings, which wouldn't necessarily be captured.

On a side note, we should keep track of the original owner, as recapturing a building should negate disabled upgrades. I also think recapturing should have a 100% chance to recapture the building and the nearby units should be ignored.

Now, that's the building being captured. What about the capturing unit? I think the simplest way to do it would be to add an optional element to the attack command. Let's keep it simple: can the attack capture and if so, let's give it a multiplier. As previously stated, buildings have a capture rate, so the multiplier would multiply the capture rate. A multiplier of one means I have the "regular" chance to capture that building. A multiplier of 0.5 would half the chance that particular attack would capture the building. For example, if the building has a 0.8 capture rate (80%) and my unit has a multiplier of 0.8 as well, then my final capture rate is 0.8 * 0.8, or 0.64 (64%). This could also be used so that some units are better at capturing. A possible application would be to make melee units more likely to capture a building than a ranged unit. Or perhaps swarm units (like the daemon or swordman) has a better chance than an archmage (which would theoretically be more likely to damage the building).

How is the building captured? Simple: the last blow has to be dealt be an attack with a capture flag.

Syntax


For the capturable unit, in the <parameters> element of a unit:
Code: [Select]
<capturable value="true">
<resource-requirements>
<resource name="food" amount="-10" />
</resource-requirements>
<capture-health value="0.5" />
<nearby-enemies radius="5" maximum="2" />
<capture-rate value="0.75" />
<allow-upgrades value="false" />
</capturable>

Let's break that down:

So in this example syntax, the building can be captured and capturing it rewards the capturing team with 10 food (and hopefully this building also stores at least 10 food). Capturing this building would put it at half health (note that it might not be possible to repair this, but that's a strong gameplay element, in my opinion and more on repair later). In order to capture this building, there cannot be more than two non-building enemies with a radius of five cells. The capture rate is 75% (although changes with the unit as well). Finally, upgrades are disabled on this building.

Now for the capturing syntax. This would go in the <command> element of an attack command:
Code: [Select]
<can-capture value="true" multiplier="0.8" />
That was nice and simple, right? The value simply tells us whether or not that attack can capture a capturable unit. It defaults to false and this entire element is optional. The multiplier will be multiplied against the building's capture rate. So with our previous example's 75% capture rate, we multiply that by 0.8 to get a final capture rate of 60%. The multiplier defaults to one and is optional.

Other notes



For modders



Implementation difficulties



Too complex?


I think an implementation like this would be the most functional and useable. However, if we need to simplify the system (preferably just to make baby steps towards capturing), we could cut out the nearby enemies feature and simply go by the capture rate. We could also remove the ability to chose if upgrades are enabled or disabled. We could forget about the recapturing stuff. However, I think the ability to manage resources is crucial for a cross-faction capturing system to work. If we wanted to really simplify it, we could also remove the need to flag certain attacks as can-capture, but I think that's a bad idea.

That was way too freaking long!


I know, I'm sorry. Here's a summary for those of us with shorter attention spans:
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: MoLAoS on 11 April 2013, 13:10:30
You are making this way more complicated than it needs to be. Also, being able to build a whole new faction is overrated. How many times do you see Toss players trying to push the zerg tree? Because of the way upgrades work its not actually useful to do that.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: GunChleoc on 11 April 2013, 21:36:24
I have no idea if this makes any sense, but how about this: After capturing a building, it has to be converted to a building of your own faction before it can start producing anything. Since there isn't any 1:1 correspondence to everything, maybe it could convert to a building that uses a similar amount of resources to build, or you could get a choice of buildings to convert to, with time or resource costs attached depending on the difference in worth.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Omega on 11 April 2013, 22:00:46
I have no idea if this makes any sense, but how about this: After capturing a building, it has to be converted to a building of your own faction before it can start producing anything. Since there isn't any 1:1 correspondence to everything, maybe it could convert to a building that uses a similar amount of resources to build, or you could get a choice of buildings to convert to, with time or resource costs attached depending on the difference in worth.
It could be work. Would be best if we assigned a tag to buildings and they would be replaced with other buildings with the same tag (of your own faction). However, that system has flaws of its own. For example, what happens if the building we're replacing is larger than the captured building? And even then, there would need to be criteria for capturing the building.

You are making this way more complicated than it needs to be. Also, being able to build a whole new faction is overrated. How many times do you see Toss players trying to push the zerg tree? Because of the way upgrades work its not actually useful to do that.
You may be right that it's not overpowered at all, but capturing the units of another faction is rather complicated. There's a lot of factors that have to be taken into mind if we don't want a broken implementation.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: MoLAoS on 11 April 2013, 23:09:03
Perhaps you would care to elaborate instead of just saying that over and over. Have you even looked at the code?
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: will on 12 April 2013, 06:04:02
I think there are technical challenges, balance concerns and AI complexity.  We have to talk about these three aspects separately.

Balance: We take long enough to balance the standard fractions we have already without capture in the equation.

Technical: But if the technical facility can be added cleanly to the engine, then letting new techtrees use it would be cool.

AI: well this is the biggest technical challenge, eh?

I imagine it working like a new attribute - rather than hp, some kind of 'influence' that gets increased by a special attack.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Coldfusionstorm on 12 April 2013, 13:27:28
i have to agree with Molaos, In Command & Conquer Zero Hour you can capture ANY building, Except for defence buildings, this is really not such a big deal, It can however lead to fun and interesting unit composistions.
Title: Re: Suggestion: conquer enemy's building instead of burning them down
Post by: Omega on 12 April 2013, 13:52:31
Perhaps you would care to elaborate instead of just saying that over and over. Have you even looked at the code?
You're right that I have no idea how technically difficult it would be to simply allow a unit from another faction to be controlled by a different player. However, that's not what I'm looking at, but rather the other aspects that would have to be taken care of. As mentioned, there's other issues outside of the programming that would have to be taken care of, particularly how factions don't share the same types of resources. Without access to food, magic can't use a captured barracks (for example). Setting a health at which captured units start with is probably relatively simple compared to everything else. Requiring there to be a small number of enemies nearby is an option up to a modder, and as mentioned, it's probably the best feature to skip if the implementation is too difficult (to be worth it). Giving a capture rate should be rather simple as well, and would make the feature more interesting in my opinion (instead of always capturing a building or unit). In retrospective, you and coldfusionstorm raise good points that it might not be overpowered at all, and the concept of disabling upgrades could then be skipped for simplicity (although it never hurts to give modders an option, I would think).

Balance: We take long enough to balance the standard fractions we have already without capture in the equation.
I can't say for certain if capturing would be overpowered (perhaps not), but if it's up to modders to implement, then balance should not be an issue (assuming modders are taking it into perspective if they enable it).

I imagine it working like a new attribute - rather than hp, some kind of 'influence' that gets increased by a special attack.
That's an interesting idea. Attack commands could be given a "capture value", and buildings would have a "capture rate". Each attack would add the capture value to the building, and once it matches the capture rate, the building would change control. For example, a building might have 100 capture rate. A unit whose attack has a capture value of 5 would need to attack that building 20 times to capture it. So it's like filling up a bar (or dropping one, like HP). That could work better, as it's about attacks in general rather than just "who dealt the death blow". To prevent a building from being captured from gradual attacks over time, there'd have to be a way to reduce the number of capture points (influence, if you will) over time, like regeneration.