.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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 

Bookmarks

Thread Tools
Display Modes

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 03:20 PM.


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