Tag Info

New answers tagged

0

The problem with arrays is that they can not resize dynamically. When you exceed the initial capacity, you need to allocate a new array and copy the whole array over. When you want to remove an entry in the middle, you need to move all entries after it down by one. These are both very expensive operations when your array is large. The List class is an ...


2

Flocking behaviors is the way to go. This link gives a great explanation on how to code flocking in really any game engine.


4

First of all please read Array versus List: When to use which? for coverage of this issue from a general perspective. Now to focus on your case, I would recommend a list if: You don't know how many enemies you will have in advance (and don't want to worry about handling resizing) You would like to remove enemies from the middle (and don't want to worry ...


0

I'm not sure that I'd call what you describe Event Driven BTs, but then again, driving a BT fully with events is no small feat. Addressing your specific issue, you're right. If you have a unique scheduler you'll run into ordering issues as you've shown. The answer is to have hierarchical schedulers, to support parallel nodes. In your example, you'd have ...


0

It sounds like what you want is named delegates. If I understand it correctly, your actions are just a call to a function in an existing component. Then all you need is to store a member function pointer and a pointer to the component, instead of a custom class. You can do this directly with member function pointers, or wrap it in a delegate class. It would ...


0

Probably the easiest way is to alter the A* heuristic. Once a tile has been used in a path, increase the heuristic for this tile so that the next pathfinding call will try to avoid that tile. This will also make the zombies gather around the player.


0

One of the possible solutions would be to disable unit collision in such tight spots. For example in the Starcraft game, workers (SCVs, Probes, Drones) don't collide with each other when mining crystals.


0

If you've been looking at steering behaviours you've probably seen this page which is by the guy who first came up with steering behaviours. If you want to know about the general background of how steering behaviours work that's the best place to start. The steering behaviours were implemented by the same chap in a library called OpenSteer which was ported ...


4

Since your AI is steering based it's pretty simple. You need to weigh your forces based on how important they are. The closer you get to obstacles the more important they should be, otherwise chasing should be the most important. There are a couple different ways to implement it, but I always found having some "max force" worked best where you iterate over ...


1

This sounds similar to polyomino puzzle solving, which I've played with... With a 10 x 10 grid, you can reasonably do an exhaustive search for each shape. Starting from the top left, and going to the lower right, try to set the shape onto the grid. If it contradicts one of the known misses, discard it. If it overlaps some of the known hits, rank it as more ...



Top 50 recent answers are included