Tag Info

Hot answers tagged

12

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


8

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: ...


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

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 ...


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

(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 ...


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

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 ...


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

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 ...


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

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, ...


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 ...


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 ...


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

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 ...


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 ...


1

Yes, a rules engine can be used for complex AI, at least to some extent. Unfortunately, game AI rules engines are apparently rather rare. Most of my Google searches on the subject turned up results unrelated to games or just questions regarding using it in games (including this question). I only found a few games described as using rules engines. One of ...


1

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 ...


1

As a rule of thumb there is no right or wrong way of doing the rendering, it all depends on your architecture and game. Rendering is usually done outside of the component based system, despite this you will either reference your models from a renderable system where the updates on position will be done or the models will fetch the latest animations frame ...


1

You could make a two-dimensional grid made of Array of IElement type. I imagine String or int would be enough for an element's name/id (e.g. "Diamond" or "Chest"), but your request for the game being easily upgradeable implies elements may have some state or even a functionality. The IElement would be an interface with following methods: 1. canSwap ( ...


1

The dimensional problem you address is quite normal and nearly unavoidable. You want to find a way to express your entities that is both coincise and flexible. A "container" (the bush in the jhocking answer) is a coincise way but you see that is not flexible enough. I do not suggest you to try to find a generic interface and then use configuration files to ...


1

Is it? Maybe. My opinion would be that it would make for a very poor fit for entertainment software generally, although it might work well for the low level libraries. EDIT: Here's some justification for my opinion. Wikipedia defines BDD as a technique that "encourages collaboration between developers, QA and non-technical or business participants in a ...


1

There's plenty of prior art in the whole MUD and MUSH culture, with many open source platforms. Many MU*'S include support for adding behaviors/actions on the fly--i.e. admin users can create new commands via scripting. Then there's Inform7, which is arguably the state of the art for IF or and single-player, text-based games today.



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