Jump to content


Photo

I Think, Therefore I Am


81 replies to this topic

#1 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 16 February 2011 - 03:58 AM

It never worked.

No one could tell in the beginning, when we were still like vanilla. We got our first hint of the truth with research. Then the attacks began to quiet, and colonies disappeared. If we continued to change, there would soon be no game.

We changed anyway.

The task ahead was unprecedented: create a fully customized artificial intelligence. Despite a community's best efforts, it had never before been achieved. All attempts to alter the equations, the AI's means of perceiving the state of the game, had failed.

It turns out that FoC actually runs two distinct AIs: its own and EaW's. There is no way to alter the original EaW AI through modding FoC. It can, however, be circumvented.

And we have finally done so. After an arduous process of black box testing with no debug tools and too many distinct exception fixes to remember, Phoenix Rising can think.

My main objective with the AI in this release, besides deciphering a confusing system architecture so that it might work, was to return all the functionality it had out-of-the-box. It would need to be taught to reason in terms of our rules instead of those of the original game. Every line of every script and equation would need to be reviewed and, if necessary, converted.

In previous versions of PR, the base AI became dysfunctional as gameplay gradually changed. Some features went unaffected, while others shut down entirely. This iteration should return everything to its disposal.

A few aspects of the original AI would explicitly not make the transfer. Gone are the cheat scripts that spawned everything from cash to structures to dreadnaughts. The future will be won or lost on our own merits.

Before I began, a unique category type was created for each unit class in the game. It's now possible to easily distinguish between freighters and corvettes in the code, which, despite their very different roles, wasn't previously practical. More than just an AI improvement, this has benefits for anything that deals with units.

The conversion yielded an operational AI adapted to our scope and terminology, but with essentially the same logical processes as vanilla. For the space and land portion of the AI, this was acceptable - reformulating equations from scratch and adding new behaviors are projects for a later date.

Galactic AI was another matter. In EaW, a surprising portion of it simply did not work - rarely would you see an enemy Infiltrator Facility, Officer Academy, Cantina, Hutt Palace, or Mining Facility. Given its reaction to our splitting the Star Base, there was little left to salvage. Infrastructure, as it were, would have to be built from the ground up.

Once again, a subproject was called for and all structures were reevaluated. Why teach the AI how to build when the blueprints might be outdated? Basic stats like cost, time, and integrity were tweaked, but that's just the start.

We had a clean slate for land, so nothing would be held sacred. Starships are naturally organized into classes based on their size, but what about ground vehicles? EaW split them into indiscrete groups of "light", "heavy", and "advanced". I prefer to think of vehicles in terms of their method of locomotion. In that trend, there will be three types of factory: the Crawler Factory, for traction-based units; the Walker Factory, for legged vehicles; and the Speeder Factory, for anything that hovers. All building prerequisites were removed.

What's the difference between SecForce and SpecForce? We felt it was more than just a letter - the need for dichotomous barracks has been apparent for some time. With generic heroes steadily approaching pointlessness in favor of named, the Officer Academy no longer made sense. Its models were cannibalized to create a new concept for Stormtrooper and Special Forces types, the Elite Barracks. The suddenly redundant Infiltrator Facility was discarded.

"Hutt Palace" felt too factional, so it was replaced with a functionally identical Guild House. The HVs-2 Hypervelocity Gun and m-68 Planetary Magnepulse Cannon are no longer buildable by the Empire; in their place is the w-165 Planetary Turbolaser. The term "Star Base" has been retired in favor of "Orbital Shipyard". Finally, space research and upgrades are now conducted from a Research Station, which opens up use of places like The Maw and its Research 3 advantage.

With structures settled, work on the AI could begin in earnest. For every strategic and tactical goal available to the AI, there is an underlying equation that resolves to a number representative of desire to perform said action. Goals are organized into likewise sets; the goal with the highest desire in a set is executed by a plan - provided that the cost of the plan fits into the AI's budget. This process is repeated after a time interval given by the goal for every applicable object or area in the game. In the case of infrastructure, it's always considering friendly planets.

The first step in a new equation is to establish a constant desire to be modified by factors in the game. For production facilities, we use a large number that scales down as the faction reaches an "ideal" galactic ratio of structures to planets. For something like a Mining Facility or Golan SpaceGun, we're more concerned about not exceeding a local ratio. Others require unique considerations.

In all cases, it's prudent to include some basic checks to eliminate choices that break the rules. For example, the AI should not try to build stations if there is no colony, or a Walker Factory if it is Rebel, or two Research Facilities. Decisions should also be weighted by the relative value of a target planet, whether it is connected to an enemy player or not, and possibly by what other structures are present.

The aforementioned logic could work for any FoC mod, but this is our AI. Remember the planetary advantage update I posted about last year? It understands them intrinsically. Clone worlds get Elite Barracks. Research Stations are built at places with Archives. And Mining Facilities become increasingly difficult to pass up the greater the bonus.

It all adds up to an opponent that can do everything a human player can do - including win. Sure, it may throw units at you like it always has in battle, but its bases will be laid out with master precision. And that is the foundation.

#2 sargeantsandwich

sargeantsandwich
  • Members
  • 56 posts

Posted 16 February 2011 - 04:43 AM

!!!!!!!!!!!!!!!!!!!!!!!!
Will the A.I. research now?
and will it attack more than once an hour of gameplay?

#3 SpardaSon21

SpardaSon21

    title available

  • Members
  • 332 posts

Posted 16 February 2011 - 04:45 AM

YEEEESSSSSS!!!!

All hail Phoenix Rising and his team. The Force truly has been with them.

#4 mitch

mitch
  • Members
  • 11 posts

Posted 16 February 2011 - 04:54 AM

Incredible!..and well written :wink_new:

#5 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 16 February 2011 - 05:10 AM

!!!!!!!!!!!!!!!!!!!!!!!!
Will the A.I. research now?
and will it attack more than once an hour of gameplay?

Inevitably I missed some details in this eleven-month summary.

Yes, it has a specific chunk of the budget set aside for research. I've seen Rebel Dreadnaught Mark IIIs early on in Core Worlds. It's no coincidence either, since Alderaan has University 2 and Shipyards (Class 3).

And, yes, it's fairly aggressive - as long as it has units to spare. Most campaigns should start with a blitz. It's pretty fair about going after player and non-player factions in equal measure. Just don't leave anything undefended...

#6 sargeantsandwich

sargeantsandwich
  • Members
  • 56 posts

Posted 16 February 2011 - 05:22 AM

!!!!!!!!!!!!!!!!!!!!!!!!
Will the A.I. research now?
and will it attack more than once an hour of gameplay?

Inevitably I missed some details in this eleven-month summary.

Yes, it has a specific chunk of the budget set aside for research. I've seen Rebel Dreadnaught Mark IIIs early on in Core Worlds. It's no coincidence either, since Alderaan has University 2 and Shipyards (Class 3).

And, yes, it's fairly aggressive - as long as it has units to spare. Most campaigns should start with a blitz. It's pretty fair about going after player and non-player factions in equal measure. Just don't leave anything undefended...

so have you ever lost to it?

#7 Zeta1127

Zeta1127

    Supporter of P-canon

  • Members
  • 415 posts
  • Location:A galaxy far, far away
  • Projects:A Galaxy Far, Far Away
  •  Ancient Order of the Whills Clone Marshal Commander of the 89th Legion

Posted 16 February 2011 - 05:26 AM

Excellent, looks like the AI might actually be fun to play against now.

PR, I looked again at the planetary advantages thread and realized that you said you took a leaf out of the SoaSE, Sins of a Solar Empire, playbook with your planetary advantages system. I recently purchased Sins, but not either of its expansions yet, its a good game.

Edited by Zeta1127, 16 February 2011 - 05:26 AM.

"I'm just a simple man trying to make my way in the universe." - Jango Fett
"You are fooling yourself, Captain. Nothing here is what it seems. You are not the plucky hero, the Alliance is not an evil empire, and this is not the grand arena."
"And that's not incense." - The Operative and Inara Serra
"What you will see, if you leave the Mirror free to work, I cannot tell. For it shows things that were, and things that are, and things that yet maybe. But which it is that he sees, even the wisest cannot always tell. Do you wish to look?" - Galadriel
Clone Marshal Commander Zeta 1127 of the 89th Legion
Admiral Zebulon Wilhelm of Task Force Mystic/Fleet Junkie

#8 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 16 February 2011 - 05:52 AM

so have you ever lost to it?

I've lost battles and planets, yes. Superior tactics can only do so much against overwhelming force sometimes.

PR, I looked again at the planetary advantages thread and realized that you said you took a leaf out of the SoaSE, Sins of a Solar Empire, playbook with your planetary advantages system. I recently purchased Sins, but not either of its expansions yet, its a good game.

The non-artifact bonuses that pop up when exploring are along the same lines. I liked how they were standardized.

#9 Ghostrider

Ghostrider

    Sith Lord of Campaigns

  • Project Team
  • 2,035 posts
  •  Phoenix Rising QA Lead; Manual Editor

Posted 16 February 2011 - 08:55 AM

Excellent, looks like the AI might actually be fun to play against now.


It scares me!

I made the mistake of leaving Coruscant vulnerable in early TO testing some while back (when the AI was only part fixed) and it reacted instantly, flattening my space fleet.
Oops. :wink_new:

Edited by Ghostrider, 16 February 2011 - 09:00 AM.


#10 Tropical Bob

Tropical Bob

    title available

  • Members
  • 1,348 posts

Posted 16 February 2011 - 08:56 AM

:blink:

:wink_new: :grin: :p :grin: :) :grin: ^_^ :grin: :thumbsupsmiley: :grin:

I can't wait to try this out. Part of why I always fall out of playing PR is because the AI almost never gives a challenge. One giant disorganized fleet every so often is easy to hold off once you see the pattern in what planets it tends to target constantly, and you have ships several tiers above theirs.

#11 Element94

Element94
  • Members
  • 12 posts
  • Location:Germany

Posted 16 February 2011 - 02:45 PM

That sounds very well! Can't wait until its ready!

Who always gives his two cents in suspicion turns out to be a sausage


#12 Mercykiller_AUS

Mercykiller_AUS
  • Members
  • 13 posts

Posted 16 February 2011 - 03:32 PM

Does this help with the lag too? Sounds like it would, given that the AI is no longer struggling with stuff that doesn't exist, or works differently. And going from 2 AI's that don't work to one that does has to be good for our RAM and CPU cycles.

#13 muneyoshi

muneyoshi
  • Members
  • 196 posts

Posted 16 February 2011 - 03:40 PM

I happen to agree with the comment about falling out with playing PR because of the AI issues. I used to work on some minimods for PR myself.. yet with the ever present AI and lag issues I gave up. Well also I got married.. have 4 kids now and went back to school and am studying for a BS in Computer Science.. so it was AI, lag and a lack of time to try and work on it too lol.

#14 Ghostrider

Ghostrider

    Sith Lord of Campaigns

  • Project Team
  • 2,035 posts
  •  Phoenix Rising QA Lead; Manual Editor

Posted 16 February 2011 - 03:54 PM

Does this help with the lag too? Sounds like it would, given that the AI is no longer struggling with stuff that doesn't exist, or works differently. And going from 2 AI's that don't work to one that does has to be good for our RAM and CPU cycles.



I'm currently playtesting Operation Shadow Hand (Probably the toughest campaign for CPU loadings) on the aforementioned AI opponent and I can move around the galaxy fine. Just hope my fleet can survive....

It's much better than 1.1 in that regard!

#15 Phoenix Rising

Phoenix Rising

    Beyond the Impossible

  • Petrolution Staff
  • 6,509 posts
  • Projects:Phoenix Rising
  •  Mod Leader
  • Division:Petrolution
  • Job:Mod Specialist

Posted 16 February 2011 - 05:58 PM

Does this help with the lag too? Sounds like it would, given that the AI is no longer struggling with stuff that doesn't exist, or works differently. And going from 2 AI's that don't work to one that does has to be good for our RAM and CPU cycles.

I really didn't even go into all the problems that came up in the course of doing this, but rest assured, I cleaned up a lot of obsolete data in order to get this to work. That alone seems to have improved performance.

Stuff that doesn't exist, per se, really is an issue though! The Map Editor, at some point, had corrupted our maps in a seemingly minor way - by shifting the faction on a couple of map objects. When it happened to turn asteroid fields to Independent, space battles on that map seized up. It's been corrected... for now.

It's not that there are two AIs going at once in FoC, but there are two sets of files and some don't necessarily override like you'd think. Who knows what's really going on when they don't match up?

I happen to agree with the comment about falling out with playing PR because of the AI issues. I used to work on some minimods for PR myself.. yet with the ever present AI and lag issues I gave up.

That's why I didn't think we could wait another release to do something about the AI, even if it meant adding a good portion of 11 months in development time. Emphasis on "good portion"... this isn't the last bit of news before the release.

#16 sargeantsandwich

sargeantsandwich
  • Members
  • 56 posts

Posted 16 February 2011 - 06:07 PM

I'm not sure I can stand any more good news.... I'm sure everything is going to be well worth the wait

#17 Zeta1127

Zeta1127

    Supporter of P-canon

  • Members
  • 415 posts
  • Location:A galaxy far, far away
  • Projects:A Galaxy Far, Far Away
  •  Ancient Order of the Whills Clone Marshal Commander of the 89th Legion

Posted 16 February 2011 - 06:35 PM

so have you ever lost to it?

I've lost battles and planets, yes. Superior tactics can only do so much against overwhelming force sometimes.

I know I can handle it, the vanilla AI attacked me where I am weak before. This is nothing new in that respect, if anything, "this is where the fun begins".

PR, I looked again at the planetary advantages thread and realized that you said you took a leaf out of the SoaSE, Sins of a Solar Empire, playbook with your planetary advantages system. I recently purchased Sins, but not either of its expansions yet, its a good game.

The non-artifact bonuses that pop up when exploring are along the same lines. I liked how they were standardized.

Yeah, I like the planetary advantages too, very standardized, which is a good thing.
"I'm just a simple man trying to make my way in the universe." - Jango Fett
"You are fooling yourself, Captain. Nothing here is what it seems. You are not the plucky hero, the Alliance is not an evil empire, and this is not the grand arena."
"And that's not incense." - The Operative and Inara Serra
"What you will see, if you leave the Mirror free to work, I cannot tell. For it shows things that were, and things that are, and things that yet maybe. But which it is that he sees, even the wisest cannot always tell. Do you wish to look?" - Galadriel
Clone Marshal Commander Zeta 1127 of the 89th Legion
Admiral Zebulon Wilhelm of Task Force Mystic/Fleet Junkie

#18 Ghostrider

Ghostrider

    Sith Lord of Campaigns

  • Project Team
  • 2,035 posts
  •  Phoenix Rising QA Lead; Manual Editor

Posted 16 February 2011 - 07:32 PM

Does this help with the lag too? Sounds like it would, given that the AI is no longer struggling with stuff that doesn't exist, or works differently. And going from 2 AI's that don't work to one that does has to be good for our RAM and CPU cycles.



I've just done a crude FRAPS test on the new system - bear in mind this is a very crude test - On the opening PR sequence i.e. main menu the frame rate on my system is about 20.

Core Worlds runs at a frame rate of 15-19 and Operation Shadow Hand runs in the 8-14 range. On V 1.1 (and I have upgraded my system since then) frame rates barely got over 10, so the new system architecture (and some hardware upgrades) have made a difference.

The main point to note here is that with V1.2 on my new system, the drop in frame rates is much less significant, resulting in much smoother play.

Enjoy!

#19 Aizen Teppa

Aizen Teppa
  • Members
  • 206 posts

Posted 16 February 2011 - 07:34 PM

Truly wonderful development with regard to AI. Simply cannot wait for 1.2. For now having fun with X3:Terran Conflict (proper theme) :thumbsupsmiley:.

Just like Muneyoshi I ditched small scale modding and 1.1 as a whole because of lag issues and logic behind how AI is [not] working, game very quickly turn into boredom fest (when you play as an Empire) or frustration fest as a Republic (Empire AI spamming 20 SSDs fleets all around the map).

Still, we are all waiting for 1.2, don't mater how long it takes. It will be simply spectacular. I'm absolutely sure of that. Like buying spanking-brand-new-hot EaW for the very first time.

#20 implicid

implicid
  • Members
  • 34 posts

Posted 16 February 2011 - 07:52 PM

Excellent!!!

I know that was a LOT of tedious and frustrating work. Awesome job, I can't wait to try it out. I don't know if you intend to but, I would personally love to read a little more detailed report on that eleventh month process. It sounds very interesting. I'm just really curious as to how the AI is really affected by these changes.

About the AI, will a planet with a Shipyard cap of 5 say...Kuat, no matter what the faction is that's controlling it, will they build many defenses and make it an epic planet to take based on its bonuses? I'm really interested to know what kind of things might change and improve. That's one thing I always felt cheated on in EAW; even in PR 1.1. I really craved the AI to send in a fleet spanning starfighters to capitals and even a dreadnaught whose purpose seemed clear that I had an invasion force on my hands. To deal with an actual enemy fleet that makes sense; I have craved this in EAW. I hope this groundwork into this AI will bring about unpredictable actions and suprising battles that make sense and bring challenge.

I've spent much time on these forums going through all of the previous news posts trying to get a good idea of what is coming in this new version. If I had the time I would offer to help you guys with making up documentation as I knosw thats tedious enough when you have more exciting development stuff to do.

Congradulations for sure! Indeed this is a very unique mod!
Best of luck PR, Ghost, and everyone else involved!

Edited by implicid, 16 February 2011 - 08:19 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users