Tannerd

Members
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

117 Neutral

About Tannerd

  • Rank
    Newbie
  1. Hi all, what are the best practices to keep data synchronized in a multiplayer game? Is usually the server responsible to send up to date data based on the order at which it receives the events from the clients? Think for instance of a shooter game where players have rechargable shields: the simplest way that I can think of is that the server receives a "hit" event and then computes the up to date shield value of the hit player according to the time from the game start at which it _receives_ the event. Then the server sends the new shield value of the hit player to all of the clients (including the shooter player) that simply accept the new value. Has anyone ever thought of a strategy to move this computation away from the server? Is it something it is worth enough to think of, anyway?   Many thanks.
  2. I guess you will need to. Actually I think ( I am not 100% sure ) you should cast a circle (or a box) which is slightly more complicated. What you do in this case however, is enlarge the walls by the agent radius obtaining a sort of rounded walls (the corners of the inflated walls will be filled with arcs), and then cast a ray against them; the ray shall have length = distance_of_wall_detection (which could be current_velocity * time_of_prediction). You will need segment to segment intersections and segment to circle intersection ( [url="http://www.gamedev.net/topic/304578-finite-line-circle-intersection/"]http://www.gamedev.n...e-intersection/[/url] ) By the way, (I am saying this just not to let anything out) do you connect the node of the graph based only on the criterion that two adjacent cells are passable? If yes you should instead cast a box as large as a gridcell (or as large as an agent bounding box) towards an adjacent cell and connect them only if no intersection with any static obstacle occurred. In this way the smoothed path you showed might not be computed: the agent will go up to the cell with the value = 2 and the steer by 90° towards the goal. I hope this helps.
  3. Are these walls defined when an agent computes the path? Are they defining the maximum distance from the path that an agent must follow (path with a width)? If yes, you shift the path segments alongside their normal (both ways) and then change the extreme of these segments using the intersection with the lines passing through the extremes of the adjacent segments in order to roughly fill the gaps that creates (like the picture I posted before). Does this help?
  4. Maybe you want the agents to follow a path without getting too far from the segments of the path that connects the nodes, is that it? The example you posted shows a behaviour that seems just to perform a clamping of the agents positions against walls. If you need the agents to follow the path having their distance from the current path segment be less than an amount, you need just to define which is the current path segment and the distance from the agent. Compute the closest node to the agent find the graph links _in the path_ that share that node have the distance of the agent be less than an amount for one or both of the graph link just found and beware of "corners" as shown in this figure [url="http://i.imgur.com/jmpPK.jpg"]http://i.imgur.com/jmpPK.jpg[/url] (the red lines are the path segments normals, the blue lines are the imaginary walls that define your path width, the red ugly circles are the wrong agents positions, as you can see those agents in the corners shall compute their distance from the walls carefully) Just kindly check this strategy because I am not 100% sure it will find the correct path segments from which to measure the agent distance. Let me know if I understood correctly.
  5. Please find here the mesh representing the roads. [url="http://i.imgur.com/8D2N5.jpg"]http://i.imgur.com/8D2N5.jpg[/url]
  6. I guess yes they are freeform approximated by the triangles of a mesh, those roads were modeled on top of a google map fragment. Should I choose a semi-automatic approach? That is once the graph is generated I build a simple GUI to edit the nodes, so that I can add and smooth curves or simplify unnecessary complexity and so forth... I need also to understand if the graph should represent the actual lanes of the roads (that could be smoothed on run time by a path follower system) or if it should just be a sort of high level graph and then the agents will figure out what the lane to follow is.
  7. At least the first problem seems to have been solved. I am picking each side of each triangle and checking if there is any other triangle that have the same vertices as one of its side, if yes that side does not belong to the border of the road, otherwise I just add those two points to a list which contains couples of points representing the border of the roads. Now I need to find out how to compute and save the segments of the lanes.
  8. I have a mesh representing the roads of a town and its texture is a png where the non road points have alpha = 0 and the road points have alpha = 1. I have implemented PD control to move vehicles autonomously either following a line (this needs to be completed though, see below (*) ) or going towards a point. I need to make a tool (not working in real time during the simulation) that takes the mesh representing the roads and generates a graph and / or lines representing the centre of the lanes of the roads, so that the PD control can follow them in order the vehicles to drive in the lanes and they can perform pathfinding as well. So far it seems I need only one lane per way (small two ways roads) Does anybody have any suggestions? The first idea I had is to use the texture that I have been given to easy understand the segments of the triangles that are on the border of the roads: those sides of the triangles whose corresponding uv map points to pixels having at least one alpha = 0 pixel as neighbour are border sides. Now that I know what segments are on the border of the roads I can shift them inward (imagine X axis orthogonal to the side of the triangle pointing towards the alpha = 1 region and the correct way is Z = X x Y) by a fixed amount (the half of the size of a lane) and then connect them with the nearest segments computed with the same method for adjacent triangles. I think the connection points will be just the intersection between the lines passing through the segments. Could this work? So far it seem that I do not need to implement multiple lanes per way, but how would you generate them? (roughly I am thinking that if there is space I just add a parallel segment but I would need the rules of driving to connect them properly in order to generate a graph that implements the rules of the roads) (*) so far I compute the error using a line that is represented by a simple equation such as sin(x). I think I will need to compute the distance from a line represented by multiple consecutive segments. The first rough idea is to compute the distance from the lines passing through all of the segments (maybe with some optimizations, but currently this is not a big problem) and using the smaller as the error from the path.