Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Click Detection System
Click Detection System
Aug 25 2016, 1:07 am
By: Sie_Sayoka  

Aug 25 2016, 1:07 am Sie_Sayoka Post #1

Powder_Keg and I have been working on a system to detect where the player clicks without the use of EUDs. We have hit somewhat of a wall.

The Concept

Using a group of scourges located outside of the detectable area, the system will be able to pinpoint the exact location where the scourges are ordered to move to. By calculating each of the scourge's paths you should be able to determine where these paths intersect.


Maximum of 12 scourges.
128x128 detectable area. This is to ensure a wide potential of practical uses for different maps.
Accurately detect a click within a 1x1 tile area.
Scourges must be located outside of the detectable area to allow mobile grids.


It may be difficult to determine angles after around 16?. Scourge pathing (or maybe pathing in general) allows for small inconsistencies that may hinder having further detectable angles.
What would be the minimum detectable angles necessary to cover the entire 128x128 grid?
Because the system will have to calculate the exact angle of several scourge paths the majority of the trigger production will be automated.

Progress So Far

I've got a rough idea of how the system will work but it still needs some tweaking. I'm using inverted locations around the scourge and depending on what combination of locations the scourge enters after it leaves the starting point I can determine the rough angle of travel. However I think that I will have to tweak the location sizes in order to get accurate angles.

I've already figured out how to move a location to the clicked area by using a combination of a mobile grid for the x axis and a static grid for the y axis.

Attached is an example map. It has a rough system for detecting the angle of travel of the scourge but it isn't accurate yet. In the middle would be the 128x128 example grid.

Of course different systems are always welcome.

grid test2.scx
Hits: 1 Size: 54.51kb


Aug 25 2016, 1:42 am jjf28 Post #2

Cartography Artisan

1.) Use simple brings to check which x-axis and y-axis scourges a click was closest too (simple logic i.e. 'is it to the right of this one?')
2.) Grab the set of coordinates for each scourge: you may find this helpful (or maddening): Exact Coordinate Detection
3.) Calculate the angles of both scourges (calculate the imaginary triangles side lengths, use law of sines/cosines, taylor series/hardcoded angle values)
4.) Pick an origin somewhere on the map, using the start-point, your angle, and the angle tools listed above, calculate the slope-intercept equation for your line
5.) Calculate the intersection point from the two slope-intercept forms

I did something similar getting target Y coordinate and angle using EUDs, then calculating X coordinate:

TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 25 2016, 8:03 am Cinolt Post #3

I haven't looked at your map, but without EUD's (and the game-breaking Extended Preplaced Units, which do not use EUD's IIRC) you are indeed restricted to using locations/brings to detect the scourge placement offsets which would occur after the player ordered to move them.

I don't know if you are already aware of FRAGS which implements just this, albeit in a much smaller area.

Kenoli's method of calculating placement offsets provides pixel accuracy. albeit not the easiest to understand, and hybrid location grids are probably the best option for placing locations at the desired point in the area, demonstrated here (mobile grids prohibit air units in the vicinity, and cause nearby ground units to be slowed).

In essence, each scourge movement provides a single linear equation. With two scourges, you can solve a system of two linear equations to get a single x,y point (except when the slopes are parallel). With three or more equations, there is no guarantee that a solution exists, so you're probably left to solve each combination of two equations, then simply calculate the arithmetic mean of the resulting points, which presumably provide better accuracy than simply using two scourges.

Either way, you are way better off using some sort of programming language for trigger/location generation. Oreo Triggers is probably the best option as it allows you to directly compile trigger data into your map, as opposed to the other options where you have to manually copy and paste text triggers. SCMC is another option that also directly compiles but is less documented (if at all).


Aug 26 2016, 6:44 am Sie_Sayoka Post #4

Thanks for the replies guys. I'll check out the links when I have the time. I was more focused on how to set up the triggers and locations in order to get the directions of the scourges. I do plan on using Oreo to automate the calculation part.


  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:44 pm]
Ultraviolet -- 1337 ejaculator
[10:29 pm]
ejac1337 -- derp
[07:08 pm]
Slyence -- Well shucks ..
[2021-11-26. : 4:02 am]
O)FaRTy1billion[MM] -- Slyence
Slyence shouted: I could've swore I used to have a colored username.
probably, they did get reset at some point
[2021-11-26. : 4:02 am]
Apos -- :wob:
[2021-11-26. : 12:01 am]
UndeadStar -- 🦃 Just saw a new news 🦃
[2021-11-25. : 6:04 pm]
Slyence -- Meme x2
[2021-11-25. : 12:39 pm]
Moose -- meme
[2021-11-25. : 12:25 pm]
Slyence -- I could've swore I used to have a colored username.
[2021-11-24. : 10:56 pm]
RdeRenato -- xd
Please log in to shout.

Members Online: Roy, Oh_Man, MetalGear