Jump to content
  • Advertisement

Banavalkar

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

113 Neutral

About Banavalkar

  • Rank
    Newbie
  1. Banavalkar

    Warcraft 3 style Collision avoidance

    Well, here is a basic prototype. Currently units just have basic steering behaviours like seek and flee. All units have a collision radius. And when a collision is detected they are simply separated. I haven't done any complex obstacle avoidance yet cause I'm still trying to figure out what strategy is best to use in my case. As you see, now units still often overlap each other and even if the collision with one unit is resolved, it might cause a collision with the other unit and so on. So, obviously, it's not the way I'm gonna leave it. So, here is a link http://www.fastswf.com/dAfu7cM if it helps (I'm using Flash AS3). The finished version will be a top-down view strategy where units are controlled by player-written AI. The map will be quite small (probably up to 4 times bigger than you see it now compared to units' sizes).
  2. Banavalkar

    Warcraft 3 style Collision avoidance

      http://aigamedev.com/open/tutorials/clearance-based-pathfinding/   by finding a clear path, you avoid obstacles, thus collisions are avoided.   a game that uses some form of A* will typically re-calculate paths from time to such as when a path is deemed no longer valid. other approaches include only doing A* out to a limited range instead of the entire map, and re-calculating from time to time - used for lots of units and large maps where full blown A* of everything is too slow.   generally speaking, A* is known to be processor intensive, so you want to calculate path only when required.   note that heuristic approaches can also yield good results in your case (many units, not complex environment, no concave obstacles).   But imagine.. All units are moving all the time. So if one unit receives an order to follow other unit, then the path should be recalculated if not every frame, then at least quite often (because the goal position is changed). And also the passability map should be updated every frame (possibly a bit less often) based on the current unit's locations. It already looks like it's gonna consume lots of CPU. Generally speaking, the path calculated for a unit will already be invalid for the next frame... So, what is the solution? Maybe in my case the Warcraft 3 solution is not feasible then?
  3. Hello guys. I'm trying to write a simple 2D strategy game. However it has some specific features to consider while programming collision avoidance system. And I'm a bit stuck choosing appropriate algorithms. I was thinking that Warcraft 3 style collision avoidance could work but I'm not sure what are they using there. So here are some special features that need to be considered: The map is just flat and doesn't have static obstacles, so no pathfinding is required (or is it?) The map will normally have 2 armies consisting of up to 300 units in total.  All units are controlled by AI (not the player). Which means that all 300 will normally have different goals (attacking or avoiding different enemy units) Most of the time the order of each unit will be either to attack (follow) or to flee from another moving unit (not just to go to a specific point). So coordinates of the unit's goal will change constantly, as well as it's speed vector. My explanation might sound a bit blurry, but I will be glad to provide a better explanation if needed.   As for Warcraft 3, I found that the way units avoid each other there would perfectly suit my needs. While trying to figure out what approach they use in Warcraft 3, I found many answers that refer to pathfinding (it is typically said that clearance based pathfinding HAA* is used) but none of those referring to collision avoidance.   While trying to figure out what do they use in Warcraft 3, I found that units that are not moving at the moment are treated as normal obstacles, so when calculating a path, the area where they stand is marked as impassable. (I thought so because when there were some units standing in a line and I sent a unit right behind them, the unit was not walking just straight into this formation and then trying to find the way around, but from first chose it's pass in a way that went around these units even if sent from far away). But what about moving units? My guess is that the path is recalculated each time a collision occurs with all the nearby units (in some range of collision interest) are treated as obstacles as well. But that sounds a bit naive.. Anyway, with the features my game has, such approach is not feasible.
  4. Banavalkar

    Multiplayer platformer game architecture

    That doesn't sound so good. And what about games where one of the players act as a host? Like Warcraft 3, for example. There a host is basically a server. How is it made in such games? p.s. I haven't chosen the model really yet. The key thing is that I'm using Flash as one of the technologies.
  5. Banavalkar

    Multiplayer platformer game architecture

    Thanks for your answer. But I'm not using Adobe Media Server. As I've written, I'm using SmartFoxServer2x. In this kind of set up UDP is not available. It would be if I was using AIR. But the game will be in browser so I'm limited to using TCP.   I'm not really asking about the actual implementation using Flash. I'm asking how it is normally done. The only limitation is that I can't use UDP. So don't think too much of what technologies I'm using. Just think of possible ways to organize such game so that the clients would be synchronized and latency and server load would be minimized.   Btw, if anyone knows the game Teeworlds game, I think the concept should be approximately the same. It's a multiplayer real-time platformer/shooter which is very responsive in terms of lag. The question is how did they make it?
  6. Hello, guys. I'm now working on a Flash multiplayer platformer game (2D hero arena). I'm quite new in the world of multiplayer games and really confused thinking of what approach to use to synchronize all clients. For the server I decided to use Smartfoxserver2x. I've read some articles on the internet and one of the approaches they suggest is to run the same game simulation on the server and to synchronize all clients with it. In this case clients would just send input events to the server and get back the updated position, etc. But the problem of this approach is that I would have to write all the game mechanics including it's physics (I'm using ActionScript 3 Nape physics engine for my game on the client side) on the server (on Java) and it's very complicated. And unfortunately, there is no Nape version for Java.   To understand better what I want to make, you can see this example http://92.243.68.118:8080/game/Platformer.html (AWD to move hero and mouse click to attack). At the end it's supposed to be multiplayer with minimum lag. Currently players just send keyboard and mouse messages to each other via server and there is no synchronization at all. So players might see completely different things.   What approach can you suggest for such game?   p.s. Few other things to mention.. 1. In the final game users will be able to create gaming rooms (16 players max) that can be joined and left by other players at any time. 2. The game is in Flash so only TCP connection is available (no UDP)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!