Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Units that leave the screen die
Units that leave the screen die
Jun 9 2010, 8:26 am
By: ydralisk  

Jun 9 2010, 8:26 am ydralisk Post #1



Hi, I have constantly moving observer with a 19x12 location centered on it, which is the whole size of the screen you see in-game. When a unit leaves the screen, it should die. This works well for maps like Roy's Dash because you only control 1 zergling so it's easily detectable by having 0 units in the location, but what if I have more units? I then realized that maybe an inverted location would work, a horizontal one, but then I realized i need the unit to be on both sides outside the observer's location for it to work. No unit is fat enough to stretch that far. :bye1:



None.

Jun 9 2010, 9:24 am Lanthanide Post #2



Follow the player with two locations, 19x12 and one that is like 24x17.

Assuming you're killing CPU controlled players that are owned by Player 8, here's some triggers you can use:
Give all men owned by P8 at inner location to P9
Kill all men owned by P8 at outer location
Give all men owned by P9 at inner location to P8

This would have the disadvantage that because you are constantly giving units, players wouldn't be able to select them, so here's some extra triggers you can add so that you only need to carry out the killing action when required (at that instant you would lose selection of any units):

The best way to carry this out is to store the number of units in each location into a death-count. Like:
Player brings 1 men to inner location, set InnerDC to 1
Player brings 2 men to inner location, set InnerDC to 2
Player brings 3 men to inner location, set InnerDC to 3
...
Player brings 20 men to inner location, set InnerDC to 20

Player brings 1 men to outer location, set OuterDC to 1
Player brings 2 men to outer location, set OuterDC to 2
...
Player brings 20 men to outer location, set OuterDC to 20

Then have triggers to compare the DCs using binary arithmetic:
If InnerDC at least 8, subtract 8 from InnerDC, subtract 8 from OuterDC
If InnerDC at least 4, subtract 4 from InnerDC, subtract 4 from OuterDC
If InnerDC at least 2, subtract 2 from InnerDC, subtract 2 from OuterDC
If InnerDC at least 1, subtract 1 from InnerDC, subtract 1 from OuterDC

If InnerDC is exactly 0 and OuterDC is at least 1 -> we have a man in the outer location that is not present in the inner location!



None.

Jun 9 2010, 10:31 am ydralisk Post #3



Thank you for your input, but I guess I should've made myself clearer. These will be active players with multiple units who will not be allowed to leave the screen.



None.

Jun 9 2010, 10:44 am NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Probably the best you can do is using a mobile grid to center 4 boundary locations around the center location. When anyone enters any boundary location kill him. :)




Jun 9 2010, 12:05 pm Azrael Post #5



Won't centering a mobile grid on an observer mess up the grid? =x

Post has been edited 2 time(s), last time on Oct 12 2010, 12:17 pm by DevliN. Reason: Mineral abuse.




Jun 9 2010, 1:06 pm Biophysicist Post #6



Are the units all land units? If so, you can put a P9+ Observer over each player-controlled units, then cycle through Observers and keep them above their units. Then, if an Observer leaves the screen, then KILLKILLKILL the unit beneath it (and the Observer). Note that you'd need to make sure not to accidentally cycle onto the Observer controlling screen centering - the best way to do that would be to use different players for the cycle Observer and the centering Observer.



None.

Jun 9 2010, 6:00 pm Azrael Post #7



Bio, do you have an example of that system working? I've tried countless ways in the past of being able to keep track of specific units and nothing ever works. If you have 2 civilians which each have an identical observer over them, constantly staying on top of them, how can you prevent the situation where the 2 civilians pass closely to one another and end up with 1 civilian snagging the observer of the other, resulting in a civilian with no observer who is free to leave the screen?

Even if you have a 1x1 pixel location constantly centering on a civilian at that 1x1 pixel location, it will still switch to other civilians who it passes by.

If you can post an example map where this works I would greatly appreciate it, because there is a lot of things I would do with the ability to keep track of specific units.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:17 pm by DevliN. Reason: Mineral abuse.




Jun 9 2010, 6:28 pm CecilSunkure Post #8



Quote from NudeRaider
Probably the best you can do is using a mobile grid to center 4 boundary locations around the center location. When anyone enters any boundary location kill him. :)
This is true.

You could also do something more elegant. Have your 20x12 location on your character to denote the screen. Then cycle through each enemy unit on the screen, and check to see whether or not it is in the 20x12. If it is, kill it. The cycling can be done by constantly keeping a location on each enemy unit, or by giving each enemy unit to another player each time a unit is scanned, then when they are all owned by that other player, give them back to the original.

If giving the actual enemy units to another player isn't an option, you can lay down a grid of burrowed units and use those to scan the entire map for units that are not in the 20x12 location on the character, and kill them.

Let us know if you want more information on any of these methods.



None.

Jun 9 2010, 8:30 pm ydralisk Post #9



Well let me reveal what I'm planning, maybe it'll give you some more information on my background issue:
I'm making random micro map with a long horizontal strip of terrain which is split into sections with uraj crystal walls. The observer is stop and go and slowly moving from the left side to the right side, and players must micro and defeat the enemy units which will destroy the uraj crystal wall, otherwise they fall behind. All units (except computer units) must stay within the screen. Any unit leaving the screen (except computer units) will die.



None.

Jun 9 2010, 11:35 pm Azrael Post #10



Quote from CecilSunkure
Quote from NudeRaider
Probably the best you can do is using a mobile grid to center 4 boundary locations around the center location. When anyone enters any boundary location kill him. :)
This is true.
This is not true. I already said why mobile grids won't work. The only way to use them would be with a location off-set and to have them running independently, which would be an unnecessarily complicated method of doing something otherwise simple.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:18 pm by DevliN. Reason: Mineral abuse.




Jun 10 2010, 12:07 am Kimaru2 Post #11



Quote from name:Azrael.Wrath
Quote from CecilSunkure
Quote from NudeRaider
Probably the best you can do is using a mobile grid to center 4 boundary locations around the center location. When anyone enters any boundary location kill him. :)
This is true.
This is not true. I already said why mobile grids won't work. The only way to use them would be with a location off-set and to have them running independently, which would be an unnecessarily complicated method of doing something otherwise simple.

Thanks! Your method worked like a charm!



None.

Jun 10 2010, 12:09 am Aristocrat Post #12



Quote from ydralisk
Well let me reveal what I'm planning, maybe it'll give you some more information on my background issue:
I'm making random micro map with a long horizontal strip of terrain which is split into sections with uraj crystal walls. The observer is stop and go and slowly moving from the left side to the right side, and players must micro and defeat the enemy units which will destroy the uraj crystal wall, otherwise they fall behind. All units (except computer units) must stay within the screen. Any unit leaving the screen (except computer units) will die.

Why doesn't a mobile grid work? you can have it set up like this:

-----------------------------------------------------1x1


1x1---------------------------------------------OBSERVER(>>)----------------------------------1x1(*)


-----------------------------------------------------1x1

Put burrowed lings on the 1x1 location marked with a (*); when the ling enters the screen-sized location, move all four of those locations forward 1 tile with a mobile grid and move the lings. Then, center 10x1/1x20 locations (or however wide/tall a screen is) on the four 1x1 locations. Constantly kill units in those locations.



None.

Jun 10 2010, 12:09 am Azrael Post #13



Yeah that works great until he fights his first air unit :wtfage: Why use an over-complicated method that's also unreliable? Unreliable isn't even the right word, because if he fights a single air unit over the course of the entire map, the mobile grid system will reliably fail every single time. That's even worse than just being unreliable.

Mobile grid system you described won't work even with no air units because it would have to move the borders around 2 tiles at a time, while the view is being centered on the Observer. The locations would rarely ever actually border the screen. It wouldn't work.

I didn't say you couldn't use them, if you read the entire post: "The only way to use them would be with a location off-set and to have them running independently, which would be an unnecessarily complicated method of doing something otherwise simple. " I already implemented a system into his map which required exactly 1 trigger and no air units, is easy to work with and configure, and is 100% reliable: all things a mobile grid system fails hard at.

People don't use mobile grids because they want to, they use them because they have no other choice.
Quote from Kimaru2
Thanks! Your method worked like a charm!
No problem, glad to help ^^

Post has been edited 3 time(s), last time on Oct 12 2010, 12:17 pm by DevliN. Reason: Mineral abuse.




Jun 10 2010, 12:10 am Biophysicist Post #14



Quote from name:Azrael.Wrath
Bio, do you have an example of that system working? I've tried countless ways in the past of being able to keep track of specific units and nothing ever works. If you have 2 civilians which each have an identical observer over them, constantly staying on top of them, how can you prevent the situation where the 2 civilians pass closely to one another and end up with 1 civilian snagging the observer of the other, resulting in a civilian with no observer who is free to leave the screen?

Even if you have a 1x1 pixel location constantly centering on a civilian at that 1x1 pixel location, it will still switch to other civilians who it passes by.

If you can post an example map where this works I would greatly appreciate it, because there is a lot of things I would do with the ability to keep track of specific units.
The trick is to cycle through the Observers.



None.

Jun 10 2010, 12:15 am Azrael Post #15



Quote from Biophysicist
The trick is to cycle through the Observers.
So a different player number for every observer? :wtfage: If you have a dozen civilians, there is no way to keep track of an individual one, this much I'm almost sure of. If you can show an example map of it working, or explain it in more detail so I can implement and test it myself, I would appreciate it immensely.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:16 pm by DevliN. Reason: Mineral abuse.




Jun 10 2010, 12:22 am Biophysicist Post #16



No. Cycling through units means that you:
-Center a location on a unit, based on type and owner
-Do whatever at the location
-Give the unit to a different player
-Repeat until all of that unit type belong to the "different player"
-Give all the units back

In this case, you'd do that every trigger cycle, and the "do whatever" step would involve putting the Observer directly above the Civilian again.

I can write out the triggers, if you want.



None.

Jun 10 2010, 12:29 am Azrael Post #17



... I know what cycling is. I was hoping that isn't what you meant. What you described isn't going to work. At all.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:16 pm by DevliN. Reason: Mineral abuse.




Jun 10 2010, 1:07 am Biophysicist Post #18



Quote from name:Azrael.Wrath
... I know what cycling is. I was hoping that isn't what you meant. What you described isn't going to work. At all.
Reality offers a different opinion. What wouldn't work about it? You get a location that cycles through all the units. It's also been used before (though in the map I'm thinking of, it was stackable Medic sprites instead of Observers for some reason).



None.

Jun 10 2010, 1:10 am Azrael Post #19



Quote from Biophysicist
Reality offers a different opinion. What wouldn't work about it? You get a location that cycles through all the units. It's also been used before (though in the map I'm thinking of, it was stackable Medic sprites instead of Observers for some reason).
Ok, let me change my phrasing

It will work if you can keep 1 Observer above every Civilian.

Now how do you do that? That's what I asked, and you said, "cycling". That is the part that won't work. Yes, you cycle them, I get that, it would work great if you could keep 1 Observer over every Civilian.

Which you can't, as far as I know. If you can tell me a way to keep them there then like I said, I'll be extraordinarily grateful.

Post has been edited 2 time(s), last time on Oct 12 2010, 12:17 pm by DevliN. Reason: Mineral abuse.




Jun 10 2010, 1:12 am Lanthanide Post #20



Quote from name:Azrael.Wrath
In the time people sat on the forum arguing TheoryCraft with non-working ideas, I went out of my way to message him, get the map from him, implement an actually working system for him, explain to him how to configure and make changes to it if necessary (also how to make it start over from the beginning, which he needs to happen half-way through map), etc.
Can you share your solution with us? You know that would go a long way to helping end the conversation in this thread.

Furthermore, I'm interested in how you solved it, and also that makes this thread much more useful for other people in the future, especially as SC mapping wanes out, people will be able to mine these forums for invaluable information they can't get anywhere else.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-6-12. : 6:23 am]
Ultraviolet -- got some light recalls behind too
[2024-6-12. : 12:07 am]
O)FaRTy1billion[MM] -- 🦗
[2024-6-11. : 9:53 pm]
Wing Zero -- I wonder how he knew I was in the market for a good cricket bat
[2024-6-11. : 2:27 pm]
lil-Inferno -- ya
[2024-6-11. : 10:49 am]
Oh_Man -- or scarab maybeh
[2024-6-11. : 10:49 am]
Oh_Man -- shielt battery + photon cannon blast?
[2024-6-11. : 10:49 am]
Oh_Man -- check out the animation at 7:56
[2024-6-11. : 9:06 am]
Oh_Man -- https://youtu.be/3mpjxspSUtQ I defeated the hell boss yall, bow to my power
[2024-6-10. : 5:04 pm]
lil-Inferno -- poop
[2024-6-06. : 5:20 pm]
Ultraviolet -- I was kinda thinking something along these lines
Please log in to shout.


Members Online: Roy, Oh_Man