Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Limited vision or "Blind"
Limited vision or "Blind"
Oct 20 2009, 12:27 am
By: EzTerix  

Oct 20 2009, 12:27 am EzTerix Post #1



I was going to add a gameplay element to my game where the human players would have to use a flashlight. I was wondering however how to use "blind" to give them limited vision until they turn on their flashlight (I want them to have the ability to turn it on and off at will)
In the game Shroud of Darkness I saw how the creator made a flashlight system and was really intrigued by it and thought how it would benefit my type of game greatly.

So basically I was wondering how I blind the player's units when they don't have the flashlight on and how to unblind (restore?) them when they do. If this contains some sort of trigger location that follows units and some AI scripts I'd like an explanation a noob like me can understand =). I don't really want to utilize the drop ship inventory system since my game is already far in. Also I was thinking when the player finds the flashlight they have the ability to turn it on by walking on a beacon (in the inventory) and off by either waiting long enough for the battery to run out (hopefully by some kill units commands where the battery power will be units) or just walking off the beacon.

Hopefully this isn't too much, if we figure this out my game will become so much better gameplay wise.
^_^



None.

Oct 20 2009, 12:30 am Vrael Post #2



You can use the AI script "Turn OFF Shared vision for Player 1", in a trigger run by P1, to turn off P1's vision of himself. Then, when it comes time to use the flashlight, you can run the "Turn ON Shared vision for Player 1"

In places that a player always needs to see (inventories or something), place units/map revealers owned by an allied computer or something that the players have vision with.



None.

Oct 20 2009, 12:47 am EzTerix Post #3



Quote from Vrael
You can use the AI script "Turn OFF Shared vision for Player 1", in a trigger run by P1, to turn off P1's vision of himself. Then, when it comes time to use the flashlight, you can run the "Turn ON Shared vision for Player 1"

In places that a player always needs to see (inventories or something), place units/map revealers owned by an allied computer or something that the players have vision with.

Ok I seemed to have overcomplicated it for myself xD. Glad to see there is an easier way. However if I turned off player1's vision for himself would he not be able to control his units? I can work around this but however I was wondering if he could still control and see his main unit.



None.

Oct 20 2009, 1:09 am DavidJCobb Post #4



A player without vision of his own units can't control them unless that unit is in the line of sight with something that the player does have vision of. So if you have a P1 Ghost and a P2 SCV near each other, and P1 shares vision with P2 but not with himself, then he can still see the Ghost because it's in the SCV's line of sight.

However, wouldn't P1 lose vision of their Map Revealers when they lose vision with themselves?



None.

Oct 20 2009, 1:32 am EzTerix Post #5



Quote from DavidJCobb
A player without vision of his own units can't control them unless that unit is in the line of sight with something that the player does have vision of. So if you have a P1 Ghost and a P2 SCV near each other, and P1 shares vision with P2 but not with himself, then he can still see the Ghost because it's in the SCV's line of sight.

However, wouldn't P1 lose vision of their Map Revealers when they lose vision with themselves?

Hmm this is a little tricky. I believe I should let the players ally a computer who they have vision of and put that computer's buildings or whatever near the player's inventories so they can see those at the very least. Other than that I'd probably have to give the players this flashlight early on or just basically start with it since it would be too much trouble to make sure they don't lose their characters in the dark.

Thanks for the help so far but I have one last part to my question. How should I do this battery system? One way could be resources but it sounds troubling since I am not experienced with typing in triggers yet. Was figuring that the battery system would go like this:
Player finds flashlight
Player starts with 10 units (batterys) in the battery area ( an area in the inventory system where you can see the batteries counted)
Player gets an on/off switch (unit)
Player gets a Turn on/off area (turn on would be a beacon, turn off would be just leaving that beacon)
Player can have a maximum battery power of 10 batteries(units) in the battery count area, if the player leaves it on any longer the excess just gets removed.

Ok imagining if the player decides to turn on the flashlight.
Player puts on/off switch on the on beacon (lets player get to see his units)
Player leaves on/off switch on the beacon (he continues to see his units, however a "battery" gets removed or dies every 30 or so seconds (might increase time since I'm not sure) )
Player turns off flashlight (he loses vision of his units, a wait command instantly issues which waits for about 15 or so seconds till he gets a new battery (no definite time yet of course)

There is no neutral area for the flashlight, it's either ON or OFF.

Does this make sense or did I overcomplicate it? :3



None.

Oct 20 2009, 1:51 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

I figured out the way vision works a while back. It turns out every 100 frames, vision updates. If you leave a unit with shared vision over this frame, you get to keep vision. This resolves the "flicker" effect when you constantly create/remove a unit by the player who does not have vision with himself.

Essentially what happens, you can set view range to:
Hydralisk: 6
Zergling: 5
Drone: 7
Defiler: 10
Hunter Killer: 8
Ghost: 11 (maybe?)
Infested Kerrigan: 9 (maybe?)
Spider Mine: 3 (maybe?)
Blinded unit: don't know, 1? doesn't matter much anyway.

Now, the maybes are due to when created, I'm not sure if they go through their cloak routine. To keep things pretty, we don't want to see a cloaked unit cloaking every time it is created. The burrowed zerg units work flawlessly, however. The basic premise is this:
When the player moves (center 1 px/inverted location), create the vision unit (5=zergling) with the burrow property, then immediately remove it. This is the first step. If you just do this, you will lose vision when you stand still. Next, you need a counter which counts the frames, and on every 100th frame, create a vision unit, wait until the next trigger cycle, then remove it. This will carry the vision over the vision reset frame, leaving you with vision even if you stand still.

An important note: Giving units DOES NOT update vision. Creating units DOES update vision. The only time giving units updates vision is if you control that unit over the vision reset frame (which we can exploit in this method). Also, if any unit is blinded, this resets the vision update frame to that instant the unit is blinded, effectively crippling this system, since there's no way to know which frame the unit was blinded on. In other words, you can't use optical flare without vigorous testing.

If this sounds appealing, I'll link you to my test map so you can see it in action.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 20 2009, 9:37 pm DavidJCobb Post #7



That would solve the problem of burrowed Zerg units being visible (if vision if shared with them), right? Just create them only when necessary, and delete them the moment they outlive their usefulness; and repeat the cycle of life and death ad infinitum.



None.

Oct 20 2009, 10:56 pm darksnow Post #8



you get to control the range too.
if you cant use the optical flare, are there any units with a vision of 1 to use when the flashlight isn't on?



None.

Oct 20 2009, 11:06 pm rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

vision of 3 is VERY small. Those are all the units I could find which would achieve a unique vision, while still be cloaked somehow (to allow them to exist for 2 frames, then instantly disappear, so you can't actually see them).

The only units with a vision of 1 are the doors and a preplaced sprite unit start location. I couldn't find anything with a vision of 2 (I presume which is blind).

Post has been edited 1 time(s), last time on Oct 20 2009, 11:27 pm by rockz.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 21 2009, 5:13 pm samsizzle Post #10



what you could do is place copies of the players unit somewhere on the side and blind it with medics, then when you want to turn on/off the flashlight you just switch the two units. The only downside to this is hotkeying your unit would be useless if you were using flashlight frequently and it would say blind when you dont have the flashlight on...



None.

Oct 21 2009, 6:12 pm Super Duper Post #11



I have been thinking about this one.
What you COULD do is turn off the vision for the player that you dont want the vision for and you could center a location on the players adventure unit and then make a trigger that spawns a spider mine for a player that has vision for the adventure unit and always center that spider mine on the unit.
The only thing is that it would spam "UNIT un-placeable" if you go on some un-walkable terrain.



None.

Oct 21 2009, 6:59 pm rockz Post #12

ᴄʜᴇᴇsᴇ ɪᴛ!

I've been thinking. You won't see a unit which is created/removed in the same trigger cycle. You also can cloak almost any unit with either an arbiter or disable/enable/enable. That means for ground units, you can use any ground unit. For air units, you can use any air unit. I might make a test map which includes variable vision with an air unit and a ground unit.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 21 2009, 7:06 pm Super Duper Post #13



I didnt say it gets removed, I was saying that it is constantly being moved near the unit, not removed and created again.

Move Unit to: Centered Location on unit.



None.

Oct 21 2009, 10:00 pm rockz Post #14

ᴄʜᴇᴇsᴇ ɪᴛ!

If it's burrowed or an air unit, then you have slowdown. If it's not burrowed, you have a unit constantly blocking you. I was talking about my method, which gives vision without ever flickering or showing a burrowed/cloaked unit.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
Please log in to shout.


Members Online: Roy, lil-Inferno