• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] AI

Status
Not open for further replies.
Level 8
Joined
Aug 13, 2018
Messages
338
Hello, I want to create a AI for my map Battle Lines that you can find it's link below my post in signature, but I don't know what I want, I can create a fully random card casting for it, it's very simple but it's really good? I hear your suggestions
 
Level 12
Joined
Jun 15, 2016
Messages
472
Well that's a very interesting question.

Obviously, you'll have to trigger the AI somehow. The thing is, the AI will be decided completely by the game rules, which you know best. I can give you a high level idea of what such an AI can be:

It's always good to divide problems like this into smaller chunks, so you can, for example, say your card AI works in turns by making actions in a loop. Each such action should be done in two steps:

1. Evaluate the AI player's condition and save it. For example if the AI player has enemies next to it's arcane tower, you might want to note that. Other things can be resources, number of cards in hand, whatever you think is necessary. Save all those things, your AI player's state, and calculate a score of how good your player is doing right now.

2. If you have a small number of actions possible, for example pick and draw one card from a hand of 8, you can go over all possible actions and see how they change your state and it's score, and simply pick the one action which maximizes your score. If you have a lot of possible actions going over all of them will take a lot of time, and won't be useful at all. Instead, you can create rules for how to handle different situations. For example, if the enemy is attacking the AI player's arcane tower, then you'd probably want to deal with that, and quick. Otherwise you can go on to less pressing issues like attacking the enemy arcane tower, etc.

Of course that is just the beginning, and you can think of a lot of ways to improve that, like saving good cards for times of need, take opportunities and the likes. If you can find another map which has a card mechanic with AI, you can see how they implemented they're own and build on it (be sure to credit them).
 
Level 8
Joined
Aug 13, 2018
Messages
338
The thing is, the AI will be decided completely by the game rules, which you know best.
You know, it's a paper stone scissor, so I must use a system that counters each card of enemy, but in the same time, it must send some troops to attack (use ofensive units). How can I check if you send a Destroyer, AI plays Guard Tower? (in this example, until Destroyer reaches the Guard Tower, Guard Tower is in the end of Hp,(for negative regention of buildings) how can I solve this?)
Of course that is just the beginning, and you can think of a lot of ways to improve that, like saving good cards for times of need, take opportunities and the likes. If you can find another map which has a card mechanic with AI, you can see how they implemented they're own and build on it (be sure to credit them).
So, it's a bit similar to Castle Fight, What that used for AI?
Also do you know any other map that can help me?
 
Level 8
Joined
Aug 13, 2018
Messages
338
Starting with a purely random one is better than none at all. One can then work to improve from there, possibly with special cases for some of the more complex cards.
There is no problem if after simple AI I ask fans for a developing AI? Like this:
"AI of this map is very simple, if you want to help developing the map, you can give me unprotected version and create a smarter AI. Thanks for help."

Also, here is AI thread so there is no problem to ask how to create an AI for my second map: Battlefield (you can find it below post). I haven't any idea for it, it uses commands to play, also pause entering units to Player Regions so it's very hard to create AI for it (at least I think it is)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Creating AI is a notoriously difficult problem. If your map is unprotected then you are more likely to receive help with development from players than not. Ultimately one has to ask if whatever AI is created ends up good enough, since creating a perfect AI is currently as good as impossible.
 
Status
Not open for further replies.
Top