grids
Jul 11 2008, 1:13 am
By: stickynote  

Jul 11 2008, 1:13 am stickynote Post #1



I have a 256 x 256 map, and I need to be able to move a location to anywhere I need to on the map. It is an rpg, so there are unique units involved. What would be the best method?



None.

Jul 11 2008, 1:18 am Falkoner Post #2



You can place burrowed units on the places you may need the location and the center it on those units... Please specify what you mean.



None.

Jul 11 2008, 1:21 am stickynote Post #3



I was using an EUD to detect where the mouse is. I used the mouse to aim spells. Now I need to center the location where the spell will take effect where I need to cast the spell.



None.

Jul 11 2008, 1:24 am Falkoner Post #4



You could use a mobile grid to move to the mouse, by starting at a corner of the map, I'll use the top left, when figure out the exact size of a location, and then measure the number time you must use a mobile grid to move the location to the place that the EUDs gave you, it won't be totally accurate(depending on the size of the grid), but it will be about as close as you can get.



None.

Jul 11 2008, 1:27 am stickynote Post #5



Actually, something just occured to me. I could use a 20x12 mobile grid (the screen is constantly centered on the unit) and move it to the hero, but only when the player casts a spell.



None.

Jul 11 2008, 4:25 am Atlos Post #6



I would recommend using a mobile grid if you are using a spell type system or use a coordinate grid type system if you literally want to move a location anywhere on the map. Here's an example of a coordinate grid, just ask if you want an explanation.

http://www.staredit.net/files/564/

EDIT: As far as your spell system goes, iirc there are no EUD action triggers now and the only way to center a location on where you click would be through the old dark swarm/disruption web system.



None.

Jul 11 2008, 4:29 am stickynote Post #7



I already downloaded it, and figured it out myself, but it would be inconvenient, since my map is 256x256; it would take a huge amount of locations. I decided to use a mobile grid system; since I have them constantly center viewed on the hero, mouse detection and using the mobile grid for proper location placement won't be too difficult.



None.

Jul 11 2008, 4:36 am Atlos Post #8



If you made its accuracy up to a 2x2 square then it would only require ~130 locations, and then you wouldn't really need any other locations at all on the map besides. Now that I think of it, you could actually make a system where you can detect your main hero's coordinates anywhere on the map and then not need any other locations at all. I'll make an example of it tomorrow in case anyone else wants it. Using the coordinate system, triggers would look like:

Current Player has suffered exactly 100 deaths of Coordinate X
Current Player has suffered exactly 78 deaths of Coordinate Y
--------
Actions

instead of

Current Player brings at least 1 unit to "Enter Shop"
----------
Actions

If you catch my drift.

EDIT: Actually I think you could even do up to one tile accuracy with ~130 locations, I wasn't keeping in mind that you can recycle locations for the other half of the map.

Post has been edited 1 time(s), last time on Jul 11 2008, 4:43 am by Urmom(U).



None.

Jul 11 2008, 4:44 am stickynote Post #9



Yeah, I understand. The accuracy is 2x2, due to limitations by the mouse detection. That way would require a shit load of triggers, and you would have to strain your eyes just counting the 2x2 squares to determine the coordinates you need. Wouldn't you also need another location to determine where your hero is? So that would put the location total at 129 locations. Gold trophy for location savyness. Of course, I think you might need to have a table so tat you know what cooridnates mean what.



None.

Jul 11 2008, 4:51 am Atlos Post #10



The majority of the triggers can be created with Trigger Duplicator created by Mind Archon since they are very repetative. It wouldn't be so hard I think, I'll make a demo map tomorrow. An example of how to create a unit at (45,80) would be:

-Whatever you want to trigger the creation
---------
-Create one <unit> at "Cache"
-Set deaths for "Create Coordinate X" to 45
- Set deaths for "Create Coordinate Y" to 80

Then you would have a general trigger moving all units from the cache to the focus location in the coordinate grid so that you don't have to make tons of triggers for each specific unit. It would look like:

Current player brings at least one anyunit to "cache"
---------
Move all any unit at "cache" to "focus"
Preserve

And that trigger would come after the coordinate triggers placed the focus location at the correct coordinates.



None.

Jul 11 2008, 3:42 pm Falkoner Post #11



Guys... A 20x12 system is over 9000 times better than what you are suggesting, it completely narrows the locations, and a mobile grid can get it MORE accurate than what you are telling him.



None.

Jul 12 2008, 8:14 pm Atlos Post #12



A 20x12 grid will be really annoying to create, but even if you do that I fail to see how you will center the location where your mouse is unless you use a Dark Swarm/Disruption Field system (which you wouldn't need a mobile grid for anywawys). Also, what about the lag factor?



None.

Jul 12 2008, 8:16 pm Falkoner Post #13



He only needs the grid when they click, and I believe he can find the coordinates of the hero unit, so he can find how to offset from the unit. If he wants, he can lessen the lag by stacking grids off of each other in order to use less units.



None.

Jul 13 2008, 5:53 pm stickynote Post #14



What's "stacking grids off each other"?



None.

Jul 13 2008, 7:55 pm Atlos Post #15



Well, there is no way to make a perfect 20x12 grid (to my knowledge at least) without first creating a perfect 3x3 grid with observers and scourges and then building off of that. You would have to center on one of the corners or use another mobile grid to eventually get to 20x12.



None.

Jul 13 2008, 10:17 pm Falkoner Post #16



But as I said, you do not need it to be 20x12 grid, you can set up triggers that make grids off of each other depending on the coordinates of the click from the hero unit.



None.

Jul 14 2008, 3:17 am SelfPossessed Post #17



Quick question unrelated to grids but related to the map itself. Using EUDs to find the mouse location should cause desync in multiplayer, if what I read on the forums is correct. Are we to assume that this is a single player map? If it is played in single player mode, constantly center viewing will also cause the mouse to move to the center of the screen. Is this then limited to a single player map played on Battle.net or LAN?

Now back on topic. I apologize if this still is already known or said before; if it is, please ignore the blabbering newb that is me.

Coordinate Grids won't lag like Mobile Grids will as it doesn't use create/give/remove. They also aren't limited by other units being in the way. You can create a Coordinate Grid system with 1x1 accuracy in a little over 128 locations through the use of units to represent an axis. It was done in FRAGs.

For example, say I have a 30x30 coordinate grid. Along the top edge of the map, I pre-place a row of 30 units in this repeating sequence; Zergling Hydralisk Marine Medic Zealot. For every group of these units, I have a 5x1 location called Group X over them, where X is a number from 1-6. I also have a row of Spider Mines along the bottom edge of the map.

Now say I want to create an Archon at position (14, 7). I'll subtract 5 from 14 until I get a number between 1 and 5. The number of subtractions +1 (in this case 2+1=3) becomes which Group I should pick from (the location called Group 3). The remaining number (in this case 4) becomes which unit to center on (which is the Medic). Now, I center a 1x14 location (to get Y coordinate 7) on the Medic located in location Group 3 and create an Archon in that 1x14 location.

If I want to create the Archon at position (14, 25), a similar process is used. After finding that I need to center on the Medic in location Group 3, I center a 1x30 location on the Medic, then center a 1x10 location on the Spider Mine located in location 1x30, then create the Archon in the 1x10 location.

In other words, the Zergling represented 1, the Hydralisk 2, the Marine 3, the Medic 4, and the Zealot 5. The Groups represent a form of multiplication to save locations. 14 = 5 + 5 + 4, so I need to get the 3rd group, 4th unit.

Though it would take more triggers to do, it is also possible to not use groups at all (saving even more locations) but instead use every single unit possible owned by different players (computer players and players 9-12). A Zergling owned by player 9 might represent 1, another owned by player 10 might represent 2, and so on.

Note that there is a drawback in that as you're using units, you may actually approach the unit limit. The 30x30 example used 60 units. Also note that you could also use the Y axis first, whereby the units would appear on the left and right side of the map instead.

On a 256x256 map, using 16 groups of 16 different units, a total of 128 + 16 = 144 locations used. If no groups are used, only 128 locations are needed, though it would inevitably involve far more triggers. Furthermore, this will require 512 units to be delegated specifically for the grid itself, 256 for the top row and 256 for the bottom row.

Basically, the Coordinate Grid is definitely usable with 1x1 accuracy on a 256x256 map. It has advantages over Mobile Grids (no lag, no units getting in the way) and disadvantages (requires 512 units and 128 locations). Use what you feel is most applicable to your map.

Whew, there's my 2 cents on location saving for Coordinate Grids. Forgive me if you've heard it all before.



None.

Jul 14 2008, 3:22 am Atlos Post #18



Quote from SelfPossessed
<snip (too long :P)>
That's exactly what I was doing in the test map I was making. :P

Maybe it's not worth it to continue, unless anyone wants me to?



None.

Jul 14 2008, 3:27 am SelfPossessed Post #19



Quote from name:Urmom(U)
That's exactly what I was doing in the test map I was making. :P

Maybe it's not worth it to continue, unless anyone wants me to?

Sorry for the giant wall of text. Apparently, I just repeated what everyone already knew. Sigh. Someone needs to put this stuff in the SEN Wiki though AND make the Wiki article more accessible. There are way too many questions on existing grids nowadays; one should be able to refer to the Wiki or example maps and be done with it. The exception of course being unique grid systems like the hexagonal and pixel grids, of which I have no idea how they operate.

At the very least, finish the example map and upload it into the SEN database. The unit version will be a bit more applicable than your current pure location Coordinate Grids map. The only other map I know of that uses units in a coordinate grid is FRAGs, and those triggers are hell to look at.

On another note, I still want to know if this is a single player rpg due to EUD desync. If it's possible to obtain mouse location with multiple players and not desync, I want to know.

Post has been edited 1 time(s), last time on Jul 14 2008, 3:33 am by SelfPossessed.



None.

Jul 14 2008, 6:20 pm Falkoner Post #20



I understand that the lag factor is definitely something you want to limit, but for one, this is one-player, and while it's still over B.net, lag isn't a huge issue here, and two, a mobile grid the size I said shouldn't cause lag much, especially if it's only being done when they click.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: Roy