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.
[06: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, bransonesoto, Ahonial74, derrickecannon