Tag Info

Hot answers tagged

15

Behaviour trees are getting pretty big in the industry right now. Halo 3 uses them extensively for their AI (Halo 3 - Building a Better Battle). Alex Champandard seems to be a big fan as well (Lots of articles on it on AIGameDev.com). For code examples, take a look at: ...


13

It's probably safe to say that BDD, like TDD, or (insert trendy development buzzword-paradigm here) is used by some game developers somewhere, but they probably don't know they are nor would they neccessarily be able to identify what BDD actually means. The question is really how much they use it and how much do they have to use it for it to matter to you? ...


7

See the image I provided in my previous answer: If you imagine that node 1 is 'Evade Enemy' and node 2 is 'Chase Enemy', you'll see that even though in the second iteration (when everything is green except for '2' and 'B' is when the second iteration starts), 'Evade Enemy' still gets checked first. Only when 'Evade Enemy' fails, because there are no ...


7

Avoidance This makes an object avoid obstacles that may be hindering it while it navigates to a goal. Perfect avoidance would never allow objects to overlap. Separation This deals with the situation when avoidance fails to keep objects apart. This often occurs 'between frames': an object can move into a new position that overlaps other objects because the ...


5

Based on your description it appears key[LEFT] = false; and key[RIGHT] = false; are never reached. The if-condition for that piece of code reads if(ev.type == ALLEGRO_KEY_UP), however the key down handling code's condition looks like this: if(ev.type == ALLEGRO_EVENT_KEY_DOWN). Without knowing any Allegro, I suggest you use ALLEGRO_EVENT_KEY_UP in the key ...


5

A behavior tree is essentially a sub-type of a (possibly non-deterministic) state machine. Behavior trees are used not because they can do something FSMs can't, but because they are simpler to follow and understand for us humans. Generally, AI has tons of states, and behavior trees are used to make them understandable. Other management, on the other hand, ...


5

Look at it like this, an enemy entity (clearly something in need of AI) is something that needs a behavior of some sort. We need this behavior to be conditional and not totally predictable. A behavior tree (with weighted-random chances when making a choice) is a good fit for something like this. Now let's take a look at a gun. This clearly is not an item ...


5

(Optional) The navigation mesh approach is just an extension of the waypoints approach, that allows "wandering". In other words, you can use your navigation mesh to get back to a waypoint graph, by taking the centroid of each polygon in the navigation mesh. (If you are pre-generating the navigation mesh, you can just store the original source points; this ...


5

Add an intermediate layer. You have some kind of PlatformInput that manages all the different input methods and generates low-level events like KeyUp, KeyDown, etc. Another layer then processes these messages into logic events, like MoveUp, Jump, etc. It can do this by receiving the inputs, mapping keys to logic events, and doing only the most basic ...


4

The common answer you'll get is "with components". There are lots of questions with that phrase in them that you can search through. In particular, here's a good article that has been linked to several times that's worth a read: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/


4

Your problem is: !1 == -2, not !1 == 0. Try this instead: val = tmp * X1; val += (1 - tmp) * X2; This works because: 1 * x = x (1 - 1) * x = 0 * x = 0 ----------- 0 * x = 0 (1 - 0) * x = 1 * x = x As suggested by Nathan, to make the code more compact you can use lerp. The equation for lerp is (a * (1 - c)) + (b * c) which is ...


4

If you want a behavioral psychology answer, then here's one - if the player isn't sure if he'll win the next game, he's more likely to try one more game. If he lost, he thinks "Maybe this I'll be lucky". If he won, he thinks "Ooooh that was awesome, one more". You actually need a 50/50 win/loss ratio to keep the players engaged. The effect is basically the ...


4

Rather than making a separate function for every combination of nouns and verbs, you should setup an architecture where there is one common interface that all the objects in the game implement. One approach off the top of my head would be to define an Entity object that all the specific objects in your game extend. Each Entity will have a table (whatever ...


4

I think your soldier may be decomposited into mind and body (and whatever else). Subsequently, body may be decomposited into legs and hands. Then, every part needs its own behaviour tree, and also public interface — for requests from higher or lower level parts. So, instead of micro-managing every single action, you just send instant-shot messages like ...


4

It wouldn't really make sense. Behavior trees have their conditionals at the leaf nodes. Those conditionals determine if the traversal will continue to the other leaf nodes in that parent, or move back up to the other parent nodes. You seem to be talking more about decision trees, where it's expected to have logic in the parent nodes. You can learn more ...


3

This is the way I see it, but really this is a decision you need to make based on what types of conditions/actions/behaviors you have. Actions: Running a function to process data. For example finding a path with A*. These happen in the background and aren't seen by the user. They usually happen in a single frame, but can stretch to a few frames if needed. ...


3

Behaviour trees are a really great way to manage AI, and Ai Game dev is the best place to learn about them! There are tonnes of example implementations out there on places like Codeplex, or even AIGD's own Sandbox engines implementation (which admitedly is fairly complex and can be hard to follow). Last year at the game AI confrence there was alot of ...


3

I've never written a trainer myself, but I would guess that they operate by editing specific locations in the game's memory. Access to the game's address space can be gained by DLL injection or by using a debugger-style API like WriteProcessMemory. To alter specific aspects of the running game (health, points, resources etc.) you have to figure out exactly ...


3

Jeremy, My game Neptune's Pride is a super simple space strategy game. The object of the game is capture half of all the stars in the Galaxy so you have to wage war on your neighbors to capture them. The game gets interesting when you realize you aren't going to be able to take on all the other players without allies. You'll need friends to trade tech ...


3

I'd advise to just write it with regular branching in your shader code. The D3D shader compiler is extremely good at taking code like this and converting it to a non-branching equivalent in bytecode, and can also detect cases (they're rare but they do happen) where a branching solution is actually faster than a non-branching one. You definitely shouldn't ...


2

One technique you should be familiar with in any case is the action list approach. At the simplest level, it's just a list of action objects, which each action object has its update() method called each frame. You can quickly expand on this however to allow blocking actions, multiple lanes of actions, child groups, etc. Just about anything you can build ...


2

One think I think is important is to seperate why an agent wants to acomplish something from how it does it. Goal-orientated Action Planners do this well, but there are also other solutions. This gives you great flexibility for constructing agents as you can pick and choose from a bucket of goals and a bucket of actions. Behaviour trees are designed to ...


2

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? Forget about ...


2

While it is, of course, possible to implement animations within an AI architecture, it would be a poor methodology for a number of reasons. One such reason would be an agent that chooses to walk but cannot for some reason. Another reason would be needless complexity (many decisions would have to implement an exact-copy of an animation node because they ...


2

Here are my thoughts: Movement: you can do with path finding,if you find it hard to implement as an algorithm start with simple logic (while move if hit wall do...), and after that try to create a simple algorithm to make it more efficient. The A* algorithm seems to be the best for path finding. If that's too hard use "zombie movements" (if ...


2

One option is as Nathan's comment, just identify when and where the values need to be cleaned up and do it manually there. If you implement callback on the edges of a FSM rather than just the nodes, meaning chunks of code that are run on transition, then you can have a specific implementation of an edge from any of the Tree states to Idle allowing the idle ...


2

Laying in bed last night, I had something of an epiphany as to how I might go about this without introducing the complexity I was leaning towards in my question. It involves the use of the (poorly named, IMHO) "parallel" composite. Here's what I'm thinking: Hopefully that's still fairly readable. The important points are: the Sit down/*Delay*/Stand up ...


1

A win rate of 50% is the only number a matchmaking system can possibly aim for. As an example, if the system were set up to create matches in which players have an estimated 60% chance of winning, then from the pigeonhole principle, it follows that there must be a probability of at least 20% of the match ending with both teams victorious. League of Legends, ...


1

There are other, more powerful factors than just "reward". In the case of competive multiplayer games such as LoL the most important one is the social component, you will likely have friends who play LoL too, and that alone will make the player much more likely to continue playing even if they are fed up with it. Another is the overcoming of challenge, and ...


1

Generally there would be no need to "swap" out trees. Build all your behaviors, add in your sequences and selectors to make your tree for your ai agent. Then for special case stuff you add decorators to stuff where needed. One big tree, per agent "type" so a soldier type would have a tree with patrol, attack etc etc and a miner would have a different ...



Only top voted, non community-wiki answers of a minimum length are eligible