Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Tuesday, May 18, 2010

Auto balancing Decision trees aka Resource Trees II

Just continuing from last time.

So after we called Act on the economy node it checks that it isn't a leaf node and therefore it checks it resources.



Monday, May 10, 2010

Auto balancing Decision trees aka Resource Trees I

Today were gonna talk about a process for decision making that you can use for higher level Ai functions in games. Basically this method can handle purchases, tech level up. In some case even goal selection for a computer opponent. I will discuss this in the context of trying to make an Ai for an RTS game but the same principles will hold for a turn based strategy game and depending on context in a lot of other games too.
So the basic idea here is the following. Computers are really good at managing tree structures we have tons of efficient algorithms that works well with them and we can search in them easily. This however is not just limited to existing algorithms, basically any kinda of data is normally easy to analyze if you can represent it as a tree.

This comes from the fact that when you represent data as a tree you have already performed a divide and conquer on that data to divide it into smaller parts. Those making the code to crunch the data for each node of the tree a lot simpler than if you had to crunch all that data in one piece.


Sunday, March 28, 2010

Influence Maps II - Practical Applications

Now it is time to look at how we can use influence mapping in a practical application showing how we can use a simple influence mapping based scheme to create an AI that reacts surprisingly realistic and intelligent as long as it works within certain perimeters and you aren't trying to control it too precisely. This test as I have implemented it will only be using the basic Influence map but we will discuss interesting possibilities of using the other maps too. I am also sure that you by yourself will imagine a ton of ways to use the maps and even create new maps after these two articles. But for now we look at creative ways to use what we have learned so far.

What we are going to be looking on is what we used early on as an experimental Ai for Ground Control 2 it actually become the basis for that AI though heavily modified, partially because it did defeat our project lead 1 on 1 but mostly because the single player team needed a lot more control to create interesting single player missions. But within it's limitations it performed admirably and as I mentioned did become the basis of the AI.


Monday, March 22, 2010

Influence Maps I

In artificial intelligence one of the biggest problems is how to convert a complex world into a set of data that the AI can actually understand and work on. The real world or even a game world is infinitely complex and different techniques to compress that infinite data set into a usable format is a classic problem in ai research. Thankfully for games we don't have the trouble of having to interpret the image from a camera to create a 3dimensional world to move around in.

We have the advantage of having access to extremely detailed data of everything in the game. But the amount of data we have access to makes any sort of planning by the means of calculations impossible. The world is simply to complex, so in order to be able to work with it we have to employ a series of different algorithms the one we are going to look at today is called influence mapping and it's a way to resolve the actual strength relation ship on a map and helps to base tactical decisions on this. It has nothing to do with purchase planning or high level strategical decisions It's simply a analysis tool to create an accurate and usable view of the world.

Influence maps are based around the concept that objects in the game influences the strength relationships between the players and this influence spreads from their current position outwards throughout the map. If you add in all the influence of all the objects then you would get a view of the relative strength relationships for that part of the map. You should also be able to detect the actual front lines between the different sides with it too. As we will show later on we are able to calculate a lot of different data from the influence maps but for now I think it is time to go back to explaining how this all works. But as a tease in the end of this we will discuss how to create a simple army level opponent behaviour by only using influence maps. There will be limits to it of course but it is still pretty cool.


Monday, March 15, 2010

Trivial navigation mesh generation II

This one better not turn out as long as the last one or I will have to split this out over even more articles. The reason I allowed the last article to become so long is because I wanted to leave you with enough meat to implement it so that if you wished you could have it done by this post and then start refining it.

The meaning of Updating

The reason I always refers to updating is because you can’t just set a triangle to being blocked or unblocked. Well you can do that but what if the same triangle gets blocked by more than one obstacle for example and then that obstacle is destroyed. If you just set the triangle to unblocked you will be able to drive through one of the objects. And if you don't then you can't make objects that you can destroy dynamically at all.

Monday, March 8, 2010

Trivial navigation mesh generation I

This is going to be a intermediate level lecture so before you read this lessons there are a couple of things I'm going to assume that you have prior knowledge of.
  • A*
  • The different search space representations for it and how to use it on them.
  • 2D Line vs 2D Line intersection
  • 2D Triangle vs 2D Triangle Intersection
  • 2D Triangle inside Triangle tests
  • 2D Point inside Triangle test
That's it so it's not a too hefty list basically it means you understand A* and that it is a graph based algorithm and that the natures of the graph might change, and basic linear algebra knowledge or well access to a basic 2D intersection library. I'm sorry I can't touch on everything but I have to try to keep the articles short and focused on the target. I will spread the difficulty level around quite a bit but at the moment I am mostly looking at the things we teach at the beginning of the second year at TheGameAssembly but there will appear articles targeted to beginners too and some like the last series that can be enjoyed booth by beginners and intermediate students.