rts logic: How did Westwood do it?

0 favourites
  • 3 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • hello!

    I am playing a lot of Red Alert 2 now and I am wondering if anyone has insight into how Westwood created some the C&C logic.

    For example: if you have a tank that joins a group of tanks of the same team, how does that group make place for that one tank? They all move up and down and left until it fits. What would be a way to achieve this?

  • Same way you sort a list.

    I imagine that they had some indexing system like we have.

    For example, if you had a line of tanks along the x axis, and you wanted to insert one in the middle, you could either set the x values less than the desired position to x-n, or x+n for the places greater than, then move the one you want. Of course that gets complicated if you want to keep it from running over other units. It would have to be able to find a path using the other tanks as obstacles. That's even more complicated if you try to do that while they are all moving. So you would need events to find a path if an obstacle moves, constantly.

    Trigs your friend here, so are square roots if you like square formations.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply newt.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)