Debug drawing collision volumes

21 views
Skip to first unread message

vecima

unread,
Dec 8, 2015, 3:41:08 PM12/8/15
to ReplicaIsland Coding Community
Hi RICC,

I'm making a game that started from RI, and the dynamic collision concept is pretty much unchanged. This is where you assign "attack" and "vulnerability" volumes to each frame of animation for a character. I've been doing a lot of work on various characters, and it's been a PITA to figure how how big the volumes should be for each frame of each animation. I was wondering if there was a way to draw the volumes in the game for debug purposes to make it easier to see the sizes. I realize in RI that the character sizes in world units matched up to size in pixels so you could use an image editor to determine where the volumes should be, but in my game I've added support for sprites with different sizes than the character (128px by 128px character sprite, where the character size in world units is 64 by 64).

Has anyone done this, or know what the best approach would be? I don't think the RI code supports this already, but I could be wrong (which would be awesome).

Thanks in advance!
Eric

vecima

unread,
Jan 20, 2016, 11:23:31 PM1/20/16
to ReplicaIsland Coding Community
To any reading this, I've found that the Replica Island code already supports this, but it's commented out.
In Game.java (around line 239 unless my file has changes, I can't remember) look for the following lines:

            // debug systems
           
//BaseObject.sSystemRegistry.debugSystem = new DebugSystem(longTermTextureLibrary);
           
//dynamicCollision.setDebugPrefs(false, true);


uncomment the latter two lines and the game should draw squares & circles representing your collision volumes.

Chris Pruett

unread,
Jan 21, 2016, 7:17:48 AM1/21/16
to replica-island-...@googlegroups.com
I had 100% forgotten that this was in there.  Nice find!

Also, to my past self: “setDebugPrefs” is a terrible function name.


--
You received this message because you are subscribed to the Google Groups "ReplicaIsland Coding Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to replica-island-coding...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages