Collision Detection for a 2D RPG
Posted
by
PHMitrious
on Game Development
See other posts from Game Development
or by PHMitrious
Published on 2012-09-20T06:24:08Z
Indexed on
2012/09/20
9:52 UTC
Read the original article
Hit count: 322
First of all, I have done some research on this topic before asking, and I'm asking this question as a mean to get some opinions on this topic, so I don't make a decision only on my own, but taking into account other people's experience as well.
I'm starting a 2D online RPG project. I am using SFML for graphics and input and I'm creating a basic game structure and all for the game, creating modules for each part of the game.
Well, let me get to the point I just wanted to give you guys some context.
I want to decide on how I'm going to work with collision detection. Well I'm kinda going to work on maps with a tile map divided in layers (as usual) and add an extra 2 layers - not exactly in the map - for objects. So I'll have collisions between objects and agents (players - npcs - monsters - spells etc) and agents and tiles. The seconds one can be easily solved the first one need a little bit of work.
I considered both creating a basic collision test engine using polygons and a quadtree to diminish tests since I'm going to be working with big maps with lots of objects - creating both a physical and graphical world representation. And I also considered using a physics engine like Box2D for collision tests.
I think the first approach would take more work on my part but the second one would have the overhead of using a whole physics engine for just collision detection and no physics.
What do you guys think ?
© Game Development or respective owner