mincloakdistance Improvement Request.

mincloakdistance Improvement Request.

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

mincloakdistance Improvement Request.

Post by Argh »

The check to see whether a Unit can remain Cloaked is not taking Neutrality into account.

Anything that isn't Allied to your Units may uncloak it, regardless of SightDistance or LOS- i.e., your building may be completely blind, but it can still uncloak stuff at the mincloakdistance :P

Needless to say, this produces some irritating results with World Builder stuff, which is all completely blind, yet decloaks cloaked Units around them, and makes it rather hard to have cloaking that's over a large area, as opposed to almost-impossible-to-find cloaking.

Just removing Neutral stuff from the checking loop would probably be sufficient to remedy this. However it'd make Neutral stuff that's supposed to be dangerous completely unable to uncloak things. I don't see any other cheap way to do this, though.

The relevant section is in Unit.cpp, here:

Code: Select all

else if (wantCloak || (scriptCloak >= 1)) {
		if ((decloakDistance > 0.0f) &&
		    helper->GetClosestEnemyUnitNoLosTest(midPos, decloakDistance,
		                                         allyteam, unitDef->decloakSpherical)) {
			curCloakTimeout = gs->frameNum + cloakTimeout;
			isCloaked = false;
		}
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: mincloakdistance Improvement Request.

Post by Pxtl »

Wait, if faction X decloaks a unit, then faction Y can see it? Since when???
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: mincloakdistance Improvement Request.

Post by Argh »

Yup. Every gameframe, Units check in a sphere for Units, to see if decloak happens... if not Allied, then it decloaks. Simple as that.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: mincloakdistance Improvement Request.

Post by yuritch »

Currently a unit is either cloaked or not. Doesn't matter who uncloaked it, once this happened, it's visible to all the factions (if they have LOS over that point, of course).
It would be good if cloak state was per-player (as in only the player who uncloaked a unit can see it, and not others), that may require quite a bit of messing with the code however.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: mincloakdistance Improvement Request.

Post by Argh »

It would be good if cloak state was per-player (as in only the player who uncloaked a unit can see it, and not others), that may require quite a bit of messing with the code however.
It'd be nice, yeah. I just can't figure out any fast way to do that.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: mincloakdistance Improvement Request.

Post by [Krogoth86] »

yuritch wrote:It would be good if cloak state was per-player (as in only the player who uncloaked a unit can see it, and not others), that may require quite a bit of messing with the code however.
It shouldn't break shared vision with your allies though i.e. make the per-player-visibility compatible to a per-team-visibility... :wink:
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: mincloakdistance Improvement Request.

Post by Pxtl »

I can see why it was done like that, thinking it over. Look at it from a player's perspective - as the player, your unit is either cloaked or not. "Relative to whom" is not a question. Otherwise, when would you show the "decloak" graphical effect?

As for the other thing, a straight up "causesDecloak" boolean tag would probably be good enough, defaulting to true (or to sight-range is non-zero). More versatile than forcing it to non-zero sight-range.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: mincloakdistance Improvement Request.

Post by lurker »

It's easy enough to make up a way to render a unit that shows that it's cloaked but not hidden to all.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: mincloakdistance Improvement Request.

Post by yuritch »

Even more than that, the player owning the unit doesn't have to know it's been discovered. Take Starcraft for ex. - the Protoss player is likely to have his cloaked Observers all over the map, and can easily spot some Terran Ghosts trying to sneak into his base. But the Terran player will only know his Ghosts were spotted when they will get attacked. Even more, in an FFA game the Protoss can observe other players battles without them knowing someone is seeing their cloaked units.
Currently Spring cannot do this - if an enemy decloaks your unit, you immediately know about this, even if you cannot see the unit that spotted yours (if your units have longer decloak range than LOS for ex.)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: mincloakdistance Improvement Request.

Post by zwzsg »

Cloacking cost energy, so a unit is either declocked or cloacked. Maybe if we had cost-free cloacking we could have units cloacked to some enemy sight and not others.
User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: mincloakdistance Improvement Request.

Post by Tribulexrenamed »

zwzsg wrote:Cloacking cost energy, so a unit is either declocked or cloacked. Maybe if we had cost-free cloacking we could have units cloacked to some enemy sight and not others.
True, but perhaps the system should work more like this:

Set cloaking on --> constant E drain, except when attacking or building if applicable.
Unit becomes visible to another player--> Visual indication (or maybe the fact that your unit is being attacked), continued E drain since unit is still cloaked. Unit is visible to player that uncloaked it. The unit is still cloaking, but chances are your enemy is tracking it, so the cloaking is ineffectual for hiding the unit from that team.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: mincloakdistance Improvement Request.

Post by Warlord Zsinj »

I'd like to have a lot more control over what decloaks what.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: mincloakdistance Improvement Request.

Post by Forboding Angel »

zwzsg wrote:Cloacking cost energy, so a unit is either declocked or cloacked. Maybe if we had cost-free cloacking we could have units cloacked to some enemy sight and not others.

lolwut? Cloaking doesn't HAVE to cost anything, just most of us assign a cost so that if the game is almost over, you don't end up with one unit that can stay cloaked forever. This comment isn't even related to what argh is talking about anyway.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: mincloakdistance Improvement Request.

Post by Pxtl »

Forboding Angel wrote: lolwut? Cloaking doesn't HAVE to cost anything, just most of us assign a cost so that if the game is almost over, you don't end up with one unit that can stay cloaked forever. This comment isn't even related to what argh is talking about anyway.
The point: either a unit is cloaked or it isn't. When it's cloaked, it exhibits different behaviour from being de-cloaked. Energy drain is the big one.

Units that have an enemy in decloak range aren't just visible, they're un-cloaked, with all the effects that being un-cloaked have.

If you have a unit with COB script that changes things based on cloaked/decloaked, then that is particularly relevant.

Making units that are spotted through cloak-range be still cloaked-but-visible would be a serious change, and break OTA compatibility (for however little that's worth).
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: mincloakdistance Improvement Request.

Post by Tobi »

It could easily be done as addition that doesn't break anything; e.g. have a minCloakDistance (like now) and a seeCloakDistance (cloaked units in this range from unit wearing this tag remain cloaked but are shown to the allyteam of the tag-wearer anyway, without any indication whatsoever to the allyteam of the cloacked unit.)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: mincloakdistance Improvement Request.

Post by KDR_11k »

I'd prefer a Lua function to set whether a unit is visible to a specific team if it doesn't exist yet.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: mincloakdistance Improvement Request.

Post by trepan »

I actually did a patch for just that some time ago
(raw control of unit LOS state via Synced lua). I'll
try to find it, and get it in today / tomorrow.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: mincloakdistance Improvement Request.

Post by Pxtl »

trepan wrote:I actually did a patch for just that some time ago
(raw control of unit LOS state via Synced lua). I'll
try to find it, and get it in today / tomorrow.
Cool! Does this work for radar too? That is, can I set a unit to be a radar-blip (or not) for player X, and let the engine handle radar-drift, etc?
Post Reply

Return to “Feature Requests”