• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to find the weakest lane

Status
Not open for further replies.
Level 22
Joined
Aug 27, 2013
Messages
3,973
Hello there, I need help creating a trigger for AoS map. I want to summon a Super Creep in the enemy's weakest lane. For example, my map has four lanes. If the numbers of enemy's tower in the top lane are less than the numbers in the other lanes, super creep will be summoned in the top lane. But if all the numbers from all lane are still equal, super creep will be summoned in either mid top lane or mid bottom lane.

This is similar to Mobile Legends' Lord, If you have played it before.

Thanks in advance!
 
What you want to do is to weightout units on each lane. (?)

I guess I would go with unit groups for each lane for each team, so all units are always tracked for a lane, and you don't have to create complex algorithms which count them in an intuitive way onAction.
-- create -> add to group
-- death -> remove from group
-- owner change -> switch group

What we have now is 3 groups/ists of lane units for a team. How to prioritize them is pretty much map specific.
You could make a "LaneStrength" integer variable, and for each unit in a group, depending on certain parameters that you think are important (probably unit type, but maybe also HP, or so) you add a number to LaneStrength. So LaneStrength is the sum of all powers of units on a lane. Then the LaneStrengths of each lane can be compared. If required the LaneStrength might be also be splitted into multiple sub-strengths, like: RangeStrength, MeleeStrength, etc, etc.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Heroes of the Storm does this with objectives by summing the total health of structures along each lane and then choosing the lane with the most health. You can do something similar except choosing the lane with the least health. After summing all lane structure health into a real array where index is lane number, perform a minimum linear search (standard Computer Science algorithm demonstrated thousands of times on the internet). The minimum index is the lane number to spawn the unit for and send it along.
 
Status
Not open for further replies.
Top