AI Coding |
Fri, 16 February 2007 12:44 |
|
sirgwain | | Senior Chief Petty Officer | Messages: 86
Registered: March 2004 Location: Tucson | |
|
I just finished implementing bombing code and according to the unit test it actually works. At this point CraigStars! has exploration, expansion, battle, and conquest. All my AI does is explore and colonize though. It's a hacked together chunk of code and I would like to formalize it.
Here are my ideas. I've never programmed anything remotely AI-ish before, so if anyone has any other ideas or suggestions, please let me know.
AI's need a set of knowledge. They need to have at their fingertips knowledge of the universe, such as:
- A list of enemy fleets they know about.
- A list of unexplored planets that need scouting
- A list of habitable planets that need to be colonized.
- A list of enemy planets that need to be destroyed.
To work with the above lists, the AI needs to be able to design ships and build custom fleets to accomplish the above tasks. This is where things get tricky. In CraigStars! the techs are all loaded from a file. They aren't coded into the engine. The AI needs a way to determine what techs to use for what situation.
I have added a 'Ranking' field to each tech to determine how it stacks up to similar techs. My thought with this is to enable the AI to design ships with any technology set, not just the standard Stars! one. I haven't implemented it yet, but I think it'd be fairly easy to say "Build a colony ship with the best engine, the hull that holds the most cargo, and the best armor/shields available."
I'm not sure where to go with hulls themselves though. What kinds of ships should an AI be building? How should the AI determine what hull to use for a colony ship? Should they use the standard hull and ship colonists along with it? Should they colonize planets and then send freighters with people after the fact?
At what point does an AI attack another player? Is there some heuristic for when you switch from a explorer/colonizer to a warm machine?
I want to make the AIs as simple to make as possible because I would like, eventually, for anyone to be able to program one and plug it in. All AI programmers will need some shared functionality, so it might as well be in the game engine for everyone to use.
Some ideas I've had for types of fleets to build...
- Colonizers
- Search and Destroy Attack Squadrons
- Remote Miners
- Transports for mineral balancing
- Transports for population balancing
- Bombers
- Planet invaders
Report message to a moderator
|
|
|
|
Re: My AI Pipedream |
Fri, 16 February 2007 13:41 |
|
|
I'd like to also see AI's make a more sensible usage fo fleets - i.e. 'act' like a real player.
Once the AI has colonized a core area, multiple minelayers get deployed in space laying many small fields.
Attack plans for planets are done using a 'look ahead' like in chess. Calculate how many of what type of ships are needed to win the battle and bring chaff. One way of fixing the chaff problem is simply to expand the order set to have specific orders to kill capitol ships first or fastest armed ships. Granted, there will still need to be an attractiveness calculation done of some sort since battles aren't interactive - nor should they be for any Stars! version.
However, I would not want to completely remove chaff effectiveness.
I would really like to see the AI's build large fleets and send them out using cloaking and all the techniques that we all know as players.
Ptolemy
Though we often ask how and why, we must also do to get the answers to the questions.Report message to a moderator
|
|
|
Re: AI Coding |
Fri, 16 February 2007 13:48 |
|
m.a@stars | | Commander | Messages: 2765
Registered: October 2004 Location: Third star to the left | |
|
sirgwain wrote on Fri, 16 February 2007 18:44 |
AI's need a set of knowledge. They need to have at their fingertips knowledge of the universe, such as:
- A list of enemy fleets they know about.
- A list of unexplored planets that need scouting
- A list of habitable planets that need to be colonized.
- A list of enemy planets that need to be destroyed.
To work with the above lists, the AI needs to be able to design ships and build custom fleets to accomplish the above tasks. This is where things get tricky. In CraigStars! the techs are all loaded from a file. They aren't coded into the engine. The AI needs a way to determine what techs to use for what situation.
I have added a 'Ranking' field to each tech to determine how it stacks up to similar techs. My thought with this is to enable the AI to design ships with any technology set, not just the standard Stars! one. I haven't implemented it yet, but I think it'd be fairly easy to say "Build a colony ship with the best engine, the hull that holds the most cargo, and the best armor/shields available."
I'm not sure where to go with hulls themselves though. What kinds of ships should an AI be building? How should the AI determine what hull to use for a colony ship? Should they use the standard hull and ship colonists along with it? Should they colonize planets and then send freighters with people after the fact?
|
I'd guess the AI would do well to keep records on foreign ships, ranked by quantity detected, cost, observed average speed, and even battle prowess. That kind of info should enable it to answer questions like: what's the most likely composition of an enemy battlefleet? Which is their main wardesign? Which is the better to copy? What's the best (or at least the commonest) freighter/bomber/minelayer design?
And of course careful records of its own designs, possibly carried across several games, like a kinda portfolio.
That would enable an "arms race", as well as some evolution by imitation.
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
|