Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Dynamic placement of locations
Dynamic placement of locations
May 8 2014, 1:32 am
By: sethmachine  

May 8 2014, 1:32 am sethmachine Post #1



Hi,

What is preferable in this scenario:

Suppose I have a set of supply depots that need to behave in the way they do in maps like Napoleon Total War, where when an enemy player is in some distance, a garrison is spawned. When the garrison is defeated, the enemy gains control of the depot, etc etc.

Now this is really a property of a location and not the depot, so the number of these is bounded by the number of map locations (n=255?), assuming any enemy unit can activate them (if a certain unit is needed, i.e. unique, then there is no limit, but makes capturing enemy depots less intuitive).

So what I see most maps do is hardcode the locations with the depots. This is ugly and messy, because, well, it's completely arbitrary, and makes looking back at the map much more difficult.

Instead, why not have some set of locations L = {L1, L2, L3, ..., LN}, and then when the game starts, assign each of these to a depot automatically? It'd just be a simple counting process (center L1 on depot owned by neutral, give to P9, etc, etc. When neutral command no more depots, give all depots back to neutral). Also, this method allows random placement of the depots, since the counting/assignment process does not care where they are. So why is this not done in most such maps?



None.

May 8 2014, 1:51 am Azrael Post #2



It seems like it'd be easier to just use one location, and cycle through all the unclaimed supply depots a few times a second. This would remove your limit of 254 as well.

If you're bothered by the fact players can't select the unused supply depots (since giving units causes deselection), then you can place a burrowed unit at each supply depot (which can even be done when the map starts) and then cycle through the burrowed units instead. If the players have detectors and can see the burrowed units, you can manually place the burrowed units so that the supply depots are hiding them. You could just do this once, then copy the supply depot and burrowed unit together, and then paste it at every location you wanted to have a supply depot.




May 8 2014, 7:25 am sethmachine Post #3



The idea of each depot is that it functions this way:

Whenever an enemy unit is within X range of any supply depot, create some units for the player owning that depot (the garrison).

If the enemy kills the garrison and any of the units friendly to the garrison within X range of the depot, the enemy gets the depot.

Else, when there are no enemy units within X range of depot, the garrison is removed (ownership unchanged).

Are you saying there is a way to do this by using a single location for an arbitrary number of depots?

Counting the depots can be done with 1 location but how about making this garrison effect?



None.

May 8 2014, 8:36 am Azrael Post #4



You can do it the same way as you would to count them, just check for all the things you're interested in instead of counting.

CONDITIONS:
Current Player commands at least 1 Supply Depot.
ACTIONS:
Give 1 Supply Depot owned by Current Player at Anywhere to Player 9.
Center location "Only Location" on Supply Depot owned by Player 9 at Anywhere.
Preserve Trigger.

CONDITIONS:
Player 9 commands at least 1 Supply Depot.
Foes bring at least 1 [men] to "Only Location".
[Garrison has not been created yet]
ACTIONS:
Create [Garrison] for Current Player at "Only Location".
Preserve Trigger.

CONDITIONS:
Player 9 commands at least 1 Supply Depot.
[Garrison has been created]
Foes bring at least 1 [men] to "Only Location".
Current Player brings exactly 0 [men] to "Only Location".
Allies bring exactly 0 [men] to "Only Location".
ACTIONS:
Give 1 Supply Depot owned by Player 9 to Player 12.
Preserve Trigger.

CONDITIONS:
Player 9 commands at least 1 Supply Depot.
[Garrison has been created]
Foes bring exactly 0 [men] to "Only Location".
ACTIONS:
[Remove Garrison]
Preserve Trigger.

CONDITIONS:
Player 9 commands at least 1 Supply Depot.
ACTIONS:
Give 1 Supply Depot owned by Player 9 at "Only Location" to Player 10.
Preserve Trigger.

You'd repeat this series of triggers for the total number of Supply Depots which a single player can own, and have the triggers owned by all players. At the end of this series of triggers, you'd give all Supply Depots owned by Player 10 at Anywhere to Current Player.

Something I assumed here was that you already have triggers for giving Player 12 Supply Depots to new players who show up to capture them (in case any players leave). When a player loses their Supply Depot, it gives it to Player 12, and the previously mentioned trigger would then transfer ownership to whoever is trying to capture it (in the event multiple players are attacking it simultaneously, I'm guessing they'd need to drive off the other player before being able to claim it).

The last thing you'd have to figure out is how to track if the Garrison has been created or not. I'd suggest a burrowed unit hidden behind every Supply Depot, or a flag beside them; there are other ways to do this, but they wouldn't be nearly as easy. These markers could be owned by Player 9, given to Player 10 when the Garrison is created, and given back to Player 9 if the Garrison is removed. This would make tracking each Supply Depot's current status fairly simple.

Then the number of Supply Depots would just be limited by the maximum number of units which can exist simultaneously: 1700.




May 12 2014, 5:37 am sethmachine Post #5



Ah I see. So you are saying I have a single location floating around all the depots that does the detection/garrison effect for me.

Wouldn't this be slower than stipulating each depot out with a specific location, since a player might have to wait for the location to come by to take a depot?



None.

May 12 2014, 9:16 am Wormer Post #6



sethmachine,
This won't be slower, because you repeat these triggers for the number of supply depots a player can own (effectively number of supply depots on the map or close to this number). Everything will happen during one trigger cycle. But there is the other side of the coin. Be warned: this is a major source of map lag, because it involves a massive transfer of units back and forth between players. This is the main reason I'm very cautious about such techniques and usually never use them in my maps or using to a very limited extend.

Azrael,
Also this isn't that simple, because it's possible to cheat these triggers: declare ally to your enemy that is trying to capture the town and the third trigger will never run because 'Foes bring at least 1 [men] to "Only Location" ' will never be true.

Also, see discussion here.

Post has been edited 1 time(s), last time on May 12 2014, 10:52 am by Wormer.



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6: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.
[2024-4-26. : 6: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
Please log in to shout.


Members Online: Oh_Man