Reverse engineering logic

Bug #895118 reported by mireazma
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ares
Confirmed
Wishlist
Unassigned

Bug Description

Imagine you can make an enemy unit/vehicle enter one lab, by mc, hj or simply by walking on an invisible pad.
You are then able to build that kind of unit.
It is natural, complies with RA2YR spirit, complements the spy logic.

Revision history for this message
Renegade (renegade) wrote :

I like the idea...kind of like the smarter, Allied version of Yuri's Grinder.
Will have to see about this one, since *Types are a little pissy about runtime changes, and the type lists are used for all sorts of purposes, I think.

But I'll look into feasibility.

Revision history for this message
Beowulf (genkosygin) wrote :

As far as I'm aware, this was an ability in Red Alert 2 with the Cloning Vats.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Ren, how would this require runtime changes?

Revision history for this message
Renegade (renegade) wrote :

Well, you would have to enable that *Type to be built by that particular user, which, in my thinking, would require adjusting the requirements in terms of building, the houses it can be built on, etc. - since, for example, an Allied player wouldn't necessarily have a Soviet factory.

If there's an easier way to do it, all the better.

Revision history for this message
Firefly (firefly) wrote :

how about the secret lab logic? does that help?

entering a soviet-factory with an allied engineer would not allow you to build a random unit/building (defined by a certain list) but the building which is entered. here: the factory

prerequisiteoverride= flag might be helpful, also

just my thoughts

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Code related to this issue has just been checked in!
Author: DCoder
Location: trunk, r815
Commit contains DLL: Yes
Revision comment:

Related to issue #457 - [Building]
Grinding=yes ; required for now, will probably be improved later
ReverseEngineersVictims = yes
SpyEffect.UndoReverseEngineer = yes ; spies destroy all your plans for reverse-engineered objects, you lose the ability to build them, this particular flag hasn't been tested.
[Victim] ; InfantryType/VehicleType only
CanBeReversed = yes/no; defaults to yes, you'll really want to set this to no on engineers and dogs

Objects grinded by this structure will become available to your house while completely ignoring:
- Prerequisite=, PrerequisiteLists and PrerequisiteOverride
- StolenTech, both old and new models
- TechLevel
- Required/ForbiddenHouses
but obeying BuildLimit, PrerequisiteTheaters, NegativePrerequisite, and required factory stuff to avoid NCO.

When you are the owner of the reversing facility,
- ReverseEngineering any InfantryType for the first time will play EVA_ReverseEngineeredInfantry and EVA_NewTechnologyAcquired;
- ReverseEngineering any VehicleType for the first time will play EVA_ReverseEngineeredVehicle and EVA_NewTechnologyAcquired;
- The undo-reversing spy effect will play EVA_TechnologyStolen. It might not be the most appropriate sound, but eh.

This feature is currently easy to abuse - you can grind your own high level units, sell your Tech Center, and retain the ability to build them. I have not yet made up my mind on how to fix this, and if any ignored requirements should be respected by this system, so your feedback on this is important.

Also, I'd like to hear different ways this should work besides the grinder - Ren suggested that the Chrono Prison should be able to reverse its captives. Adding a magic logics that lets something drive onto a battle lab is a lot of work, you'll have to be content with existing ways of making a unit drive into/onto a building.
Related to issue 457 .

SVN: http://svn.renegadeprojects.com/Ares/815

Revision history for this message
Marshall (m-edward) wrote :

Not sure how hard this would be, but I have a vision of an InfantryType using a personal EMP cannon on a Terror Drone, picking up that Terror Drone (Chrono Prison-style), changing image to show the terror drone on his shoulders (probably just a generic backpack), carrying it back to base and depositing it in the Reverse Engineering Facility. AND then they CAN'T build the Terror Drone, but instead get a new stolen tech index satisfied so they can build something else.

Usage case: My UFO mod, humans stun an Ethereal and kidnap it in order to open up Mind Control tech.

Revision history for this message
reaperrr (reaperrr) wrote :

[Building]
Grinding=yes
ReverseEngineersVictims = yes
[Victim]
CanBeReversed = yes/no

These all seem to work fine.

SpyEffect.UndoReverseEngineer = yes

This one I'm not sure. I let a spy (player-controlled, but not player house) enter my Grinder and the build option for the Reverse-engineered unit did not disappear. Can anyone else confirm this?

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

(player-controlled, but not player house)Do other spy effects work in this setup?

Revision history for this message
reaperrr (reaperrr) wrote :

yes, I tested it again by adding

SpyEffect.ResetSuperweapons=yes
SuperWeapon=AmericanParaDropSpecial

to the same building and the spy did reset the sw timer, but still didn't remove the reversed tech.

Revision history for this message
WoRmINaToR (worminator) wrote :

@Marshall: Not only would there be a fairly enormous amount of work to put into that (changing the SHP, and not to mention actually drawing the SHP), but the chrono prison logic requires there be Passengers>0 on the unit. Passengers= does not work well with infantry.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Code related to this issue has just been checked in!
Author: DCoder
Location: trunk, r817
Commit contains DLL: Yes
Revision comment:

Related to issue #457 - Added logging for SpyEffect.
Related to issue 457 .
SVN: http://svn.renegadeprojects.com/Ares/817

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Uh, Reaperr, are you using SpyEffect.Custom = yes? It's required to get any custom effect at all. I added some logging, but can't spot any problems in the code.

Revision history for this message
reaperrr (reaperrr) wrote :

>>Uh, Reaperr, are you using SpyEffect.Custom = yes? It's required to get any custom effect at all.

ugh, that's what you get for not looking at the manual first >.<

yeah, that solves the problem, works fine now. Sorry, my bad.

Revision history for this message
mireazma (mireazma) wrote :

For the abuse solution I thought of a few (I'm inexperienced in modding so bare with me):

A. It would have been just perfect to work with enemy only, like with capturing by engineers. This also handles a specific abuse -- allies "borrowing" each others' technology.

B. If it's impossible, then maybe a tech level requirement per unit, so that it's buildable only if the player has a tech building (battle lab), no matter of which side. I think it's fair enough.

C. After all, selling the tech center is not a problem; the rev. eng. facility _is_ a technology canter; the problem arises when you sell _both_ battle lab and rev. eng.

D. Couldn't the rev. eng. facility made like an add-on pad to an existing war factory for units and to a barrack for infantry? Or to a battle lab.

E. Make the rev. eng. facility unsellable.

F. Make it so a limited number of "analyzed" units may be built (like an ammo for building). This would add to game balance because you have to spend money selling and re-building the facility and can't afford not to have it at all times.

G. For this one my intuition says that the service depot logic would help:
You can build a unit only as long as one "specimen" is currently lying on/in the facility. At a second thought, this would place second as a suggestion.

I hope I helped giving an idea.

Revision history for this message
WoRmINaToR (worminator) wrote :

Perhaps if your country is one that IS listed in the unit's Owner= list then prerequisites apply. If not, then prerequisites do not apply. Since, by westwood convention, the owner= list only includes countries that will build the unit under normal circumstances this shouldn't be a major problem, but people could change this....

Perhaps not the best idea but it's an idea.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Mireazma, your option G sounds quite interesting... I'll think about that.

Worm, the Owner= list is already related to the Kennel Hack and the NCO bug, I can't quite make it work for this as well without risking large fuckups somewhere.

I suppose a way to indicate a "prerequisite that is required even after reverse engineering" or "is a substitute to [structure X] for reverse engineering" would help...

Revision history for this message
arielby (ariel-bys) wrote :

StolenTech maybe?

[FV]
...
StolenTechWhenReversed=10

[XFV]:FV
StolenTechIndex=10
Prerequisite=FACTORY

Or a string StolenTechIndex or something like that.

Revision history for this message
WoRmINaToR (worminator) wrote :

@DC: Good point, didn't really think about that...

@Alpha: That still wouldn't solve anything. The ReverseEngineering logic already voids prerequisites. Placing prerequisites on the unit defeats the purpose of reverse engineering, and not placing prerequisites does not solve the problem of the possibility to abuse this system by putting your own units in and then selling your battle lab.

Thus, we need to come up with a better way to solve this problem.

Revision history for this message
Marshall (m-edward) wrote :

Actually I think Alpha's suggestion would work great.
Just have it so that ReverseEngineering doesn't void the stolen tech requirements but instead can provide stolen tech.

If you want to be able to get the unit from stealing tech or reverse engineering then just have the Battle Lab give the same tech index as reverse engineering gives.

The only thing you wouldn't be able to do with that is (SpyBattleLab XOR ReverseEngineer), just AND/OR.

Revision history for this message
Renegade (renegade) wrote :

You could, of course, just add GenericPrerequisite=, and have reverse engineered units adhere to that.

That way, a unit could have
[DILDOTANK]
Prerequisite=GASEXS,GAWEAP,GATECH
GenericPrerequisite=Factory,Tech
And would appear at the appropriate technology level on all sides.

It's completely implausible to require Side A to have a bunch of tech buildings to build a high tech unit, and to allow Side B to build the exact same thing in a cave.
"Hey, look! We reverse engineered the enemy's cold fusion-powered microwave laser tank! Let's hack it together with figs and leaves in our cave!"

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

That fails when you add a unique prerequisite structure to one side, e.g. RCC for the Robot Tank, or a Nuke Reactor as a prereq for Deso.

Oh, and let's all not forget that the Kennel Hack will complicate this even more.

Revision history for this message
Renegade (renegade) wrote :

Actually, that is exactly what my example had...GASEXS, the Allied Sex Shop.

The point is, that way, you could at least roughly ensure the overall level of prerequisites is met - e.g. at least a Tech Center for high tech units.
Allowing all objects of all type to be built at all times, no matter what else the users owns, is kinda problematic, imo.

Is it possible to derive appropriate prerequisites from the actual ones?
e.g. for each building in Prerequisite, check if it's buildable by the reverse engineering user, and, if so, keep it as a prerequisite; if the building isn't buildable, check if it's part of any prerequisite group, and if that is the case, add that group to the prerequisites; if neither is the case, drop the prerequisite.

That way, if something were listed as needing NANRCT, NAWEAP and NATECH, the reverse engineered unit would drop NANRCT and ask for Factory and Tech instead.
If all else fails, i.e. if none of the prerequisites can be built or we can't come up with a better solution, we could take the prerequisites of the lowest reverse engineering object in the game.

If it takes Tech to build a reverse engineering facility, then we can assume that's a high-tech skill, and that reverse engineering without high tech facilities wouldn't be possible. Thus, if no other prerequisites are available, the "new" unit should have a prereq of Tech.

Revision history for this message
falaka21 (falaka21) wrote :

DCoder is Right... When I put my own Hi_Tech units in to the Reverse Engineering Facility, It overrides "Original Prequisites"

But I guess 0.2 comes with this feature all fixed.. Just wait and see,right ? :)

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

No, actually I haven't had the time and inspiration to fix that part yet. Might just leave it as is for now and fix/improve later.

Revision history for this message
falaka21 (falaka21) wrote :

O.K. You are the boss..We can wait..

Revision history for this message
OmegaBolt (omegabolt) wrote :

Thinking about this a bit more...

Maybe the logic requires either UnitAbsorb (meaning it can reverse only vehicles), InfantryAbsorb (reverse only infantry) or Grinding (reverse either). The first two options means the captured unit has to be retained in the engineering vat in order for the player to build them, while Grinding disposes of the unit and still allows construction.

To be honest I don't see a big problem with being able to build an Apocalypse without a Battle Lab, for example. As long as the reverse engineering structure still stands then it should be buildable. That's kind of one of the benefits of capturing units - it acts a tech lab for the stolen technology. This can be balanced with Unit/InfantryAbsorb as then stolen tech can be freed from the building and there's a limited amount of storage as well.

I don't see stealing your own tech much of a problem either. If you capture your own tech, then lose/sell your Batlle Lab you still don't have access to high tech structures and if the engineering lab gets destroyed you lose the units too. If you have the Absorb tags on as well then your gonna need a few of these buildings just to store all your own tech.

Revision history for this message
Graion Dilach (graiondilach) wrote :

Supporting OmegaBolt's mechanism.

Revision history for this message
narfnin (narfnin) wrote :

I was reading this, and had an idea that may be good.

Perhaps when engineered, you get something similar to "StolenXTech" only it's "UnitEngineered=" and then, on some units, the prerequisite could be "EngineeredFrom="

Example:

[MTNKA]
(basic Apoc coding EXCEPT:)
Prerequisite=FACTORY,TECH ;this makes it need a war factory and battle lab
EngineeredFrom=MTNK ;Derp
ForbiddenHouses=Russians,Africans,Arabs,Confederation ;this makes it so soviets can't reverse engineer steal from each other.

What do you guys think?

Revision history for this message
Untrue (untrue) wrote :

Just wondering if the Reverse Engineering logic defaults to yes then that means we can reverse engineer other units too like civilian vehicles right?

Revision history for this message
modder666 (modder666) wrote :

Supporting OmegaBolt's mechanism as the best possible solution.

Revision history for this message
Chanterier (speederyr) wrote :

OmegaBolt's system is probably the best suggestion for this issue.

narfnin's suggestions about EngineeredFrom= stuff also sound good. You could make systems in which you receive certain elements of a unit with this method (like prism weaponry from the Prism Tank) and allow your engineers (let's say you're Soviet) to construct a completely unit based on the prism tank etc.

Revision history for this message
Professor_Tesla (professor-tesla) wrote :

I support OmegaBolt's proposed mechanism for this feature.

Revision history for this message
WoRmINaToR (worminator) wrote :

For the record, bolt's idea isn't a lot different from the current function, but I agree with his argumentation. I think something a lot of people are forgetting here is the cost of money and time associated with reversing your own units. Assuming stock values for prices, if a soviet player wanted to reverse his apoc tech, he would have to spend $2000 on the battle lab and an additional $1750 for the apocalypse, including whatever the engineering facility costs, which for this we will assume to be $1500. He can sell the lab sure, but he still spent a total of $4250 and that includes the bonus for selling the lab. And if bolt's method is implemented, the lab is still vulnerable to destruction, meaning you can lose the tech still, and don't forget that you are short an apoc tank which you might have needed for the fight.

So in short, this "exploit" is certainly possible, but certainly not worth it. You might as well keep your battle lab.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

While the suggested additions sound quite cool, implementing them now would delay 0.2 even further, so retargeting to the future.

Revision history for this message
MT1337 (mt1337) wrote :

I'm quite fine with what renegade suggested, it makes perfect sense to me.

Revision history for this message
Graion Dilach (graiondilach) wrote :

Tested it with current SW branch. //I know, that's not the best version, but Virus Bones said rev 817, and it was applied to all current branches.

It seems that ReverseEngineer only lifted up RequiredHouses, and Prerequisites still applies to the reverseengineered unit. Bug or feature?

Revision history for this message
YR M0ddEr (yr-m0dder) wrote :

"Objects grinded by this structure will become available to your house while completely ignoring:
- Prerequisite=, PrerequisiteLists and PrerequisiteOverride"

I suggest you retest in trunk

Revision history for this message
Graion Dilach (graiondilach) wrote :

Retested in trunk.

Bug applies but source was misidentified.

ReverseEngineer reverses the unit only if it was yours. So Chrono Prisons filled with enemy units won't give you new technology.

Revision history for this message
Renegade (renegade) wrote :

If you grind the Chrono Prison, you grind the Chrono Prison, thus you reverse engineer the Chrono Prison, and can build the Chrono Prison.
No handling for passengers of any kind was added yet.

Also, how are you going to force non-owned units directly into the Grinder?
You can only control them if you own them, one way or another.

iow: As far as I can tell from the bug report, everything is working as expected at this point.

Revision history for this message
OmegaBolt (omegabolt) wrote :

Since Chrono Prison'd units are in some kind of temporal prison dimension surely they'd have to be freed in order to be reverse engineered, therefore control would be returned to the enemy and they'd probably just break out of the engineering building. :P

Revision history for this message
Graion Dilach (graiondilach) wrote :

The Chrono Prison passengers aren't controlled by the CP owner, they are still owned by the original owner. Mindcontrolled units can be reverse-engineered.

And it's correct, I can build the Chrono Prison after all.

Oh well... this just means that the purpose I decided to create a Chrono Prison is just not possible. Never mind, then.

Revision history for this message
Renegade (renegade) wrote :

Depending on Ares's fate, additional features to deal with Chrono Prison passengers will be added in the future.
For now, the interesting question is if this particular feature works bug-free to the extent it was implemented?

Revision history for this message
Graion Dilach (graiondilach) wrote :

Passengers and parasites won't be reverse-engineered (I was wrong, it wasn't the owner's problem), except these cases, all works as intended.

Revision history for this message
Renegade (renegade) wrote :

Thank you :)

Revision history for this message
Graion Dilach (graiondilach) wrote :

Just a bit doc issue related to this. The second NB @ Reverse-Engineer is based upon my first observations, it haven't been updated since.

Revision history for this message
OmegaBolt (omegabolt) wrote :

Some EVA issues I noticed.

1) First I mind control a unit, reverse engineer it so now I have the tech. I now mind control another of the same unit, and also send that into the reverse engineering grinder and EVA will still say "New technology acquired", despite the fact I've already got the tech.

2) Captured enemy Spies sent into the reverse engineering building will play their infiltration voice and EVA will also announce that technology has been stolen.

Note, if I have SpyEffect.UndoReverseEngineer=yes set the Spies do NOT remove stolen tech, they simply get added to my sidebar as normal.

Revision history for this message
Bug Importer (bug-importer) wrote :

Code related to this issue has just been checked in!
Author: SteelMirage
Location: trunk, r1113
Commit contains DLL: No
Revision comment:
Related to Issue 457: Changed final note, mentioned minor bugs were attached to this issue.
SVN: http://svn.renegadeprojects.com/Ares/1113

Revision history for this message
YR M0ddEr (yr-m0dder) wrote :

"Captured enemy Spies sent into the reverse engineering building will play their infiltration voice"
Not an Ares bug.

Revision history for this message
OmegaBolt (omegabolt) wrote :

And why not? Ares enabled this feature in YR, so of course it is an issue Ares should fix.

Revision history for this message
AlexB (alexander-b) wrote :

Putting things into a grinder is essentially "entering" a building. Spys usually are allowed to only enter enemy buildings, to do agent stuff them. Putting them into your own grinder is an exception to this rule, but the enter voice will play here also. Not saying this is meant to be like this.

Revision history for this message
Graion Dilach (graiondilach) wrote :

To clarify more... if a Spy enters into an allied Spyable=yes structure (because it's a Grinder and a barracks at the same time, for example) it'll play it's infiltration sound. This is valid in YR 1.01 as well.

YRM have tested this possibility after I asked him to do so, this is why he stated its a YR bug.

Revision history for this message
Krozalid (krozalid) wrote :

So if the Grinder=yes structure doesn't have Spyable=yes, it won't play the infiltration sound?

Revision history for this message
Graion Dilach (graiondilach) wrote :

It won't. But then you can't use SpyEffects, neither.

Revision history for this message
Krozalid (krozalid) wrote :

Dammit. Will this be in 0.2?

Revision history for this message
Graion Dilach (graiondilach) wrote :

This is already in trunk.

Revision history for this message
Krozalid (krozalid) wrote :

Quick question, what about Bolt's suggestion? And Speeder's idea sounds good too. Can't you (the devs) impliment it the way they suggested it? Or is it too hard to do it that way and you're just gonna stick to the way it is?

Revision history for this message
Graion Dilach (graiondilach) wrote :

Later, we might.

Right now we're concentrating on 0.2 release. I suggest you to concentrate to the ACSC. It's still not entirely fulfilled.

Revision history for this message
Krozalid (krozalid) wrote :

ACSC?

Revision history for this message
Graion Dilach (graiondilach) wrote :
Revision history for this message
Mig Eater (mig-eater) wrote :

Units gained via bonus crates aren't buildable after being reverse engineered, anyone else having this problem?

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Objects grinded by this structure will become available to your house while completely ignoring:
- Prerequisite=, PrerequisiteLists and PrerequisiteOverride
- StolenTech, both old and new models
- TechLevel
- Required/ForbiddenHouses
but obeying BuildLimit, PrerequisiteTheaters, NegativePrerequisite, and required factory stuff to avoid NCO.
Are you sure your crate goodies meet these conditions?

Revision history for this message
Graion Dilach (graiondilach) wrote :

"[NCO Bug] House *insert player name here* has fulfilled all prerequisites for *unit* but doesn't have a suitable factory!"

Actually, the Not The Owner NCO bug still applies, and I'm 100% sure that one kicks in.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.