.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V > SEV Modders Knowledge Base

Reply
 
Thread Tools Display Modes
  #1  
Old October 28th, 2006, 11:23 AM

aegisx aegisx is offline
Second Lieutenant
 
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
aegisx is on a distinguished road
Default 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
Reply With Quote
  #2  
Old October 28th, 2006, 11:52 AM
NullAshton's Avatar

NullAshton NullAshton is offline
Major General
 
Join Date: Nov 2004
Location: Floating in space.
Posts: 2,297
Thanks: 0
Thanked 0 Times in 0 Posts
NullAshton is on a distinguished road
Default Re: AI state changes

Hmmm, to speed it up any, shouldn't it end after the first if statement if the returnvalue is false?
__________________
Hey! I found squirrels!

Vala - "The last time I was this bored, I took hostages!"
Reply With Quote
  #3  
Old October 28th, 2006, 02:26 PM

aegisx aegisx is offline
Second Lieutenant
 
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
aegisx is on a distinguished road
Default 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?
Reply With Quote
  #4  
Old October 28th, 2006, 02:44 PM

Raapys Raapys is offline
First Lieutenant
 
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
Raapys is on a distinguished road
Default 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

Reply With Quote
  #5  
Old October 28th, 2006, 03:03 PM

aegisx aegisx is offline
Second Lieutenant
 
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
aegisx is on a distinguished road
Default 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.
Reply With Quote
  #6  
Old October 28th, 2006, 03:10 PM

Phoenix-D Phoenix-D is offline
National Security Advisor
 
Join Date: Nov 2000
Posts: 5,085
Thanks: 0
Thanked 0 Times in 0 Posts
Phoenix-D is on a distinguished road
Default 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
Reply With Quote
  #7  
Old October 28th, 2006, 03:13 PM

Raapys Raapys is offline
First Lieutenant
 
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
Raapys is on a distinguished road
Default 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.
Reply With Quote
  #8  
Old October 28th, 2006, 04:36 PM
Captain Kwok's Avatar

Captain Kwok Captain Kwok is offline
National Security Advisor
 
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
Captain Kwok is on a distinguished road
Default 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.
__________________
Space Empires Depot | SE:V Balance Mod
Reply With Quote
  #9  
Old October 28th, 2006, 04:44 PM

Raapys Raapys is offline
First Lieutenant
 
Join Date: Jan 2005
Posts: 689
Thanks: 0
Thanked 0 Times in 0 Posts
Raapys is on a distinguished road
Default Re: AI state changes

The fog of war thing is really creating alot of Ai issues.
Reply With Quote
  #10  
Old October 28th, 2006, 04:52 PM

aegisx aegisx is offline
Second Lieutenant
 
Join Date: Sep 2006
Posts: 482
Thanks: 0
Thanked 0 Times in 0 Posts
aegisx is on a distinguished road
Default 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.
Reply With Quote
Reply

Bookmarks


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 12:48 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.