Jump to content

Thieves (and Spies)


jonbaer
 Share

Recommended Posts

How hard / difficult would it be to create a template_unit_support for thieves which would be market traders that had one way deduction from an enemies resource?  I am trying to determine if this is something which could be completely accomplished outside of the game engine itself (in simulation .js) before attempting.  What I think is mainly missing is the ability to be a non-detectible entity, for example one to be used for spying as well (to open the fog of war, etc), so you can not cloak the player color so they are not detected.

What I could picture is having an entity like that + the enemy does not realize they are attackable until they hover over them.  In this way a thief or spy would be uncovered.  I am mainly trying to understand if these 2 entity types would be programmable in the current state or requires alot more development in the engine itself.  I can't remember offhand how they worked in AoE but I remember they gave LOS (spying) ...

  • Like 1
Link to comment
Share on other sites

It wouldn't be that hard to make a unit invisible, though that will probably require a small change in the C++ part of the simulation.

The hardest part is the game mechanics around it, like sending a "make visible" command on hovering, disabling reactions of units and buildings on invisible units, AI support, ...

  • Like 1
Link to comment
Share on other sites

2 hours ago, sanderd17 said:

It wouldn't be that hard to make a unit invisible, though that will probably require a small change in the C++ part of the simulation.

Actually it isn't even necessary, now that Visibility is a scripted component. You can take a look at this patch for a example of how to do that, just take a look at the change to Visibility.js and at the new Stealth component.

The patch lacks disabling the range queries though, so it might be a bit broken. It is an old POC patch anyways :)

  • Like 1
Link to comment
Share on other sites

You might need to reenable stamina though. I had a working patch somewhere on trac for that. Gonna need some tweaks though cause some references where deleted by @sanderd17 recently

Edit: r18002 did that and  http://trac.wildfiregames.com/ticket/3468 contains an old patch that should apply prior to that.

Edited by stanislas69
  • Like 1
Link to comment
Share on other sites

Rather than simply making spies or thieves invisible - wouldn't it be much cooler if the spies could disguise themselves as enemy civilian-soldiers?  Maybe something like http://wiki.teamliquid.net/starcraft2/Changeling_(Legacy_of_the_Void) .

It could work like this:  the player produces the spy and sends him towards the enemy.  When the spy sees an enemy civ-soldier, it automatically changes allegiance to the enemy and takes on the appearance of the enemy soldier, so it is actually an enemy unit now, able to blend in by e.g. gathering resources.  The spy remembers its former allegiance however, so the player who produced the spy can also give it orders and see what it sees.  As soon as the spy changes allegiance, its stamina starts to decrease, and when the stamina reaches 0 (after several minutes) the spy changes back to a spy and will be targeted by enemy units.  The enemy player could also select the spy and delete it, if he notices.  If the spy escapes, he has to wait until his stamina reaches full before he can go undercover again.

Thieves could work the same way except that they have a tiny vision range while converted to the enemy (spies should have a large vision range), and when thieves return resources to an enemy dropsite, they actually decrease the amount of that resource for the enemy.  Before a thief's stamina runs out, he should be able to steal several times his cost in resources if the enemy player doesn't notice.

There could also be "assassins" which work like spies, except that after having been undercover for a while (stamina below a threshold), the player who produced the assassin can order it to attack an enemy unit with a melee attack.  If the melee attack connects, the enemy unit instantly dies and the spy is unmasked (stamina set to 0).  Assassins should be pretty expensive, like 200 metal 200 food, to counterbalance the fact that they can kill heroes.

Edited by causative
  • Like 4
Link to comment
Share on other sites

Could make thieves as well able to garison in a building and steal some resources :P

The concept is rather simple. The unit appears as a standard villager most of the time, except when it garisons into a building, steal resources and after a short time, gets out. then it's a thief.

 thief.gif

 

  • Like 3
Link to comment
Share on other sites

5 hours ago, stanislas69 said:

Could make thieves as well able to garison in a building and steal some resources :P

The concept is rather simple. The unit appears as a standard villager most of the time, except when it garisons into a building, steal resources and after a short time, gets out. then it's a thief.

 

 

Can perform a sabotage in production building for a while.

  • Like 2
Link to comment
Share on other sites

Yeah that is the main thing about the game I wish was a big more segmented is the fact that drop sites (+ farmsteads) don't really hold their own values (that you could steal from and target).  I haven't really thought this out as much but what would be great is if drops actually required certain individuals to move between drops and civic centers to account for the resource, ie https://en.wikipedia.org/wiki/Banker_(ancient)#Ancient_Greek (trapezites) ... I like the fact that these entities (spy,assassin,thief,banker) have an almost secondary play on watching enemy resources which affects military gameplay.      

  • Like 1
Link to comment
Share on other sites

@Itms I am curious, what is the story/status w/ your POC patch - was that part of something else that was in discussion (beyond the Stamina ticket mentioned), is there harm in adding the C++ bit so people can use it or is there something else in the works that this would be a part of?  Sorry tried back searching the Trac history but could not find anything.

  • Like 1
Link to comment
Share on other sites

2 hours ago, jonbaer said:

@Itms I am curious, what is the story/status w/ your POC patch - was that part of something else that was in discussion (beyond the Stamina ticket mentioned), is there harm in adding the C++ bit so people can use it or is there something else in the works that this would be a part of?  Sorry tried back searching the Trac history but could not find anything.

Itms worked on entity fogging and miraging before, so he was involved with the visibilities. But there's no real design discussion on how those invisible units should work (it would be quite annoying to have a design discussion without the possibility to test some things either IMO).

And if it can be done in JS allone (which means that Itms made his C++ code generic enough), there's no reason to alter the C++ code. It 's a lot easier for mods to reuse or modify JS code.

  • Like 1
Link to comment
Share on other sites

Yeah I was trying to get some idea from this convert attack mod @ https://github.com/0ADMods/convert_attack ... what I was trying to do was make an infantry convertible to enemy @ training time but non attackable.  I am pretty sure I will be able to get the behavior I want w/ some special configuration of the attributes that are already available.

  • Like 1
Link to comment
Share on other sites

When a building ends up in the FoW, it's replaced by a mirage that copies the stats from the building as you last saw it.

The problem with the markets was that the target could be a miraged one, and when the trader got close enough to get it in his vision again, that miraged market would disappear. So the trader had to update his target correctly.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...