Author Topic: Spy units  (Read 867 times)

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Spy units
« on: 20 May 2013, 11:25:44 »
In my opinion this would spice up the gameplay quite a bit, and add more suspense and strategy to the mix. But on the technical side, it might be complicated to find a correct implementation. Here's my idea:

Each faction would have the ability to train spy units. Such units would have a special feature: They can appear as an own unit to the faction they're spying for. For instance, if Player 1 (red) trains a spy against Player 2 (blue), P2 and all enemies of P1 see it as P2's unit (blue color) and will attempt to attack / not attack it accordingly, while P1 and his allies see it correctly (red color) or have another way of knowing it's P1's spy. Covered spies must never auto-attack the enemy they're spying for, but right clicking any enemy unit should attack as normal. Spies can be used to enter the enemy's territory and explore it, allowing the player to see their enemy's setup. Also, when a spy is ready to blow its cover (more on that below) they can do some damage and take the enemy by surprise.

Obviously, there should be ways to blow a spy's cover. This should happen if the spy gets in a fight with the faction they're spying for (regardless of who attacks first). Additionally, there could be anti-spy buildings or units. If a covered spy gets too close to one his cover is blown. Blown cover means the spy turns back into a normal unit which can be seen and attacked like all others. I'm not sure when and how spies should be infiltrated / masked... this should probably work similar to morphing but under more strict conditions. A spy that's been deconspired should also be unable to re-disguise itself for a few minutes.

Sadly there would be a lot of technical difficulties to making this possible. Those are the ones I'm aware of:

- What happens when the player who sends the spy is of a different faction from the player being spied? If for instance P1 is Magic and P2 is Tech, P1 would quickly notice one of their units is a magic unit although they are tech. Only solution is for each faction to have their infiltrated spies look like one of their units (have the same model). For magic that could be the mage, for tech that could be the worker or swordsman, etc. They should look the same but not have the same abilities... so if a covered spy looks like a mage it doesn't mean it can gather resources or attack with magic.

- What if a faction clicks an enemy spy and tells it to go somewhere? Even worse, what if it tells it to attack or gather resources? If the spied player notices an unit (seemingly theirs) won't respond to commands, it's obvious they're a covered spy. We could allow masked spies to be controlled by both their real owner and the faction they're infiltrated with, in which case the owner has priority (if both factions click for the spy to go somewhere). But what if the spy looks like a worker yet is visibly unable to gather resources and build... or looks like a soldier but can't attack? I guess this could be another way to deconspire them.

- Considering that Player 1 is on one side of the map and Player 2 on the other side. P1 sends a spy over to P2, which means he has to walk all the way from one end to the other. Unless P2 is really stupid or not paying attention, he notices an unit of their own walk from one point to the other, either on the minimap and in the world. They know they haven't sent anyone there, so it would raise obvious questions. This too would need some thinking.

Due to those difficulties I'm not hoping we'll see this happening, at least not anytime soon. But it would be really fun if it could. I'm reminded of a very old RTS game I used to play back when I had my first modern computer, which I think was called Populous. At some point you could produce spy units, which were able to enter the enemy's base and set fire to buildings (but once they did they were deconspired).

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Spy units
« Reply #1 on: 23 May 2013, 02:39:50 »
If spying is implemented, the cloaking system GAE had would work well.

Units can be given a cloak, which essentially hides them from enemy sight. There's a few different types of cloaks, including ones that are activated by ability and ones that are always part of the unit (the other is with effects, a feature MegaGlest doesn't yet support).

Cloaked units are invisible until they're found by a detector. A detector is a unit with a detection flag that lists the cloak type in question (so you can have multiple types of cloaks and detectors, which can run independent of each other). When a detector sees a cloaked unit, the cloaked unit loses its cloak (usually temporarily; until out of the detector's site for an always-on clock and until the ability is reactivated for command cloaks) and can be attacked by any unit. Cloaked units can still be hit by splash attacks.

Cloaks can also be set to deactivate upon using an command.

In the case of spy-style units, cloaking would allow a spy to go undetected until it performs its action. This differs a bit from the implementation noted by MirceaKitsune, but I would consider it to be more versatile, too. The feature is complex, but GAE's code might be usable as a reference.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: Spy units
« Reply #2 on: 23 May 2013, 09:19:05 »
Cloaking sounds more reasonable yes. It would remove the issue of having to mask the spy as an enemy unit in appearance, and how the spied faction could click and manipulate the unit. If the unit was invisible and couldn't be clicked, there shouldn't be any issues. Unmasking cloaked units with detector units or by actions (eg: attacking) sounds most correct too.

Why would the feature be complex however? Wouldn't it be as simple as making enemies of the player not see the unit (in world and on minimap) and not be able to click it?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Spy units
« Reply #3 on: 23 May 2013, 20:55:13 »
It's complex because of other factors. There's more than just hiding a unit and revealing it when a condition is met. We also have to find ways to ensure the feature is useful for AI. For example, the AI needs to know they can use spy units. In other words, the AI should understand a cloaking unit should not be used to attack while cloaked unless discovered or an opportunity arises (judging an opportunity would require ranking enemy units by value). They'd need to understand that cloaks are best used for stealth attacks. But the AI doesn't even handle basic misdirection (like attacking from other angles), yet. The cloaked unit must also be hidden in such a way that the unit is technically there, but can't be normally seen and won't be autoattacked. But since the player can actually tell when a cloaked unit is arround (ie, an unwalkable tile), there must be the means to attack the cloaked unit.

In GAE, the cloaked units weren't truly invisible. They used a special shader so that the model would appear as a sort of "predator-style cloaking" ([image from Fallout 3](http://fallout3.nexusmods.com/mods/images/1567-1-1229370761.jpg)). Of course, using such a system also raises questions about how the AI would react in a similar circumstance. Will they only attack you if you get really close? A percentage chance over time?

Hardly an impossible feature, but there's a lot to consider. I'd still like to see cloaking implemented, of course. Just noting it's not easy.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

 

anything