Real time Strategy?

Blitz3D Forums/Blitz3D Programming/Real time Strategy?

Hotshot2005(Posted 2013) [#1]
I think for basic start would be

Plane with Grass textures
Cube
Mouse pointing 1 cube and put where unit I want

Advance

Mouse Pointing 5 Cubes and put where units I want

How easy is to make?

Would I have deal with Path Finding AI?


xlsior(Posted 2013) [#2]
Yes, unless you want to have all your units go in a straight line from point A to B at all times, you'll have to use some form of pathfinding.

As to "how easy" it would be to make, it greatly depends on your programming skills. The individual steps aren't that hard, but you really need to do some thinking on how to break down the entire process and all its requirements into their coponent steps.

RTS games can become pretty complex after a while since there can be a lot of things influencing other things.

(The hardest thing to do with an RTS game is probably the most boring part as well: balancing your units with strenghts/weaknesses, hitpoints, etc. It's fairly easy to come up with the mechanics, but hard to come up with a good balance where the game is both interesting & challenging, without devolving into a "rush the enemy with a million unit 'X' and he doesn't stand a chance" thing.


Yasha(Posted 2013) [#3]
I'm not sure how true it still is on modern hardware, but back in "the day" path finding was the single big issue for games like the original-gen C&C. Plotting a route for dozens or hundreds of units across a field full of constantly-changing obstructions was actually well beyond the capabilities of hardware at the time. Units would guess rather than accurately plot paths, and only within a small radius, leading to the bizarre behaviour C&C players may remember like suddenly reversing direction when they got close enough to realise the path was blocked.

Coming up with a decent strategic AI is also a problem. The same old games described above simply didn't have one; behaviour was just baked into the map via invisible waypoints and scripts. Made for easy campaign design but once a player gets used to the one thing the computer knows how to do, trivial skirmishes.


Matty(Posted 2013) [#4]
A lot of the difficulty depends on the specifications for your game.

How complex are the environments? How many units do you wish to cater for?

As some basic questions to ask yourself.


Hotshot2005(Posted 2013) [#5]
thanks guys as it is interesting reading :)

How complex are the environments? It have been small Map for starter

How many units do you wish to cater for? 25 Units then if goes well and may increase it depend on framerates :)


Omnicode(Posted 2013) [#6]
Depending on what you're looking for the basis is basically trying to the run the pathfinding AI as little as possible to create the same effect.

Let's say you have 25 units and you're trying to get them all through the gap, surely making them all use a different AI pass would cause GREAT slowdown. By simply making all units around a single unit that provided the AI to get through the gap follow that prior unit, it saves computing time and slowdown is GREATLY reduced. The unit picked to do that computation on should surely be the closest and in the event of the loss of that 'leader' unit the next in line should inherit it's path.

I'd still prefer 'baked' map data for pathing. However, it makes it more difficult to make more dynamic maps.

Concept really, i haven't put anything together sides this:
-no media required-
Just demonstrates typical pathfinding AI.



RemiD(Posted 2016) [#7]

Plotting a route for dozens or hundreds of units across a field full of constantly-changing obstructions was actually well beyond the capabilities of hardware at the time


yes, that's what i am thinking too, in a RTS game with many entities which need to calculate a path to a target but at the same time, several others turning moving entities which are dynamic obstacles (like big vehicles) this requires a regular recalculation of each path considering the new areas blocked by the turning moving obstacles.

For nodes positioned on a grid (like one node each 1x,1z unit), i have an idea on how to quickly change the state of each node blocked by a turning moving obstacle, in order to consider only the accessible nodes, but for nodes positioned around obstacles, this would be difficult/impossible...

An easy optimization would be to calculate the path for a group of entities with the same start area and the same target and not for each entity...


_PJ_(Posted 2016) [#8]



yes, that's what i am thinking too, in a RTS game with many entities which need to calculate a path to a target but at the same time, several others turning moving entities which are dynamic obstacles (like big vehicles) this requires a regular recalculation of each path considering the new areas blocked by the turning moving obstacles.


for large vehicles that need a turning circle, just use a larger minimum "step" size for the pathing checks- This means they will 'detec t' obstacles that are a little way further and take alternative action early.

If they only can turn x degrees per 'TICK', then the pathfinding only needs to consider a smaller range of "Possible moves" representing a cone within that angle.


RemiD(Posted 2016) [#9]
I think that a good approach is to have a way to identify a turning moving obstacle (vehicle) and a static obstacle (building, wall, big container, big furniture, big machine, big rock, big plant) and to consider a turning moving obstacle as a temporary block.
And only recalculate a path when near enough and really blocked by the turning moving obstacle (which can turn move at any time)

I have replayed command & conquer recently and i have noticed that the pathfinding is not always the best and sometimes an entity simply stops to turn move, so it does not seem to recalculate a new path often.

Also, another good optimization is to separate the map in zones with passages (from one zone to another zone), and to have nodes childs of each zone, and when an entity try to find a path, first calculate a passages path which leads to the target zone, and then depending on which zone the entity is in, calculate a nodes path which leads to the target passage, considering only the nodes in the zone.
This greatly decreases the amount of nodes to consider, and thus the calculation to do...