Staredit Network

Staredit Network -> UMS Assistance -> Moving Location to anywhere
Report, edit, etc...Posted by fishgold on 2005-08-15 at 02:03:30
Hey, I'm trying to move a location to anywhere I want in 192 X 192 map. Is there any way to archieve this most efficiently?

Restrictions

- It shouldn't use more than 600 units. (no grid system)
- It shouldn't use more than 150 loctions. (not placing locations to everywhere)

If you can do this, you are the king of the algorithm. helpsmilie.gif
Report, edit, etc...Posted by TRiGGaMaSTa on 2005-08-15 at 03:59:49
Why not just use a mobile grid system... Do you have alot of air units in the map? or what type of map is it would help. you could randomize a number going up and a number going right then place the location with a mobile grid.
Report, edit, etc...Posted by PCFredZ on 2005-08-15 at 12:23:57
Be more specific. What is the exact scenario you're thinking of that needs the moving location?
Report, edit, etc...Posted by Gigins on 2005-08-15 at 13:04:40
Wow 192x192. Even with a very good mobile grid system this would be SO slow. Note that using 60 ling grig system the delay may be up to 5 sec. Please tell us more about your map and why you need this.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-08-15 at 13:49:41
I know you you could do it with 96 locations and 256 units. (a line across the top and bottom) and it would use at least 225 triggers though (mostly all the same)

It would be based off my coordiantes system and work flawlessly and instantly.
Report, edit, etc...Posted by Staredit.Net Essence on 2005-08-15 at 19:47:19
yeaaaaaaaaa, Trust Bolt Head, He Made "That One Bound"
Report, edit, etc...Posted by The_Shattered_moose on 2005-08-15 at 20:58:55
But really, could you tell use a bit more so we can better fix your problem? (Not that bolt_head's solution is bad or anything, I just thought perhaps a differen't less location intensive method could be used if we had more information.)
Report, edit, etc...Posted by fishgold on 2005-08-15 at 21:49:29
I have been working on my 'Micro Scan' system for more than a year. It basically moves one or multiple locations with different sizes to every single place on the map. So it can cause certain events to occur. For example, you want to make any marine can take item, if you use movelocation() then you will end up with locations being stuck on one left-most marine.


So here is my method.

Place 192 units on each end side of map. So it consumes 192 X 2 units in total. I will call these units 'Scan Axis'. Now make 192 locations starting from size 1x1 and end up with 192 x 1, have location's width increment by 2. I will call these locations 'Scan Location'.

Since it is hard to explain by paragraph, I will list bunch of steps to show you what happens in my algorithm.

(note: assume that 'Scan Axis' is previously owned by P9, and P9 represents current area has not been scanned, and P10 represents area has been scanned. And scanning direction will be left to right and bottom to top.)

Step 1. If there is any unit on the map then prepare for scan, otherwise wait.

Step 2a. If there is no unit in Section A ((0,0) ~ (0,31)) then give every 'Scan Axis' in this section to P10.

Step 2b. If there is no unit in Section B ((0,32) ~ (0,63)) then give every 'Scan Axis' in this section to P10.

Step 2c. If there is no unit in Section C ((0,64) ~ (0, 95)) then give every 'Scan Aixs' in this section to P10.

And it keeps going like this. The main purpose of doing this is to keep out those areas that do not need to be scanned from wasting time.

Step 3a. Move every ‘‘Scan Location’’s to any 'Scan Axis' at left side of map. If there is any unit in biggest ‘‘Scan Location’’ which has size of 192 X 1 then start scan, otherwise give 'Scan Axis' to P10.

Step 3b. Now look at the center of each 'Scan Location'. They point to coordinates (0, y), (1, y), (2, y), (3, y),...(96,y). This means you can move location to anywhere within the area of (0,y) ~ (96,y). Now move event locations to centers of each ‘Scan Location’. And after center of (96,y) has been reached move every ‘Scan Location’ to any 'Scan Axis' at right side of map. And this time it will be backward. Think of it as mirror.

Keep doing these steps until there are none more 'Scan Axis' has left.


But, there are lots of problems with this algorithm. First of all, since it uses giveUnit() command, it will lag the game. And this algorithm isn't so efficient because it consumes lots of units.

I have tried to make X ‘Scan Location’ and Y ‘Scan Location’, so that the system only needs 4 units, but it had to consume 192 locations. So it's not good either.

So I ask you for help. helpsmilie.gif

Actually, I'm looking for someone who want to complete my project together.
Report, edit, etc...Posted by SacredElf on 2005-08-15 at 22:04:08
i would like to take a look in that method of location grid, so i can understand it better hehe
Report, edit, etc...Posted by LegacyWeapon on 2005-08-16 at 13:14:20
I don't think giving units lags the game...
Report, edit, etc...Posted by Angelfarto on 2005-08-16 at 18:37:01
Why 192 locations? Why not just one 192x1 (H) and one 1x192 (V). Like a crosshairs thing. Start the (V)ertical loc on the left, the (H)orizontal loc will scan everything from top to bottom. Once it hits bottom, (V) shifts one to the right, and (H) scans from top to bottom again. so (V) keeps shifting one to the right after 192 scans. So, if "P1 brings unit to (V)" AND if "P1 bring unit to (H)", (where the 2 locs meet) then you've hit it.

this should even cut down the number of triggers yoou need considerably.. i'm guessing maybe like a dozen, probably not even that many
Report, edit, etc...Posted by PCFredZ on 2005-08-17 at 00:16:32
QUOTE(Angelfarto @ Aug 16 2005, 06:37 PM)
Why 192 locations? Why not just one 192x1 (H) and one 1x192 (V). Like a crosshairs thing. Start the (V)ertical loc on the left, the (H)orizontal loc will scan everything from top to bottom. Once it hits bottom, (V) shifts one to the right, and (H) scans from top to bottom again. so (V) keeps shifting one to the right after 192 scans.  So, if "P1 brings unit to (V)" AND if "P1 bring unit to (H)", (where the 2 locs meet) then you've hit it.

this should even cut down the number of triggers yoou need considerably.. i'm guessing maybe like a dozen, probably not even that many

[right][snapback]290110[/snapback][/right]

To "shift 1" you'll also need 192 units on X axis + 192 units on Y axis - 1 unit where they overlap. 383 units = too many.

Also, even with Hyper Triggers, you can scan at most 12 times a second, so considering that there're 192x192 shifts total, there's no way you can have everything fire instantly with the least amount of triggers.
Report, edit, etc...Posted by IA-Sky on 2005-08-17 at 12:16:13
hum all you guys make it too complicated just do:

192 (192x1) locations on y axis. lets call them y1 - y192
192 (1x192) locations on x axis. lets call them x1 - x192

Conditions: any
Actions: moveunittolocation, Protoss Observer, to location x32
Actions: order, Protoss Observer, move, to location y121.

Conditions: any
MoveLocation, to protoss observer.

voila i could move my location anywhere.

p.s. how do you post triggers i been trying to post it but i can't figure it out...
Report, edit, etc...Posted by PCFredZ on 2005-08-17 at 14:10:46
QUOTE(IA-Sky @ Aug 17 2005, 12:16 PM)
hum all you guys make it too complicated just do:

192 (192x1) locations on y axis. lets call them y1 - y192
192 (1x192) locations on x axis. lets call them x1 - x192

Conditions: any
Actions: moveunittolocation, Protoss Observer, to location x32
Actions: order, Protoss Observer, move, to location y121.

Conditions: any
MoveLocation, to protoss observer.

voila i could move my location anywhere.

p.s. how do you post triggers i been trying to post it but i can't figure it out...
[right][snapback]290758[/snapback][/right]

You need to review your basic triggering, what you wrote won't work at all.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-08-17 at 16:29:22
QUOTE(fishgold @ Aug 15 2005, 08:49 PM)
Place 192 units on each end side of map. So it consumes 192 X 2 units in total. I will call these units 'Scan Axis'. Now make 192 locations starting from size 1x1 and end up with 192 x 1, have location's width increment by 2. I will call these locations 'Scan Location'.
[right][snapback]289113[/snapback][/right]


Thats Exactly what I was refering too as to how to center a location on any point of the map. Its basicly a slightly modified verison of my Coordinates map.

To scan the map, I think doing something like Angelfarto said would work better. If your trying to actually move locations to any spot in your map then go with that idea.

QUOTE(PCFredZ @ Aug 16 2005, 11:16 PM)
To "shift 1" you'll also need 192 units on X axis + 192 units on Y axis - 1 unit where they overlap. 383 units = too many.

Also, even with Hyper Triggers, you can scan at most 12 times a second, so considering that there're 192x192 shifts total, there's no way you can have everything fire instantly with the least amount of triggers.
[right][snapback]290459[/snapback][/right]


The triggers for that would be realitivly simple and you could make several copies of all the triggers increasing the speed so it could be done under a second easyly.

Edit:
Here is my coordinates map i did pretty much exactly what he wants (moving a location to any point on the map) Except i didn't use any units at all (at the cost of more locations. The method fishgold already described is a way to cut the location in half by only lineing two sides with units.
Attached File Coordinates.scx ( 40.27k ) Number of downloads: 10


Angelfarto's method is a good way to scan a section but you can't center a location at the intersection of two others, therefore it is only for imput. (is there a unit at 20,45 or not?). Even when you find the unit there you can't do something to it without effecting the units in ither the vertical or the horizontal location as well.
Next Page (1)