1
\$\begingroup\$

Hi I am currently working on a small real-time strategy game.

The game consists in discovering and exploring planets to get knowledge and resource points. Every Unit of Time (UoT) in the game those points are adjusted based on a various factors. Basically the more planets you have explored the more points are generated, yet the more planets you get the greater the expenses per UoT, so it is a balance. There are a variety of planet types, some which allow to discover planets in a greater area, but produce little points, whilst others produce a lot of points. The longer the players lasts before running out of resource points and the more planets they explore the higher their score is.

I kind of got a decent game at the moment, but I wanted to add an AI to have other explorers competing against the player. I don't really know how to handle it.

So far my thoughts are to add weights to various parameters (like the number of points provided by each planet, the cost in points to explore it, the fact that it has been already explored, etc...). Those weights would be adjusted based on a variety of conditions, say if the player resource points drop below x then the weight attributed to the number of resource points provided would be greater than that of knowledge points.

I was wondering if anyone had any thoughts on this, is it likely that I'm going to get myself tangled in all of it if I do it this way.

Also one important thing to note is that the game space is randomly generated, i.e every time a UoT passes or an explorer explores a planet there is a chance that 2 new planets are being randomly generated. Which means I can't really use methods which are based on calculating a few turns ahead to make the best decision.

Finally, the game is relatively peaceful, I don't have a combat system, and the only risk of exploring a planet already explored by another explorer would be that, if that explorer is nearby, he might just re-explore it as soon as you have left meaning you have spent valuable resource points for no benefits, since all the point generation will go to the most recent explorer.

\$\endgroup\$
3
\$\begingroup\$

Having the AI generate a list with all possible decisions, rating each one based on a set of predetermined and pre-weighted factors and then picking the decision with the best rating is a good way to get a pretty decent AI.

At least as long as the number of decisions is manageable and you have enough understanding of your own game and its strategy to come up with an effective rating algorithm for decisions.

Difficulty can be adjusted by having the AI not take all possible factors into account or just plain cheating (give the AI more resources than the player or have it ignore restrictions which apply to the player). The last is the most popular with developers, while players usually expect the first, but rarely get it.

The main problem with such an AI is that it is very sensitive to slight balancing changes. A slight change in the game rules can affect which decisions are good in which situation. When you forget to adjust your AI rules accordingly, then the AI can become very weak. This is especially problematic when you allow your players to mod the game in ways which changes game mechanics but doesn't provide a way to tell the AI about those changes.

\$\endgroup\$
  • 1
    \$\begingroup\$ Another common approach is to write the "perfect" AI, then dumb it down by inserting a random element that makes it make the less-than-optimal decision. \$\endgroup\$ – uliwitness Sep 2 '16 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.