Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 2 users and 208 guests online.

Online users

  • Randallw
  • bauscho

Languages

  • English English
  • French French

Browse archives

« November 2008  
Mo Tu We Th Fr Sa Su
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Facilities, super facilities, and AI

Submitted by Mylon on Thu, 2007-05-31 04:37. SE:V MODs

Okay, so I've made 3 different flavors of some facilities. We have the standard facility, the mega, and the super. The mega takes up 5x the space, produces 10x the resources, and costs 50x as much (but gets a maintenance break). The super takes up 15x the space, produces 45x the resources, and costs 1125x(!) as much (but gets a similar maintenance break). Now the trick is, how do I get the AI to build these facilities remotely intelligently? I took a quick glance at the existing AI and as far as I can tell, it would look at this facility, see the massive mineral output, and attempt to build it above all other mineral facilities.

I imagine it might take a total rewrite of the construction queue AI to properly manage such a facility (by first considering space available, cost and time to build, and expected return on investment). But short of starting from scratch, I thought I would ask here if anyone had any ideas first.

‹ Unnamed's Stock AI upgrade Available Boosting manufacturing capability? ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Facilities, super facilities, and AI

Submitted by Qcontinuum on Thu, 2007-05-31 06:37.

Wouldn't be the game over before you ever built one of these super facilities??

» login or register to post comments

Re: Facilities, super facilities, and AI

Submitted by Mylon on Thu, 2007-05-31 07:21.

I've added in something similar for space yards to boost production rate.

But you could easily say the same of Sphereworlds. Doesn't mean they're not fun to have in the game. Smiling

» login or register to post comments

Re: Facilities, super facilities, and AI

Submitted by Mylon on Thu, 2007-05-31 14:55.

I've run into a problem with trying to get the AI to build production-boosting facilities. If I went entirely with the "get best facility with ability space yard rate modifire", this would point to the 25MT facility when these facilities very well ought to be constructed in the 4MT version, 10MT version, and then 25Mt versions in that order. I have no idea how to get, say, the "Second best" facility or otherwise point at that particular facility short of calling it directly, which would be inelegant.

» login or register to post comments
Mod Designer

Re: Facilities, super facilities, and AI

Submitted by unnamed on Thu, 2007-05-31 15:51.

Hey Mylon,

I had a similiar problem teaching the AI to use mineral scanners and system mineral scanners. The AI will always choose mineral scanners and never use the system mineral scanner.

I ended up just calling directly with:

set lng_facility_id_min_scanner := Sys_Get_Facility_ID("Minner Scanner")

set lng_facility_id_sys_min_scanner := Sys_Get_Facility_ID("System Mineral Scanner")

and in the Get_Ground_Constructions_Percentages function I just conditioned it for when I wanted it used:

if (num_mineral_facils > lng_min_scanner_cutoff) then

call Add_Facility_Construction_Percentage(lng_facility_id_min_scanner, 100, 1)

endif

For the mineral scanner it checks the number of mineral facilities on the planet against the formula that determines the minimal number of mineral facilities needed for the scanner to be worthwhile. I did the same thing with the system mineral scanner, though with different conditions. Ultimately I called the facilities directly and avoided the function to get the facility with the best ability.

-unnamed

» login or register to post comments
Telumehtar's picture

Re: Facilities, super facilities, and AI

Submitted by Telumehtar on Thu, 2007-05-31 15:52.

Master of Orion II has a brilliant design, you can built whatever you wish as far as you have the tech and resources (or credits) and output depends on population, I fail to understand why noone isn't even attempting to copy that game... it's just simple and brilliant - not to mention realistic because planets never run out of space for facilities, but population capacity yes is a valid obstacle. This would make things much easier for the AI too.

» login or register to post comments

Re: Facilities, super facilities, and AI

Submitted by Mylon on Thu, 2007-05-31 16:30.

I figured I might have to do that, Unnamed. I'm curious though, did the AI build the system scanner appropriately, or did it build more than one per system (wasteful)?

More appropriately though, I want to know how the function "Add_Facility_Construction_Percentage" works. I want the AI to build the space yard extensions, but not at the exclusion of everything else, since they are rather expensive and best built during times of peace.

» login or register to post comments
Mod Designer

Re: Facilities, super facilities, and AI

Submitted by unnamed on Thu, 2007-05-31 17:35.

It builds it properly for the logic I have in place right now. I'm still upgrading it. Currently the script checks to see if there is a system scanner in the system, if not, it is allowed to build one. However, it does not check queue's of the other planets in the system, so while the first one is being built, other planets may start one too. Once the first one is built though, no more are built. Enough of that problem though.

The Construction Script works more or less like this:

Under Get_Ground_Constructions_Percentages there is a case for everytype of colony (research, spaceyard, farming, etc.) Each type has its own list of Add_Facility_Construction_Percentage functions. Looks like this:

AI_STR_COLONY_TYPE_SPACEYARD:
call Add_Facility_Construction_Percentage(lng_facility_id_space_yard, 100, 1)
call Add_Facility_Construction_Percentage(lng_facility_id_storage_space_amount, 100, 2)
call Add_Facility_Construction_Percentage(lng_facility_id_ship_training, 100, 1)

Add_Facility_Construction_Percentage puts those items into a longlist (the first parameter being the facility, the second is the percent of space the facility can use, and the third parameter is the max number of that type of facility). The Construction script will then go down that long list and try to build each facility if it can. It checks what is on the ground and if there is already the max amount allowed or over the percent space allowed. If so it moves onto the next one. Each turn the list is made anew, and the construction script will go down the list checking what is on the ground against what is on the list.

What is at the end of the list gets built last, many planets never get to the end of the list (especially smaller ones). You could also put the building up farther on the list and put conditions on it. Ideas for conditions might include only build when the planet is in a core system (no enemies in system, or surrounding systems), only on planets with high construction rates, when not at war, create your own expected return on investment formula, etc. The current system already checks to make sure there is space available (for facilities, not units).

-unnamed

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • The mod simply knowns as "New Stuff"
  • Research By Percentage SUCKS
  • Star Trek Trailers.....
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires VI

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • Flagtastic Mod (Working on v3.0)
  • Colonizing Sphere and Ringworls
  • What makes a warp point "uncloseable"?
  • Beating the AI easily
  • Retail 1.33 Question before purchase
(c) Strategy First, Inc. All rights reserved.