Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879989 Posts in 33015 Topics- by 24385 Members - Latest Member: jhewitt

May 25, 2013, 12:51:24 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)A tool for hitbox drawing/calculation
Pages: [1]
Print
Author Topic: A tool for hitbox drawing/calculation  (Read 755 times)
Arvind
Level 0
**


Cheesy motivational one-liner goes here.


View Profile WWW Email
« on: August 05, 2012, 01:24:17 PM »

I'm a programmer working on a 2d double dragon style fighting game, where I store my sprite clips and hitboxes in xml.

Is there a tool which lets me specify the sprite image and the output file so that I can visually draw hitboxes on the sprite and get the output rectangles? (Not necessarily the exact same format, if it's open source I could modify it).

Here's what a single frame of my game looks like: (clip is the sprite clip, box_v is vulnerable hitbox (hurtbox), box_d is damage hitbox)
Code:
<frame>
<!--When sprite is facing left-->
 <left dx="0" dy="0">
   <clip x="200" y="3000" w="200" h="200" />
   <box_v x="71" y="14" w="74" h="172" />
   <box_d x="0" y="0" w="0" h="0" />
 </left>
<!--When sprite is facing right-->
 <right dx="0" dy="0">
   <clip x="200" y="2800" w="200" h="200" />
   <box_v x="54" y="14" w="74" h="172" />
   <box_d x="0" y="0" w="0" h="0" />
 </right>
</frame>

Link to video of hitbox tool similar to what I'm looking for (this is just a viewer afaik)

My current workflow involves me drawing hitboxes on the sprite sheet in paint.net, and then manually inputting values for each frame. This can be rather...taxing on my sanity (not to mention very inefficient), I'm hoping there's a better way to do this.

Any help would be awesome.
I searched the forums for this but didn't find anything, pardon me if it's a repost.
« Last Edit: August 05, 2012, 01:33:27 PM by Arvind » Logged

Xienen
Level 2
**


Greater Good Games


View Profile WWW Email
« Reply #1 on: August 06, 2012, 08:24:16 PM »

In all honesty, it'd be pretty easy to write this tool from scratch(especially if you already have a renderer and image loader).  I'd suggest create a new "mode" for your engine(which could be flipped on via the command line: edithitboxes ./path/to/file.jpg) and then just catching the mouse click/drag to draw a box.  For bonus points, you could catch the mouse wheel to get a little zoom going.  Everytime a box is drawn, output some static XML file(possibly named HitBox.xml).
Logged

Owner/Programmer at Greater Good Games makers of Break Blocks
Currently developing It Hungers(Unity) and Swipe Attack(UDK)
Arvind
Level 0
**


Cheesy motivational one-liner goes here.


View Profile WWW Email
« Reply #2 on: August 06, 2012, 09:03:40 PM »

The approach would work for a very simple hitboxes, but I've got about 8 frames like the one I mentioned for each animation, and about 20-odd animations for a single character. Without a proper tool to play/pause through animations frame by frame, this method won't work very well.

Making my own tools is a last resort, but I was thinking that there has to be an existing tool or project I could use and/or contribute to. With all the games being made, somebody better than me would have dealt with this problem by now Smiley
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic