Quote:

1. Since I'm building an RTS, each unit needs to conduct itself independently and simultaneously of all the other units on the battlefield. However, this would require all of the units to have its own pathfinding graph, otherwise ordering one unit to move somewhere will cause all of the units on the field to move to that destination. But wouldn't this solution cause memory problems with big levels and lots of units?


you generate a new Floodfillgrid for each new Pathfind request.
With a 100x100 grid Map each one will take only 20kb Memory.
You make a list of array of maps, and assign it to the units that want to use it.
None used can be freed.
For example: you have a list of arrays, with an id number.
Each unit has one id number stored, of the grid it uses
currently. If the unit needs a new target, it will receive a new id number
of a newly generated grid.

Quote:

2. Suppose I order a unit to attack another unit. The unit I ordered should intelligently follow the unit it is attacking until its victim is dead. But wouldn't this require me to constantly recalculate my pathfinding graph so that the unit can avoid obstacles intelligently?


In most situations, they will not chase each other for long.
You can limit the recalculation of new coordinates to like
every 2 seconds.
You can of course also test if there is a direct path, and
only use a local short-distance follow routine.
(walking to the next square closest to the target)

Quote:

EDIT: I've furth
er contemplated these problems and come up with some other solutions. I would be happy if you could tell me whether they are worth my time, of tell me of something better.

1. To avoid the memory problems, I could keep a "queue" of orders in a linked list. When a player orders a unit, to say, move to a certain location, it adds this order to the "queue" and assigns a pointer to the unit ordered that points to his order on the queue. When the unit(s) have finished executing the order, the order is removed from the queue. This method will allow multiple units to share the same pathfinding information, while simultaneously making sure that only the units that are moving are provided graphs. I believe this would effectively defeat the memory problems, but do you think it would work?


In RTS like Starcraft, the player and AI-commander all use the
unitselection group logic.
The currently selected units share the same pathfinding destination,
and this the same "floodfill" grid. So you only need to generate one for each new targetsearch.


Quote:

2. I know no real solution for this problem, but I figure I can help defeat part of the problem by only recalculating the unit's graph every few seconds. He won't be moving fast anyway, and I doubt the enemy unit will be either... But in my mind, such a solution seems like it would be prone to failure. What do you think?


First realise the simple method (generate a new path
every time the destination changes)
if it affect the performace, make a timedelay for automatic searches.
If it still affects performance, use a direct-walk search.


Also: if the player clicks outsied of the map or on a non passable
area, you can make a floodfill seachrch, assuming the map
has no obstacles. This way the unit will at least walk
towards the clickpoint.
(or you just use a normal direct walk, without pathfinding)