JTMK Engine

by Aistarin


Posted on February 14, 2011 at 6:06 AM



Platform/skeletal animation engine for my upcoming games, including JoAnna The Magical Kitsune, a Gunstar Heroes-type scrolling shooter, and Kilin's 64Brawl (name pending).

FEATURES

-Fully 2D skeleton-based animations thanks to Drifter's Sk2D -Smooth animation blending between animations
-Pixel-perfect platforming collisions thanks to Jenner's Platform Engine v2
CONTROLS

-Z to shoot
-X to jump
-Directional buttons to move (quickly press twice to run)
-Down to forward-roll while running or to drop from a ledge
-1 to toggle debug mode
-2 to toggle slomo
-Q and W to scale the room

BUGS

-JoAnna rolls in the air when she run-jumps from a slope or the very edge of a platform
-Pressing the directional buttons twice sometimes fails to enable running
-Landing from a high place will result in JoAnna jumping again
-Some others

TODO

-Crawling
-Jump/crawl up from hanging
-Attacking/shooting
-Smoother, more responsive controls
-Optimize the shit outta everything
-Document/comment the code
-Re-implement engine in C++/SFML
-Release the GMK source after the engine is re-implemented in C++

Version History:

2/6/2011: http://64digits.com/users/index.php?userid=Cyrus&cmd=comments&id=269713
12/10/2010: http://64digits.com/users/index.php?userid=Cyrus&cmd=comments&id=269274
10/17/2010: http://64digits.com/users/index.php?userid=Cyrus&cmd=comments&id=268909
10/11/2010: http://64digits.com/users/index.php?userid=Cyrus&cmd=comments&id=268876



Ferret commented February 14, 2011 at 6:04 AM
This is awesome cyrus! :D
I think the responsiveness would be fine if ledges were wider and there was more room to work with. The animations are great. I think you need to make double tapping arrows to run a little easier, it usually takes me a few tries to run. (Noticed that you think thats a bug, why not just use alarm?) Can't wait to see this improve.
colseed commented February 14, 2011 at 6:11 AM
Looks neat, I'll have to try this tomorrow.
Aistarin commented February 14, 2011 at 6:12 AM
Yeah, I'm using alarms for the double tapping. Pressing a directional key sets a setRun variable to true and alarm[0] to 10, which sets setRun back to false. If the directional key is pressed again before setRun is set back to false, run is enabled to true. However, I think there's an animation event dependent on checking if the player is in the air that is setting run back to false.
JID commented February 14, 2011 at 6:12 AM
Pretty smooth, only wish you could jump and roll without having to run first.

And I agree with Ferret.

8/10
Aistarin commented February 14, 2011 at 6:14 AM
You can do that if you quickly press forward+down twice.
Ferret commented February 14, 2011 at 6:16 AM
Hmmm, 10 frames doesn't sound like a very large window to double tap, but maybe I'm underestimating my ability to tap quickly.
Aistarin commented February 14, 2011 at 8:39 AM
I'm gonna restructure the animation events script soon, because it's becoming exactly what I tried to avoid through using animation blending.

EDIT: Perhaps tomorrow I should finally release the source?

Also, I lol'd at my very low rating. Might be a glitch, lemme check...

Hmm...apparently messing around with the rating selection and choosing none submits a rating of "zero" instead of "NULL". I've already given myself a rating of "zero" three times, according to the database.

lol64D
Ferret commented February 14, 2011 at 8:56 AM
Probably only happens when you edit your comment, since it's only 4 votes and JID is the only one that actually has.
Aistarin commented February 14, 2011 at 4:19 PM
Yeah I'ma have to look into this later today. I had to nullify my votes through the database.
JuurianChi commented February 14, 2011 at 9:23 PM
Pretty good, level design should compensate for the way jumping works though.
Aistarin commented February 15, 2011 at 3:37 AM
Updated: controls should be easier to handle and more difficult to break.
Ferret commented February 15, 2011 at 3:39 AM
Still kinda have the same problems, only now I don't continue running after jumping.
Aistarin commented February 15, 2011 at 5:09 AM
Then you just suck at double tapping. The final product may have an option to set the run-walk delay. >:(

Anyways, updated with more bugfixes. Last bug I'm gonna try to tackle before I begin on gameplay is the one where JoAnna flaps her hands like wings when she either jumps from the absolute edge of a platform (past the vertical center of the sprite mask), a slope, or when you double-press the up and left/right buttons. They all seem to be affected by the same bug. Also, crawling and jumping from the edge of a slope.
mazimadu commented February 15, 2011 at 10:00 AM
Ran into a few game breaking bugs. First, there are some collision problems that happen when ever Jo jumps. I am guessing either the mask keeps changing or the sprite keeps scaling.

Also, I don't know if this is my pc or the C code used in SK2d, but the game eats a ton of CPU (but still runs smoothly, I changed the theme of my MSI U230 to XP since it hates GM6+ games). I terminated the app and it still lingers according to the resource manager.

So far, good job though.
Aistarin commented February 15, 2011 at 10:11 AM
The mask would only change when you are rolling, so it may have to do with the skeleton events checking if the player is on the ground. You can especially see this if you try jumping from a slope or an edge (or some weird combination of keys). As for the CPU usage...this isn't really intended to run on a netbook at the moment. On my system (Intel Core 2 Duo 2.10GHz), there needs to be 10 JoAnnas on screen at once for any noticeable slowdown.
Carlos508 commented February 16, 2011 at 3:35 AM
very cool! I've actually never seen 2D skeleton animation before
[edit]
oh yea, the double tap delay should be a little longer too...but i suck at double tapping sooo
Castypher commented February 16, 2011 at 4:27 AM
I figure since part of this is for me, I should finally comment on it.

The animations are very impressive, and for the most part, collisions and transitions are very good as well. But you've got some mean bugs too. For one, going out the side of the screen teleports you back, and your character's movement is broken.

Also, I see the double-tapping issue. Lengthen the timeframe to either 15 or 20 steps and I think it'll be fine.

Other than that, the only thing I don't like is how holding the up arrow makes you continue to jump. It looks very sloppy.

And other than that, it looks pretty solid. I'm not going to rate, so have another zero.
Aistarin commented February 16, 2011 at 6:28 AM
Dunno why, but every time I try to restructure the code, the character animation always break. I've rewritten the animation events script a few times to simplify things for anyone else who might be reading my code in the future.

NOTE TO SELF: next time you restructure the animation events code, check for animations that are currently playing rather than checking the dozens of Boolean variables that you made to describe every single character action. FFS, If statements are taking up the whole page. The only variables I should be checking for are which animations are currently playing, is the player free in the air, rolling, in the process of jumping, or grabbing on to a ledge. Srsly, no need to make things more complicated.
colseed commented February 16, 2011 at 7:02 AM
Looks good.
Double-tapping is slightly annoying (as others have said), but that should be solved by what Kilin said about modifying the timeframe.

Only other thing I had trouble with was (seemingly) randomly getting stuck in the walking animation, not being able to move, and so having to hit Esc. : /

EDIT: Dangit 64D just counted that comment as a vote didn't it -_-
Aistarin commented February 17, 2011 at 6:46 AM
Ok I updated it. I made it easier to double-tap and made the animations harder to break. There's still some glitches, such as when the roll animation finishes underneath a block, but this should be fixed when I make crouching/crawling animations this weekend. Also, holding down the jump and directional button doesn't allow you to keep jumping forward. I was gonna remove this ability anyways, so yeah.
Ferret commented February 17, 2011 at 8:54 AM
Love the changes. Kinda would like to keep running after a jump run. Also does the running cancel out if I accidentally triple tap?
Aistarin commented February 17, 2011 at 9:32 AM
It shouldn't. Does it?
Ferret commented February 17, 2011 at 10:14 AM
Feels like it does sometimes.
Aistarin commented February 19, 2011 at 9:42 AM
Updated my demo with shooting and other stuff. New controls as well.

Shooting doesn't look very smooth at all at the moment, so smooth aiming will come later.