Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: X,Y Grid Centering Help
X,Y Grid Centering Help
Jul 20 2008, 9:20 pm
By: Brontobyte  

Jul 20 2008, 9:20 pm Brontobyte Post #1



I was wondering today, how devilesk used an X,Y grid in his Egg Ball map, with different sized X locations to center a smaller unit on an area inside the two locations. (X, and Y) I know Lethal_Illusion also used something like this in his in his FRAGS concept map.

I went over and over the triggers and I came up with something like you center the desired X location (the correct length) in the center of the middle of the small Y locations on one or the other side of the map. You center a small location named "loc" inside the X location and then center that very same X location on the loc location inside itself. I don't know how this works, and its probably wrong. :P



None.

Jul 20 2008, 9:40 pm FoxWolf1 Post #2



I haven't opened up either of those particular maps, but the way I've always figured I'd do it if I needed something like that was that I'd use the fact that moved locations won't go over the side, so if they're too wide or high to center on the spot where you told them to center, they'll align in the dimension that will fit, and try as best they can with one edge up against the side of the map. So if you've got a location slightly narrower than the map and center it on a point at either side of the map, then center a new location at the wide location, the new location will go to the center of the wide one, which due to the width will still be near the middle. With progressively narrower wide locations, you get closer and closer to the sides, so you can put your new little location at any coordinate.



None.

Jul 20 2008, 9:59 pm Atlos Post #3



You mean like a Coordinate Grid?

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



None.

Jul 20 2008, 9:59 pm Brontobyte Post #4



Quote from FoxWolf1
...moved locations won't go over the side...

Oh yeah? This map demonstrates how an "Inverted Location" can be centered on a unit and still be off the sides of the map.

Anyhow, I understand this concept. A "regular" location can't be centered off of the respective map. Thus the odd shaped locations would be "pushed" into the map, forming sort of a bar graph.

The part that I don't get is how you get an X and a Y value and then center a location so that the location is in the correct spot.

How do you move a location (X) and then center a location in side of that X location, and then center it inside another location (Y) to get the proper location?



None.

Jul 20 2008, 10:00 pm Brontobyte Post #5



Quote from name:Urmom(U)
You mean like a Coordinate Grid?

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

Copy cat... :-_-: http://www.staredit.net/files/549/ :P MINES IS BETTER ANYWAYS!!!111



None.

Jul 20 2008, 10:05 pm Kaias Post #6



Quote from SelfPossessed
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.
Does this help?



None.

Jul 20 2008, 10:06 pm Falkoner Post #7



Looking at the Frags map, the way he did it is on the Y axis he has different length locations, and he centers them on units on the sides, this allows him to hit an exact point, if he wants a point closer to the line of units, he uses a smaller location, for further away, he uses a larger one. Does that make sense?

EDIT: Kaias has a much better description :P It shows the mathematics, which I didn't :D



None.

Jul 20 2008, 10:07 pm Brontobyte Post #8



Quote from Kaias
Grid Stuffz

Does this help?

Not at all... Collapse box please... :P



None.

Jul 20 2008, 10:08 pm Brontobyte Post #9



Quote from Falkoner
Looking at the Frags map, the way he did it is on the Y axis he has different length locations, and he centers them on units on the sides, this allows him to hit an exact point, if he wants a point closer to the line of units, he uses a smaller location, for further away, he uses a larger one. Does that make sense?

EDIT: Kaias has a much better description :P It shows the mathematics, which I didn't :D

Yeah yeah yeah, I know this concept.

Do you understand my question? How do you center a location inside two different locations and find the point that they intersect?



None.

Jul 20 2008, 10:12 pm Atlos Post #10



Yours isn't exactly a coordinate grid though. :P

Take a look at my map though. I'll give you the basic rundown on what goes down. The X locations Center in the Y locations. When units are created, they are created in the middle of the location. When the locations are too big and would be centered off the map, they get pushed to the edge instead of going over which is how this works.

Hmm, I'm gonna take a look at devilesk's map although I'm pretty sure he uses something like this.



None.

Jul 20 2008, 10:17 pm Falkoner Post #11



Yeah, but he's wondering how you get them to create the unit where they intercept, instead of in the center of both, but I told you, he will center the two large locations on the spot, then center all the smaller locations on the edge unit inside the larger X axis location, he can then find, which ones the spot is in, and which ones it is not in, once he finds the smallest location, that has the spot in both it, and the Y location, he can then use the location twice the size of that one to make sure the unit is created in the center of it.



None.

Jul 20 2008, 10:20 pm Kaias Post #12



You basically find where the X coordinate should be and then create the unit at a location centered on that X coordinate position which is 2 twice as tall as how far down it needs to be (assuming your grid row as at the top)

Thats the general idea



None.

Jul 20 2008, 10:23 pm Falkoner Post #13



Oh, wait, sorry, Frags doesn't use an XY coordinate grid, it has two Y axises, but yeah, it does exactly what I said, using two Y axises, but yes, what I said before still stands, same concept, just two Y axises, he uses two in case the half way point of one side is past what he could reach using his location's centers.



None.

Jul 20 2008, 10:24 pm Brontobyte Post #14



Quote from name:devilesk
It depends on what I'm doing.

When I'm trying to determine a unit's location I find out what row and column it's in. To find out the row, I center the big Y Location on each of the smaller Y locations checking each time to see if the unit is there. To find out the column, I just center each X location one by one on the Y14 location. The row, y14, is just an arbitrary row that I center the x locations on, it's just to get the X locations on the left or right edge. Finally, I center the long X location the small x locations to be able to check if a unit is anywhere in the entire row.

When I'm trying to place something at a specific location I first look at what the Y coordinate is as well as what the X coordinate is. Based on the Y coordinate I center location "loc" on one of the smaller Y locations. Based on the X coordinate I know whether to center it on the small left Y or the small right Y, because there are two small Y locations, but they're on opposite sides of the map.

Centering loc on one of those Y locations isolates the position of the Y coordinate I'm trying to place a unit at. Then I take whatever X location is necessary based on the X coordinate, and I center it on "loc". That gives me the proper x coordinate along the row that loc is in.

Finally, I just center a small location (I think it's loc reused) on that X location, which just represents one grid square and it gets centered in the middle of the X location.



This is a mock up of what devilesk uses. I'm pretty sure that he doesn't create any units anywheres to center the locations.

:lol: I posted in the wrong topic... I suck at multi-tasking...

http://www.staredit.net/topic/2890/6/#76508



None.

Jul 20 2008, 10:26 pm Kaias Post #15



Right. I forgot to mention you have to do it for bottom row as well so you can get the bottom half of the map.



None.

Jul 20 2008, 10:27 pm Falkoner Post #16



Yeah, devilisk does what I was saying, Lethal used a double Y axis, one on each side, I actually like Lethal's method a little better, but meh.



None.

Jul 20 2008, 10:28 pm Brontobyte Post #17



Quote from Falkoner
Yeah, devilisk does what I was saying, Lethal used a double Y axis, one on each side, I actually like Lethal's method a little better, but meh.

devilesk uses two Y axis, as well.

I guess what I am trying to ask is:

When you already know the units position in Egg Ball, and you want to move a location that you plan on ordering the Zerg Scourge towards, how to you center this "move/order" location on the intersection of two locations?

Post has been edited 1 time(s), last time on Jul 20 2008, 11:35 pm by Brontobyte.



None.

Jul 20 2008, 11:58 pm Kaias Post #18



The fact that locations be moved off the map is utilized-
By centering on a unit at the top most part of the map, the location hangs there like a stalactite (from the ceiling).
By using a location twice as tall as how far down from the map we need the unit to be created, when we do create it, it is in the center of the location and thus half as far as twice as far, which is of course exactly where we need it.

So is it that you didn't understand that or that you don't understand how to calculate as to which X coordinate you need or which location length?

P.S. Do opposite for bottom half of map



None.

Jul 21 2008, 12:01 am Demented Shaman Post #19



Dude all you need to do is trace through the triggers :-_-: They tell you what's happening as clear as day if you understand what conditions and actions are. :-_-:

AND WHY ARE YOU ASKING THE SAME QUESTION YOU ASKED IN THE SHOUTBOX AFTER I ANSWERED IT?

Quote
[07:41 pm] (U)devilesk -- you don't move a location into the intersection of two different locations
[07:40 pm] Brontobyte -- I get the whole "locations can't go off the edge of the map" idea, its the moving a location into the intersection of two other different locations.
It's not even possible. Are you even familiar with the center location action at all? :-_-:



None.

Jul 21 2008, 12:01 am Kaias Post #20



You aren't using an intersection of two locations. This isn't the normal Coordinate grid.

And to add to previous note, obviously you just center location on nonexistant unit in the x2tall location replacing unit creation.

P.S. I recognize I didn't try explaining it so pretty like, but if you understand the concept, just read what I quoted earlier, thoroughly.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[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
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- 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
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy, IlyaSnopchenko