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.
[01:53 am]
Ultraviolet -- :lol:
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
Please log in to shout.


Members Online: lil-Inferno, C(a)HeK, Ultraviolet