 |
|  |
 |
|
Scipio Centaurus
|
|
Next time you see that happen, try setting the map preferences to show planned movement routes and take a look at where the game wants to move the unit. I think more often than not your going to notice a long straight green line leading from the unit to some far away point on the map that crosses directly through a geographic barrier for the unit type in question.
Last time I saw it one of my own games was with a sea former that kept cycling through the same 3 squares located in a harbor on the north side of a larger landmass. Sure enough, the planned movement line from the sea former at each of those squares headed due south right across the landmass and off the bottom of the map display. Maybe the recursive pathfinding routine just ran out of memory while trying to negotiate its way around the east and west coasts of the landmass.
I've seen similar problems for land units that get stuck along the coast apparantly trying to cross bodies of water to get to areas of land on the other side.
|
|
|  |
 |
|
death_head
|
|
Caledonia, IL, USA
Jul 2000 time: 23:14
|
|
Would it be so hard to impliment a simple algorithm to watch out for these traps? All it would have to do would be to calculate a few moves ahead, and if it reads a loop, it could force the Former (or whatever) to make a different decision. Maybe this would be harder to do than I think, but it's worth a try.
|
|
|  |
 |
|
Avenoct
|
 |
NC, USA
Apr 2001 time: 00:14
|
|
If Scipio is correct and that it's 'just' a matter of a unit trying to go somewhere it can't, perhaps that could be solved with a turn-remember type AI. If the unit was unable to advance last turn, it demands new orders this turn, or somesuch.
On the other hand, if it's a loop, thinking ahead a turn or two is pretty darn mathmatically interesting. Rather than think ahead a turn, wouldn't it be simpler to think back? In the three point loop, say for a rover based unit (to give it movement) on a road, this could happen within one turn:
Data remembered: I've been to point A, B, and C
Alpha Priority: I'm needed at C to get to D
Consideraton: But I've been to C and that doesn't help get to D!
Beta Priority: I'll try going to E, asking for instruction, or changing my priorities.
As for the math looking ahead a turn (and please jump in if I'm incorrect!):
One unit has 8 possible directions to move. To consider the next move means (8 squared - 8) as you wouldn't order the unit back the way it came, hence the -8. That's 56 moves to consider, one move ahead.
Two turns ahead:
[(8x8x8 )-(8x8)]=456 moves to consider
Three turns ahead:
[8x8x8x8)-(8x8x8)]=3640 moves to consider
But, it's not just moves to consider! Let's add in a few elements the unit might contend with:
1. enemy units in sensor range, how to apply this knowledge?
2. does this move create a loop?
3. is this tile a good one on the 'path' I'm taking to X location?
4. If a former, does this tile need me?
Throw in just one of these and you double the # of calculations the AI must make per/move/possible. Even on a fast machine it's going to get complicated pretty fast. Consider too that you're talking about 100's of units doing this each turn and ya see why it can't be like a chess algorithm (ie considering enemy moves), nor can it be a truly effective debugger of loops. Just some thoughts...I'm probably wrong on the math too, but hey, it's fun to think about.
-Smack
|
|
|  |
 |
|
death_head
|
|
Caledonia, IL, USA
Jul 2000 time: 23:14
|
|
Well, I never said that this would be a small calculation. But it occured to me that this type of memory programming could be used in other ways as well. For example...
Instead of fighting the hopeless war of making the AI "smart", maybe the AI could "remember" what the human player has done when they win, or which tech strategy works on which map settings...it would certainly be a lot better then just making choices based on the current conditions, with no way to learn. (Polymorphic software!)
Or would this be for a mainframe?
|
|
|  |
 |
|
death_head
|
|
Caledonia, IL, USA
Jul 2000 time: 23:14
|
|
Oh, I read that thread, but forgot about it. I guess what I am thinking about is not only AI that can avoid stupid loops, but AI that can learn from past losses, e.g...
Recall the thread on AI always going for a former, even when there is a combat threat nearby. Wouldn't it be possible to make the A.I. look ahead and see that if it destroys the former like the last time (it would remember that in a .log file or something), it'll lose the war several turns down the road? Or maybe if the A.I. could actually have a dynamic victory plan, maybe if they were ahead in tech they could "decide" to go for transcendence, and thus prepare several crawlers in advance (a trick they learned from a previous game against a human).
The only disadvantage would be that SMAC would slowly increase the amount of space it used, but these files could be moved and edited and so forth. That's what I am proposing.
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|