Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Relative Distance Detection
Relative Distance Detection
Jan 3 2019, 3:52 am
By: goobie  

Jan 3 2019, 3:52 am goobie Post #1



Hi All!

I've not seen anything on the forums or wiki that provides quite this functionality, so I thought I'd share it. I've created a system that will determine the distance between two units' x and y coordinates. It utilizes location shifting to ignore one coordinate at a time. In my sample map you can see this happening along the top and left edges of the map. Your zergling and marine's movements are tracked by burrowed zerglings. Then it's a simple pseudo-grid (It can't place a location at a specified destination, only detect units) to compare the distance between the x-zerglings and the y-zerglings. The advantage is that this pseudo-grid utilizes 30 locations, but can cover most of the map!

The sample map can determine the distance between x and y coordinates up to 224 pixels (7 tiles) with an accuracy of 8 pixels, rounded down. A pixel accurate version could be created using more locations. I've used zerglings, which are 16x16 pixels, so to detect distances smaller than 8 pixels I would need to use inverted locations. I believe a hybrid with a static grid along the axes could be used to increase the maximum distance detectable to the map size, at the cost of units.

I used the trigger generator LIT, so I'm including the lua file and a link to CecilSunkure's thread for LIT.

RelativeDistance.scx

Attachments:
RelativeDistance.lua
Hits: 3 Size: 1.79kb

Post has been edited 2 time(s), last time on Jan 3 2019, 4:04 am by goobie.



There's got to be something more to life than being really, really, ridiculously good looking...

Jan 3 2019, 8:45 am Lanthanide Post #2



Do you know that SCR supports EUD actions, such as being able to read and write the specific Left/Right/Top/Bottom positions of locations?



None.

Jan 3 2019, 10:06 am goobie Post #3



I'm trying to avoid EUDs as in my experience they break replay and save functionality in SC remaster. But it is good to know EUDs can access location data directly, I was not aware of that!



There's got to be something more to life than being really, really, ridiculously good looking...

Jan 3 2019, 10:57 am Pr0nogo Post #4



Yes, EUDs break saves, replays, extended unit limits, and several triggers like set next scenario as far as I remember. Maybe someone has a complete list of functions that are disabled by using EUDs in 1.2+.




Jan 3 2019, 1:23 pm jjf28 Post #5

Cartography Artisan

I like this, a simple way of grabbing coordinate differences; here's one existing alternative:

You should be able to get single coordinate accuracy using Exact Coordinate Detection then calculating the difference (which is the leftover amount when doing a binary countoff to zero e.g. if a > 4096 && b > 4096 then a -= 4096, b -= 4096; difference can be easily optimized).

I knitted together that, Precise Location Placement, and some EUD conditions to make a little shooter.

I've moved this thread to theories.



TheNitesWhoSay - Clan Aura - github

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

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:46 am]
RIVE -- :wob:
[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?
Please log in to shout.


Members Online: Ultraviolet, Roy