Author Topic: Suggestion: conquer enemy's building instead of burning them down  (Read 3028 times)

zilviuz

  • Guest
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


Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #1 on: 18 February 2013, 14:37:26 »
The problem is that "captured" buildings might not be in the same faction.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

zilviuz

  • Guest
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #2 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

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
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.
WiP Game developer.
I do danish translations.
"i break stuff"

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
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?
WiP Game developer.
I do danish translations.
"i break stuff"

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
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.).
WiP Game developer.
I do danish translations.
"i break stuff"

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
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.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #10 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.

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #11 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.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #12 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:
  • capturable: Straightforward enough; true if the unit can be captured and false otherwise. Defaults to false. The entire element is optional.
  • resource-requirements: This is the exact same syntax as the element in the parameters of existing units. Its purpose is to provide resources that the capturing faction might need, but can't access. It could also be used to penalize capturing factions.
  • capture-health: A percentage between zero and one that denotes what percentage of the maximum health the building will start with once captured.
  • nearby-enemies: The radius to check for nearby enemies and the maximum enemies that can be nearby. Note that we are only counting non-buildings as enemies.
  • capture-rate: A percentage between zero and one that denotes the capture rate of the building.
  • allow-upgrades: If true, upgrades may be purchased as normally; if false, upgrades are disabled (preferably hide the icons).

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


  • Upon capturing a building, there should be a popup dialogue (akin to the "game over" dialogue) asking if we want to keep it. If the game can be paused, we should do so. Why offer a choice? Because there's no way to delete a unit (we should look at that, too, though) and the building might have penalties to capture set by the modder (resource costs; for repair or whatever). If the building isn't captured, it's destroyed as normal.
  • We should consider a way to repair capturable units. Perhaps simply allow the repair skill to list units that are not in the faction. This becomes problematic since we might not be loading the faction that contains these units. In which case, we should ignore the extra units. The biggest issue would probably be buildings that have the same name. To fix this, we could add a faction attribute to repairable unit list. This would also permit the error reporting to continue to function properly.
  • I heavily mentioned the fact that factions often use a different type of food-style resource. Supplying this is difficult, as the capturing forces might not have captured a farm. For most buildings, the easiest way to do this would be by giving the building the normal ability to store the resource. We could add alternatives, like changing the resources stored by the building after capture or by automatically adding storage for supplied resources, but I think it's more trouble than it's worth and possibly an issue because...
  • I've been mentioning buildings only here, but this should work fine with regular units, too. The problem then is the resources. If magic captures a swordman, that swordman is going to starve, because magic has no food resource. A possible fix would be to ignore consumable resource costs for captured units. Might be necessary to ignore static resources too? I'm not sure if they'd be consumed.
  • On a side note, capturing a unit should not enforce the unit's resource costs. So maybe the above fears about food wouldn't matter for capturing units. At the very least, though, we don't want to lose several hundred resources because we captured an enemy building. The building already exists, we're not spending resources on it. However, the resource costs element could be used to make capturing use some resources. In which case, insufficient resources should just use what there is.
  • As mentioned, we need to keep track of who the building's owner was. I think recapturing your own buildings should have a 100% success rate (ignore the capture rate, multiplier, nearby-enemies, allow-upgrades, and resource requirements). However, the original owner should be the person who built it. Consider this scenario: player 1's barracks is captured by player 2. Later, player 3 captures this barracks. Player 1 is still the original owner and has the advantages for getting it back.
  • This system has a heavy reliance on the last blow to a building. This is a shortcoming, but then again, that's also an issue with the kill counter. If you want to maximize capturing a building, you'd have to micromanage so the low (or no) capture rate units attack first and units with high capture rates are making the final blows. There isn't really an easy way to change this, but I don't think that's an issue. If a real life building is cleared by a navy team only to be bombed heavily, you're not capturing that building. The last attack is important (although the experience system could still be revamped).
  • AI is an issue. If the implementation can be done in such a way that the AI can handle it, great. Otherwise, we could just have the AI choose to never capture a building.

For modders


  • One issue I have with capturing is that the winning team becomes stronger. That's bad, because then whoever wins the first battle quickly becomes unstoppable. We're already giving them the ability to diversify their army more, so let's not give them a free pass to win the game. Thus, I don't think it's ideal to let an entire techtree be built up via capturing. Avoid 100% capture rates and don't set the main building or workers as capturable.
  • One interesting way to balance out capturing dynamics is to add a resource cost. Think of it as a cost to repair the building. After all, the building was reduced to zero health and we're healing it up when capturing. It would also make modders think about whether or not capturing the building is worth it.
  • If units can be captured, their capture rates should be low and they should not be captured at full health. Directly capturing units would be the quickest path to becoming overpowered. On a side note, if the unit doesn't have regeneration, it might be stuck with its capture health. Regeneration is a good idea.
  • I'd personally disable all upgrades unless the faction is heavily dependant on upgrades. The problem with upgrades is that they could contribute again to overpoweredness and many upgrades affect different buildings, which might not end up captured (rendering the upgrade useless).

Implementation difficulties


  • Units aren't respawned, but saved from death, healed, and have their control changed. Yet, the faction is not changed, so there needs to be a way to allow a player to control multiple factions. Before we do this, it might be worth implementing the long awaited "let the human control more than one player" feature.
  • Resources, resources, resources. They're a huge pain. Normally we don't display resources like food for magic, since we can easily see that their units and upgrades don't use the resource. If possible, we should dynamically change the HUD when we gain a new resource. Hopefully that's possible.
  • Also on resources, the food-style resources (consumable and static) should still be used on captured units. If I capture a swordman, he shouldn't be getting a free meal. However, none of the other resources should be applied (the gold and wood have already been spent on him!). It might be necessary to have the modder specify what the food-style resource is (if there is one). We might be able to just simply use up static or consumable resources based on their type, but that seems problematic. To be honest, though, the first implementation of a capturing dynamic should focus on just buildings. Worry about units after.
  • Multiplayer code: will it need changes to accommodate modifying the control?

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:
  • Buildings can be designated as capturable; we can set things like how many enemies can be around, the chance of capture, their health after capture, resources after capture, and if they can perform upgrades.
  • Attack commands can be designated as can-capture. We also add a multiplier so some units/attacks are better at capturing than others
  • Resources are a big concern nobody addressed in this thread. For example, magic uses energy and Tech uses food. In order to ensure that a captured building can actually produce stuff, we have to supply that food-style resource.
  • We've also glossed over the fact that capturing can be overpowered. To combat that, modders shouldn't let the main building or worker be captured. This ensures you can't build up an entirely new faction, but rather just claim parts of an existing one.
  • Preventing things from being overpowered is also why we should consider disabling upgrades
  • It should be easier to recapture your own lost buildings (100% capture rate)
  • This applies to units, too; not just buildings. Capturing units shouldn't give them free meals, though, so the food-style resource is still used
« Last Edit: 11 April 2013, 08:07:58 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #13 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.

GunChleoc

  • Horseman
  • ****
  • Posts: 202
    • View Profile
    • Fòram na Gàidhlig
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #14 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.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #15 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.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #16 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?

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #17 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.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #18 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.
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Suggestion: conquer enemy's building instead of burning them down
« Reply #19 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.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything