Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

SuperV1234

Member Since 26 Jun 2011
Offline Last Active Feb 28 2013 01:17 PM

Topics I've Started

[Video Tutorial] Solving the "crack" collision problem (getting stuck between t...

08 February 2013 - 08:39 AM

Hello gamedev, I made a video tutorial on how to solve a common problem encountered in 2D collision detection and resolution.
The issue often happens when your physical bodies live in tile-based environments. Sometimes the order in which the collisions are resolved is incorrect, and the physical body gets stuck between two tiles.
 
crackProblem.png
 
I've discovered two interesting ways to prevent (and fix) the issue, and I've created a tutorial video:
http://www.youtube.com/watch?v=FkcuCHleiWo
Enjoy!
 

Video description:

Foreword: this is my first time doing a video tutorial. Please excuse me for any mistake, or if the explanation wasn't clear. I've also had some technical difficulties - my microphone is broken, and my webcam has a very poor quality. I recorded the tutorial (both audio and video) using my iPhone 4S. Unfortunately the quality of the markers I'm using is also poor - they're old and I couldn't find anything better, but I will buy some better markers tomorrow.
You can see an EXPERIMENTAL implementation of the merging method here:https://github.com/SuperV1234/SSVSCollision[3]
Additional information: I've already written an article about collisions. It's outdated, but some concepts can be easier to understand in the article. I talk about spatial hashing and "overlap area" sorting, albeit in a different (and less elegant) way. If you need more info on what I'm talking about in the video, the article would be a good place to start.
http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-one/[4]http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-two/[5]
When I have time, I'll update the article and put it in my website. (http://http://vittorioromeo.info/[6] )
Please let me know if you need anything explained in the comments - and if you have suggestion on how I could record audio/video in a better way.
Thanks for watching.


Undefined reference to add-on methods/classes

21 November 2012 - 10:03 AM

I can include "angelscript.h" and use all of its methods/classes properly. I can include add on headers, but trying to use them gives me "undefined reference" problems.

I tried compiling with a lot of different parameters but that didn't work. Am I doing something wrong?

New to C++ from C#, is my pointer usage correct?

16 October 2012 - 09:33 AM

http://codepaste.net/rt4wj6

I've started learning C++ and wanted to make sure I'm not doing anything wrong. I've designed a very simple component-based entity system intended for game development.

An EntityManager manages pointers to Entity objects, and an Entity manages pointers to Component objects.

Game behavior is written by having classes that inherit from Component and override its methods.
The compiler was complaining about not having a virtual destructor in Component and I added one.

The Factory class is supposed to be an easy way to create Entity objects with preset component combinations.

This system is obviously not ready for game creation and missing many features, but the main point here is my memory management and pointer usage.

Is this the correct way to do it? What would you change?
Sorry if this is an unusual/uninteresting post, but I want to make sure I learn good practices from the beginning. Thanks for the help

Articles on 2d collision detection and resolution

14 August 2012 - 07:43 AM

Hello gamedev!

I just started a new blog where I can share my experiences as a novice game developer.

My first article is about the creation of a physics engine, how my initial project failed, how the engine worked, and how I managed to salvage it and create something useful.

I wrote this article for every starting game developer out there - it deals with technical problems in collision detection, and design problems such as "reinventing the wheel".

It is divided in two parts: the first one deals more with my experience and with the problems a game developer faces in designing a physics engine, the second one (the most useful) explains how my collision detection and resolution works, along with videos, diagrams, .gifs from my project and source code analysis.

http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-one/
http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-two/

Hope you find it interesting and useful, considering many questions nowadays are about collision detection.
Check it out!: D

Grid pathfinding with a lot of entities

12 June 2012 - 06:08 AM

I'd like to explain this problem with a screenshot from a released game, DROD: Gunthro's Epic Blunder, by Caravel Games

Posted Image

The game is turn-based and tile-based.

I'm trying to create something very similar (a clone of the game), and I've got most of the fundamentals done, but I'm having trouble implementing pathfinding.

Look at the screenshot. The guys in yellow are friendly, and want to kill the roaches.
Every turn, every guy in yellow pathfinds to the closest roach, and every roach pathfinds to the closest guy in yellow.

By closest I mean the target with the shortest path, not a simple distance calculation.

All of this without any kind of slowdown when loading the level or when passing turns.
And all of the entities change position every turn. Also (not shown in screenshot), there can be doors that open and close and change the level's layout.

Impressive.

---

I've tried implementing pathfinding in my clone.

First attempt was making every roach find a path to a yellow guy every turn, using a breadth-first search algorithm. Obviously incredibly slow with more than a single roach, and would get exponentially slower with more than a single yellow guy.

Second attempt was mas making every yellow guy generate a pathmap (still breadth-first search) every time he moved. Worked perfectly with multiple roaches and a single yellow guy, but adding more yellow guys made the game slow and unplayable.

Last attempt was implementing JPS (jump point search). Every entity would individually calculate a path to its target. Fast, but with a limited number of entities. Having less than half the entities in the screenshot would make the game slow. And also, I had to get the "closest" enemy by calculating distance, not shortest path.

---

I've asked on the DROD forums how they did it, and a user replied that it was breadth-first search. The game is open source, and I took a look at the [source code][3], but it's C++ (I'm using C#) and I found it confusing.

I don't know how to do it. Every approach I tried isn't good enough. And I believe that DROD generates global pathmaps, somehow, but I can't understand how every entity find the best individual path to other entities that move every turn.

What's the trick?

---

This is a reply I just got on the DROD forums:


> Without having looked at the code I'd wager it's two (or so) pathmaps
> for the whole room:
>
> One to the nearest enemy, and one to the nearest friendly for every
> tile.
>
> There's no need to make a separate pathmap for every entity when the
> overall goal is "move towards nearest enemy/friendly"... just mark
> every tile with the number of moves it takes to the nearest target and
> have the entity chose the move that takes it to the tile with the
> lowest number.


To be honest, I don't understand it that well.

PARTNERS