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
|
|
|