_id
int64
0
49
text
stringlengths
71
4.19k
30
One AI object for each npc Let's think for a moment a game where you'll have around 1k npcs, each one has to take its own decisions. Should each one has an object that decides what to do, or maybe exist one to process every unit? Also, let's think about a complex ai, not just check if npc can see the player nor decides if npc will attack or not. Something like Dwarf Fortress does.
30
How to create a reasonable AI? I'm creating a logic game based on Fox and Hounds game. The player plays the fox and AI plays the hounds. (as far as I can see) I managed to make the AI perfect, so it never loses. Leaving it as such would not be much fun for human players. Now, I have to dumb down the AI so human can win, but I'm not sure how. The current AI logic is based on pattern matching if I introduce random moves which make the board go out of pattern space the AI would most probably play dumb until the end of the game. Any ideas how to dumb down the AI in such way that is does not go from "genius" to "completely dumb" in a single move?
30
Prevent instances from overlapping gamemaker studio I have a game where multiple instances of an enemy move towards a player in their step process. There can be as many as 50 instances on screen. The issue is that the instances all end up in 1 big group as they follow the player. I would like to prevent them from getting more than 2 pixels of each other. the code is as follows if distance to object(player) lt 160 direction ppoint direction(x,y, player.x, player.x, player.y) p potential step(x,y, player.x, true) If I put a distance check of 2px in this code, the instance starts making jerky movements and spins. I would like the instance to continue following the player, but just not allow themselves to overlap.
30
Techniques for bot movement in (first person) shooter games I was wondering what kind of technologies were used in FPS games to move bots around the level. I know the pathfinding is done using waypoints or navigation meshes but how do the bots actually rotate and move over those paths? Is something like opensteer used for that, if so, which particular parts?
30
Is finding graph minors without single node pinch points possible? Is it possible to robustly find all the graph minors within an arbitrary node graph where the pinch points are generally not single nodes? I have read some other posts on here about how to break up your graph into a Hamiltonian cycle and then from that find the graph minors but it seems to be such an algorithm would require that each "room" had "doorways" consisting of single nodes. To explain a bit more a visual aid is necessary. Lets say the nodes below are an example of the typical node graph. What I am looking for is a way to automatically find the different colored regions of the graph (or graph minors)
30
Quake 3 Bot Programming Example I would like to implement an intelligent bot for Quake 3. I downloaded the and built the code successfully under Linux. My problem is that I couldn't find any complete tutorial telling me how to build an agent telling which files to use( as there are many files in the source code). Can you give me a website or piece of source code telling me how to start? Or something like an example source code for a bot.
30
AI Tactics for out of range enemies I'm working on a Fire Emblem style tactical engine, and looking into the AI. I have it working so enemies will find the best target within their movement attack range, but what about when no units are within range for example at the start of the map when they're far away. Who do they decide to move towards? Does it just pick out the weakest from the player units? Does it go for the nearest?
30
Available AI middleware A useful list of AI middleware. Please provide URL, free open source or licenced, and brief description of abilites. Format Package (License) Link Pros Cons
30
Webworkers HTML5 for game AI? So I am designing a game like scrabble in which a user has to make words using the letters on the screen. When the there is no possible combination of word that can be made with the letter the game is automatically supposed to tell the user to shuffle. Which changes the present set of alphabets with a new set (odds are very very very low that the new set cannot form a word either.) So I now its a simple word game, but I am making this on HTML5 Canvas. It hugely resource consuming. And I need to run this even heavier computation on the client machine of whether a new word is possible from the selection on the screen. Ideally I would run a thread were this an app for the native code, and check after every new word created whether new words are possible with the remaining alphabets. Alas on the web browser I am afraid, it will toast the computer, crash the browser and a lot of other horrible things. So I would like to know is there a way that I could make such a computation feasible with all the other actions I am already running!? Thanks
30
Can a rules engine produce manageable and complex AI? I am currently in the middle of creating an AI village simulation in Java. Having implemented a simple rules engine for dialog, I am wondering if this DSL can be extended for AI. I have previously implemented both GOAP and behavior trees, but considered GOAP to be confusing for the average user. Behavior trees may still be an option. In this case, I expect the AI to be able to control interactions between villagers (covered within the rules system already) and to manage the goals daily actions of both individual villagers and the village as a whole. Actions could range from gathering resources, to deciding what to build on a broader scale. However, I have concerns about whether a rules system will be able to manage hierarchy or many complex situations. There may also be some interaction with non technical users, so understandability is important. The rules engine as it stands currently takes in a number of facts on an event, matches it to the best rule and executes a number of actions. The outcome of the AI needs to be sufficiently complex as to be believable for example, there may be many competing desires to relax, work on a pressing task etc. This needs to be able to be managed and prioritized as tasks come up. A village wide AI can assign tasks to individual villagers based on their abilities and the urgency of the task. There are randomized events that can change the priority of certain tasks. My main concern is whether the rules engine will be performant, be able to schedule tasks well and be responsive to dynamic conditions. Is a rules based engine desirable for this kind of AI?
30
Collaborative Diffusion vs. A for loose armies combat any clear winner? Collaborative Diffusion (CD) takes a lot of the work that A does and combines (writes) it cheaply for multiple agents to read cheaply. This is because the majority of CD's processing works via a simple CA diffusion approach that produces a single shared map for every agent to use on a given game update. Agents then perform hill climbing within that space, which is also very cheap. The primary downside is that the data structure created by CD must apply for all agents that is, each agent's subjective view of the environment is identical A OTOH needs a path calculation per agent, each frame. In spite of this, the relatively low cost associated with CD would seem to make it, on average, a far more suitable approach than A , even when we must create unique views for agents (comments experience on this are welcome). EDIT Consider the following example using Collaborative Diffusion Two armies are on a battlefield, each army emitting a uniform scent. They charge (climb the scent gradient), and as the two lines clash, each agent takes on the first, closest enemy agent on the opposing line. This happens because on each approach step for each unit, it checks whether it's yet adjacent to an enemy if so it locks on attacks indiscriminately. This is much freer than specific targeting, which is where A would seem to be a better choice. Am I correct in these assumptions? Are there other downsides to CD as opposed to insert your flavour of A , for selecting ANY target between large groups?
30
Should pathfinder in A hold closedSet and openedSet or each object should hold its sets? I am about to implement A pathfinding algorithm and I wonder how should I implement this from the point of view of architecture. I have the pathfinder as a class I think I will instantiate only one object of this class (or maybe make it a Singleton this is not so important). The hardest part for me is whether the closedSet and openedSet should be attached to objects that can find the path for them or should be stored in pathfinder class ? I am opened to any hints and critique whatsoever. What is the best practice considering pathfinding in terms of design ?
30
PID controller error value for heading correction I'm using a PID controller in my AI to steer my NPCs to a desired heading (by adding torque). I've adapted the code from here http answers.unity3d.com questions 199055 addtorque to rotate rigidbody to look at a point.html The above example uses the cross product of the two headings as the error value for the PID controller. This works great if the angle between the desired and current headings is less than 90 degrees but if the angle is greater than that, the PID controller corrects to the opposite direction than I want (as it tries to correct to zero)! What is a good error value between two vectors to pass into a PID controller that works no matter what the angle between the desired, and current heading? Note because the PID controller returns the correction as a vec3, the error value must also be a vec3
30
algorithm advice for game background ambiance animals living in forest In the game, there is a forest and animals living in it. The interaction of the animals is just a background ambiance. When googling I found Goal Oriented Action Planning pattern. And this pattern seems to solve the issue. If we give goals to the animals while achieving their goals they can behave realistically for the ambiance. After more research, I found a paper which is advising extending GOAP with smart ambiance objects to make agents behave context aware. "Feeling the Ambiance Using Smart Ambiance to Increase Contextual Awareness in Game Agents" For example, think of an adventure game, the player is searching for clues items in the forest. Meanwhile, a bird (non player character) is looking for a fruit on the tree to eat. Bird sees a fruit on the tree but also saws a snake danger close to the fruit. So bird afraid and do not decide to eat that fruit... Are there other algorithms patterns that you can remind to solve this need?
30
How do I implement following behavior with a state based AI? I'm making a 2D game with two spaceships flying around shooting each other. One spaceship is controlled by the user, the by an AI. I want to use a simple Finite State Machine (FSM) for the AI. I'm trying to make the AI ship follow the player's ship and stop at a given radius from it. I've got a GetInsidePlayersRadius state, and a StopMoving state. But so far I got a weird bug involving the AI ship moving a few pixels, then stopping for a moment, than moving again, creating very fragmented movement. The AI can move up, down, left, right, up left, up right, down left, or down right, just like the player. What could create this fragmented movement behavior, generally when an AI agent is constantly trying to get inside a certain radius from an object, and stop when it's inside it? How would you implement a following behavior of an AI as part of a Finite State Machine?
30
Can anyone recommend an AI sandbox? I'm passionate person, who has been around AI from a long time 1 but never going in deep enough. Now it's time! I've been really looking for some way to concentrate on AI coding but couldn't succeeded to find an AI environment I can focus on. I just want to use an AI sandbox environment which would let me have tools like visibility information character controller able to easily define a level, with obstacles of course physics collider management triggers management don't need to be a shiny, eye candy graphical render this is about pathfinding, tactical reasoning, etc.. I have tried Unreal Dev Kit while the new release announce is about C coding, this is about external tools and will be released in 2013 Cry Engine really interesting as AI is presents here but coding with it appears to be an hell did I got it wrong ? Half Life source, C4, Torque, Dx Studio either quite old, not very useful or costly these imply to dig in documentation (when provided) to code everything, graphics included. Unity 3D the most promising platform. While you also need to create your own environment, there are lot of examples. The disadvantage is, in addition to spend time to have this env. working, is the languages choice C , Javascript or Boo. C is not that hard, but this implies you'll allways have to convert papers (I love those from Lars Linden) books codes, or anything you can have in Aigamedev are most often in C . This is extra work. I've look at "Simple Path", the very good Arong Greenberg work but no source provided and AngryAnt work. AI Sandbox this seems to be exactly what as AI coder I want to use. I saw some preview but from 2009 we still don't know what it will be about precisely, will it be opensource or free (I strongly doubt), will I be able to buy it? will it really provide me tools I need to focus on AI ? That being said, what is the best environment to be able to focus on AI coding only, is it even possible?
30
Artificial player evaluation I have a problem concerning a board game I'm creating. I plan on making an artificial player for the game using MiniMax with AlphaBeta prunning, but I'm not sure how to evaluate ir the player is good at the game. Since it's a new game I can't get a player who is good to give feedback. So I'd like to know if there is any technique to determine objectively if the artificial player is actually good. Thank you in advance.
30
Running state in Behavior Trees What happens, in a behavior tree, when a priority node chooses another branch over a running branch? Small example Priority 1 Fight Sequence Enemy near? Fight! Priority 2 Move Sequence Is there a hole? Jump! Run 5m! Now in the first iteration there is no enemy, but a hole, so the action Jump! gets executed. It's a rather lengthy animation so it returns running. For what should happen in the next iteration I found kind of contradictory statements. According to this answer the priority node always begins at the first priority disregarding if another priority is running. In this article however while the examples follow the same scheme, the explanation also mentions that it's possible to lock the tree in the Running state until it's finished. If the tree is locked in the Running behavior, the character can't react until he walked all the way to his walking target, so this can't be the right interpretation. If always the first priority gets checked again, the character can react to enemies while he's running (he stops and fights) that's the desired behavior. If however he's in the air jumping, he can not just stop and fight, he has to land first, so this time I can't choose priority Fight over Move! How should I handle those cases? Am I even approaching it the right way?
30
What are the possible options for AI path finding etc when the world is "partitionned"? If you anticipate a large persistent game world, and you don't want to end up with some game server crashing due to overload, then you have to design from the ground up a game world that is partitioned in chunks. This is in particular true if you want to run your game servers in the cloud, where each individual VM is relatively week, and memory and CPU are at a premium. I think the biggest challenge here is that the player receives all the parts around the location of the avatar, but mobs monsters are normally located in the server itself, and can only directly access the data about the part of the world that the server own. So how can we make the AI behave realistically in that context? It can send queries to the other servers that own the neighboring parts, but that sounds rather network intensive and latency prone. It would probably be more performant for each mob AI to be spread over the neighboring parts, and proactively send the relevant info to the part that contains the actual mob atm. That would also reduce the stress in a mob crossing a border between two parts, and therefore "switching server". Have you heard of any AI design that solves those issues? Some kind of distributed AI brain? Maybe some kind of "agent" community working together through message passing?
30
Can a rules engine produce manageable and complex AI? I am currently in the middle of creating an AI village simulation in Java. Having implemented a simple rules engine for dialog, I am wondering if this DSL can be extended for AI. I have previously implemented both GOAP and behavior trees, but considered GOAP to be confusing for the average user. Behavior trees may still be an option. In this case, I expect the AI to be able to control interactions between villagers (covered within the rules system already) and to manage the goals daily actions of both individual villagers and the village as a whole. Actions could range from gathering resources, to deciding what to build on a broader scale. However, I have concerns about whether a rules system will be able to manage hierarchy or many complex situations. There may also be some interaction with non technical users, so understandability is important. The rules engine as it stands currently takes in a number of facts on an event, matches it to the best rule and executes a number of actions. The outcome of the AI needs to be sufficiently complex as to be believable for example, there may be many competing desires to relax, work on a pressing task etc. This needs to be able to be managed and prioritized as tasks come up. A village wide AI can assign tasks to individual villagers based on their abilities and the urgency of the task. There are randomized events that can change the priority of certain tasks. My main concern is whether the rules engine will be performant, be able to schedule tasks well and be responsive to dynamic conditions. Is a rules based engine desirable for this kind of AI?
30
Is precomputed pathfinding still relevant? Context Old Lucas Arts (ScummVM era) point and click graphic adventure games used precomputed pathfinding. Here's a rough outline of the technique. Step 1 The floor in each room was divided into what they called "walk boxes", which were pretty much equivalent to nodes in a navigation mesh, but limited to trapezoid shapes. E.g A B C D Step 2 An offline algorithm (e.g. Dijkstra or A ) would calculate the shortest path between each and every pair of nodes, and store the first step of the path in a 2D matrix, indexed in each dimension by the starting and ending node used. E.g. using the walk boxes above A B C D lt Start Node A A A B C B B B B C Next node in shortest path C B C C C from Start to End D B C D D End Node As you may guess, the memory requirements increase quickly as the number of nodes increase (N 2). Since a short would usually be large enough to store each entry in the matrix, with a complex map of 300 nodes that would result in storing an extra 300 2 sizeof(short) 176 kilobytes Step 3 On the other hand, calculating the shortest path between two nodes was extremely fast and trivial, just a series of lookups into the matrix. Something like Find shortest path from Start to End Path Start Current Start WHILE Current ! End Current LookUp Current, End Path.Add(Current) ENDWHILE Applying this simple algorithm to find the shortest path from C to A returns 1) Path C , Current C 2) Path C, B , Current B 3) Path C, B, A , Current A, Exit Question I'm suspecting that with today's powerful hardware, coupled with the memory requirements of doing this for every level, any benefits this technique once had are now outweighted by simply performing an A at runtime. I've also heard that nowadays memory lookups might even be slower than general computation, which is why creating sine and cosine look up tables is not as popular anymore. But I must admit I'm not yet too knowledgeable on these matters of low level hardware efficiency though, so I'm taking this chance to ask the opinion of those more familiar with the subject. On my engine I also needed the ability to dynamically add and remove nodes to the graph at runtime (see this) so the precomputed route only made things more complicated, so I scrapped it (not to mention my runtime A solution was already running perfectly). Still, I was left wondering... Bottom line, is this technique still relevant nowadays in any scenario?
30
Potential Field Pathfinding in a non Axis Aligned World I am trying to create a game that has player created obstacles which can be placed anywhere in free space, and which has a large amount of enemy agents. In persuit of maximizing the number of agents I can have active at any given time, and as a secondary goal of maximizing the possible size of my map, I found potential vector fields to be a very appealing solution, except for one thing. Since the geometry is not aligned to any particular grid I have the problem of what to do when I have a narrow alley between obstacles that is approximately the size of one of my units (As such ) In this case, cells approximately the same size as the unit would consider this route impassable. One solution would be to use a smaller size of cell, but this of course means more computational resources. Does anyone know of an alternative solution to this problem?
30
Roguelike game detect intent of other actors by observing their moves In grid turn based roguelike game, how can I detect the following scenarios other actor is following observing actor other actor is intentionally moving to block its path Path blocking can happen if for example player intentionally stops right in front of actor and then when actor moves to avoid player, player moves in front and that keeps repeating as long as player does it. I managed to detect that situation in hackish way and I would like to know if there is a better method for solving things like this.
30
Grid Based AI Pathfinding I'm creating a top down RPG and I have the movement system set up for the player character it is alike to Pokemon in the movement sense in that it looks smooth but it is aligned to a grid. Since I have the player sorted I was trying to figure out how to use this movement principle for the Enemy AI's Pathfinding but I haven't figured out how to do it I was wondering if anyone has a possible solution to this.
30
Developing AI for Zatacka I am trying to develop a stronger AI for the popular game, Zatacka. The basic aim of the game is to survive the longest. It's like the TRON game, but the characters can only turn smoothly, instead of 90 degree turns. I am new to game AI. I have the following ideas in mind, but I don't know how they can be implemented. Collision prediction. If another player is about to come into the same area, then the player should turn around and try to evade. Hole taking capability. How to detect holes. How to distinguish holes from a normal empty area. Early detection of a dead end and being able to turn around before its too late. The problem with this how do we determine a dead end, it could be a bit far than our current position. Doing a path finding algorithm and searching for the wall or a player's body might not be efficient enough as this has to be done for each steps. Are there any standard algorithms for these problems? Can somebody throw some light on how I can approach these problems?
30
Seek Steering Behavior with Target Direction for Group of Fighters I am implementing steering algorithms with group management for spaceships (fighters). I select a leader and assign the target positions for the other spaceships based on the target position of the leader and an offset. This works well. But when my spaceships arrive they all have a different direction. I want them to keep to look in the same direction (target start). I also want to combine this behavior with a minimum turning radius that is based on the speed. The only idea I have is to calculate a path for each spaceship with an point before the target position, so the ships have some time left to turn into the right position. But I dont know if this is a good idea. I guess there will be a lot of rare cases where this can cause a problem. So the question is, if anybody knows how to solve this problem and has some (simple code) or pseudocode for me or at least some good explanation.
30
Negamax for turn based game I am working on a fast paced turn based game, each turn the player can move left, right or stay put and choose whether or not to fire. Each turn the shots move one block in the direction they are pointing. I would like to implement NegaMax on this game for curiosity's sake. Could anyone recommend a brilliant tutorial they tried and found satisfactory? Thanks
30
Should enemies still attack if they cannot see the player? This may seem like a silly question, but let me explain this further. Consider a common stealth situation where the player is hidden from the enemy AI. The AI has vision and hearing and if they either see or hear the player they will move towards the player's last known position. However if the player is behind cover (therefore the enemy cannot see them) and they attack with a silent weapon (therefore the enemy cannot hear them either), how should the enemy react? Realistically, the enemy should have an idea of the direction from which the attack struck them and therefore start moving in that direction. But I am wondering if this then would be detrimental to taking a stealth as oppose to offensive approach. If the enemy turns around when hit irrespective of whether they were hit with a loud or silent weapon, there is little benefit to using a silent weapon, since the loud ones will have more power anyway. On the other hand, if the enemy simply stands their while being hit several times by a silent pistol, it may make the AI seem a little stupid. I suppose it comes down to balancing between rewarding stealth gameplay in a stealth game, but not making the AI seem silly at the same time. What should I do to balance this?
30
Find required entities to accomplish specific task in shortest time I have a grid like map with entities that can perform turn based actions like moving or growing strength. When I have a task that requires a certain strength, I want to find the entities required to solve that task as fast as possible and move them to the target. The distance to the target is important, since moving a tile takes 1 turn. When entities move on a tile with an existing entity, their strength is combined together. A task can be solved only if the combined strength of the last entity is greater than the requirement. This logically means that entities near the target can grow while additional entities need to move to the target immediately. It feels like I could use a modified pathfinding, but I can't formulate the procedure to get something meaningful. This inablity also worries me a bit that the problem might be np hard. Can you help me?
30
How does an AI determine the bearing to follow within a nav mesh? I've done some reading on nav meshes, and I understand how to generate a path of polygons to reach a goal. However, what I don't understand is how you determine the bearing to follow within each polygon. Without a central node to aim for, what do you aim for? I suppose you could cast a ray to the goal and then head to the point where that ray crosses into the next cell but that would only work if that next cell is actually on your path. If your ray doesn't cross the edge into the next cell, do you instead plot a path to whichever corner of the edge is closest to the goal? I think that would get you the path shown in the 3rd diagram, but would it work in all cases? http udn.epicgames.com Three NavigationMeshReference.html
30
Component Entity based design Behavior Trees how to integrate? For my current project I implemented a component entity based system, basically following most of the best practice there is in this rather undefined area. So I got (slightly extended) Entities, which are basically an int ID, a human readable Name, a std map of components and a long "type indicator" which is used to show what components are present (I have an power of two enum for all the components types and whenever a component is added to the Entity, I automatically alter that long via bitwise operations, compare this answer). Then there are the Components, also rather simple int ID, enum as component type, parent Entity pointer and a std map of all properties this component holds. Lastly some Systems Managers that handle the actual logic processing. They first check if the currently processed Entity has a matching long "type indicator" all necessary components for that system are present. It then accesses some properties if needed and either directly calls some functions in the respective component or send some messages (via a message dispatcher). Bottom line Until here, a rather standard event driven component entity based system combined with a data driven approach (compare, components do not have hard coded data variables, but instead a generic map, as (some) components archetypes of components will later be read from files with the option to add additional data, that is not part of the actual component code. Now I would like to also introduce Behavior Trees (based on AiGameDev BTSK) into that project, but I am not sure if and how they should be linked to the already existing components or how to integrate those design in general. Several related ideas points questions come to mind My BTs will be read from files (again). I currently have a hard time seeing how I would however best make the connection between an BT Action in that tree and the actual coding in my application. Should I build up some sort of map between the action names used in the BT files and a function pointer to the actual logic implementation? What is the usual approach to solve that? I assume that I will have to create BTs for all my different Entity types (so for each game logic AI relevant combination of components as indicated by my multiple times mentioned long "type indicator"). As a result it doesn't make sense to put the BT Action implementations in the components as most likely many components will be involved per action, does it? So should the BT Action logic sit in a multiple separate systems (to whose methods the map from idea 1 points to)? The system would then check per my long "type indicator" whether the Entity for which the BT is currently checked and that was told to execute a certain action ( method in the system) is actually allowed to do so ( has the necessary components). But then, if not (because for example the BT creator did overlook a specific situation, where a necessary component might not be attached to the Entity at runtime anymore), nothing would happen. Questions Are there proven concepts for that kind of integration? What is your take on my 3 points above? Any other things that come to mind, also regarding my component entity based design in general?
30
approach for the system that record player actions and imitate it I am trying to implement some kind of system, that would allow AI to imitate player's action at certain points in similar cases. Case example Player (hp 10, mp 5) used skill BasicAttack when in battle When I set for a bot parameters like hp 10, mp 5 and state attack it should use BasicAttack skill because in same case player used that action. (I'd like to have ability to define similar cases like when hp 11, mp 6 then bot use BasicAttack too because it is similar to hp 10, mp 5 case but whatever) The question is that what are the basic approaches for such cases? Leaving aside snapshotting of player's state, how can such system be implemented? So far I have two ideas. My ideas are 1. order player parameters by priority and states and create tree where every node would be corresponding parameter value. For example node with name hp and value 10 will have a child note mp with value 5 thus I can create required paths to actions 2. I have event log with recorded player events. It keeps its record ordered. I iterate over it and using pattern matching I compare player parameters and retrieve corresponding player action The first approach seems much faster though. But I'd like to know if there already exist approaches for such systems, in order not to reinvent the wheel as I used to do. Are any?
30
Adaptive AI (Artifical Intelligence) I was thinking to make my arcade game match the players strength in the hard level mode. Like checking the score and if the human player's score is above computer's for certain number of units then the computer player would automatically increase the speed of its reactions, just like a human companion who gets more determined to fight back. Does this sound a good idea to you? Are there other ways to approach this, so to make a game, like air hockey for a crude example, permanently challenging for anybody? EDIT I agree with the answers below. I believe that most people like to win about 70 time over the computer in order to be motivated. Hence an adaptive intelligence must not be become too superior to the player and depending on human player's concentration and some random elements in the game (good 'old' quantum RND), the outcome should be always uncertain. A nice thing about this is that such a system could handle week and strong players and would adjust to the human's learing curve.
30
In MMO game, how to handle user characters, who are offline? In my medieval MMO game, players have their own character, that represents themselves inside game. Like a King. Players could have cities and armies, but King acts as main driving force. Then it comes to player, going offline vacation disconnect. How to deal with "offline King", to keep some sort of reality in game, without ruining everything for player. I have never liked unrealistic stuff in games, like appearing dissapearing from thin air, like in WoW or other MMO RPG's, when it comes to connect disconnect, like in Matrix movie, when you are disconnected, your "avatar" inside the system just vaninshes. Ok, if player char stays where it was left, other players who are online could kick his ass like offline player char was frozen? I see only one solution give player char, while offline, some sort of AI, that controls char. Is there any other solutions? May be, some sort of legend story, could make users only as inner voice, leaving King just passively controlled by user, or other stuff... Please, help! I hope you understand my question.
30
Developing AI for Zatacka I am trying to develop a stronger AI for the popular game, Zatacka. The basic aim of the game is to survive the longest. It's like the TRON game, but the characters can only turn smoothly, instead of 90 degree turns. I am new to game AI. I have the following ideas in mind, but I don't know how they can be implemented. Collision prediction. If another player is about to come into the same area, then the player should turn around and try to evade. Hole taking capability. How to detect holes. How to distinguish holes from a normal empty area. Early detection of a dead end and being able to turn around before its too late. The problem with this how do we determine a dead end, it could be a bit far than our current position. Doing a path finding algorithm and searching for the wall or a player's body might not be efficient enough as this has to be done for each steps. Are there any standard algorithms for these problems? Can somebody throw some light on how I can approach these problems?
30
Monte Carlo Tree Search for simultaneous multiplayer game I am developing AI for bomberman and i want to implement monte carlo tree search. I read that MTCS can be applied for simultanous multiplayer game. Problem i have is that i dont know how to implement it. For instance, how to store all possible moves in one game state or how to apply UTC selection. Should i call utc selection for all players and final state to select will be combination of their moves? Has anybody any literature to read or article? Thanks
30
What are the most common AI systems implemented in Tower Defense Games I'm currently in the middle of researching on the various types of AI techniques used in tower defense type games. If someone could be help me in understanding the different types of techniques and their associated advantages. Using Google I already found several techniques. Random Map traversal Path finding e.g. Cost based Traversing Algorithms i.e. A I have already found a great answer to this type of question with the below link, but I feel that this answer is tailored to FPS. If anyone could add to this and make it specific to tower defense games then I would be truly great full. How is AI most commonly implemented in popular games? Example of such games would be Radiant Defense Plant Vs Zombies Not truly Intelligent, but there must be an AI system used right? Field Runners Edit After further research I found an interesting book that may be useful http www.amazon.com dp 0123747317 ?tag stackoverfl08 20
30
What AI scheme is appropriate for a 4 player, Tic Tac Toe style game? I am about to release an android game that is like tic tac toe, but on a bigger board, and 4 player. Instead of winning when you get 3 in a row, you get points for chains, and the most points at the end wins. I'm going to have a later release that will include AI, but I'm quite new to this. Would minimax be a good choice, but does it work in 4 player? I'm worried that because there are around 90 possible moves for each turn then this would get slow too slow for large enough searches. Any suggestions?
30
approach for the system that record player actions and imitate it I am trying to implement some kind of system, that would allow AI to imitate player's action at certain points in similar cases. Case example Player (hp 10, mp 5) used skill BasicAttack when in battle When I set for a bot parameters like hp 10, mp 5 and state attack it should use BasicAttack skill because in same case player used that action. (I'd like to have ability to define similar cases like when hp 11, mp 6 then bot use BasicAttack too because it is similar to hp 10, mp 5 case but whatever) The question is that what are the basic approaches for such cases? Leaving aside snapshotting of player's state, how can such system be implemented? So far I have two ideas. My ideas are 1. order player parameters by priority and states and create tree where every node would be corresponding parameter value. For example node with name hp and value 10 will have a child note mp with value 5 thus I can create required paths to actions 2. I have event log with recorded player events. It keeps its record ordered. I iterate over it and using pattern matching I compare player parameters and retrieve corresponding player action The first approach seems much faster though. But I'd like to know if there already exist approaches for such systems, in order not to reinvent the wheel as I used to do. Are any?
30
what is the best way to add avoidance behaviour to an AI framework? I have a small AI framework for a shooting based game. Although this is rarely needed, as when agents are close to each other they are usually fighting, I would none the less like some way of implementing avoidance behaviour. For example, if in the future I wanted to take away their weapons and have many of them wonder around in a crowd, how would I make them not hit pass through each other, but instead avoid each other? while still following their calculated paths that is. two ideas I had would be to add steering behaviour and allow that to deviate from their path, or to use a dynamic pathfinding technique. Are these valid solutions? If yes how, in theory, would I implement them? Are there better ways? What is the more respected practice?
30
Minimax for Bomberman I am developing clone of Bomberman game and I am experimenting with different types of AI. First I used searching through state space with A and now i want to try different approach with Minimax algorithm. My problem is that every minimax article i found assumed players alternates. But in Bomberman, every player make some action at the same time. I think i could generate all possible states for one game tick, but with four players and 5 basic actions (4 moves and bomb place) it gives 5 4 states at first level of the game tree. That value will raise exponentially with every next level. Am I missing something? Are there any ways to implement it or should i use totally different algorithm? Thanks for any suggestions
30
How does an AI determine the bearing to follow within a nav mesh? I've done some reading on nav meshes, and I understand how to generate a path of polygons to reach a goal. However, what I don't understand is how you determine the bearing to follow within each polygon. Without a central node to aim for, what do you aim for? I suppose you could cast a ray to the goal and then head to the point where that ray crosses into the next cell but that would only work if that next cell is actually on your path. If your ray doesn't cross the edge into the next cell, do you instead plot a path to whichever corner of the edge is closest to the goal? I think that would get you the path shown in the 3rd diagram, but would it work in all cases? http udn.epicgames.com Three NavigationMeshReference.html
30
AI Learning vs. Strategizing I have a theory on AI that I would like to write a "whitepaper" about. The distinction I want to explore in AI is learning vs. strategizing. My question is, where can I read other material about this subject? Let me give a chess example. Let's look at a chess AI as a max tree, where capturing an enemy unit adds that unit's value to the "move score" for that decision (and likewise losing a piece subtracts that value to the score). Capturing a pawn might net 1 point, a knight 4 points, a rook 5 points, etc. Strategizing would be AI to apply these points and determine the next move eg. given ten possible moves, pick the best (max score) at the end of three moves. Learning would be applying statistical observation to determine those values. If you play 100 games, the AI might decide that capturing a pawn is 2 points, and a knight is worth 7 points, while a rook is only worth 3 points (based on 100 gameplays). Does this distinction already exist in literature, and if so, where can I read about it? Edit Does anyone know a Chess game (with source code preferably) that utilizes this approach? Maybe Chess960 Home?
30
How to ensure a condition in a behaviour tree when processing following nodes? Example tree (Source) As far as I understood, a sequencer iterates over the children until one failed or all are successful. If one children returns "running", the sequencer will start to process from that child on the next tick. Let's say "Do I have food?" takes longer than one tick because the AI has to walk to the fridge. When "Am I Hungry" was successful, it won't be processed anymore. Now while walking to the fridge, the hunger magically disappears. How do I prevent the tree from processing the other nodes even though I am not hungry anymore? Should every following node check the condition again? That doesn't seem to fit the idea of a behaviour tree. How do I implement a condition that has to stay true while following nodes are processed?
30
To what extent are video game bots NPCs artificial intelligence ? Wikipedia says In video games, this usually means a character controlled by the computer through artificial intelligence. https en.wikipedia.org wiki Non player character In video games, a bot is a type of weak AI expert system software which for each instance of the program controls a player ... https en.wikipedia.org wiki Video game bot However as far as I know such bots amp NPCs are way too hard coded or explicitly coded to be accurately called "artificial intelligence". Mainly most often they lack the ability to learn dynamically from the player. Arthur Samuel calls "artificial intelligence" The "field of study that gives computers the ability to learn without being explicitly programmed" (1959). So to what extend can bots and or NPCs be called "artificial intelligence" if they (or a subset of them) can be designated as such?
30
3D Side Scrolling Shooter to use or not to use Lua scripting? I'm programming a Side Scroller, and I've reached the point where I need to program the enemy behaviour. I don't know what I should choose between hard coding the enemy ships' behaviour or using a scripting language. Going with the hardcoded way, all different kind of enemies would be different classes derived from an abstract EnemyShip class with a virtual function redefined for each of them. Going with the scripting instead I could do just a base class and a script manager which moves the ships as needed. What should I do?
30
Path tables or real time searching for AI? What is the more common practice in commercial games path lookup tables or real time searches? I've read that in many games path lookup tables are pre calculated and baked into each map, so to speak, then steering behaviour is used to handle dynamic obstacles. or is it better practice to use optimised hierarchical A searches? I understand the pro's and cons of each, I'm just curious as to what is most often used in the industry.
30
Discovering path through unknown territory Let's say all the AI knows about it's surroundings is a pixel map that it has which clearly shows walkable terrain and obstacles. I want the AI to be able to traverse this terrain until it finds an exit point. There are some restrictions There is always a way to the exit in the entire map that the AI walks around in, but there may be dead ends. The path to the exit is always pretty random, meaning that if you stand at crossroads, nothing indicates which direction would be the right one to go. It doesn't matter if the AI reaches a dead end, but it has to be able walk back out of it to a previously not inspected location and continue its search there. Initially, the AI starts out knowing only the starting area of the whole map. As it walks around, new points will be added to the pixel map as the AI corresponding to the AIs range of sight (think of it like the AI is clearing the fog of war) The problem is in 2D space. All I have is the pixel map. There are no paths in the pixel map which are "too narrow". The AI fits through everything. The AI does not know where the endpoint is (it is hidden in the map) The AI traverses the terrain in real time It shouldn't be a brute force solution. E.g. it would be possible to simply find a path to each pixel in the pixel map that is yet undiscovered (with A , for example), which will lead to the AI discovering new pixels. This could be repeated until the end is reached. The path doesn't have to be the shortest path (this is impossible without knowing the entire map beforehand), but when movements within the visible area are calculated, the shortest and from a human standpoint most logical path should be taken (e.g. if you can see a way out of your room into a hallway, you would obviously go there instead of exploring the corner of your current room). What kind of approaches to solve this problem are there?
30
Is there a design flaw when an entity's state doesn't fully utilize enter(), execute() and exit()? I'm following Mat Buckland's Programming Game AI by Example, and I find that I don't always have use for enter(), execute() and exit() on an entity's state. For example, in an RPG, a weapon may have an equipped state, and I may use enter() and exit() for that state to add or subtract to a player's ability modifier, but there isn't really a need for execute(). Is this a design flaw in my engine, or a shortcoming of this approach?
30
Algorithm for exploring filling grid map I'm working on a small game that takes place on a grid map. I'd like to write an AI that is able to explore the grid map by filling as much of its available space as possible. From any given position there are four possible moves (north, south, east, west), but some of these may be blocked by walls. Also, once I visited a cell I don't want to visit it again. What's more, I want to avoid getting stuck if moving in one direction means I'm going in a dead end, I'd rather not fill out that part of the grid. Can you please help me with some pointers as to how I can do this?
30
How much logic should be in an individual behaviour tree node? Let's say I have a condition node which has to spend a lot of time calculating something to finally return a bool to the behavior tree. But in the following action, we need this information again. I now have a few options I could just calculate the information again. That could unnecessarily take a lot of time and may result in redundant code. I could save the information into some kind of state data dictionary but now the action depends on calling the condition first. I could make it a single action that would just fail if the resulting calculation would end up being False. I would possibly end up with a bunch of very similar, very complex actions. Again possibly a lot of unnecessary redundancy. How do I tackle something like that? Is there a pattern that I could apply to the action condition design (or whatever) or inside the behavior tree implementation that solves this? Or am I using behavior trees wrong entirely?
30
Strategies for monster targeting AI in a turn based combat system I am making a Final Fantasy style battle system. I have a random generator that select the monsters move when it is their turn different moves have different chances to be performed. I also have reactions and conditional actions for the monster to create simulated intelligence... but what I can't figure out is targeting. I could just choose randomly between the five player characters, but I was looking for something that would make the game more challenging by adding some kind of strategy to the monsters' actions. I code in C . Does anyone have an idea how to implement a system for the monster to choose who to attack besides completely random?
30
AI system recommendations for a Hive mind system Im currently starting to work on a game project where a player will be faced against an enemy which has a hive mind. I was wondering if anyone could recommend an A.I system which I could use as at the moment I am thinking about using Finite State Machines(FSM) and I think that if I use FSM's that it will get messy. Just to clear up what will be part of the "Hive Mind" if anyone was wondering will be Hive Leader Soldiers Workers Under each of these categories there will be roughly 2 3 different sub categories which will have to have slightly modified FSM's dependent on their abilities. Thanks for any response
30
AI engine for iOS game development? I'm looking for an AI engine for iOS game development (machine learning, path finding).
30
Any good pathfinding algorithm for lots of different speed zones? NavMesh seems not work I have a terrain map with lots of different areas roads, grass, swamp, forest, mountains. Each has different speed for the player. The map is continuous 3D map, not grids. Given a start amp end point, I want to find the shortest time path instead of shortest distance path. I tried NavMesh with area cost as the standard solution. But it could not solve system with different speed zones correctly. For example, given a simple NavMesh graph, each square is a nav mesh (you can think of two triangles if you like), gray is road, which has fastest speed green is swamp, which has slowest speed. Given the start point s1 to end point e1. The NavMesh algorithm will give the direct path p1 since it's translating within one mesh, no matter what the area cost is. But the actually shortest time path would be p2 get out of swamp, then travel along the road, finally get into the swamp again. Another example is s2 gt e2. The actually shortest time is the direct path, but the NavMesh would give the red path since each mesh only count once, without considering the path length. So for my use case, what would be a good path finding algorithm?
30
Are there any pathfinding algorithms that would handle different movement types? I'm developing a bot for a BattleTech board game simulator http en.wikipedia.org wiki BattleTech, it is turn based. The board is divided into hexagons, each one has a different terrain type and elevation. You drive a robot which moves over them, to destroy other robots. I only know Dijkstra and A pathfinding algorithms, but the problem is that there are 3 types of movements walk, run and jump several hexagons (each of them have their own rules). Walk and run are almost the same. The best path could be a combination or each movement type. Here is an example of map http megamek.info sites default files isometric view.png Do you know a good algorithm for this complex pathfinding or a way to combine A results for each movement type?
30
How do I create an animation without noticeable loops? I'd like to create vivid idle and passive animations for a creature, but I want to avoid the appearance of obvious loops in the animation and avoid the use of obviously identifiable pre baked animation clips. How can I accomplish this?
30
Scripting a sophisticated RTS AI with Lua I'm planning to develop a somewhat sophisticated RTS AI (eg see BWAPI). have experience programming, but none in game development, so it seems easiest to start by scripting the AI of an existing game I've played, Warhammer 40k Dawn of War (2004). As far as I can tell, the game AI is scripted with some variant of Lua (by the file extension .ai or .scar). The online documentation is sparse and the community isn't active anymore. I'd like to get some idea of the difficulty of this undertaking. Is it practical with a scripting language like Lua to develop a RTS AI that includes FSMs, decision trees, case based reasoning, and transposition tables? If someone has any experience scripting Dawn of War, that would also help.
30
Where will my character stop? Many years ago I coded some AI for a budget pseudo 3d game. There was one calculation which I never really figured out the best way to do, and that was calculating where the enemy would end up if it stopped now. For example The enemy is currently at X 540.0. The enemy is moving right at 10 pixels per frame. When the enemy wants to stop, it's speed will drop by 1 pixel per frame until it reaches zero. Is there a simple formula that would get me the position where the enemy ends up when he is fully stopped? I ended up precalculating and hardcoding the offset which worked for my needs but would have to be calculated separately for enemies with different speeds.
30
How do I make NPC pathfinding look believable? Is there an "academic" way to have NPC walking randomly on a map, but having a believable comportment ? The obvious scenario is a armed guard who is walking around a basement to secure it. It's quite easy to set up a "believable" path. What I'm looking for is a way to simulation a crowd in a small town, in fact. How can I make their move look like they aren't goalless robots.
30
Measuring enemy "success" against player I've been toying with an idea for a game prototype where the player must defend against waves of enemies, but between each wave the enemies "evolve" to better combat whatever tactics the player is using. Essentially each enemy type has some genetic information that can be used to generate their health, speed, attack type and so on with the more "successful" enemy types being mutated into new sub types, while ineffective enemy types are phased out. What I'm trying to figure out, is what is a good way of measuring "success" against the player? EDIT Although I don't really want to get too specific about the game mechanics, let's assume that the game world is complex enough that you cannot figure out if an enemy type will be effective against the player without testing it. So far I've thought of two basic solutions Use heuristics like whether a certain enemy deals damage to the player or survives a long time without being killed. The problem I have with this approach is that it can be exploited if (when) the player figures out how the algorithm works. For example you would be able to deliberately let the weakest enemies land a few free hits to trick the game into creating more of them. It may be possible to improve this with better heuristics however. Only use about half the pool of enemy types at once and swap types in and out randomly between waves. Analysis could then be performed on the player's performance throughout the wave and each participating enemy type would be considered equally successful unsuccessful. After a number of waves the success of enemy types would be varied enough to perform mutation deletion. This solution seems intuitively harder to exploit and it would also pick up on successful combinations of enemy types that might not be possible to detect by looking at individuals, however it might also result in anomalies where useless enemy types are considered successful because they happened to get assigned to waves with stronger enemy types backing them up. To clarify, I'm not asking about the actual process of evolving enemies, just about how to measure which enemies are successful against the player.
30
How is AI most commonly implemented in popular games? I'm no gamedev, I'm just a curious coder of not games. I wonder, how does AI work in popular modern games, say, FPSs? Is it based on hard coded rules? How much does it have in common with other kinds of AI (like the one which powers autonomous cars etc)? How do developers ensure the AI behaves naturally and is fun to play against? Stuff I've googled mentioned different derivatives of MinMax but failed to answer how AI deals with continuous, changeable world, for what actions states AI is rewarded and how it figures out its chance for success of different actions. I've also seen Machine Learning mentioned here and there but it seems it's not used in any serious game?
30
Where will my character stop? Many years ago I coded some AI for a budget pseudo 3d game. There was one calculation which I never really figured out the best way to do, and that was calculating where the enemy would end up if it stopped now. For example The enemy is currently at X 540.0. The enemy is moving right at 10 pixels per frame. When the enemy wants to stop, it's speed will drop by 1 pixel per frame until it reaches zero. Is there a simple formula that would get me the position where the enemy ends up when he is fully stopped? I ended up precalculating and hardcoding the offset which worked for my needs but would have to be calculated separately for enemies with different speeds.
30
How should I handle interrupting the current goal with goal oriented action planning? I'm reading about goal oriented planning for AI, but there I'm having difficulty finding an implementation so that I can address some questions that I have. Specifically, I don't understand how to handle scenarios in which an agent is in the middle of a goal, but then another goal gets calculated as higher priority. For example, suppose I have the following goals subgoals actions MineGold (goal) gt MoveToGoldMine (goal) gt MoveToPosition (action) gt SwingPickaxe (action) gt TakeGold (action) gt DeliverGold (goal) gt MoveToTownHall (goal) gt MoveToPosition (action) gt DropGold (action) AvoidEnemy (goal) gt MoveToHidingSpot (goal) gt MoveToPosition (action) gt Wait (action) AttackEnemmy (goal) gt MoveToEnemy (goal) gt MoveToPosition (action) When the game starts, my agent calculates its goal priorities and its highest priority is the MineGold goal. So it pushes the list of subgoals and actions for MineGold onto its planning stack. Suppose the agent moves to the gold mine, mines the gold, takes the gold, and then starts to move back to the town hall. While it's moving back to the town hall, an enemy soldier gets close enough such that the AvoidEnemy goal becomes higher priority than the MineGold goal. So now the agent pushes the AvoidEnemy subgoals and actions into its stack, ahead of the remaining DeliverGold subgoal. While the agent is avoiding the soldier, an enemy assassin sneaks up on his team's commander. The commander calls for help so the AttackEnemy goal becomes the highest priority. So AttackEnemy is pushed onto the stack ahead of AvoidEnemy. Eventually the assassin is killed, so the AttackEnemy goal is no longer valid and gets popped off the stack. Now the topmost goal is AvoidEnemy to avoid the enemy soldier. But if my agent just attacked the assassin, it would be weird for him to then start running away from the soldier (or maybe the soldier is already far away and I don't want to keep moving to a hiding spot), so I would rather him return to his original goal of DeliverGold. Here are my questions Am I correct in assuming that I should be periodically recalculating the highest priority goal and switching to the highest priority goal if it's different than the existing goal? Am I correct that when a new goal becomes higher priority than the current goal, then I should be pushing that new goal onto the stack ahead of the current goal, as opposed to overwriting the current goal with the new goal? Assuming I'm correct that new goals are additive, how do I handle this situation where sometimes I don't want an agent to return to certain prior goals? I know that I could accomplish this through a set of quot mutually exclusive quot flags or something, but that seems like an inelegant way and that it would start to return me to using finite state machines instead of goal oriented planning.
30
How is AI most commonly implemented in popular games? I'm no gamedev, I'm just a curious coder of not games. I wonder, how does AI work in popular modern games, say, FPSs? Is it based on hard coded rules? How much does it have in common with other kinds of AI (like the one which powers autonomous cars etc)? How do developers ensure the AI behaves naturally and is fun to play against? Stuff I've googled mentioned different derivatives of MinMax but failed to answer how AI deals with continuous, changeable world, for what actions states AI is rewarded and how it figures out its chance for success of different actions. I've also seen Machine Learning mentioned here and there but it seems it's not used in any serious game?
30
Running state in Behavior Trees What happens, in a behavior tree, when a priority node chooses another branch over a running branch? Small example Priority 1 Fight Sequence Enemy near? Fight! Priority 2 Move Sequence Is there a hole? Jump! Run 5m! Now in the first iteration there is no enemy, but a hole, so the action Jump! gets executed. It's a rather lengthy animation so it returns running. For what should happen in the next iteration I found kind of contradictory statements. According to this answer the priority node always begins at the first priority disregarding if another priority is running. In this article however while the examples follow the same scheme, the explanation also mentions that it's possible to lock the tree in the Running state until it's finished. If the tree is locked in the Running behavior, the character can't react until he walked all the way to his walking target, so this can't be the right interpretation. If always the first priority gets checked again, the character can react to enemies while he's running (he stops and fights) that's the desired behavior. If however he's in the air jumping, he can not just stop and fight, he has to land first, so this time I can't choose priority Fight over Move! How should I handle those cases? Am I even approaching it the right way?
30
Error in the order of the target points to be followed. How to set the order of elements in an array? I have a project where it has 1 NPC and 3 target points In the project I set the NPC to go to target point 1, then to 2, then to 3. Expected path Path that is occurring This problem did not happen out of nowhere, but first I will explain the creation of the target points. I created the first target point, added the components it needed, and then replicated it. Selecting the first target point and pressing CONTROL W. I positioned the second target point, and then, again selecting the first target point, I again replicated it. The order of the path was as expected. I modified some code (none of the codes I modified related to the NPC or target points). After that I created a new target point (replicating it from the first target point) and then my problem started. The NPC was initially going to target point 3, to the 4, 1 and then 2. Even excluding target point 4, the order did not return to the expected (1, 2 and 3). I inserted a print after the loop that causes the NPC to move toward the target points, so I could figure out the order of the target points, and it is making sense with the order of the path that is taking place. Blueprint Print 3 to 1 to 2. I created 2 more target points, and see how the order changes without any sense 4 to 5 to 1 to 2 to 3. I added another 1 target point to see if it meets a pattern No sense at all. I'd like to know how to set the order of target points in the array. EDIT 1 (Root of the problem) From what I researched, I came to the conclusion that the problem is due to the function Get All Actors Of Class (that I use to make the NPC follow the target point) It was also researching that I discovered that I can search for a specific actor using tags. Link where I made the discovery https docs.unrealengine.com en us Gameplay HowTo FindingActors Blueprints But this feature does not serve me, because I do not want to establish an exact number of target points, I would like the order of the path to be given by the name of the target points or at least by the creation order. EDIT 2 (today opening the project again, the order is correct) Correct order I suspected that if I added new target points, the problem would come back, but that was not what happened. Again the order is correct Even so, I'd like you to tell me if there is any way to know all the elements of an array, and thus be able to treat, set, and order them. For this problem may occur again at some crucial moment.
30
Multilevel 2D grid graph and A I've coded up a little grid based dungeon game. Everything working quite nicely in a Tile , . The AI uses basic GOAP for tasks and A for moving around. Tile reachability is done using a floodfill. Thinking about what my next step would be, I decided to change the art style from being the typical dungeon to a more sci fi approach and thought it'd be great to have multiple levels. This is where I ran into a problem because A in a 2d grid I understand. But adding extra levels makes it a wee bit harder. My initial thoughts would be to add connections to the next levels in 'stairs' or 'elevator' tiles and adding these to the neighbor list of a Tile for evaluation by A . But this throws my heuristic for a loop. I'm using Manhattan distance. TL DR How should I improve my heuristic for multi level path finding?
30
What is a convincing Berserker enemy AI finite state machine for a Roguelike I'm looking for a way to create a convincing Berserker enemy in a Roguelike I've been creating for some time. You may assume a game like NetHack for this when considering what kinds of actions can be taken and text messages that can be alerted. I ask this for two reasons I've been trying to solve this problem for over a year and have failed. Examples to follow. I see a general lack of examples on this SE that show what a mapping of an entity's states, in total, looks like. It would be helpful to the community to have such an example. What I need When I say Berserker I mean an enemy that can swing into a blind rage and attack other entities that it is in conflict with with violence and bloodlust. Not simply switching to attacking targets randomly, as is done in many RPGs. To this end, feel free to assume the addition of any status effects or buffs you wish. Just make sure you detail the pertinent information for those states. A berserk entity needs to express his rage in a way that isn't simply a status change with some strength increases. This is a very shallow solution to the problem. The entity doesn't end up feeling like a Berserker at all. What I've Tried I've tried 3 different ideas over the last year. And none of them satisfy. A solution to the problem could be all new, or a 'fix' for one of these. I am mainly including them to get the juices flowing. The first thing I tried was a simple Berserk state that increased the strength of the entity, randomized its target (from list of enemies), had him shout obscenities, so on. Once in this state, the enemy would remain in it until death. The next thing I attempted was really a modification of the above. The enemy felt very flat, and there was no way to calm him or knock him out of his rage which seemed unrealistic. I added the ability to calm (with a spell and other effects) and also added a condition that would return the enemy to a normal state, from which he could transition to others such as fleeing. This created more depth, but made the Berserker state seem even more shallow and less destructive. From here I scrapped it all and aimed for something more emergent. Essentially a buff that the enemy could cast on itself based on a transition state. Once cast, this would change the enemies behavior (for targeting) and increase their damage while randomly issuing insults from the enemy. Then, he could enter any other states and stay enraged. So he might flee, but still taunt. He might heal, but still be enraged and deal lots of damage. This is better, but the underlying issue still remains. He doesn't really seem berserked, just pissed. Mainly because you typically encounter the enemy alone, and not with other enemies the berserker doesn't like, so the randomization aspect is down played. How else can I make the guy seem Berserked, and not just pissed foul mouthed? I realize this is a borderline list question. So I impose these requirements It must be a very detailed complete answer that shows all the states and conditions for transitioning. And it must be more than a guess. You should test this in your own roguelike, or it should otherwise be obvious why this is a probable 'best' solution at getting the idea of Berserk status across. I also won't take offense if this is closed. I realized it dances the edge.
30
Logic for enemy chasing main player I'm making AI to tell a minion to chase and attack the player. I played Magicka, and the minion follows the player in a nice curved manner (left image), rather than what I currently have (right image), where the minion just keeps reacting the the player's changes in X,Y. The code I have makes the chasing minion appear to move in a blocky way as it keeps trying to have its coordinates the player's coordinates if (enemy.pos.x lt game.data.playerX) enemy.body.vel.x enemy.body.accel.x me.timer.tick else enemy.body.vel.x enemy.body.accel.x me.timer.tick if (enemy.pos.y lt game.data.playerY) enemy.body.vel.y enemy.body.accel.y me.timer.tick else enemy.body.vel.y enemy.body.accel.y me.timer.tick How can I achieve a more smooth transition effect?
30
Reynold's Steering Behaviors So I read Reynold's 1999 paper, Steering Behaviors For Autonomous Characters 1 , and I presume something went over my head, because it doesn't seem to make any sense to me. steering force truncate (steering direction, max force) acceleration steering force mass velocity truncate (velocity acceleration, max speed) position position velocity Not sure how this makes any sense. Unless there's a constant time step of 1s, this integration (a forward Euler, which is bad in it's own right), doesn't make much sense to me. The behaviors themselves don't seem to make much sense either Seek desired velocity normalize (position target) max speed steering desired velocity velocity The desired velocity is in the wrong direction? Should be (target position)? It also doesn't return a force it returns a difference of velocities. It doesn't scale at all with mass. Arrival target offset target position distance length (target offset) ramped speed max speed (distance slowing distance) clipped speed minimum (ramped speed, max speed) desired velocity (clipped speed distance) target offset steering desired velocity velocity This just doesn't make any sense to me. This will flat out not work. Sure, you'll eventually get a vector pointing away from the target, but depending on the vehicle's mass, may not be able to stop it in time. It's also dependent on an arbitrary slowing radius not tied to the objects max thrust, max speed, or mass. Like Seek, it also doesn't actually return a force. I stopped reading after that. Clearly there is something I am missing here..
30
What technique should I use for the AI for Go? I am currently undertaking a project where I need to program AI for Go (the Asian strategy game) and I would like to know, how do I start? I am aware of the many approaches to AI for their applications to Go, such as the neural network, machine learning (supervised learning, etc), the Monte Carlos method, or knowledge based AI. I am more interested in machine learning however I am short on time as I have about two months to complete it. I am also considering minimax and alpha beta pruning with brute force as a compromise in case I don't have enough time to do anything else. I am fully aware that it is not the best way to go about this but if I am short on time then I have no other choice.
30
Do higher level 'Pure AI' concepts (such as Neural Nets or Genetic Algos) ever get implemented successfully in commercial games? Although graphics is my main area of focus, I've been dabbling with Game AI concepts for quite some time now from simple A path finding to intricate Perceptrons.. My question is this Does anyone have any examples of successful (or perhaps more interestingly, failed) implementations of some higher level AI concepts in large scale commercial titles? By higher level, I mean methods of simulating intelligence that are usually found in Pure AI.. For example.. Neural Networks Genetic Algorithms Decision Theory I understand that as well as a financial budget, developers also have a budget of memory usage (with AI often taking a back seat). Many of these methods are costly to implement and provide limited returns.. I am just intrigued to find out if anyone knows where or when any of these (or any other high level concepts that I've forgot to mention) have been deployed in any well known games ) I also know that in this industry, trade secrets are a fact of life ) Aside from the AAA titles, if you have any of your own success stories (or disasters) it would be nice to hear them! D
30
Collaborative Diffusion vs. A for loose armies combat any clear winner? Collaborative Diffusion (CD) takes a lot of the work that A does and combines (writes) it cheaply for multiple agents to read cheaply. This is because the majority of CD's processing works via a simple CA diffusion approach that produces a single shared map for every agent to use on a given game update. Agents then perform hill climbing within that space, which is also very cheap. The primary downside is that the data structure created by CD must apply for all agents that is, each agent's subjective view of the environment is identical A OTOH needs a path calculation per agent, each frame. In spite of this, the relatively low cost associated with CD would seem to make it, on average, a far more suitable approach than A , even when we must create unique views for agents (comments experience on this are welcome). EDIT Consider the following example using Collaborative Diffusion Two armies are on a battlefield, each army emitting a uniform scent. They charge (climb the scent gradient), and as the two lines clash, each agent takes on the first, closest enemy agent on the opposing line. This happens because on each approach step for each unit, it checks whether it's yet adjacent to an enemy if so it locks on attacks indiscriminately. This is much freer than specific targeting, which is where A would seem to be a better choice. Am I correct in these assumptions? Are there other downsides to CD as opposed to insert your flavour of A , for selecting ANY target between large groups?
30
Best next step for game AI implementation I have recently finished a small framework that employs agents governed by a small hierarchical finite state machine, however I have quickly discovered the drawbacks of this approach. Namely the fact that increasing numbers of behaviours call for an exponentially complicated rule base to govern the switches. It occurs to me that there is probably a much better way of coding AI, where they have overall goals and can assess new information with regards to this. I did some research but was a little overwhelmed by the amount of methodologies, and for that matter the lack of information about which techniques are more commonly used and which are best for certain situations. what would be a good next implementation methodology for a 3rd 1st person shooter? such as a neural network or GOAP.
30
Problems with Obstacle Avoidance steering behavior I learned how to implement the Obstacle Avoidance steering behavior from this tutorial. The approach depicted in this tutorial (simplified) is this (note that I'm using rectangular OBBs for obstacles, not circles) The entity that avoids obstacles will have a 'ahead' vector, representing the entity's 'sight'. It will be equal to the velocity vector, but scaled to some length (the "sight distance"). For each entity in the "sight distance" radius from the entity, we check if it contains the the 'edge' of the ahead vector, marked with a red dot (actually the vector itself treated as a point) For an entity that contains the red dot, we calculate the vector from the center of the entity to the red dot This vector (scaled by a scalar MAX AVOIDANCE FORCE) is the avoidance force. We apply it on our entity, and it should avoid the obstacle. However, what happens in practice after applying the force is this As you can see, the entity is about to get stuck on the obstacle. That's because it doesn't sense it's about to collide, because the obstacle doesn't contain the edge of the 'ahead' vector. So what would be a good solution to this problem? How should I implement the algorithm?
30
Efficient way of training a chabot AI I am currently working on a chatbot game using Python 2.7.10. I use the Chatterbot library. This library seems to do all I need but the training data (or corpora) are very very limited. I haven't quite decided what the game is going to be like. I was thinking of doing something where the bot contacts you on behalf of a assassinated police inspector and asks you to help it solve the case. But I am still at the stage where I am experimenting what can and can't be done using a chatbot. An alternative to this game would be a simple "guess who" kind of game. I had a look online expecting to find a lot of every day conversation chat logs especially made for training chat bots. But I could only find a few logs of quiet random conversion (mostly on programming). I thought of using plays and film scripts but that requires a lot of editing. What recommendations would you have. I basically need strings lists in which each string is a response to the previous one. I can also train pairs of question answer.
30
Approach to AI in Entity Systems We are making game using Entity Systems. And we with my colleague have different opinions about what approach is better when doing AI. Basically, he thinks that everything should be a system, where I'm not. That is his way Systems Sensor System (look for a target) Pathfinding System (find a path to a target which will be colliding between agents with high probability) Attack System (attack target if in attack range) Movement System (advance path to target, resolve colliding if can't advance) There is my proposal Systems Attack System (find a target with hp gt 0, write to Target component and attack if in range) Movement System (find a path to target (if there isnt already) and advance) Utility classes Sensor Pathfinding There is problem with first approach. For example, 10 units all choosed one target and attacked it (simly because it was closer). But in reality 3 units are sufficient to kill that target in an instant. So, why other 7 should attack this target too? When they choosed their target they doesn't known yet that 3 unit would suffice. They know now that target hp lt 0 but they can't choose another, because Sensor System finished his work already. If we want to fix it then problem will be in unreasonable complexity of Sensor system. Where in latter approach we simply wouldn't select target if hp already lt 0. Similarly, in first approach pathfinding will find paths which are colliding between them. When one unit taken grid cell another can't take it. That means he must forget his path. But he can't build a new, because Pathfinding system already finished his work. So, he advances one cell in direction of target. In latter approach, we will build path in respect to new positions of units. Maybe there are another problems in both approaches which we couldn't foresee. So, please say something if you know. Which way are better (both clear code and good AI)? Maybe both are wrong then please advice what is right way to make it.
30
Using MCTS in Unreal Engine I have been making a turn based board game in UE4 and have come to the point of making a first pass on the AI. I planned to use Monte Carlo Tree Search but this requires you to make (at least) one copy of the game state for each simulation. I am guessing that I will have to do hundreds of simulations per move. I am fairly new to UE4 but the problem is that there isn't really a separation between view and logic (at least the way that I have programmed it!). For example I have actors which contain their static meshes, current material etc as well as their logical state. I think in UE4 to create a real deep copy I would have to spawn new actors etc. Obviously in hindsight I have made a big mistake and should have realised this earlier so that I could have switched to a different engine, but too late for that now. Neither of the ideas that I have come up with are good 1) Implement a special copy function which sets the static mesh etc to nullptr. I am not sure how Unreal will react to creating all of these actors but not spawning them in the level, my experience up to now suggests not well. 2) Make AI versions of all classes e.g. an AIUnit class which can be constructed from a normal Unit class but only initialises the minimum required data. I think this would work but it would be painfully inelegant with the obvious downside that I will essentially have to maintain two almost identical games and keep the rules in sync. MCTS with UE4 doesn't seem to have many hits on google so any advice would be appreciated, I am willing to sacrifice some dead time e.g. wait 1 second every turn for AI "thinking" time.
30
Creating a path including loops and spirals I have a paper airplane that I would like to take a "random" path towards its destination based on the game layouts size. I want it to include spirals and loops and gliding a little back and forth. How would I go on about creating those random movements?
30
Poker AI's designed for casual play DISCLAIMER So I asked this on StackOverflow and was told it was not a good question for the community but was suggested to check here. If this question sucks or just doesn't belong here either, feel free to let me know. It seems a fair question to me, but I know it's important to maintain high standards on these sites. So I just put the finishing touches on a poker game in JavaFX. Part of the functionality in this program is a single player mode, where you can play hands against the computer. To be transparent, this is a university project, so I'm not aiming for perfection. More, just an ai that behaves semi intelligently for game variation and minor challenge for casuals. So to be clear, I am aware of general poker strategy, and have found numerous articles research papers links on more in depth poker AI's designed to compete against competitive players. I guess as an analogy, there's the Easy mode bots in League of Legends, then there's the deep learning AI that beat a DOTA pro in laning. I'm definitely aiming for the former here. While I currently have a basic algorithm that works as if(gamestate flush, straight, 3 pair, full house, face card pairs) raise 1 4 pot else if(gamestate pair, potential flush or straight, etc) check call else fold So I already have functionality that can detect current board hand states, but I do not have any functionality that can estimate chances at winning the hand, compare with opponent's possible hands, etc. Since the game only needs to be for casual play, the more advance algorithm's seem like massively overkill. I guess my wishful thinking hope is that something exists similar to min max in tic tac toe, although poker is obviously more complex. But something that can make some kind of rough approximation of hand value, that wouldn't require thousand's of if statements to cover every possible situation. So if anyone knows of any algorithms that would be used in, for example, a poker phone game or such, I'd really appreciate some help. To reiterate, if this question is too vague, I'm happy to provide any other information about my existing research, program design, or anything in this vein.
30
Interrupt on behaviour tree I'm using a custom Behaviour Tree library (not UDK or any other engine) so I'm wondering on the best way to cause an interrupt to a currently running node. I don't have decorators or parallel nodes in this library so looking for a different way to do it. I don't care about the specific reasons as to why the interrupt is needed. In general it just needs to tell the currently running node to stop running so the tree can be transversed again and that would find out the reason as the main "threats" would be checked. I'm trying to think of a clean way to cause such interrupts in the tree. Generally the conditions that are already in the tree would be the reason for the interrupt (IsEnemyInRange, IsThirsty, IsHungry, etc) but if a node is running over multiple frames these don't get checked. Any ideas given the above limitations I listed?
30
Reynold's Steering Behaviors So I read Reynold's 1999 paper, Steering Behaviors For Autonomous Characters 1 , and I presume something went over my head, because it doesn't seem to make any sense to me. steering force truncate (steering direction, max force) acceleration steering force mass velocity truncate (velocity acceleration, max speed) position position velocity Not sure how this makes any sense. Unless there's a constant time step of 1s, this integration (a forward Euler, which is bad in it's own right), doesn't make much sense to me. The behaviors themselves don't seem to make much sense either Seek desired velocity normalize (position target) max speed steering desired velocity velocity The desired velocity is in the wrong direction? Should be (target position)? It also doesn't return a force it returns a difference of velocities. It doesn't scale at all with mass. Arrival target offset target position distance length (target offset) ramped speed max speed (distance slowing distance) clipped speed minimum (ramped speed, max speed) desired velocity (clipped speed distance) target offset steering desired velocity velocity This just doesn't make any sense to me. This will flat out not work. Sure, you'll eventually get a vector pointing away from the target, but depending on the vehicle's mass, may not be able to stop it in time. It's also dependent on an arbitrary slowing radius not tied to the objects max thrust, max speed, or mass. Like Seek, it also doesn't actually return a force. I stopped reading after that. Clearly there is something I am missing here..
30
AI remembering obstacles without a grid For some research purpose I've build a small tanks game where you have 1 tank controlled by a player and one or more NPC tanks. Now I want these NPC tanks to navigate through a field which they have no knowledge of. They can detect obstacles if they are in a certain range. If they detect those obstacles they should save them in a certain data construct that's easy to query. So that they can take them in account in pathfinding. Now here is where I'm stuck if my field would be a grid (level discretized in tiles) it would be quite easy for me, I would just save which tiles the obstacle is on. But I haven't really worked with a grid, my tanks just move forward a few pixels depending on their speed, so a tank can be located on any pixel combination. Is this bad game design? I could probably make a grid just for my obstacles, but that restricts a bit the kind of obstacles I can have. Any suggestions tips ? Please ask more information if needed, I was not really sure what to include.
30
Understanding the Seek steering behavior I'm currently studying steering behaviors. Have recently learned about Seek. I have a question about this. Seek is supposed to turn the agent slowly in the direction of it's target, and then move in that direction. However, I don't understand how Seek turns the agent around slowly. It seems to me like it should make the agent change direction immediately. This is the code for a Seek function Vector Seek(Point target) Vector toTarget new Vector(target agent.getPosition()) Vector desiredVelocity toTarget.normalize() agent.getMaxVelocity() return desiredVelocity.subtract(agent.getVelocity()) And then here is the update() function of the agent. void update() Vector force seek(target) Vector acceleration force.divideBy(mass) mass 1. velocity velocity.add(acceleration) position position.add(velocity) Anybody mind explaining to me where the gradual change of velocity takes place? Thanks
30
Space Invaders type game Keeping the enemies aligned with each other as they turn around? OK, so here's the lowdown of the problem I'm trying to solve. I'm developing a game in PyGame that's a cross between Space Invaders and Columns. I'm trying to make the motion of the enemies similar to that of the aliens in Space Invaders that is, they're all clustered in a grid, and if even one hits the side of the screen, the entire formation moves down and turns around. However, the motion of these aliens is continuous (as continuous as a monitor can be, anyway), not on a discrete grid like in the original. The enemies are instances of an Enemy class, and in turn they're held by a 2D array in a enemysquadron module (which, if you don't use Python, is in this case essentially a singleton due to the way Python modules work). Inside the Enemy class I have a class scope velocity vector that is reversed every time an Enemy object touches the edge of the screen. This won't do, though, because as time goes on the enemies just become disorganized and jumbled (i.e. not in a grid as planned). I haven't implemented the Enemies going downward yet, so let's not worry about that right now. Any tips?
30
Making the AI take different paths to each other I have a top down 2d game where the AI spawn at the edges of the map and run towards the center. I'm using A and a node mesh to do the pathfinding. Right now, the AI spawn at a point on the edge of the map and all take the same path which is the shortest route to the center. Now I want them to be more surprising and interesting and take different paths to each other. I can immediately think of two ideas for doing this but wanted to know if there are other ways or better ways that people often use? When one enemy spawns and generates a path to the center, temporarily increase the cost of all the nodes on that path, then slowly decrease them back down over time. Then the enemy AI that spawn later will be forced to take a wider path. The above approach will lead to AI just taking a wider and wider path though and still be very predictable. So I thought I'd also introduce a number of intermediate goal nodes around the map. When the AI spawn they randomly pick one of the intermediate goals and head there first before heading to the center of the map. Combining this with the above approach of increasing the costs might look pretty good? What approaches have people found work best to getting the AI to vary the paths they take, look convincing and surprising?
30
Conditional priority in behavior trees I want to trigger behavior based on certain conditions. I currently just have a sequence that runs different behavior, it triggers on condition but always in sequence. When the first condition is met it runs that. Let's say I have 2 behaviors. Flee from threat and find food if hungry. Usually the flee from stronger threat prevails and thus is placed early in the sequence. But what if the entity running the behavior is starving, it can take more risk. Since the flee from threat comes first in sequence and triggers on a threat it will never pick to gather food if there is a threat present. I guess I need something like a scoring system and let the tree pick the best option. Is this common in behavior trees? How is it called or best implemented? I'm using gdx.ai in particular and perhaps there is something out of the box I can use. I can make a task in the behavior tree that weighs all the possible actions but this ties everything together and bt's are widely used for the opposite.
30
How would intensive AI pathing be done server side in an MMORPG? Take WoW or Runescape for an example. You have an incredibly large map, filled with cities and forests, each filled with people and monsters. Monsters roam around an area at random that is 25x25 tiles big (ambiguous). This is done server side, so every player than comes across this area sees the same location of the same monster, and when a player attacks kills that monster other players see it too. How is this calculated without being a massively intensive task? If you have 500 different types of monsters, all of which have 5 maximum spawned, you'll be calculating 2500 different paths continuously.
30
AI of Turn Based game using Entity System approach I just recently learned about Entity Systems and want to try it out on a real example (I was developing a game recently and want to try to port it over Entity Systems). But I got problem right away. Actually that is two questions in one. First would be In traditional OOP approach I had game loop which was picking action to do for idling units every 100ms (so called 'turn'). But rendering obviously was run at every game loop iteration. How should I do that? Maybe I need something like individual interval for systems to run? Like RenderingSystem running every Update while AI Systems are running each 100ms. Or maybe there is some better approach which I should use? Second question would be about about these AI Systems I understand how to make AI which will manage every unit completely individually. However I have somewhat simultaneous pathfinding for all units which will do Mark units that should start moving as 'moving'. Find path for every 'moving' unit to it's target (basically closest enemy). All 'moving' units aren't considered as obstacles for path but all not 'moving' units considered as obstacles. Try to move every unit one step at it's path. If can't make step (someone is already standing there) then mark path as invalid (to recalculate at next AI iteration) and move one step in direction of target (if there is free nodes). Mark all 'moving' units as not 'moving' Besides there is addition 3. Before making step we will check if we have enemy around us and instead of moving we will attack that enemy. So, one AI iteration required to give action to each unit which will be run until it finishes. Then AI should give next action. How I can make that in Entity System approach? Because in ES all systems are run one after another where I need to "jump" beetween them freely. Or maybe I'm overcomplicating things and should do something different instead of "jumping" between systems?
30
How do I end a behavior tree's action early without evaluating the entire active branch? I'm reading about behavior trees, and one of the common recommendations I've seen is to maintain a reference to your running action so that you don't have to traverse the entire tree during every game loop. Without traversing the entire tree every time, how do I check if an action should end early? For example, suppose I have the following tree and the AI encounters an enemy that's closer than 10m, so he starts to aim his weapon. But then while he's aiming, his HP drops below 50 . I would want the agent to stop the aiming firing sequence and move to the "use medkit" action. The only way that I can think of to accomplish that sort of behavior is to evaluate every node in the active branch starting from the root node during every game loop. But based on what I've read, evaluating the entire active branch every game loop is discouraged. Is there a way to be able to abort an action if a higher level node is no longer valid, while not spending a lot of processing power evaluating the entire branch every game loop?
30
AI Learning vs. Strategizing I have a theory on AI that I would like to write a "whitepaper" about. The distinction I want to explore in AI is learning vs. strategizing. My question is, where can I read other material about this subject? Let me give a chess example. Let's look at a chess AI as a max tree, where capturing an enemy unit adds that unit's value to the "move score" for that decision (and likewise losing a piece subtracts that value to the score). Capturing a pawn might net 1 point, a knight 4 points, a rook 5 points, etc. Strategizing would be AI to apply these points and determine the next move eg. given ten possible moves, pick the best (max score) at the end of three moves. Learning would be applying statistical observation to determine those values. If you play 100 games, the AI might decide that capturing a pawn is 2 points, and a knight is worth 7 points, while a rook is only worth 3 points (based on 100 gameplays). Does this distinction already exist in literature, and if so, where can I read about it? Edit Does anyone know a Chess game (with source code preferably) that utilizes this approach? Maybe Chess960 Home?
30
Getting a Ranged AI "In Range" to shoot In my game, ranged units and melee units have the same behavior. Ranged units try to maintain a fixed distance r, from their targets. If they're within r d of the target (where d is a small value) they stop and shoot it. Note that this means the ranged unit can't be closer than r d. Melee units are the equivalent of ranged units, but with r set to zero. Right now, my AI for ranged units is as follows Find a path to the target using A . Walk along the path until you are within r d, r d of the target. Stop and shoot. If the target is dead, quit. If you are still within r d, r d , goto 3. Otherwise, move away towards the target until you are within r d again. Goto 4. Here's a sort of diagram. My problem is, if there are obstacles and the target moves, step 5 causes a lot of problems. Ranged units will end up backing into walls, unable to shoot. If instead of going to step 5 I go back to step 1 (planning a path), the problem still isn't solved, because walking toward the target will only decrease the range, not increase it. How can I get ranged units to successfully follow and shoot their targets?
30
UDK game Prisoners Guards For school I need to make a little game with UDK, the concept of the game is The player is the headguard, he will have some other guard (bots) who will follow him. Between the other guards and the player are some prisoners who need to evade the other guards. It needs to look like this My idea was to let the guard bots follow the player at a certain distance and let the prisoners bots in the middle try to evade the guard bots. Now is the problem i'm new to Unreal Script and the school doesn't support me that well. Untill now I have only was able to make the guard bots follow me. I hope you guys can help me or make me something that will make this game work. Here is the class i'm using to let te bots follow me class ChaseControllerAI extends AIController var Pawn player var float minimalDistance var float speed var float distanceToPlayer var vector selfToPlayer auto state Idle function BeginState(Name PreviousStateName) Super.BeginState(PreviousStateName) event SeePlayer(Pawn p) player p GotoState('Chase') Begin player none self.Pawn.Velocity.x 0.0 self.Pawn.Velocity.Y 0.0 self.Pawn.Velocity.Z 0.0 state Chase function BeginState(Name PreviousStateName) Super.BeginState(PreviousStateName) event PlayerOutOfReach() Log("ChaseControllerAI CHASE Player out of reach.") GotoState('Idle') class ChaseController extends AIController CONTINUED State Chase (continued) event Tick(float deltaTime) Log("ChaseControllerAI in Event Tick.") selfToPlayer self.player.Location self.Pawn.Location distanceToPlayer Abs(VSize(selfToPlayer)) if (distanceToPlayer gt minimalDistance) PlayerOutOfReach() else self.Pawn.Velocity Normal(selfToPlayer) speed self.Pawn.Acceleration Normal(selfToPlayer) speed self.Pawn.SetRotation(rotator(selfToPlayer)) self.Pawn.Move(self.Pawn.Velocity 0.001) or deltaTime Begin Log("Current state Chase Begin " GetStateName() "") defaultproperties bAdjustFromWalls true bIsPlayer true minimalDistance 1024 org 1024 speed 500
30
Entity's FSM and exposing internals of the entity I'm trying to implement FSM according to Programming Game AI by Example, it is a pretty standard and straightforward FSM that goes like similarly to this (some stuff omitted and translated from C to C , hope it's fine) class StateMachine lt Entity gt Entity owner State lt Entity gt state void StateMachine lt Entity gt (Entity entity) owner entity void Update() state.Execute(owner) class State lt Entity gt Entity owner void Execute(Entity owner) if (owner.Foo) owner.Bar() class Entity() public type Foo private StateMachine lt Entity gt stateMachine public void OnStart() stateMachine new StateMachine lt Entity gt (this) public void Bar() My problem with this state machine is that the because the state machine is not part of the class anymore (as opposed to, let's say, the naive "switch" "if else" implementation), it is necessary to expose internal logic of the Entity (e.g. variable Foo, method Boo()). Is this the right way to do it? What if the the Entity class grows, how does it scale. Is it really necessary to keep exposing more and more variables creating getters setters? How are these FSMs implemented in larger projects?
30
Approaches to partner trick taking card game AI I am creating an android game out of a partner based trick taking card game. What are some generic approaches to AI players for these types of games and what are the advantages disadvantages of each?
30
How can I maneuver an AI pirate ship for a sea battle? I'm trying to picture in my head what would be required to make an AI controlled enemy do the following in a top down pirate sailing game Approach the player ship Bring player in line with port starboard guns Keep guns trained on player Be able to manoeuvre around obstacles Not cheat acceleration to achieve the above When I first started thinking about the idea it was quite simple, but the more I think about it, the more complex the requirements become with the major problem being the AI calculating perfectly the curve required to come up along side the player, or to better yet, make a pass along their bow stern before coming along side without needing to let them quickly speed up slow down to achieve this.
30
Enemy evolution in shoot em ups Are there any shoot em ups in which the enemies actually evolve as a response to their relative success against the player? By evolve, I mean that each enemy has some genetic information encoding their behaviour. Enemies which last longer or do more damage are allowed to mix their genes to create new enemies. This way the enemies would become better adapted to the particular player.
30
Problems with Obstacle Avoidance steering behavior I learned how to implement the Obstacle Avoidance steering behavior from this tutorial. The approach depicted in this tutorial (simplified) is this (note that I'm using rectangular OBBs for obstacles, not circles) The entity that avoids obstacles will have a 'ahead' vector, representing the entity's 'sight'. It will be equal to the velocity vector, but scaled to some length (the "sight distance"). For each entity in the "sight distance" radius from the entity, we check if it contains the the 'edge' of the ahead vector, marked with a red dot (actually the vector itself treated as a point) For an entity that contains the red dot, we calculate the vector from the center of the entity to the red dot This vector (scaled by a scalar MAX AVOIDANCE FORCE) is the avoidance force. We apply it on our entity, and it should avoid the obstacle. However, what happens in practice after applying the force is this As you can see, the entity is about to get stuck on the obstacle. That's because it doesn't sense it's about to collide, because the obstacle doesn't contain the edge of the 'ahead' vector. So what would be a good solution to this problem? How should I implement the algorithm?
30
Choosing a heuristic function for RPG character's AI I am designing an AI for mouse and cat. So they have HP, and cat will chase and eat mouse, mouse will eat cheese. This eating action will help them to gain HP. If they can't eat food, they will die if they use up all the HP. So I searched through books and I have a basic algorithm for this. def chooseAction(actions, goals) Go through each action, and calculate the discontentment. bestAction actions 0 bestValue calculateDiscontentment(actions 0 , goals) for action in actions thisValue calculateDiscontentment(action, goals) if thisValue lt bestValue bestValue thisValue bestAction action return the best action return bestAction def calculateDiscontentment(action, goals) Keep a running total discontentment 0 Loop through each goal for goal in action Calculate the new value after the action newValue goal.value action.getGoalChange(goal) Get the discontentment of this value discontentment goal.getDiscontentment(value) struct Goal value def getDiscontentment(newValue) return newValue newValue This algorithm is quite easy to understand, and quite easy to implement. So I have to determine Goal and goal value for each action they take. Let say a mouse, He may want to move, eat. So I have to come up with a value(wiliness) for these values. What is a good way to determine these values? My approach is here. Ley say my mouse have a view range of 3 cells and it can only walk in four directions up down left and right. The goal eat value may determine by its MAX ENERGY and NOW ENERGY and I come out a formula eatValue MAX ENERGY NOW ENERGY. This make sense because, it NOW ENERGY is equal to MAX ENERGY, my mouse has a wiliness 0 to eat. What is a good way of come out this simple formulations? What will be the good heriustic for my mouse to move?