.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

Reply
 
Thread Tools Display Modes
  #1  
Old December 28th, 2005, 04:13 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default AI Construction Vehicles

Is this a correct (psuedo-c code) algorithm for how the AI evaluates what to build when parsing AI_Construction_Vehicles.txt?

Code:

while(we need to add things to build queues) {
// Case is just saying, go to the state we are currently in.
case (state) {
STATENAME:
// Parse every type in the list for this state.
for (int # = 1; # <= Num Queue Entries; ++#) {
PPI = Entry 1 Planet Per Item;
Num Planets = count up all of our colonies;
Num Ships of Type = number of the ships we own of type Entry # Type;

// Build one item based on the PPI condition per iteration of the
// main loop.
if (PPI < (Num Planets / Num Ships of Type))
{
construct Entry # Type;
}

// Build as many as are needed to satisfy Must Have At Least on every
// iteration of the main loop.
while (Num Ships of Type < Entry # Must Have At Least)
{
construct Entry # Type;
}
}
}
}

__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #2  
Old December 28th, 2005, 04:39 PM
geoschmo's Avatar

geoschmo geoschmo is offline
National Security Advisor
 
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
geoschmo is on a distinguished road
Default Re: AI Construction Vehicles

You probably need some sort of check in the loop for resources being spent and a break if it exceeds a certain threshold. I don't believe the AI will keep putting items in the queue if it doesn't have the available resources to spend.
__________________
I used to be somebody but now I am somebody else
Who I'll be tomorrow is anybody's guess
Reply With Quote
  #3  
Old December 28th, 2005, 05:05 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: AI Construction Vehicles

Well yeah, but I don't care about that at the moment, just trying to understand how this file works. And besides, that would make the code very, very messy. Assume they have infinite resources available for the time being.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
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:25 PM.


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