Thread Tools
Old July 11, 2001, 08:31   #1
D4everman
Prince
 
D4everman's Avatar
 
Local Time: 11:27
Local Date: October 31, 2010
Join Date: Jun 2000
Location: Oberammergau, Germany
Posts: 371
Formers going berserk
Has anyone else had this happen?

I usually don't automate formers until late in the game when most of the bases have been terraformed to the max of their radius. By then I'm usually involved in a vendetta or trying to snag as many SP's and concentrate on the end game. I automate them and let them go around building mag tubes (I usually have so many formers by then its easier than controlling all of them)

But every so often one of them goes berserk! It just loops around the same few roads of mag tubes every time like its stuck or something. I can stop it by taking control, moving it a few squares away and reautomating it, but I wonder why that happens? Is it a bug or something?

D4
__________________
"I know nobody likes me...why do we have to have Valentines Day to emphasize it?"- Charlie Brown
D4everman is offline  
Old July 11, 2001, 08:55   #2
Avenoct
Prince
 
Avenoct's Avatar
 
Local Time: 06:27
Local Date: October 31, 2010
Join Date: Apr 2001
Location: NC, USA
Posts: 777
D4,

Thankfully this doesn't happen more often than i does. It's a bug, but one common to strategy AI's everywhere. Any unit can get caught in this trap, but as it's conveniently rare in Alpha Centauri it doesn't really affect strategy too much. Try movng the unit farther away before re-automating it. If that doesn't work you'll have to manually change whatever it is it was working on. I'm sure we'll hear varied opinions on why movement gets stuck in this almost-infinite loop. Here's my 2 cents: The Former makes decisions in response to the environment. In one square it says to itself 'Ok, nothing to improver here...closest move is...there!' and heads that way. On the way it gets another idea, perhaps promted by 'new' information on the way to it's destination. So it changes course again. I have yet to see a unit stuck in a 2-move loop and I believe such loops are detected and stopped by the AI. Rather, units get stuck in the less likely 3-move loop:
Point A: must move to point B
Point B: must move to point C
Point C: must move to point A

I would guess this is harder to debug as no one move reveals the loop. Though it's not possible to view the Formers reasons for these moves, as the landscape is changed (by other formers or your lucky mindworm, etc...) the loops should naturally end.

-Smack
Avenoct is offline  
Old July 12, 2001, 10:04   #3
Scipio Centaurus
Prince
 
Scipio Centaurus's Avatar
 
Local Time: 11:27
Local Date: October 31, 2010
Join Date: Jan 2001
Posts: 317
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.
Scipio Centaurus is offline  
Old July 12, 2001, 10:39   #4
death_head
Prince
 
Local Time: 05:27
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Caledonia, IL, USA
Posts: 388
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.
death_head is offline  
Old July 12, 2001, 11:13   #5
Avenoct
Prince
 
Avenoct's Avatar
 
Local Time: 06:27
Local Date: October 31, 2010
Join Date: Apr 2001
Location: NC, USA
Posts: 777
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
Avenoct is offline  
Old July 12, 2001, 12:02   #6
death_head
Prince
 
Local Time: 05:27
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Caledonia, IL, USA
Posts: 388
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 is offline  
Old July 12, 2001, 15:53   #7
Avenoct
Prince
 
Avenoct's Avatar
 
Local Time: 06:27
Local Date: October 31, 2010
Join Date: Apr 2001
Location: NC, USA
Posts: 777
Death, some experienced (or at least sounding) people were talking about this very thing in another thread...I think its the thread about AI.

Yep yep, here it is: YAAI

-Smack
Avenoct is offline  
Old July 12, 2001, 16:23   #8
death_head
Prince
 
Local Time: 05:27
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Caledonia, IL, USA
Posts: 388
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.
death_head is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:27.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team