Command & Conquer™ Remastered Collection

Command & Conquer™ Remastered Collection

Command & Conquer™ Remastered Collection Workshop
Create, share, and play mods for a custom C&C experience! A new Map Editor is also included. Welcome back, Commander.
Learn More
The mystery of stealth in cnc?
I know base defences and com center has the code "detector" and all infantries can "detect" stealth. However, is there any specific line of code that explains the stealth better?

I recently noticed when blocking a refinery with stealth tank and the harvester comes to dock and touches the stealth tank it starts to flicker "decloak-cloak-decloak-cloak"... why is this? Do tanks also detect when touching or running 'into' a stealth tank?
< >
Showing 1-11 of 11 comments
Nyerguds 8 Aug 3, 2022 @ 11:00am 
Never really looked at that, but I know that harvesters that get blocked will request the blocking unit to move out of the way. So I'm assuming there's some special code that if said unit is an enemy stealth unit, the harvester "realises" a Stealth unit is the problem, and to convey this in the game, the Stealth tank is made to shimmer.
DDF3 40 Aug 3, 2022 @ 11:58am 
I think you were seeing the Stank Shimmer , It is a partial decloaking.

Basically it will do that if something is trying to take its spot , but cant actually decloak it.

If you look on Techno.cpp
TechnoClass::Do_Uncloak ,
TechnoClass::Do_Cloak,
TechnoClass::Do_Shimmer,
XKorpion 2 Aug 3, 2022 @ 12:01pm 
Without looking into the code, I would say it's behaving as... coded. What would you expect? Maybe your ideas can become a plugin mod?
XKorpion 2 Aug 3, 2022 @ 12:01pm 
Originally posted by DDF3:
I think you were seeing the Stank Shimmer , It is a partial decloaking.

Basically it will do that if something is trying to take its spot , but cant actually decloak it.

If you look on Techno.cpp
TechnoClass::Do_Uncloak ,
TechnoClass::Do_Cloak,
TechnoClass::Do_Shimmer,

STANK SHIMMER. LOL
Incia3000 22 Aug 3, 2022 @ 2:52pm 
Originally posted by XKorpion:
What would you expect?

That vehicles can't detect stealth no matter what, so you can block ramps with stealth tanks.


Thanks for the explanation Nyerguds and DDF3, that makes sense about the shimmer and that harv looks for a reason why the ref area is blocked.

For example if you just have a base defense around that area, when the stealth tank shimmers like that, the base defense will kill it automatically.
Nyerguds 8 Aug 4, 2022 @ 12:35am 
Originally posted by Incia3000:
For example if you just have a base defense around that area, when the stealth tank shimmers like that, the base defense will kill it automatically.
Which emulates exactly what would happen in real life when someone realises something invisible is blocking their way :steammocking:
Last edited by Nyerguds; Aug 4, 2022 @ 12:35am
Incia3000 22 Aug 5, 2022 @ 9:40am 
Okay, I actually made a maze map with enemy 'sleeping' stealth tanks. What I seem to have figured out is the followings:

1: Nothing decloaks an idle Stealth Tank. No matter if I build a Guard Tower/Com Center next to it, put infantries next to it, they just stop moving into the square but do not detect it.

2: Everything decloaks (or makes it shimmer) if the Stealth Tank bumps into them. Moving Stealth Tank gets decloaked a few seconds when running into infantry/any units/structures that detect. They need to run into set structure/unit. Or for example a Harv bumping into Stealth Tank.

3: Shooting at a Stealth Tank (by force fire) or the Stealth Tank shoots back makes them decloak fully.

So what exactly does this 'detector' code do?
Forces the Stealth Tank to shimmer when they drive by?
And if that's the case then everything in the game 'detects'.

I mean I build 5 Guard Towers and put infantries around a Stealth Tank, and nothing 'decloaked' it. I knew there was a Stealth Tank because I couldn't place a structure there. Then I force fired the Stealth Tank and everything shot and killed it.

PS: Harvester is the best Stealth Tank finder as it seems to make them Shimmer easier than anything else.

https://steamcommunity.com/id/Incia/screenshots/
Last edited by Incia3000; Aug 5, 2022 @ 9:49am
DontCryJustDie 5 Aug 5, 2022 @ 11:00am 
They put the code for stealth detectors (objects with IsScanner) on the object with stealth and not on the IsScanner object probably to improve performance. So only when the stealthed object moves the code checks if an adjacent cell contains an object that is a scanner and if so the stealth breaks. That is the reason why your GTWR and infs didn't detected the STNK because it didn't moved.
Incia3000 22 Aug 5, 2022 @ 12:00pm 
Originally posted by DontCryJustDie:
They put the code for stealth detectors (objects with IsScanner) on the object with stealth and not on the IsScanner object probably to improve performance. So only when the stealthed object moves the code checks if an adjacent cell contains an object that is a scanner and if so the stealth breaks. That is the reason why your GTWR and infs didn't detected the STNK because it didn't moved.

Ooooh... that makes a lot of sense. Thanks. Yeah that does make the detecting work little difficult to test. Now I can put this to rest.
Incia3000 22 Jul 17, 2023 @ 11:17am 
https://www.youtube.com/watch?v=MxsTobdiG0w

Sorry for necro but I finally compiled a video about stealth tanks and I give shoutouts to you guys helping me understand the coding. :)
Nyerguds 8 Jul 17, 2023 @ 2:16pm 
Very nice breakdown!
< >
Showing 1-11 of 11 comments
Per page: 1530 50