LibGDX Shader does not work with FBO texture I have a shader and I want to run the shader on the whole rendered image at the end instead of each individual sprite that I render on screen. For this purpose I created an FBO, I render the all my images to the FBO and then I render to colorBufferTexture generated by the FBO. There is just one problem, the shader does not work when I render the FBO texture. The withoutFbo() method render the image with the shader working just fine, but the withFbo() method only renders the image without the shader. Also I know that the shader in withFbo() is working because if I try to render something other then the colorBufferTexture from the FBO the shader will work. So why isn't the shader working with the texture generated by the FBO? public class Application3 extends ApplicationAdapter float time Sprite sprite FrameBuffer fbo SpriteBatch batch Texture noiseTexture TextureRegion fboTexture ShaderProgram shaderProgram Override public void create() ShaderProgram.pedantic false batch new SpriteBatch() sprite new Sprite(new Texture("game.png")) sprite.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) shaderProgram new ShaderProgram(Gdx.files.internal(Shader.GLITCH2.getVertex()), Gdx.files.internal(Shader.GLITCH2.getFragment())) noiseTexture new Texture(Gdx.files.internal(Shader.GLITCH2.getPath() "noise.png")) noiseTexture.bind(0) fbo new FrameBuffer(Pixmap.Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false) fboTexture new TextureRegion(fbo.getColorBufferTexture()) fboTexture.flip(false, true) Override public void render() withFbo() withoutFbo() void withoutFbo() Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) time Gdx.graphics.getDeltaTime() shaderProgram.setUniformi("u noise", 0) shaderProgram.setUniformf("u time", time) batch.setShader(shaderProgram) batch.begin() batch.draw(sprite, sprite.getX(), sprite.getY(), sprite.getWidth(), sprite.getHeight()) batch.setShader(null) batch.end() void withFbo() Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) time Gdx.graphics.getDeltaTime() fbo.begin() batch.begin() batch.draw(sprite, sprite.getX(), sprite.getY(), sprite.getWidth(), sprite.getHeight()) batch.end() fbo.end() shaderProgram.setUniformi("u noise", 0) shaderProgram.setUniformf("u time", time) batch.setShader(shaderProgram) batch.begin() batch.draw(fboTexture, sprite.getX(), sprite.getY(), sprite.getWidth(), sprite.getHeight()) batch.setShader(null) batch.end()


How to split a screen in half using LibGDX without scaling? I am currently working on a racing game with libGDX and I need to split the screen in half for a two players mode. (Player 1 in first half and Player 2 in second half). I already have Camera1 that will follow Player 1's car, and Camera2 that will follow Player 2's car. Basically, I want the first half to show Player 1's car and the second half to show Player 2's car. I have been searching for a while online for a way to split screens with LibGDX and found how to split the screen in two with this code Left Half Gdx.gl.glViewport( 0,0,Gdx.graphics.getWidth() 2,Gdx.graphics.getHeight() ) Right Half Gdx.gl.glViewport(Gdx.graphics.getWidth() 2,0,Gdx.graphics.getWidth() 2,Gdx.graphics.getHeight() ) However, it squeezes the screen into the right half, which is not what I want. Is there a way to split the screen without squeezing it?


Why is my texture drawn in a different place when in fullscreen? I'm trying to draw a texture (with a crescent moon) in the middle of the y axis public void draw(SpriteBatch batch) batch.draw(lune, 0, Gdx.graphics.getHeight() 2) It renders this when windowed And in full screen mode I don't understand why it doesn't work since I'm always drawing at the top of the middle in the y axis. I add a little update to what i do exactly Override public void resize(int width, int height) this.levelDatas.screenWidth width this.levelDatas.screenHeight height this.levelDatas.lune.updateSize(width, height) My render method Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL10.GL COLOR BUFFER BIT) this.levelDatas.batch.begin() this.background.draw(this.levelDatas.batch) this.levelDatas.lune.draw(this.levelDatas.batch) this.levelDatas.batch.end() ... And this is the updateSize and draw method for the "Lune" object public void updateSize(int width, int height) this.widthScreen width this.heightScreen height public void draw(SpriteBatch batch) batch.draw(new TextureRegion(lune), 0, this.heightScreen 2, 0, 0, this.lune.getWidth(), this.lune.getHeight(), 1f, 1f, 0) Still got the problem !


Box2D fixed timestep updating is twitchy on constant FPS I'm messing around with libgdx and box2d and I'm trying to implement sidescroller movement with fixed timestep logic according to the famous Fix Your Timestep! tutorial guide. However, logic updating seems to be twitchy and I'm not exactly sure why. Here's the render method where the issue lies public void render() handleCameraInput() handleTestBodyInputImpulse() handleTestBodyInputVelocity() accumulator Math.min(Gdx.graphics.getDeltaTime(), STEP) int logicStepCount 0 while (accumulator gt STEP) world.step(STEP, VELOCITY ITERATIONS, POSITION ITERATIONS) accumulator STEP logicStepCount Gdx.graphics.setTitle("FPS " Gdx.graphics.getFramesPerSecond() ", Logic steps " logicStepCount ", Test body vel " testBody.getLinearVelocity()) cam.update() update box2d world camera Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) renderer.render(world, cam.combined) renders box2d bodies From what I've noticed the logic while loop responsible for updating the physics sometimes doesn't execute (counter goes from 1 to 0 for one frame) and that seems to be causing the twitching. This is weird to me since delta time added to the accumulator is clamped and since the FPS is constant 60 on my machine I'd assume that the loop should always execute once. Am I doing something wrong? Is this behavior normal and is it something I am supposed to solve during rendering with interpolation? Complete minimal example can be found here on Gist and can be run on any LibGdx project with Box2d dependency.


Using Delta for a stopwatch, delta too fast than real time seconds I search for methods to create a stopwatch on libgdx and came across with this public void trigger(float delta) playTime delta playTimeRounded ((double)Math.round(playTime 100) 100) Gdx.app.log("deltaTime", delta "") But its not accurate and its much faster. How can i create an accurate stopwatch?


How do I manually make a .pack file like TexturePacker (without using TexturePacker)? I am using libGDX and apparently the only way I see for creating a UI is with texture packs. I would say that since a texture pack is nothing more than JSON or XML file and a large png I could manually code a texture pack. How?


How can I create a button with an image in libGDX? I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize it. I have put TextButtons in my app and it works and resizes fine too. Any suggestions ?


How to set orthographic camera for libgdx I have implemented a basic demo of camera but it is not showing any sprites on screen. I cannot figure out what's wrong with my code. public class MyGdxGame extends ApplicationAdapter private int width, height private OrthographicCamera camera private SpriteBatch batch private Texture roboTex private Sprite roboSprite private World world private Body robot Override public void create() width Gdx.graphics.getWidth() height Gdx.graphics.getHeight() world new World(new Vector2(0, 0f), false) camera new OrthographicCamera() camera.setToOrtho(false, Constants.viewportWidth, Constants.viewportWidth (height width)) camera.update() batch new SpriteBatch() textures roboTex new Texture("Images robot.png") roboSprite new Sprite(roboTex) roboSprite.setBounds(0,0,3,6) Override public void render() batch.setProjectionMatrix(camera.combined) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) batch.begin() roboSprite.draw(batch) batch.end() Override public void resize(int width, int height) float screenAR width (float) height camera.setToOrtho(false, Constants.viewportWidth, Constants.viewportWidth screenAR) camera.update() batch new SpriteBatch() batch.setProjectionMatrix(camera.combined) Override public void dispose() world.dispose() roboSprite.getTexture().dispose() batch.dispose() Did I missed anything??


How to use Actors Groups with ShapeRenderer instead of Batch? I am intersted in using Actors and Groups on a Stage so that I can make components and subcomponents which draw relative to their parents, but I intend to do my drawing with a ShapeRenderer instead of a Batch. From what I understand of an Actor, the batch which is passed in to the draw() method has all of its matrices set up properly so that I can just use a coordinate system WITHIN THE PARENT to lay out the subcomponents. But it seems that this coordinate system is focused on Batches, and I want to draw using a ShapeRenderer. What do I have to do to get the child Actors to draw themselves RELATIVE TO THEIR PARENT (rather than in global coordinates) when drawing them with ShapeRenderers? Also, one other question How should I be managing begining ending the ShapeRenderer? I am currently passing in a reference to a global ShapeRenderer when I construct my parent object, and this parent object passes in references to each of its children. Should I be calling begin() end() separately in the draw method of each parent child actor? Or should I call it in my main app's draw() method, so I'm only calling it once each frame?


How to create a Pixmap from an OrthographicCamera in LibGDX I am trying to create a picture based on what one of my OrthographicCamera can see. LibGDX has a ScreenUtils class that has a getFrameBufferPixels method, but it does not what I want as I want to get only what one camera sees, not the whole screen.


How can I check if a player drawn line follows a path? I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for tracing the letter A. if((traitSprite.getX() lt Invisible.X amp amp traitSprite.getX() gt Invisible.X )) ... (traitSprite is a sprite.)


Player customization of entity and handling textures I'm developing a racing game where you can customize your vehicle with pre made textures and also user generated ones (players can add assets to the game). I want to know what you think is the best approach to this type of customization. Use pre packed textures and load the corresponding atlases for every single part (I think this is the easiest, but wastes memory having 3 or 4 atlas in memory and just using one texture of each). Check what the user selected and pack those textures into an atlas at runtime and use that until the user changes any part and pack it again, and so on... (more complex, less gargabe in memory). Take into account that customizable parts include wheels, spoilers, hoods, decals, exhausts and the user also has the possibility to add content. I've never implemented something like this so any help would be appreciated.


Using Box2d to model rotating turret I would like to model a rotating "turret" on top of a tank like object in 2D from the side view like pictured here tank with turret http uofitorn.net static images tankwithbox2dturret.png Notice the faint outline of a gun protruding to the upper left courtesy of libgdx's debug renderer (the actual gun sprite is not being rendered). How do I best implement this using Box2d? Should I use two bodies? If so, how? Or one body with two fixtures? I tried using two bodies connected by a Revolute Joint, but the turret "gun" does not maintain a constant angle but instead rotates down until it is vertical and then just hangs there. Or should I not model the turret aspect of the tank in box2d at all?


LibGDX, Box2D , Destroy body into parts I am developing a game using libGDX game engine and box2d physics engine. There are asteroids in my game, I want to destroy their bodies randomly and fill with texture. How can I do it?


What causes undefined geometry to be drawn? I am currently using the polygonSpriteBatch of libgdx to draw triangles, rectangles and a concave polygon as border. After adding the concave polygon for the colored borders everything seems to break and random geometry appears (sometimes even with a gradient). Some Examples Here you can see on the left everything looks good and after drawing the additional rectangle with its border and removing the other borders you can still see some weird red regions. This is even more extreme. On the left part of the concave polygon is drawn with a different color, and after it despawns (on the right) there is still part of it left and other triangles not created by me are drawn. I am quite confident that all convex polygons are defined in counter clockwise ordering. In the past I had trouble with providing the correct TextureRegion and it still doesn't feel like my current implementation is how it should be, but it worked for simple rectangles and triangles. Currently I have a (3px) (3px) Region and all polygon vertices are between (0f,0f) and (3f,3f). Because I define all triangles of the polygons myself the short array given to the PolygonRegion for a rectangle looks like this (0, 1, 2, 3, 4, 5) and the corresponding Vector2 polygon array like this ((0.0, 3.0), (0.0, 0.0), (3.0, 0.0), (0.0, 3.0), (3.0, 0.0), (3.0, 3.0)) I experienced even more artifacts when executing this on android and for some reason drawing a small rectangle for each vertice (for debugging) fixed some of the artifacts above. This is quite a complex problem but I hope somebody knows what could cause such a behaviour.


Using a vector to measure an angle relative to the screen camera My game is supposed to have an object that changes it sprite depending on which way the mouse faces. programming this has become a challenge, because I want to calculate the angle relative to the center of the screen using the X axis. To explain what I mean, pretend that under a sprite in the center of a screen is a protractor. I want to measure the angle that's formed between the cursor and the center. If I use the X axis as a base, I should get an angle between 180 and 180 . How would I achieve this? I've tried vector.angle(reference vector), but that doesn't seem to give the desired result.


undo touchdown in LibGDX with scene2D i'm making a game in libgdx and i have a question. I have a Button from scene2d. If there is a touchDown event on this button, i want the touchUp event only inside my button. Now if i touchDown a button, then swipe outside my button, libgdx consider this like a touchUp. I know that i can extend stage and work with it, the question is if there is a simple way to do this...


What are some techniques used for mouse tracking, with a bit of "emulated lag"? I am trying to implement a system, where the cursor (in my case the player's avatar) is always about 1.5 seconds (a configurable interval) behind where the mouse actually is. If I change the cursor's location every time through, I get an emulated mouse cursor with no delay, I'm wondering if there are any pre canned type of solutions I can throw at this before I "roll my own." Source code or even just basic steps you've used would be helpful.


Path finding algorithms? I posted this question on stack overflow first, but I guess no one is very interested in video games there... What are some path finding algorithms used in games of all types? (Of all types where characters move, anyway) Is Dijkstra's used a whole lot? I would think not, as it doesn't actually trace out the steps to take to get somewhere, right? If I'm understanding it right, it only determines which object is the closest. I'm not really looking to code anything just doing some research, though if you paste pseudocode or something, that would be fine (I can understand Java and C ). I'm basically looking for a quick overview of path finding in general. I know A is like THE algorithm to use in 2D games. That's great and all, but what about 2D games that are not grid based? Things like Age of Empires, or Link's Awakening. There aren't distinct square spaces to navigate to, so what do they do? What do 3D games do? I've read this thingy http www.ai blog.net archives 000152.html, which I hear is a great authority on the subject, but it doesn't really explain HOW, once the meshes are set, the path finding is done. IF A is what they use, then how is something like that done in a 3D environment? And how exactly do the splines work for rounding corners?


Would A or Dijkstra be more proper for a grid based tactics game? In a grid based tactical game (think Fire Emblem), would A or Dijkstra be more proper for finding a path to use for enemy AI to determine the best place to move? A has a better performance that Dijkstra, however Dijkstra may offer me better smarter looking results for an AI. If possible, I'd like to have the answer for both a hexagon based grid, and a rectangle based grid, if it'll make a difference.


Overlaying grid for pathfinding My game is not grid based, so units can be at any arbitrary coordinate and move at different speeds. My obstacles are all rectangular and axis aligned, so naturally it makes sense for me to overlay a grid over the map for pathfinding. Each unit will take up a grid cell (floor(unit.x CELL SIZE), floor(unit.y CELL SIZE)). I will then run standard A grid based pathfinding on the grid. The problem is that although the path is grid aligned, the unit movement is not. Thus, in the midst of moving, the unit might end up colliding with a cell that is blocked, and get stucked. Here's a picture to illustrate I'm trying to get from point A to point B. B is the center of the grid cell, since it is a waypoint from the found path. A is the point the unit is currently at. The pathfinder thinks A to B is valid movement, since it takes the grid cell of A as the start point and the diagonal neighbour B is not blocked. But moving from A to B might result in position C, which is blocked. I thought of using a soft collision radius for pathfinding, but it has its problems. The pathfinder will not return any paths where there's a soft collision. So if the current location of the unit already has a soft collision, the unit cannot move! It seems that it is necessary to keep the pathfinding collision and physics collision identical... How do I resolve this problem, and what is the standard way to overlay a grid for pathfinding?


Simple Stupid Funnel Algorithm (SSFA) for 3D Navigation tl dr I need an algorithm similar to SSFA except for portals with 4 vertices (or n vertices if an algorithm like that exists). I'm working on a game that requires pathfinding in 3 dimensions. By this I mean agents have full control over their position as opposed to many games where agents only control forward, back, left, right, and need to walk up stairs or ramps to go up and down. To do this I made a "nav mesh" using an octree that checks for collision at each region, and subdivides if there is a collision (until a certain cube size limit). So I now have a graph where each node is a cube with some size based on the octree. Using this I can run the A algorithm for pathfinding on the graph. Unfortunately, just moving towards the center of each node looks bad, and even moving towards the center of each connecting face of the node (the smaller of the two connected node's adjacent faces) looks bad. In the past, I've used the SSFA for path simplification, but it only applies to situations with an edge as a portal, not a face. Is there an algorithm for this, or is there a way to make my pathing look better? Ninja edit I'm already somewhat using steering behaviors, but since the center of nodes can vary wildly, based on the complexity of the octree, it still doesn't look nice.


Basic A star implementation tutorial Possible Duplicate Pseudo code examples of A ? Hey guys Iam making a TD game and now I am stucked in implementing A star algo. I know there are many 3d party softwares but they are difficult to understand and modify. I want to make own for my game. I need a step wise programming tutorial for implementing A OR if someone has basic snippet. I am using unity and c .


Tiled based pathfinding in a 1 or 2 dimensional array As far as I know all tile based map editors export a JSON object containing one dimensional arrays. While most pathfinding libraries tutorials are only provided for two dimensional arrays. Also if for example I would like to do pathfinding in this one dimensional array and this array is huge i'm geussing this would cause performance issues. So why is it that most tile based map editors output a one dimensional and how should I handle those regarding pathfinding? example tile editor http elias schuett.de git Online Tile Map Editor Just google pathfinding to find all the two dimensional patfhfinding tutorials


Restrict A pathfinding to overlapping "safe zones" within map I've been bashing my head against this idea for a few days without luck, I'm hoping someone sees something I don't. So I have a 2D map containing walls and obstacles, and I have a unit that navigates through it (A and funnel algorithm). So far so good. Now, for gameplay purposes, I need to limit the movement of this unit to circular safe zones that I can place on the map. Think of them like cell towers, the unit has to stay within range of at least one tower, with the max range dictated by the tower (possibly different for each tower). Effectively, imagine drawing a set of interlocking circles over the map, and the unit must remain within that. Now for the complicated part. The map is a constrained Delaunay triangulation, not a grid, so the triangles that A is using can vary in size and shape. With a grid, I could imagine limiting individual grid cells by circle distances, but in my case these triangles could be larger than any one circle. There could even be cases where the start and end points of a path are within the same triangle, but because of the network of circles, an indirect path would have to be chosen to stay within the circles. The only option I can think of involves adding these circles into the triangulation as additional edges, altering the map. This would mean rebuilding the map triangulation each time a player adds or removes these circles, and would require that I maintain a separate copy of that triangulation per player. And since these circles don't care about map walls, I'd have to alter my triangulation method to allow edge splitting and removal, to prevent overlapping lines from rendering the triangulation invalid. I feel like there has to be another way to do this. I've considered Running A purely on the circles first, then placing that intermediate path on the map and re pathing it to avoid obstacles. Finding all of the circle intersections between the start and end points, and treat those lines as portals that I must pass through, somehow altering the A pathing to prioritize passing through them. Performing a regular path search on the triangulation, but forcing a dead end whenever entering a triangle that is too far from a circle. Then refining that path to conform to the circles themselves. Each of these have issues, or scenarios where they fall apart. Has this been done before? Any input on how this might possibly be achieved would be appreciated. Edit Adding an image to show what I'm trying to accomplish. The red lines show the path that A would generate using just the map triangulation. The green lines show the desired path, taking the circle bounds into account.


Finding N shortest paths I know about several of path finding algorithms that exist depth first search, Dijkstra's algorithm, A etc. Now I would like an algorithm that gives me the N paths with lowest cost. Can this be obtained by some simple modification of one of the above? Or is a different algorithm needed, and if so which?


How can I navigate to a target between bodies moving along fixed paths? The problem An autonomous ship starts at the outskirts of a solar system, and wants to move to a moving target, which is one of the planets. There are also many other planets moving at the same time, and these should be considered the only obstacles. I want to find the optimal path to the target. To keep it simple, the world is 2D, and the planets are moving in uniform circular motion around the sun as opposed to how planets actually behave. Also, assume the ship knows pretty much everything about the world. Most importantly, the location, speed, and orbit radius of every planet. With complete knowledge, this seems conceptually simple. For any planet and any time, you can find its location by doing some fairly simple math. But how would you apply this to pathfinding? Would it be just to pathfind in 3 dimensions x, y, and t? In theory this makes sense, but I think working that out to an actual solution would involve a lot of complications. Is it really as simple as 'setup a on a grid with x,y,t values'?


How can I compute the shortest path in Euclidean environments with non convex polygons? Can someone suggest papers or algorithms about calculating shortest paths in Euclidean spaces with non convex polygon as obstacles?


How should I use Monte Carlo method to simulate some police cars that keep patroling in a tile based map? I have a tile map (isometric) and I have some police cars that they patrol all the time on the map, there is some building and other cars in map too so they are considered as constraints in my shortest path algorithm (below). I use to randomly select some target for each police car and use A algorithm to find the path to the randomly selected destination tile and this cycles over and over. because cars should move all the time! (except those that gamer should control) The problem is police cars routes are correlated and they do not just traverse the area randomly, for instance, they do not usually cover a same area or they do not repeat their own route so my implementation based on some random destination point wasn t a good idea and the result was not satisfying. Take a look at the following picture, it shows how randomly selecting the destinations worked for me, obviously, it is a dumb patroling for sure, even a cockroache could do better! Suddenly, I remembered Monte Carlo Method and I thought it would solve my problem, because it exactly does what I wanted to do, However may be I should use Zobrist Hashing since it is tile base in nature. Does anyone has any idea how should I use this kind of methods? Question in Brief How can I use Zobrist Hashing or Monte Carlo method to set destinations points for my patroling car (like police car)? If anyone knows another way to implement a patrolling method, he she is very welcome to post an answer, I am not sure if Zobrist Hashing is the best and worth to implement. First Edit (added following paragraph) I need to distribute the cars and their destination points in a homogeneous manner. Every kind of solution that get me close to a good pattern could be my answer, of course there is a lot of methods to do so, but I dont have any clue.


Simple bare bones path finding routine I have a 2D grid with a number of cells. I need to find a path from one cell to another. There are no obstacles or opponents, and all cells are identical. What is a SUPER SIMPLE routine to calculate the shortest path? I have read about A and other routines, but they are waaaaaaaay overkill in my case at this point. (Maybe I will need them later, in the future.) Thanks!


Roguelike corridor creation Connecting rooms I have a simple Tile , that I populate with Rooms. Now I need to connect the rooms with a single tile wide corridor. At first I used A to hook up the rooms but that, of course, get's the best path from tile to tile, but that's a bit boring. So I decided to roll my own path walker, which very inefficiently get's me the same paths currently as A except for some reason it never reaches the end tile. I was planning to add a randomness to it by adding a random chance to go in a random direction for a few steps before going back to it's route. public static List lt Tile gt GetPath( Room startRoom, Room endRoom, Tile , map, int drunkenStep ) Select random tile from the wall list Tile startTile startRoom.wallTiles UnityEngine.Random.Range( 0, startRoom.wallTiles.Count) Tile endTile endRoom.wallTiles UnityEngine.Random.Range( 0, endRoom.wallTiles.Count) startRoom.wallTiles.Remove( startTile ) endRoom.wallTiles.Remove( endTile ) Make it a floor tile startTile.type RoomType.FLOOR endTile.type RoomType.FLOOR startRoom.floorTiles.Add( startTile ) endRoom.floorTiles.Add( endTile) Add the start tile to the list Tile selectedTile startTile List lt Tile gt path new List lt Tile gt () path.Add( selectedTile ) List lt Tile gt tilesToCheck new List lt Tile gt () do loop four times for each adjascent tile for(int i 0 i lt 4 i ) int x selectedTile.x Convert.ToInt32( selectedTile.adj i .x ) int y selectedTile.z Convert.ToInt32( selectedTile.adj i .y ) x y because 2D map. Tile y is for height displacement Check if we are within bounds if( x lt 0 x gt map.GetLength(0) y lt 0 y gt map.GetLength(1) ) continue We cant back track through a room and only use tiles that aren't set yet if( map x,y .type RoomType.NONE (map x,y .type RoomType.FLOOR amp amp map x,y .roomId 1) ) tilesToCheck.Add( map x,y ) float minDist Mathf.Infinity Vector2 endPos new Vector2( endTile.x, endTile.z ) foreach (Tile t in tilesToCheck) float dist Vector2.Distance( new Vector2( t.x, t.z), endPos) if (dist lt minDist) selectedTile t minDist dist path.Add(selectedTile) tilesToCheck.Clear() while( selectedTile ! endTile ) return path Right now this never resolves and i'm not entirely sure why it doesnt reach the end tile. So my question is What is going wrong and what should I do to get straighter corridors and maybe some drunken randomness maybe have a path loop around a little bit Thanks for your time!


2D Top Down Can't follow the path accurately In my game, there are many agents. Agents request a path, then after attaining a path to "goal" they follow the path. However player and many other things in the world can impact their position by pushing them or pulling them. When agents get pushed and they happen to advance forward closer to "goal", I want them to smartly follow the previously given path. I have pictures below to enhance your understanding of my situation. I COULD recalculate path every a few seconds or when agent gets out of path BUT I have DOZENS of these little agents. I don't want to do path finding for DOZENS of agents again, again, again, and again whenever they walk out of the path.


Navigation Mesh, Chunks and Funnel Algorithm I am building a little RTS like game as a side project and I am currently working on pathfinding. My approach to pathfinding is heavily inspired by things I saw in the Starcraft II map editor, which enables diagonal obstacles. My map consists of tiles that are subdivided into 4 triangles each and each triangle can be passable or not passable. I then build a navigation mesh by generating polygons (with holes) of the passable area and then triangulating them. See the following pictures for an example The colored areas are the triangulated polygons that make up the navigation mesh. As an optimization I thought it would be a good idea to subdivide the map into chunks (i.e. 32x32 grid tiles) to allow for fast updates of the mesh (as soon as a triangle changes from passable impassable I rebuild the whole chunk and update the navigation mesh accordingly). See the following picture for an example The red lines are the chunk borders (which is also why the color of the navigation mesh sometimes changes accross the borders). The triangulation is a separate constrained delaunay triangulation for each chunk. For the chunk wise updates to work I had to introduce constraints at the chunk borders for the triangles to line up. Up until now everything seemed to work fine. I then went to implement some pathfinding using A on edge midpoints and path smoothing using the Simple Stupid Funnel algorithm (see "Efficient Triangulation Based Pathfinding" by Demyen and Buro or How does the Simple Stupid Funnel Algorithm work?). The problem is now that some triangles have their vertices at chunk borders that don't correspond to an obstacle. If such a triangle is part of a path found by A the funnel algorithm uses it if it was a corner point of an obstacle and produces a wrong path. See the folowing picture for an example The red area is the passable area and has no obstacles inside. The green path is the path as it is found by e.g. A and the blue path is the smoothed path using the funnel algorithm. Since there is an extra vertex in the navigation mesh introduced by the the chunk borders (where the 4 chunks meet) the funnel algorithm handles it the same as if it was the corner of an obstacle and thus the path is not a straight line but takes a detour around the corner. Ultimately I wanted to implement something along the lines of "Compromise free Pathfinding on a Navigation Mesh" by Cui, Harabor and Grastien to find truly optimal paths in a navigation mesh. But all of those methods seem to assume that the navigation mesh contains no extra vertices except for the corners of obstacles (and the outer border of course). I am looking for a solution for the problem of splitting the map into chunks for efficient updates of the navigation mesh while still being able to find optimal paths in an efficient manner (e.g. i don't want to do real line of sight checks instead of the funnel algorithm). My only other option it seems would be an algorithm for dynamic constrained delaunay triangulations and having a single triangulation for the whole map (since this would not introduce extra obstacles) which for one is pretty complicated and second (and more importantly) doesn't scale. I know that this is a pretty open question. I hope it comes clear what I am looking for, since it was kind of difficult to phrase the problem D If anything needs clarification, please tell me D


How to generate a navmesh from a set of 3D meshes from scratch I've found a great article on how to build a constrained delaunay triangulation that can be used to create a simple navmesh from cutout geometry. However, this does not seem sufficient to generate a high quality navmesh from any arbitrary set of level geometry from scratch. One of the problems is that it only deals with triangles in XZ space. But how should I handle situations where an arbitrary 3D mesh is intersecting another arbitrary 3D mesh? Within their intersection, each triangle would need to retriangulated in some way.


Correct way to handle A no pathing? I'm developing a little game for fun and I wrote a pathfinding system based on the A algorithm. What is the best or correct way to deal with unavailable paths? A by default will go through every node on the grid until it either finds the target node or it has exhausted all of them. This can become problematic if certain areas are cut off into "islands" and A tries to find a path there. The obvious solution might be to flood fill regions and check in advance, but the problem is that I plan for my world to be a bit dynamic new areas might appear, some areas which are accessable at one point might not be later, etc. Another solution I've read about is that I can limit the amount of nodes it's allowed to search before it gives up, but this sounds a bit hacky and something I'd like to avoid if possible if there are better ways, because it means that there could be a very long and complex path to the target but it'll still not find it just because of this limit. So how should I do it? I appreciate any help here, fellow devs!


Node representations in a navigation mesh There are different ways to represent nodes in a navigation mesh. It's either along triangle centroid, along triangle vertices or along edge midpoints. As I understand if you choose triangle centroid or edge midpoints as nodes, the path isn't going to be optimal, but you can use a funnel algorithm to optimize it. If you choose triangle vertices as nodes however, I understand you can find the more optimal path from get go. But you will get a "wall hugging" issue. Which you can solve by using some algorithm I unfortunately forgot the name of. What is the preferred or most optimal option?


Pointy top hexagonal A pathfinding I'm trying to create a game with a hex based map with the points at the top. I have most of it working, however the path finding is being a little awkward. The heuristic I'm using is called Euclidean I believe and is like so var dx Number destinationNode.c node.c var dy Number destinationNode.r node.r return Math.sqrt((dx dx) (dy dy)) Node is the node the unit is currently on, c is the node's column number and r is its row number. I'm using these as a simpler x and y coords. I'm trying to limit the unit to 3 hex moves in one round, so initially I thought it'd be as simple as IF returned heuristic lt 3 unit can move to that hex, however it's not working out quite like that. As you can see in the pic above, the bottom right selected hex with the "1 9 3.162277" is moveable to in 3 moves, however the hex with "9 1 3.162277" on the far right would need 4 moves to reach it. Can anyone offer any advice on how to make this work? EDIT My problem was being caused because I was using a Cartesian coordinate system and was just staggering every other Y coord. Fixed this by making the Y axis go down at a 60 degree angle. Thanks to amitp for the links that showed me what I was doing wrong.


Godot How do I asign movement cost to tiles in a Tilemap? Pathfinding I am trying to apply godot's Navigation to create a pahtfinding enemy in a Platformer game. I've read about a method to allow for pathfinding to take into account gravity. My issue is that what I know I must do is to add more movement cost to higher tiles. How do I do this? EDIT I have since found the documentation for the Astar Node. Wish me luck.


Longest path algorithm for roguelike maze generation I have a simple grid based map composed of rooms, like this (A entrance, B exit) 0 1 2 3 0 B 1 2 3 4 5 A 6 And I'm stuck trying to make a suitable algorithm to create a path of doors between the rooms, in such a way that the player has to explore most of the map before finding the exit. In other words, I'm trying to find the longest possible path from A to B. (I'm aware that this problem can be solved for acyclic graphs however, in this case there can be cycles.) EDIT Another example where rooms are connected using floodfill, and the exit is chosen as the farthest room from the entrance 0 1 2 3 0 B 1 2 3 4 A 5 6 Note that the path to the exit is not the longest possible path at all.


Path Planning in a chaotic, ever changing environment I've implemented Path Planning a few times, using A on nav meshes, and also Continuum Crowds but now I am trying to plan paths in very chaotic environments. In this environment, new routes and new blockages are created constantly, and chaotically. This is because the environment is fully destructible, and the debris can create new obstacles. In such an environment, nothing can be pre computed. What would be a good way to sense the traversability in such a world? There is no concept of a grid in my world, b.t.w, but I wonder if I should introduce an artificial one for the purpose of planning. But if navigation could be achieved without a grid, that would be much better of course. Note that the navigation is not merely dynamic in the sense that certain transitions get opened closed, but actually chaotic. This stops me from a simple approach of enabling disabling certain edges on the navigation mesh. That approach would be usable if, e.g. a gate gets locked unlocked. But in my case, in a blink of an eye, the routes could be drastically changed where simple mutations of a pre computed mesh are not doable.


Algorithm for waypoint path following? I have a worldmap, with different cities on it. The player can choose a city from a menu, or click on an available cities on the world map, and the toon should walk over there. I want him to follow a predefined path. Lets say our hero is on the city 1. He clicks on city 4. I want him to follow the path to city 2 and from there to city 4. I was handling this easily with arrow movement (left right top bottom) since its a single check. Now I'm not sure how I should do this. Should I loop threw each possible path and check which one leads me to D the fastest ... and if I do how do I avoid running in circle forever with cities 1 5 2 ?


Delaunay triangulation. Where to start? I'm trying to learn procedural generation technique's. Specifically for dungeons. I started off with a 2D array and I generate my rooms fine. Each room contains wall tiles as seen in the screenshot below. Right now I use A to link the rooms together. But this has some paths go straight through other rooms or around rooms. Having done some googling I found this demo which game me the idea of using Delaunay Triangulation to properly connect the rooms without going through already existing connections rooms. But how to apply it to my 2D array setup? My initial thinking is that I should think out side of the box (2d array haha) and grab my rooms and create a complete graph from this and then apply the Delaunay Triangulation. I've never done anything with graphs before. So what I would to know is a) is my thinking correct in creating the graph with all the rooms linked and then to apply the triangulation and b) where should i start? small edit after some more looking around stackoverflow i found this post explaining Graphs more in depth. https stackoverflow.com questions 15306040 generate an adjacency matrix for a weighted graph


Traversing an acyclic binary tree to construct paths from a given starting node, but the paths come out wrong The tree is an acyclic binary tree. It's composed of node objects that have a list of connections to link objects (at most 3), and link objects that have a list of connections to node objects (always 2). I am trying to construct a list of possible paths to other nodes that can be reached given a fuel budget and a fuel cost on each link. What it is supposed to do is go through each non backtracking connection of a node, and spawn a new route and thread to investigate that, leaving the current one to end at that node and thus create a list of routes to every node in the reachable area. When executed, the list of end destinations are valid but many of the paths that are constructed to get to them are wrong, going down other branches in the tree that are extraneous or entirely outside of the reachable area bounded by the fuel budget as well as jumping between nodes that aren't directly connected. There seems to be some pattern in the errors, when going down from the root of some branches of the tree the path goes down every offshoot in order first instead of going in a straight line, and when going up the tree the path tends to go further out and make triangle shapes, often landing somewhere other than the listed destination. I have already checked the link and node connections themselves to see if they are assigned properly, and they are. What am I getting wrong? Route class definition var origin Node var destination Node var totaldV float var totalt float var dVBudget float var tBudget float var tdVRatio float var links Array var nodes Array func duplicate values(originator Route) origin originator.origin destination originator.destination totaldV originator.totaldV totalt originator.totalt dVBudget originator.dVBudget tBudget originator.tBudget tdVRatio originator.tdVRatio nodes originator.nodes links originator.links func init(originator route) if originator route ! null duplicate values(originator route) Tree traversal algorithm var routes Array onready var root get node( quot .. quot ) func traverse(current node Node, previous route Route) if previous route null Starts off the recursion by providing an initial node previous route Route.new(null) previous route.origin current node previous route.nodes.append(previous route.origin) previous route.dVBudget 2000 previous route.totaldV 0 for link in current node.connections if (previous route.totaldV link.dV lt previous route.dVBudget amp amp !IsBacktracking(previous route, LinkDestination(link, current node))) If there is enough fuel and the link isn't backtracking, go through it. var working route Route Route.new(previous route) Copy the previous route to make the new route routes.append(working route) working route.destination LinkDestination(link, current node) working route.totaldV link.dV working route.totalt link.t working route.links.append(link) working route.nodes.append(working route.destination) traverse(working route.destination, working route) DisplayRoutes() root.get parent().pathSelectionFlag true UI control boolean func IsBacktracking(route Route, destinationNode Node) gt bool for nodeI in route.nodes if (destinationNode nodeI) return true return false func LinkDestination(link Node, originNode Node) gt Node Finds the node on the other side of a link for nodeI in link.connections if (nodeI ! originNode) return nodeI return originNode


Restrict A pathfinding to overlapping "safe zones" within map I've been bashing my head against this idea for a few days without luck, I'm hoping someone sees something I don't. So I have a 2D map containing walls and obstacles, and I have a unit that navigates through it (A and funnel algorithm). So far so good. Now, for gameplay purposes, I need to limit the movement of this unit to circular safe zones that I can place on the map. Think of them like cell towers, the unit has to stay within range of at least one tower, with the max range dictated by the tower (possibly different for each tower). Effectively, imagine drawing a set of interlocking circles over the map, and the unit must remain within that. Now for the complicated part. The map is a constrained Delaunay triangulation, not a grid, so the triangles that A is using can vary in size and shape. With a grid, I could imagine limiting individual grid cells by circle distances, but in my case these triangles could be larger than any one circle. There could even be cases where the start and end points of a path are within the same triangle, but because of the network of circles, an indirect path would have to be chosen to stay within the circles. The only option I can think of involves adding these circles into the triangulation as additional edges, altering the map. This would mean rebuilding the map triangulation each time a player adds or removes these circles, and would require that I maintain a separate copy of that triangulation per player. And since these circles don't care about map walls, I'd have to alter my triangulation method to allow edge splitting and removal, to prevent overlapping lines from rendering the triangulation invalid. I feel like there has to be another way to do this. I've considered Running A purely on the circles first, then placing that intermediate path on the map and re pathing it to avoid obstacles. Finding all of the circle intersections between the start and end points, and treat those lines as portals that I must pass through, somehow altering the A pathing to prioritize passing through them. Performing a regular path search on the triangulation, but forcing a dead end whenever entering a triangle that is too far from a circle. Then refining that path to conform to the circles themselves. Each of these have issues, or scenarios where they fall apart. Has this been done before? Any input on how this might possibly be achieved would be appreciated. Edit Adding an image to show what I'm trying to accomplish. The red lines show the path that A would generate using just the map triangulation. The green lines show the desired path, taking the circle bounds into account.


In A star, do I use the sum or the edge cost? When you add a new node to the closed list, you need to check all the adjacent nodes. If you find any adjacent nodes on the open list, you have to check if G would be lower if you went through the current node to get there. My questions is, when checking if the G would be lower if you went through the current node, do you add up from the last node or start from 0? Say you're using G 14 for diagonal and G 10 for horizontal. Last one on the closed list's G was 20. Your current node is one block lower from the last one on the closed list, and has an adjacent one that's on the open list with G 34. Are you supposed to check if the G would be lower if you went through your current node by doing 20 10 14 44, 44 ! lt 34. Or, are you supposed to start from 0, so 0 10 14 24, 24 lt 34? I'm pretty sure it's the latter as with the former, the number is never going to be lower. But if it's the latter, wouldn't the number be lower every single time after a certain point?


Sample Projects Source for Navigational Meshes Anyone aware of any sample source code that contain Navigational Meshes? I'm aware of recast navigation (which is a little bit too complicated). Written in C . Preferably C but C is ok.


What is the difference between Djikstra and flow fields? I understand flow field pathfinding (as illustrated in recent Gas Powered Games titles) consists of 1) computing a vector field covering the map for a given destination, 2) deriving unit directions from their position on that field, and 3) recomputing it at each frame to take dynamic obstacles into account. I was wondering if the very same steps could be used, but by computing the vector field simply with Dijkstra. After all, if you apply Dijkstra in reverse (from the destination), and continue until you've covered the whole map, you end up with a vector field giving the best direction for each unit trying to get to that destination. If you recompute it each frame, don't you end up with the same behavior and efficiency as flow field, only without the math I don't understand?


How to reduce the time taken to path find to an unreachable location? I have a 2048x2048 map and if I path find to an unreachable location, it makes the pathfinder go through every node on the map which freezes the thread for 4 seconds. How can I reduce that time? I'm using JPS It's a dynamic map (it changes at runtime)


Tiled based pathfinding in a 1 or 2 dimensional array As far as I know all tile based map editors export a JSON object containing one dimensional arrays. While most pathfinding libraries tutorials are only provided for two dimensional arrays. Also if for example I would like to do pathfinding in this one dimensional array and this array is huge i'm geussing this would cause performance issues. So why is it that most tile based map editors output a one dimensional and how should I handle those regarding pathfinding? example tile editor http elias schuett.de git Online Tile Map Editor Just google pathfinding to find all the two dimensional patfhfinding tutorials


How to handle pathfinding on a non grid non node terrain map I'm not sure if this is even path finding. All I have is a 3D map that has hills, etc. I'd like the enemy to flock an object, but also walk around other objects. These blocking objects may be added after the path is calculated, which would cause a re calculation of the path. What algorithm am I looking at here?


Pathfinding to Get In Attack Range with "Transparent" Tiles Currently I'm using A and a raycasting algorithm to determine the path an entity (Player) should take to get close enough to the enemy (Enemy). The player has an attack range (it's illustrated around the enemy to show how close the player has to get to the enemy in order to attack it). This works pretty well, but as soon as I add tiles that prevent entities from moving from them, but allows them to attack through them (imagine a river). Using my current implementation the player entity takes the purple route to attack the entity, but I want it to take the yellow path. I came up with the following, but this is highly inefficient Mark the tiles around the enemy (cyan circle), which are in line of sight to the enemy (raycasting) as possible destinations Run the pathfinding algorithm to find which one of those destinations is the closest to the player I know A is good for finding a single destination and Dijkstra is better for multiple destinations, but since I already got this working with A I wanted to know if it's possible to achieve this is an efficient manner. Side question how are the tiles where you cannot walk through, but can shoot through called in the industry? I know the wall likes entities are mostly called "solids".


Voxel river flow simulation I am making a Voxel game and I'd like to add rivers that can be redirected. So I thought that if a player replaces a river block or digs up a block next to a river block the river would repath itself to the sea. The rivers path would have a direction and a speed in that direction. The rivers path would be determined by these rules If the river can go down in its direction it will and then pick up speed. or if it has a speed under 2 and it can go sideways and down it will and keep its direction. Otherwise it will keep going in its direction until blocked, where it will pick a new direction. If the river can't go anywhere it will fill up the layer its on like a bathtub and go up. Repeat until it reaches the ocean. However I can't figure out how you can know what to fill. The data would be stored in some sort of height map. 1 same level, 0 down a level, 2 up a level For example 222222 211112 211112 211112 211112 222222 I can tell that the 2s completely surround the 1s meaning that all the 1s should get filled with water if the river goes up. But how can a computer tell?


Pathfinding and collision avoidance on mobile Currently I'm developing a Diablo like game for mobile platform(iphone5 ). A simple A search will find the path, but collision avoidance still needs to be taken into consideration. There will be about 50 monsters active at the same time, so performance is very important. I found some methods that might work. NavMesh RVO The recast detour library works well on the pathfinding part, but its crowd simulation quickly reach the limit(more than 5ms for 30 agents). Another library RVO2 seems fine(less than 2ms for 50 agents), but the library has some license issues. Flow Fields Physics Engine Many RTS games use this method, but it seems that a physics engine is required to resolve collisions. If many agents don't share a common goal, this method might cost more than traditional A pathfinding. Steering Behaviors Physics Engine Steering Behaviors includes many concepts, I think simple avoidance behavior might work(just turn left right if there is something in front) , but the method still requires a physics engine to work together. I'm still not sure which one to use, maybe there exists other pathfinding and collision avoidance methods. P.S. Halo Spartan Strike uses Havok AI(based on RVO?), but I didn't see many enemies in that game, so I wonder whether the first method(NavMesh RVO) will works well on mobile platform.


Can A path finding cost functions allow for path following shapes? Recently I begun developing a game prototype which could create procedural generated dungeons using a collection of room types. To ensure the hallway paths between these rooms would always be connected I implemented a A path finding algorithm following along the tile map of randomly placed rooms. The problem with doing this however is I was not necessarily trying to find the shortest path between rooms which in most cases would be a diagonal. Since being thematically a 'dungeon' I wanted them to twist and turn at 90 degree angles. By using a Manhattan distance for the heuristic I managed to get the intended shape but I've ended up with one final problem which I come to you kind people to help me with ). Though now using 90 degree angles to move the path, its saves doing the run till the end of path(See picture below). This makes the whole thing at a distance feel cramped in places instead of using all the space effectively. Seeing how simply changing the heuristic from distance to Manhattan distance has made a difference my question is, is there a cost function I could implement that would give the desired results of this non conventional path? Any answers would be appreciated, thank you. Note The algorithm also has access to the normal direction of the start and end goals.


A Pathfinding Gridless With Circles I found that A is an algorithm for grid (or tiled) maps. I want to use it or some alternative of it to my game. The problem is that I have no grid. I have canvas and GameObjects could be at position x 23.91324512, y 131.12334253461 . How would you do this? And another question, I have element with stepSize (concretely called movementSpeed), and getPosition().getX(), getPosition().getY() AND getRadius() which returns the radius of a circle. How would you do A algorithm with radius? Btw I am implementing it in Java, so maybe some Java snippet would be helpful. EDIT As you may suggest me to create a virtual grid, how do I check if I can move to the next node when I have my getRadius() and all the obstacles getRadiuses


Dynamic obstacles avoidance in navigation mesh system I've built my path finding system with unreal engine, somehow the path finding part works just fine while i can't find a proper way to solve dynamic obstacles avoidance problem. My characters are walking allover the map and collide with each other while they moving. I try to steering them when collision occurs, but this doesn't work well. For example, two characters block on the road while the third one's path is right in the middle of them and he'll get stuck. Can someone tell me the most popular way of doing dynamic avoidance? Thanks a lot.


A in 2D game. corner pathfinding issue the issue I'm having will be best described with pictures more so than with code, so lets have a look if you will. So all the mobs followed the player and started attacking him, but as soon as 4 spots to the E, S, W, N were taken, mobs 1 and 2 are no longer able to find the path. When mob from E S W N spot dies they can of course find a way to the player. My question therefore is what is the way to implement this so that mobs can get to the player when only corners are free? Diagonal movement is not allowed and i'm using Euclidean distance. I've read this How do I avoid pathfinding characters getting stuck in corners? and other questions, but they dont quite cover what I need here. I'm sorry if this isnt specific enough, happy to clarify.


Ponderate dijkstra relative to previous position I use dijkstra in my rust game to find path to a destination. My game is in a square grid like this There is, for illustration, the Rust code which use dijkstra use crate map Map use crate physics GridPoint use pathfinding prelude dijkstra pub fn find path(map amp Map, from amp GridPoint, to amp GridPoint) gt Option lt Vec lt GridPoint gt gt match dijkstra(from, p map.successors(p), p p to) None gt None, Some(path) gt Some(path.0), ... pub fn successors( amp self, from amp GridPoint) gt Vec lt (GridPoint, i32) gt let mut successors vec! for (mod x, mod y) in ( 1, 1), (0, 1), (1, 1), ( 1, 0), (0, 0), (1, 0), ( 1, 1), (0, 1), (1, 1), .iter() let new x from.x mod x let new y from.y mod y if new x lt 0 new y lt 0 continue if let Some(next tile) self.terrain.tiles.get( amp (new x as u32, new y as u32)) successors.push((GridPoint new(new x, new y), next tile.pedestrian cost)) successors ... And visualization of found path (white is found path, pink is goal) The found path is not a direct line. I'm not surprised, because the weight of diagonal is the same as lateral. With what I understand with dijkstra is I can return successor with weight for a coordinate. But I can't increase weight of diagonal lateral according to previous position (ex comming from West gt moving to Est will be less weight maybe it is not the solution ...). How can I achieve that ? With another algorithm than dijkstra ?


Pathfinding with car steering Is there pathfinding algorithm which takes car steering into account? I have large space where user can place cars (trucks actually) and other blocker objects. Objects can be placed vertically or horizontally oriented and have different sizes (may be 3x6 or 2x4 or other size). User needs to be able to select new location for any car then I need to calculate how can that car move to selected location. I have pathfinding working, and I can find paths with different size but only for square objects. Update Pathfinding need to give only path that is possible with that type of car. For example on empty map with only one car, if user selects new location right next to its current location, car can't strafe or turn in place it has to either reverse and steer or do U turn or something. Also it must ensure that car orientation at end is what user requested.


Find shortest path (quickly) on the surface of a 3d model? Imagine this scenario we have a 3d model, for instance a doughnut, apple or an orange (possibly something more complex). There's an insect (let's say an ant) on the surface of that food item. Now that ant wishes to reach a certain specific coordinate embedded on the surface of the 3d object in the shortest time possible (using the shortest path, ignoring physics). Now the ant AI could use Dijkstra on the original mesh but that might be low res so the ant will zig zag on the surface, outlining the shapes of blocky faces. You could split the faces but the angular nature of the edges, making up the structure of the mesh will continue to drive the ant to more in ziggy zaggy like manner (imagine a rougelike with very small squares, you can still only move in 8 directions at any given point). What we did is split the edges (of the model) to evenly sized pieces and embedded "navigation vertices" between these pieces, we then connected the vertices of each edge with vertices of other edges sharing a face with it (4 other edges because faces are triangular). This works pretty well cause it means the any can travel freely between faces, ignoring their shape almost completely (unless they are very small and were not split). We also have the ant "pulled" (dragged even) by an imaginary ant that is a few steps ahead to completely eliminate the more rigid areas in the path (think sharp corners). Sounds great right? But this is not terribly fast. Any advice about that is appreciated.


Pathfinding with different sized units I am actually working on a general purpose pathfinding library (find it here), mostly oriented for grid based maps. I was looking for ways to integrate support for pathfinding with units of different sizes. Actually, I am working with the assumption that all units are square (i.e. their widths and heights in tile units are the same). In researching, I came across a very comprehensive article about Annotated A star, using True clearance values for pathfinding. I tried it, and succeeded in implementing it, and got it working with a wide range of search algorithms (A star, Theta , Dijkstra, DFS, Breadth first search and Jump Point Search). There are some small details of implementation I think I am still missing. First of all, when an agent is 2x2 sized (i.e it occupies 4 tiles on the grid map), what tile can be assumed to be the agent position ? On the same page, clearance based pathfinding will fail in some cases. Let's consider the following map, where 0's are passable tiles, 1's are obstacles and x's matches walkable goal to be reached. Let's assume we are pathing with a 2x2 sized unit 00000000 00111100 001xx100 001xx100 00000000 For targets on the left (tiles 4,3 and 4,4), clearance value is 2, for both. No problem here. But for the others (tiles 5,3 and 5,4), clearance value is 1. So depending on how the agent position is taken, pathfinding will fail while obviously, for each of these target, the agent can properly fit into the dead end space. Another scenario, with the same 2x2 sized agent 0000000x 0000000x 0000000x 0000000x xxxxxxxx Well, all tiles are walkable here, no obstacles. We want the object to reach any goal on the rightmost or bottom most border. Each of these targets have a clearance of 1, so annotated pathfinding wil obviously fail here...depending on how the agent's position is taken. How do I work around this issue?


Obstacle avoidance in Bezier Curves I use an A algorithm to find a path voiding obstacles. On obtaining the path it would be a good idea to reduce the number of points. Then I would like to typically do a spline interpolation or Bezier Curves to find a smooth path but is it not possible that post smoothening my character bumps into an obstacle? If not possible then why and if it is possible, then how do I avoid it?


A path finding for road network data structure to represent directivity I have been reading A path finding to apply on a road like network structure. Most of the code I saw is about A on tile based maps. There is a short description at Amit's page here about what I am looking for. My question is about what data structure should I use to define a road network map. I have infromation like, node, cost,etc. But not sure how to represent both one directional and bidirectional roads. In a graph structure, can I mix directed and undirected edges or use two edges to represent that a segment of road can be traversed in both direction. Any good example available? Thank you so much.


Pathfinding towards a moving target in 2D Platformer I have an enemy in my 2D platformer that chases the player around the level. I implemented a modified version of A that works with gravity as described here https gamedevelopment.tutsplus.com tutorials how to adapt a pathfinding to a 2d grid based platformer theory cms 24662 But for a moving target I would have to calculate a new path whenever the target moves. Of course I'm going to run the pathfinding on a separate thread and only once a second or something like that, but it's still a waste to calculate the path from scratch. So I found this algorithm for transforming the old path to the new path with the new start and target position called FRA http idm lab.org bib abstracts papers ijcai09b.pdf However the platformer version of A has a kind of 3D grid where nodes with different jump values in the same 2D location has a different z coordinate. Is it possible to use FRA when jump values comes into play? Do I have to recalculate jump values?


Which algorithm for controlling cars on a race track? I think A is a good place to start, but since cars cannot move in all directions (they move like cars do, trying to move forward and steer), I was wondering if someone could point me at other approaches they've used. Also, I was wondering about the "Racing Line". Should one just precompute the optimal paths, and then use the A to select the path that isn't blocked by other cars ? EDIT My question is different from Driver AI in racing game because that question is about approaches. I am interested in learning about specific tried and trusted algorithms like A .


MMO In App vs. Website Purchase Im currently writing a turn based start game, which will be played in an MMO style (players download clients, central server handling the game logic etc.) and now I need to decide how I charge my players for playing my game, since this will have some implications on how player account handling is going to work. After looking a bit around, I found two alternative ways of doing this a) Classical in app purchase, for which my clients need to be able to take the payment info, send them to my server which then charges the selected amount (using some API like stripe.com) and provides the selected services b) Account administration and payment via website, and then synchronization between website and game server over some database Most MMO games I know use the website approach (b) although I assume that in app purchase (a) is faster and easier for my players and will therefore yield higher conversion rates. So, my question is Are there some major problems (security, paperwork) or drawbacks (complicated to implement) with in app purchase I overlooked? Im not doing a mobile game (full desktop) and Im from europe, just in case this information might be needed.


Strategy City Builder browser game technical details I actually have multiple questions into one. Hopefully someone can hit all of them. I wanted to give a try at a massively multiplayer web based game. Basically, the game would have similarities to Evony, or Eve Online (a much scaled down version). The idea is it would be a mostly real time city builder (like Evony) that allows complex actions between players (like Eve Online but without the graphics and much scaled down). It would sort of be like a database game. I want it to be able to support around 500 people simultaneously online off one server. However, I have multiple issues that I want to pin down before I actually start writing the code. Continuous database updating The database has to be continuously updated on a small time interval to reflect the passage of time in the game verse. Furthermore, the effects of all actions will have to be calculated as well. Right now I'm thinking about using mysql with events using the innoDB engine to do this. Is there a better faster approach to this? Continuous graphical updating Certain details (such as "time till completion" etc when building something) need to be continuously updated on the user interface. I'm thinking about having each page in the user interface continuously make ajax calls for the information. Again, is there a better faster way? Thanks


Browser based MMOs (WebGL, WebSocket) Do you think it is technically possible to write a fully fledged 3D MMO client with Browser JavaScript WebGL for graphics, and WebSocket for Networking? Do you think future MMOs (and games generally) will be written with WebGL? Does today's JavaScript performance allow this? Let's say your development team was you as a developer, and another model creator (artist). Would you use a library like SceneJS for the game, or write straight WebGL? If you would use a library, but not SceneJS, please specify which. UPDATE (September 2012) RuneScape, which is a very popular 3D browser based MMORPG that used Java Applets so far has announced that it will use HTML5 for their client (source). Java (left) and HTML5 (right) UPDATE (June 2013) I have wrriten a prototype of a WebGL WebSocket based MMO https github.com alongubkin xylose


MMO Server monster handling Dabbling with basic MMO code because it intrigues me. How does the server handle monsters mobs? I understand that generally on each game tick, the server loops through each player to send them updated positions of each other nearby player or mob. So every player loop you're also looping through every other player but is it just standard to loop through the entire mob list too? I mean there could be 1000 mobs idling around the game world zone. Would this just slow the loops down? I thought maybe they keep a seperate list of ACTIVE mobs, ones that are either near a player or are chasing a player, but that would still require looping the idle ones to check if a moving player comes near one. Unless the aggro loop is less frequent (thinking out loud here).. Is there some tricks or common workarounds involved? Or is that just how they work?


Alternatives to storing all my entities in an SQL database I've been trying to build my entity system based on pure SQL data storage as explained in this post series. The idea is that every entity or component is stored in an SQL table. I created my framework to manage that, only to realize that many SQL queries took more than 10ms, which is unsuitable for use in a game loop. I first thought the delay was I O bound, so I created an in memory MySQL cluster. This was better, but still not real time enough for a game loop. Has anyone built an SQL based entity system? If so, how did you manage to keep query times manageable? If an SQL database isn't feasible for performance issues, what data structure could I use to retain the entity system idea and the possibilities of direct SQL requests on components? I've heard of many MMOs running on SQL. Do they use it for only part of the data or a full entity system? How to separate database stored and classical memory stored structures in that case? Edit for clarification Yes, all game data is stored in the database. If say I run my physics system it will first get data from SQL, then do its stuff, then insert the updated data back to the database.


Level loading philosophy in MMO games I've been working on project for quite a while, and I've returned to dilemma about level loading. The problem is i trust the client with it's local level loading, when it's done loading it tells the server to join it to server room data stream and server start to send data. My current setup Client logs in, on login server sends the characters. Client chooses the character and start to load level locally. When client scene done loading, it request to add to room. Client receives the data he needs. I fear that user could hack the client and actually load other scene, that would result in players and characters going through props and models, it could also be an exploit to see hidden data and items. Instead, after server sends the chosen character it could "wait" for user to send response that level has finished loading. After that, server joins the character to room and send data to the user. That way client doesn't know anything about rooms or it's names. Any suggestions?


How to update the monsters in my MMO server using Node.js and Socket.IO Currently I am creating an MMO using Node.js and Socket.IO. The node server needs to handle connections for players, and also use a loop to update all monsters positions in my game and let them attack players in range. For the loop I read that you can use process.nextTick or use a child process, which option would be the best choice? What are the advantages disadvantages of using each? Also, how many times per second should I run this loop for the monsters?


Preventing item duplication? For my game, there's two types of items stackable, and nonstackable. Nonstackable items get assigned a unique ID that stays with it forever. A character ID is assosicated with the item, as is a state (CHANGED, UNCHANGED, NEW, REMOVED). The character ID and state is used for item saving purposes. Stackable items have one unique ID, as in the entire stack has one unique ID. For example 5 Potions (stacked ontop of each other) has one unique ID. When dropping a nonstackable item, the state gets set to REMOVED, and the unique ID and state don't change. If picked up by another player, the state gets set to NEW, and the character ID gets changed to the new character's ID. When dropping all items in a stack of stackable items (for example, 5 potions out of 5) it behaves just like a nonstackable item. When dropping some of a stack of stackable items (for example, 3 potions out of 5)... I really have no clue what to do. The 3 dropped potions have the state of REMOVED, but the same unique ID and character ID. If another player picks it up, it has no choice but to obtain a new unique ID, and its state gets changed to NEW and its character ID to the new one. If the dropping player picks it back up, they'd just be readded to the stack. There's two issues with that though. 1. If the player who dropped the 3 potions picks it back up, there's no way to tell if they legitimately dropped the items, or if they're duped items. 2. If another player picks up the 3 potions (assuming they're duped), there's no way to know if they're duped or not. My question is How can I create a system that detects duplicated items for both nonstackable and stackable items?


Why are so many games not fully voiced? I'm wondering why so many MMOs are only partially voiced? I asked makers of games (Thimbleweed Park, in their Q amp A) how expensive voiceover is, and they said it wasn't especially expensive unless you hire A list stars. So why would so much game dialogue be only present as text to be read onscreen? The only reason I can think of is the same that exists for localization in all software You can't record VO until all the dialogue is finished and frozen, so it is another fixed delay between finishing the rest of the game and shipping. So it doesn't seem like it's not manageable. To be clear I'm not looking for opinions or theories (that would only make the mods close this question) but actual reasons and experiences from people who have shipped games with partial voiceover.


MMORPG Representing Money in a DB table Where to begin... I'm currently busy with a few Udemy courses on game development using Unreal Engine 4. My end goal is to develop an MMORPG that I've always wanted to play, but never found online. Q How would I represent in game money in a database table? I've thought of adding it as a field in the "character" table, but then I struggle to see how I can implement it as a field in the "bank" table... Bank already has a quantity field, so I though about adding the money values as "items", but I just can't get myself to approve that... Some information on the table fields Each players bank will have a size limit (upgrade able) on how many items they can place in it. I was thinking of moving it out to the "character" table as it doesn't really have anything to do with the bank table... As for the rest of the tables, I'm still working on them. For now I just wanted to get the communities opinion on how to represent money in an mmorpg database.


Why does editing the client's memory in some MMOs allow them to cheat? Why editing the memory of the game client works? Why so many "Hack protection" tools coming with the clients? If I were to design a client server game, everything would happen at the server (the simulation of the game world) and clients would be only passive consumers receiving status updates of the part of the world near their characters, sending only some information like keystrokes or move action commands. Maybe I missing something here, but with that design, any hack like raising my STR by 200 in the client memory (if the value is present at all), just won't have any effect. The only explanation I can think is that games in which memory editing works let parts of the simulation run in the client and the server then just synchronize all the clients periodically. I can understand that design for Real Time Strategy games with a fixed number of players once a match is configured, but, why in MMORPGs? Is it a strategy to reduce server load?


Appropriate MMORPG battle system for Android oriented MMORPG? I need a tip for a game I'm making. Because of many issues I want to make a 2D mmorpg A 2D game is easier to code (I'm using ActionScript3 Starling). I can more likely find preexistent graphics, and handling them is easier. Fundamentally I don't want to eat the device's memory!! Common devices here have at most 1GB RAM memory. But when I think about battle systems, I imagine stuff like Argentum Online and Tibia. Those battle systems were OK on mouse keyboard based systems. AO's battle system will be really hard to use (specially by any spellcaster class) in devices like Samsung S3 mini. OTOH when I think in systems like Pokemon or Golden Sun, both of them being turn based, I ask myself about the interation battles would be locked (they have a protocol, you cannot suddenly leave a fight, you can take as long as you want in each turn,...) which is not acceptable in a mmorpg for many reason (mmorpg users do not expect a protocol, they expect to leave a fight as they'd like, they would HATE users who suddenly go AFK on the middle of a battle without having opportunity to act). What battle interaction would be a good balance between mobile device friendliness and not being a pain in the ass for game dynamics? Suggestions are accepted here (we cannot expect game design have absolute decisions at all).


Should I assign a unique ID to individual units of game currency? I am currently making a MMORPG. At the moment, I am working on the currency part of the game but I'm confused whether I should assign a unique serial number for every unit of the currency generated. I'm hoping to use this system to trace any misuse of the virtual currency but is this a common practice and if not, would this be a good idea on operational and or performance point of view?


Is it a legal thing to do to sell fabricated accounts of your game? For example, say I create an online mass multiplayer game with in game purchasing system and with randomness factors as well (the point is that game accounts have actual value and there is a somehow proportional relationship with playing time plus the luck of the player and the account's value) and the game appears to become popular. Is it legal to, for example, insert cheated accounts into the database (without even spend a second of legitimate playing) and sell those accounts with extremely high price?


How do we attract more developers and other Volunteers to our Open Source MMO Emulation Project? I am on a small development team that is tasked with completing the server side programming for an Open Source MMO project that has been in progress for about 5 years now. Approximately a year ago we Open Sourced the project hoping to draw in new developers, this was without much success and in fact we haven't gained even one active developer in our project. The Project Star Wars Galaxies A New Hope, is something near and dear to myself and the other few people working on the project. It is a quest to bring back one of the golden eras in gaming, Patch 14.1 for Star Wars galaxies. The progress as of this summer was extremely slow and it seemed as if we were taking two steps forward and one back every change we made. The codebase wasn't designed very well and we looked into completely rewriting it from scratch. After a couple of weeks we realized this couldn't be done in a timely manner and perhaps we should take another look at the old core to see if we couldn't revive it. We found it was worth just revamping the old core and continuing to push forward, we've made some really good changes that will help with the future of development. One reason we didn't really want to push heavy developer recruiting was the state of the existing codebase. Now that it is somewhat cleaned up, how do we go about recruiting quality individuals that are interested in finishing up this Open Source MMO project and delivering what we promised to the community? Github Project


What legal matters do I need to consider when releasing an MMO? Let's say I've finished programming an indie MMO game similiar to Tibia. I've got a stable server application ready to launch a tested, bug free, working client application ready to play the game's official website (ready to host), with a payment system and freely downloadable game client. No matter how impossible it sounds, let's also assume none of these break copyright laws. My game divides accounts into free and premium groups. Premium accounts can access all game features, requiring server authorisation to work properly. Let's say that the "premium account" can be bought on the website for a fixed monthly rate. Free accounts can play for free, but with limited access. This is what the mentioned payment system will be for. If I've correctly understood, this is the freemium model. I'm completely novice to business entity issues, so in short what steps, in legal terms, do I have to take from here so my game can legally earn me money? For example, is there something like verification that the game gives the user what it actually offers when paying on its website? If relevant, I live in Europe.


game state update structure and distribution in MMO? I'm developing an MMO, which has to maintain a global game state. Now I want to distribute the updates, which the players make to this state, to players which can see those updates (area of interest etc.) Is there a common structure format for these updates and for a global game state? Like, every action a player sends to the server has to include a type, the coordinates etc. And are the updates, which gets distributed from the server to the players in the same format or are they different? Also should I include timestamps or use the receive time from the server to check which action came first and which sencond etc.? And what should I send back to the player if he send an invalid action?


Bandwidth cost hour for one MMORPG player I am trying to calculate guesstimate the costs of running an MMORPG for a client. And now I need a pretty accurate estimate for the monthly bandwidth cost so I can calculate the possible revenue of the investor client. So what is a pretty reasonable bandwidth cost for each player per hour? The MMORPG I'm trying to make is a virtual conference with gamification. We can go to booths, see other people, make a transaction in the booths. And we will also have a quest and mini game system for the gamification. We will be making it using Unity Forge. We were thinking of using Photon before, but when I reached out to them, they said I need to subscribe for Photon Industries since it's not a game, per se, which is like 2.5x the cost of PUN. We will split the server into two the game server and the REST API server. I'm in charge of the game side of the project so the REST API and backend is not my jurisdiction. I this is the specs of the game that I had in mind The event will be held for 10 days, possibly running 24 hours straight. Max customer that we have anticipated is around 1000 2000 CCU There will be multiple scenes rooms that the customer can go to (e.g. Commerce area, Lobby area, Mini Game area, etc) The quest system, booth transactions, and other features that doesn't need real time update will be handled by the backend. So that leaves these data that needed to be synced Player position 4 bytes 3 (X, Y , Z) 12 bytes currentScene 1 byte avatarModel 4 bytes (will use bitmasking to handle the current type of clothing and accessories of the player model) playerAction 4 bytes (player's enumerated action type) playerActionTarget 4 bytes (player's action's target) Scene sceneStatus 16 bytes (any status of the current scene e.g. the current quest. Still unsure how many bytes I need to sync) So, this is what I have calculated so far using AWS EC2 (possibly wrong)


How can I synchronize state in my Asteroids game with many networked players? Wondering how state synchronization works in games with lots of players like MMOs. It seems like a hard problem to solve and I am not aware if there are standard solutions. Specifically, synchronizing game clients (users playing game) with an array of centralized servers, and then broadcasting and merging the state with all the same connected clients. How it is done (and how efficiencies are implemented) typically, and what the structure of the game state is like. To simplify this question, I am thinking in terms of a simple asteroids game You have n number of players, and the asteroids, players, and bullets are synchronized across clients. I am not familiar with how the game state should be modeled (if it's some quadtree thing you are sending around, or just a vector of patch updates, etc.). There could be players all over the world, so latency is a factor.


What kind of databases are usually used in an MMORPG? Do people write their own DB for some reason?


What languages are used to develop MMORPGs like EVE Online and WOW? As I understand it, MMORPGs are games that run on your computer like any other normal 3d video game but, with each action that happens with in the game, changes are made to the universe via HTTP calls to the server. So the players computer does all the heavy lifting in terms of rendering the graphics and animations but, web frameworks do the online communication. So I am wondering what web frameworks, web servers and databases are being used to create MMORPGs like EVE Online and W.O.W.? Also, what programming languages and 3d game engines are being used to make the client side (3d graphics animation sounds) part of the game?


How should chat be transmitted and stored in an MMO? Players in MMO games can usually send messages over different channels (private, public, guilds, et cetera). How would I transmit and store this data so as to prevent outside users from being able to access somebody's private chat messages? Should I store the data in a temporary game log, or a database?


How do I create a big multiplayer world in UDK? I want to create a big multiplayer world in UDK and I'm having a few difficulties. I created the biggest terrain possible but then any terrain related action I do takes forever. However, I've seen videos of people make same size terrain and working without a problem. My pc is strong enough, so maybe someone can tell me what I'm doing wrong. I want to make it even bigger then the biggest terrain size, so I was thinking of doing level streaming but then I read that streaming is working server side which means if I have a player on every terrain all terrains will still be loaded and I want to save as much memory possible so it will work well online. Thanks for any help you can give.


Code reuse for a CRPG data model on the server side I'm working on a turn based game with CRPG (Computer RPG) elements in HTML5. It has to support 10K CCUs (Concurrently Connected Users). The CRPG elements in the game are item and character systems The game has characters, characters have items. Items may be worn or used as consumables. Items may be crafted and upgraded. Characters gain experience and get new levels. Characters and items have characteristics (like health, attack strength etc.). Characters may have buffs and debuffs placed on them that affects characteristics. Characters have talents that acts like permanent buffs or debuffs. Items worn and consumables used may affect character characteristics. Characters may strike each other, and strike outcome is calculated based on the effective characteristics of the attacker and target. All of the above has to be stored and handled on the server side. To avoid developing everything from scratch for the 100th time, I'd like to maximize my reuse of existing code original, free, or commercial. I can adapt the CRPG model requirements to the implementation limitations to a certain (considerable) extent. Technology stack does not matter much either as long as it is reasonably scalable. How can I author my server side solution to maximize code reuse?


How many database connection should use in a MMO game server? Game server links to database, how many database connection should use? The data update works like this update role object to database every X minutes, commit all updates every Y minutes. There are 3 ways Only one database connection One worker thread one database connection and set transaction level to "Read Uncommitted". Worker thread loop all roles in it to do update amp commit periodically One game session one database connection and set transaction level to "Read Uncommitted". A dedicated thread to loop all connections to do update amp commit periodically Method 1 has a problem which database connection object needs shared by multiple worker threads, for JDBC, connection class is thread safe, but I don't know what about C such as MySql driver. If it have to use mutex to make thread safe, there will be a performance degrade all worker threads have to synchronize their data frequently. Method 2 has a problem to update old data. One map in game server run in dedicated worker thread. For example, role A in map 1 which compute by thread 1. role A transport to map 2 which compute by thread 2. This might cause thread 1's commit call after thread 2's commit call, so the older update which already executed in thread 1 commit after thread 2's commit. Method 3 seems is a waste of system resource. Because in MMO there is no need to be transaction isolation, any change in a game session should be immediately seen by other sessions. In contrast with web app, so many connections has litte meaning. However the "Read Uncommitted" isolation level can let other session read data which has not committed yet. I forget there is a thing called connection pool. Generally it is thread safe implemented so I do not need to care synchronization problem anymore. And the connection number is dynamic so I can leave problem of how many connection number to it. Only I do is get a connection from it. So, method 1 amp 3 both practical.


Best approach to develop a mobile version of existing browser mmo game? our team has developed a MMO browser game (HTML5, Javascript amp PHP). The game is similar to Empire GG, Clash of Kings, Game of War etc. We want to develop a mobile version and the question is which would be the most efficient way process we can take advantage of?


How to implement server side auto attack? I'm writing a basic MMORPG and im trying to implement auto attack. At client side I send an AutoAttackMessage to the server. Should I send this message every X ms to the server, or juste one time and then server handle this himself ? How to handle delay between 2 auto attack at server side ? (timer, special thread)...


Why would an online MMO throttle actions per day? I started playing Die2Nite and was surprised that it has such a strict limit on the number of actions per day. After a while, I figured it was just part of the charm. I also started playing Magic Duel and it has a similar mechanic that limits the amount of actions per day. Is there a game design principle behind a decision to limit actions per day in an MMO?


List of Anti Cheat Packages for MMOs? i would like to start this topic for programs to counter attack link text. I am not aware of a big list but with everyone's help i hope to make this a fine topic. Posting format NAME nProtect GameGuard GAME TYPE any type of game Website http global.nprotect.com product gg.php FEATURES? Protect the users' PC from fast evolving hacking technologies and viruses. Real time protection, diagnose various patterns latest hacking tools that can harm games, but also memory debugging prevention technology will be applied, completely blocking hacking tools through real time hacking tool monitoring and blocking function. Blocks hacking attacks through memory scan Blocks online outflow of personal information


How do you design a record replay system for a frequently changing game? I'm working in a free MMORPG and I have a problem. I'm (with other people) developing a video recording system for the game. The idea is basically we record all the packages sent amp received with timestamps, plus some local data from the client, and then dump it in a file. For playing the video, we just emulate everything that's on the file. We also have an option to export the video to avi with ffmpeg. The problem is when we change between versions of the game, it is hard to maintain backwards compatibility for the video (commands added removed, function changes, etc). Is there a good way to handle this problem? instead of having a bunch of different players and choose the right one for each version of the video file? It would be helpful to know how does other games handle this situation. Thanks for the help, sorry for my english.


How to make sure user is running the newest version of mmo client? In typical mmorpg game, you have a launcher and a client. You first run the launcher to update the client, then you run the client. In every mmo I tried if you run a client without updating first (if update is available), it automatically closes and (usually) starts launcher. My question is, how can you check if user has the proper version of client? I though about server asking client about its md5 however it's so easy to cheat. I think that there is no safe way of handling it yet every mmorpg I know uses such a system. So how do mmorpg games handle this problem? To make sure that the client is at the newest version?


How is load balancing achieved in MMOs? I believe it's a common requirement of MMOs that processing for a single shard or realm can be done over several servers to ease the load. I'm curious as to how this can be done whilst maintaining a unified consistent world where all the players, and all the NPCs can interact. My question is how is load balancing achieved in MMOs? Any links, books or general information on how to improve my knowledge on this subject is also appreciated.


Store temporary state in DB or not Background I'm trying to implement a little MMORPG. I'm planning to use Cassandra DB for the database. Question I don't really understand which data should be store in DB and which one should be just kept in memory. For example the friend list. Friend list will be stored in DB, but what about connected disconnected friends ? Should I keep in memory all connected account and access it directly ? Or should I store this information in the DB (therefore writing reading quite often for something that could be kept in the memory) ?


Is there a way to make a dynamic world such as a MMORPG horizontally scalable? Imagine a open world of 500 players with data changing as fast as 20 updates player second. Last time I worked in a similar MMORPG, it used SQL, so obvioulsy it couldn't query the DB all the time. Instead, it loaded all players from the DB to memory as C objects and used them. That is, it scaled vertically. Would it be possible to make that server horizontally scalable instead? Is there a database designed to support that amount of updates concurrently?


What are some alternative options for saving level data for a game like Hurtworld? For a multiplayer building crafting game like Hurtworld (where the player can build structures on the map), what are some alternative options or example data structures for saving the world data on the server? Level data including Grid of squares that foundations can be built on, with a flag to indicate whether the square is empty or already has a foundation Walls etc which have been built on the foundations, and multiple floors above Windows doors which can be built on window frames door frames Furniture machines which can be placed on foundations floors Other dynamic world data such as trees, animals, chests with items, etc I feel like it's too much data to store in a database. Am I wrong? If it can be stored in a database, how can I get my head around the data structure I would need to set up? Is there some simplified example? Can each square in the world grid be represented by 1 row in the database? And should there be a new row for each structure built on a square, with that row referencing the square structure that it was built on?