|
|
|
|
October 28th, 2006, 11:23 AM
|
Second Lieutenant
|
|
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
AI state changes
I could be wrong, but I don't think the state change is working correctly. My test empire seems to go right to AI_STATE_INFRASTRUCTURE. the code tells it to start with EXPLORE, but if the following function returns false, go to AI_STATE_INFRASTRUCTURE. This function could use work anyways, as just meeting someone shouldn't stop the exploration. My Test empire, turn #2 is already out of the explore state, it has warp points and hasn't met anyone.
//------------------------------------------------------------------------
// Should_We_Continue_To_Explore
//------------------------------------------------------------------------
function Should_We_Continue_To_Explore returns boolean
params
vars
retval: boolean
begin
set retval := TRUE
// Do we know of other players?
if (Sys_Empire_Politics_Get_Number_Of_Known_Players(s ys_long_Player_ID) > 0) then
set retval := FALSE
endif
// No more unexplored systems?
if (retval) then
if (lst_AI_Explore_System.Count() = 0) then
set retval := FALSE
endif
endif
return retval
end
|
October 28th, 2006, 11:52 AM
|
|
Major General
|
|
Join Date: Nov 2004
Location: Floating in space.
Posts: 2,297
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
Hmmm, to speed it up any, shouldn't it end after the first if statement if the returnvalue is false?
|
October 28th, 2006, 02:26 PM
|
Second Lieutenant
|
|
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
Maybe, depends on how it compiles though. It just does not seem to be working right. Is the a Debug print or something?
|
October 28th, 2006, 02:44 PM
|
First Lieutenant
|
|
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
It does end after the first if statement if the returnvalue is false, from what I can tell. Note the "if (retval) then".
From what I can see of the code, there doesn't appear to be anything immediately wrong.
Could there be something else triggering it? The empires in stock seem pretty messed up at any rate; they work far better in Kwok.
I believe the AI also keeps an explorer ship or two even in the other states, though?
Code:
AI_STATE_EXPLORE_AND_EXPAND:
set lng_Max_Explorers := 3
AI_STATE_INFRASTRUCTURE:
set lng_Max_Explorers := 1
AI_STATE_ATTACK:
set lng_Max_Explorers := 1
AI_STATE_DEFEND:
set lng_Max_Explorers := 1
AI_STATE_NOT_CONNECTED:
set lng_Max_Explorers := 2
|
October 28th, 2006, 03:03 PM
|
Second Lieutenant
|
|
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
I think the issue is it doesn't stay in the Explore state. I'm away from the game, but I wonder what value Sys_Empire_Politics_Get_Number_Of_Known_Players(sy s_long_Player_ID) is returning during the first few turns. Not sure if theres a way to print it out.
|
October 28th, 2006, 03:10 PM
|
National Security Advisor
|
|
Join Date: Nov 2000
Posts: 5,085
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
It might start out at 1, counting the running empire. I was going to suggest calling it from a component but that doesn't actually work.
__________________
Phoenix-D
I am not senile. I just talk to myself because the rest of you don't provide adequate conversation.
- Digger
|
October 28th, 2006, 03:13 PM
|
First Lieutenant
|
|
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
Do you actually know for certain that it's out of explorer state?
You could force a returnvalue TRUE and see if it makes any difference in the AI's behaviour, i.e. keeps him in explorer more, to find out if that's really the function that kicks it out of explorer state in the first place. If it is, and you're certain he doesn't 'know' any other empires, then obviously we've a bug in the number of known empires function.
Kwok can probably tell if what Phoenix says is a fact. Sounds strange to me that it would list itself, though. An easy fix, at any rate.
It could also be the part which checks if there's no more unexplored systems.
|
October 28th, 2006, 04:36 PM
|
|
National Security Advisor
|
|
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
|
|
Re: AI state changes
In the balance mod the AI keeps 3-5 explorers and surveyors on hand and merely meeting 1 race will not kick if from exploration mode - it's set to > 3. I also think another factor is that survey ships lag behind leaving undiscovered warp points uncovered so the AI thinks it doesn't have anymore systems to explore and the explorer ships just hang out at their target WP. Once the a new warp point is uncovered and it hasn't exited the expand and explore state it will keep going. At least this is my working hypothesis.
|
October 28th, 2006, 04:44 PM
|
First Lieutenant
|
|
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
The fog of war thing is really creating alot of Ai issues.
|
October 28th, 2006, 04:52 PM
|
Second Lieutenant
|
|
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: AI state changes
It is not staying in the explore state even though it should. I have the Empires research allocations based on the state, and they are in the Infrastructure state pretty much immediatly.
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting 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
|
|
|
|
|