Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Detect adjacent nodes in a network/breadth-first search
Detect adjacent nodes in a network/breadth-first search
Jan 29 2022, 8:41 pm
By: Brusilov  

Jan 29 2022, 8:41 pm Brusilov Post #1



Basically, my map will involve players defeating their opponents in war and being able to annex territory from them - but they're limited in how much they can take, and this territory must be adjacent to the conqueror's territory, or contiguous to other territories they're also going to conquer. In this case, we'll say the hard limit is 1 or 2 provinces ("Duchies"). For example:



Red (The Holy Roman Empire) has defeated blue (France). The grey lines represent the connections between duchies, and thus whether or not they are adjacent. Each duchy has its own specific location, and each Cybernetics Core is also an invincible unit with a specific Unit Index ID. Red is now going to enforce peace against blue and annex a duchy (at the moment, my plan is to do this via blue clicking a button on the Duchy of his choice that he's occupying, which will put a unit into the build queue and activate a trigger.)

However, blue is demanding the Duchy outlined in yellow, which cannot be demanded because it is not adjacent to any of his territories. This should spit out an error for blue, telling him to try again.

Now, I know I could simply do this via a trigger like this:

Triggername
Players

  • Player Force
  • Conditions

  • Current Player brings 'Annex Duchy Unit' to 'Location 3'
  • Current Player brings 0 Protoss Cybernetics Cores to 'Location 1'
  • Current Player brings 0 Protoss Cybernetics Cores to 'Location 2'
  • Current Player brings 0 Protoss Cybernetics Cores to 'Location 4'
  • Current Player brings 0 Protoss Cybernetics Cores to 'Location 5'
  • Current Player brings 0 Protoss Cybernetics Cores to 'Location 6'
  • Actions

  • Remove 1 'Annex Duchy Unit' at 'Location 3'
  • Display Text 'Not allowed. Please select a duchy adjacent to your holdings.'


  • And then I could copy and paste this trigger about 150 times and manually change the locations/unit indexes of EUDs for each trigger. But that's a lot of work and it's pretty likely I'll screw up at least a few of them and have to bugtest later. I thought about using a location and simply centering it over the target, then detecting whether Current Player brings at 'at least 2' Duchies, but the layout of my map is highly irregular and this would be unreliable.

    Is there another way that this could be done, perhaps with fewer triggers, perhaps by using arithmetic on the Unit Index IDs? I feel like the basic principle here is to conduct a breadth-first search, but I'm not sure how to break it down into Starcraft triggers.

    Post has been edited 1 time(s), last time on Jan 29 2022, 8:50 pm by Brusilov.



    None.

    Jan 30 2022, 8:55 am GGmano Post #2

    Mr.Pete-Tong

    You can do a full scale cycle by having a trigger with give 1 cyber Core from current player to p8.

    And a trigger with condition current p bring 0 cyber core than give All cyber core p8 back to current p.

    That way you can do a specific action for All the owned cyber cores one at a time



    A Legendary Map Maker, Player. Apparently im more than intresting to observe Irl

    you could be the rat??

    The maps I made are tweaked into perfection and maximum strategy added

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [06:10 pm]
    Ultraviolet -- sweet summer child
    [2026-6-26. : 10:31 am]
    NudeRaider -- blessed innocent soul knows nothing of the strife we had before EUDs were discovered :teehee:
    [2026-6-23. : 3:29 am]
    DarkenedFantasies -- Probably just didn't care. For example, at some point before release, they've updated the graphics of some of the Protoss buildings (Forge, CyberCore, Citadel, Observatory, Arbiter Tribunal), but instead of properly re-rendering them with edited 3D models, they did crappy copy-paste jobs on the rendered graphics.
    [2026-6-22. : 8:35 pm]
    Ultraviolet -- :wob:
    [2026-6-21. : 11:38 pm]
    Symmetry -- :wob:
    [2026-6-21. : 4:56 am]
    Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
    [2026-6-21. : 4:26 am]
    Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
    [2026-6-21. : 4:25 am]
    Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
    [2026-6-20. : 6:15 pm]
    Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
    [2026-6-20. : 3:47 pm]
    NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
    Please log in to shout.


    Members Online: Prankenstein