Tag Info

New answers tagged

1

You could do this by teleporting the player around - in the case of a staircase, after reaching a certain point just reposition the player several steps back. Of course, the environment would have to be crafted in a way so that the player doesn't notice it (that is, when he looks around in both locations (place where the teleport is and the place he gets ...


1

If the enemy paths are not very dynamic (Dynamic would be every couple agents are attacking different targets and paths to those targets have to be updated every couple frames) Then I would do a combination of flowfields and steering behaviours if performance is your main concern. There are some more complicated subjects involved like space partitioning ...


1

So @tkausl's answer worked, the player now moves smoothly along the predefined path, here is the updated code: Edit: Bonus WebM of it working if (pathFound) { // A path has been found const float unitsPerTick = 8; // Speed in Units per tick auto waypoint = waypoint_queue.front(); // The waypoint in use Vector2i movementVector = ...


2

Your problem is, you're applying all waypoints in the same frame, which makes the character appear at the last waypoint directly, without moving at all. What you have to do is take on waypoint per frame and move only this one step. Or, better yet, move a bit in direction of the first waypoint, then, if you're near enough, discard the first waypoint. ...


3

This is a pretty interesting question, and i'm going to try to contribute with what I can. First, I think you have to clearly define the boundaries for the game you are trying to create, and define those questions (some may already been answered). How far the is the monster aggro ? How many monsters at the same time is your target? How is your terrain ...


2

Use a standard A-star algorithm, modified to consider all possible orientations as you remove each node from the Openset. There are two possible implementation choices here: Test for suitability of each <neighbour,orientation> tuple before pushing it to the priority queue; or Test for suitability of each <neighbour,orientation> tuple after popping ...


0

I'm curious to hear if there's a more elegant solution, but I feel like brute force may be the best. Basically try to go down all the paths recursively, under each possible rotation orientation - assuming you only have a few rotation angles. Something like, if you reach a spot you can't continue to path through, but there is a gap, try rotating to fit ...


2

Alexandre gave a good answer. I thought I'd take a stab at a concrete example. The example is is C#, but hopefully it is general enough to be implemented in any language you choose to use. using System; using System.Collections.Generic; public class SimpleGraph { private int _numberOfCities; private int[] _paths; public SimpleGraph() { ...


8

I would suggest you start by building a node graph (a bunch of nodes and arcs (sometimes called edges)). The nodes are the cities and "dash" intersection The arcs link cities and "dash" intersection Then all these nodes have info like their 'physical' location (x/y coordinates on the map). To solve your issues: you use the position that are set in ...


2

At 4096 nodes, it's probably not an issue. The pathfinding should be fast, and the resulting paths will be pretty small. The simplest approach to reduce the number of nodes on the paths is to first find the path on the grid, and then use "string pulling" to eliminate most of the nodes from the resulting path. If you're working with a large grid you might ...



Top 50 recent answers are included