0
\$\begingroup\$

I started creating a Vue3 version of the classic Sid Meier game Colonization. I have the basic player mechanics in place and even created a map editor. So I have 3 of the 4X in place: Explore, Expand and Exploit, what is missing is Exterminate. But here it gets tricky as I need an AI for the natives and other European nations. I don't even know where to start. I've seen this question but this is more about path finding and real time AI. What I need is a tactical AI in a turn based environment. As I don't know what the original game did I can only guess a few points.

Natives:

  • Place a few vilages in the same general area of the map -> I think with some random logic I should be able to do that (I already use seedrandom for placing the special resources on the map)
  • Character movement -> Already gets a bit trickier: what boundaries should the movement have
  • Agression -> When are they getting pissed by the Europeans and start attacking and how to determine how fast they can produce units

European competition:

  • The basic from the natives apply as well, but they need to found their settlements with some logic behind, so no simple randomization. Maybe close to special resources
  • Different behaviours from the original game, eg. the Spanish are agressive against natives, the Dutch focus mostly on trade, etc.
  • Diplomacy between each other and the player

Independence:

  • I think this should be easier again, just add units to their army depending on the size of the player popoluation, cities and money and attack the coastal cities in waves.

So my question is: how to implement such an AI?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ We generally do not answer broad "how to get started" questions, but it seems to me you have some ideas already. So I'd turn the question back to you: what happens when you try to implement some of this behaviour you've described? Do you get stuck at a specific step we can help you with? Does the resulting game not play the way you want? Try to edit your question to focus to one specific issue like this. \$\endgroup\$
    – DMGregory
    Commented Oct 1, 2022 at 14:08
  • \$\begingroup\$ @DMGregory thanks for the comment. I'll try a few things out, and update the question once I have a clearer picture of what I am actually missing. \$\endgroup\$
    – Thomas
    Commented Oct 1, 2022 at 14:20
  • \$\begingroup\$ If you want to implement AI, there aren't really many options today. If you need AI whose behavior is easy to predict, use finite state machines or behavior trees; if you need AI that is hard to predict, use GOAP or HTN Planning; if you need AI that is too smart to be AI, use Utility System. \$\endgroup\$
    – BlackGlory
    Commented Oct 2, 2022 at 12:26
  • 2
    \$\begingroup\$ When it comes to AI in 4X games, there is no such thing as "basic". \$\endgroup\$
    – Philipp
    Commented Oct 2, 2022 at 13:24

0

You must log in to answer this question.

Browse other questions tagged .