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.


Requirements

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.


Issues

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.

Attachments:
grid test2.scx
Hits: 1 Size: 54.51kb



None.

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: http://www.staredit.net/topic/15142/



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).



None.

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.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are almost 3k pages
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- the real members stop around page 250
[2024-4-14. : 9:20 pm]
O)FaRTy1billion[MM] -- look at the members list
[2024-4-12. : 12:52 pm]
Oh_Man -- da real donwano
da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
it's pretty common
[2024-4-11. : 9:53 pm]
da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
[2024-4-11. : 4:18 pm]
IlyaSnopchenko -- still better than "Pakistani hookers in Sharjah" that I've seen advertised in another forum
[2024-4-11. : 4:07 pm]
Ultraviolet -- These guys are hella persistent
[2024-4-11. : 3:29 pm]
Vrael -- You know, the outdoors is overrated. Got any indoor gym and fitness equipment?
[2024-4-10. : 8:11 am]
Sylph-Of-Space -- Hello!
Please log in to shout.


Members Online: Roy, kevincope