UnsyncedCtrl Lua Interface to have sight without units

UnsyncedCtrl Lua Interface to have sight without units

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

UnsyncedCtrl Lua Interface to have sight without units

Post by zwzsg »

Hello!

I feel a need for this feature:

A new gadget callout, Spring.GiveSightInRect(number x1, number z1, number x2, number z2, number teamID, number level, number duration )

- Where x1,z1 to x2,z2 define the reactangular area where sight will be given.
If it's easier to implement a Spring.GiveSightInCyl(x, z, r, ...), no problem (as long as I can give map-wide sight without crashing or choking Spring)
Or maybe even both rectangle and cylinder, idk.

- Where teamID is which team to update the sight of. Would be sweet to have some ways to say "all team", but then special cases can be such a burden, maybe it's for the better to have to use a for loop on all teams in gadgets that give sight to all teams.

- Where level is the kind of sight to provide. Something like:
1 : Heightmap and features only
2 : plus radar and sonar
3 : plus ghost units
4 : live units and live projectile
Or whichever distinction between levels of sight makes sense, I'm not really sure how many the engine handle.

- Where duration is how long to keep providing sight after the callout. If implementable. Otherwise I guess we can have gadget repeating the command every tick. It would be probably more intuitive to have duration in seconds, but I guess ticks would be okay too. The default value should be 0, or maybe 0 should still be one tick in case the engine needs a tick to take the sight into account. Then I recall sight is updated on slower ticks than the rest? Anyway, use which default value and time units that are sensible. Or axe it if too bloatfull to add engine side.

Most immediatly, I would use it to let all player see new heightmap and new geovents layout in my map altering gadgets.
Then I would add a game option of no fog of war, full sight always everhwere.
But the power to add localised reveal special abilities would be welcomed by many modders.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by Beherith »

I know this isnt a new idea, but have you thought of spawning an invisible unit high up?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by zwzsg »

Not only thought, but even tried it. Have you?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by yuritch »

We had to use invisible/unselectable units to emulate something much like this for binoculars function in S:44. It even works. Link to gadget (spotting unit is spawned on weapon hit, since the binoculars are a weapon).

Of course our binoculars only reveal a small area, nothing like the full map, so maybe that way won't do for heavy map terraforming.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10452
Joined: 24 Jan 2006, 21:12

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by PicassoCT »

Yeah, its pretty costly for heavy map terraforming.
I use invisible units in the minimissions to highlight objectives.

But would be cool if the engine had such a unit build in to update the los-terrain, once in a while
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by Anarchid »

For things like hexfarm, possibly temporarily disabling UHM would be even more useful.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by knorke »

I think similiar came up before and it was always "not possible"...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by zwzsg »

Anarchid wrote:For things like hexfarm, possibly temporarily disabling UHM would be even more useful.
What is UHM? Unsynced Height Map? An interface for gadget to enable and disable it would indeed help me, but I'm afraid then we could have gadgets infighting and not knowing which state to leave it after they're done.

Giving sight seemed to me a more generic, more useful, solution, with less risk of misuses from gadget writers.


knorke wrote:I think similiar came up before and it was always "not possible"...
Then I have a new Feature Request [Internal Engine Refactoring]: Abstract the LoS system so it's not tied to units.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by knorke »

UHM = Unsynced Height Map
Disabling that is what you really want yes? For randomly generated maps? Maybe direct feature request for that has better chance, not sure.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by Beherith »

Out of curiosity (and so that I dont fall into the same pit), what was the issue with the invisible unit type solution? What parts of it are considered as 'blocking' bugs?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by zwzsg »

- The maximum sight of a unit is limited. To cover even a smallish 8x6 map, I needed to spawn about 8 units in a grid like fashion.
- So to cover a large map for all teams, I would need to spawn a large number of units: They would eat the unit count.
- I would be difficult, and bit dirty, to create special sight-only units that are compatible with any and every mod.
- I could not find a way to hide the radar dot on the minimap for the owner.
- Making sure other gadgets ignore the sight unit when they do Spring.Get*Units* could only be done partially.
- I don't even know how to make sure the GUI of the player that own them ignore the sight units, so that, for example, a right click doesn't do a "guard sight unit" but a "move" as if nothing was present.

I mean, yes, there is stealth, there is Spring.SetUnitNoSelect, there is AllowCommand, etc... but even when using all tricks I know, the sight unit is never completely transparent to the owner GUI, to other gadget and engine code.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: UnsyncedCtrl Lua Interface to have sight without units

Post by FLOZi »

Spring.SetUnitNoMinimap
Post Reply

Return to “Feature Requests”