Game Development Community

HBW new demo, now we're getting somewhere

by David Horn · 03/10/2008 (7:07 am) · 11 comments

Well things are starting to shape up a little.

www.homebrewwrestling.com/hbw11.jpg

I've had a couple issues, but thanks to the great members of this community, I was able to tweak the code enough to get a lot of wins this past month.

One major one was the fact that Torque does not have any kind of animation-based movement. In other words when someone animates, it actually affects the position and rotation.
Enter getNodeTransform. The savior for HBW.

www.garagegames.com/mg/forums/result.thread.php?qt=24275

What Ramen-sama has done is given the ability to get the transform of a particular node within a DTS. When I call my animate function, I pass a parameter called abm (animation-based movement). If that's set to 1, then when AniDone gets called (after any animation concludes), I get the transform of that node and then set the Transform of the AIPlayer to that and bingo, animation-based movement.

www.homebrewwrestling.com/hbw8.jpg
Now that's only done for position. Rotation is a little different. Rotation is set per move. I ran into some issues trying to set rotation due to the fact that the editor is in degrees and Torque is in radians.
So I created a function in script to rotate an object. Hopefully it's useful to some people.
function rotateMe(%wrestid, %deg){
   %xfrm = %wrestid.getTransform();
   %lx = getword(%xfrm,0); // first, get the current transform values
   %ly = getword(%xfrm,1);
   %lz = getword(%xfrm,2);
   %rx = getword(%xfrm,3);
   %ry = getword(%xfrm,4);
   %rz = getword(%xfrm,5);
   %rd = getword(%xfrm,6);
   echo(%rz @ " " @ %rd);
   //convert to degrees
   %rd = mRadToDeg(%rd);

   if (%rz < 0){%rd = 360 - %rd;}

   //apply rotation
   %rd += %deg;
   if (%rd > 360){%rd -= 360;}
   %rz = 1;
   //convert to torque
   //echo("here: " @ %rd);
   if (%rd > 239){
      %rz = -1;
      %rd = 360 - %rd;  
   }
   %rd = mDegToRad(%rd);
%wrestid.setTransform(%lx SPC %ly SPC %lz SPC %rx SPC %ry SPC %rz SPC %rd);
schedule(10,0,scaleme, %wrestid);
}
%wrestid is the id of the object to be rotated.
%deg is the rotation in degrees that you want to rotate the object.

I also was able to use the getNodeTransform to keep the wrestler within the ropes during a grapple move. I check the node and slide the wrestlers over. I still have to implement that on the "fallback" animation.
So here is the tech demo of the project thus far. We definitely have the start of a fighting engine.

http://www.homebrewwrestling.com/HBWTech_3_9.zip

"arrows" move you around, "a" performs a strike, holding "a" down performs a kick, "s" performs a grapple. Grappling normally allows you to use light moves. Grappling a dizzy opponent performs heavy grapple moves. I only have 2 moves so far.

So to perform a bodyslam...
Grapple an opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to bodyslam him.

www.homebrewwrestling.com/hbw9.jpg
To perform a suplex...
Get the player dizzy by kicking him 1 time or striking him 3 times. Grapple him opponent by moving towards him and hitting "s" on the keyboard. Move the player around if you want. Then hit "s" again to suplex him.

www.homebrewwrestling.com/hbw10.jpg
Please have fun and any comments are appreciated.
God bless
...til next time

#1
03/10/2008 (7:45 am)
That's looking pretty good, nice work.
#2
03/10/2008 (8:02 am)
Well it looks like you've made quite a bit of progress. The screens look cool, unfortunately it looks like something is missing from the demo you posted. The objects get loaded but PlayGui is never pushed. I pushed the PlayGui manually but it seems the problem is the result of the players not actually being created.

I found this in the console log:
Quote:
Object 'PlayerBody' is not a member of the 'GameBaseData' data block class
game/server/game.cs (126): Register object failed for object (null) of class Player.
Set::add: Object "0" doesn't exist
game/server/game.cs (130): Unable to find object: '0' attempting to call function 'setTransform'
game/server/game.cs (131): Unable to find object: '0' attempting to call function 'setShapeName'
game/server/game.cs (134): Unable to find object: '0' attempting to call function 'getEyeTransform'

--------- woooooooooooooooooooooo game stuff started ---------
Object 'PlayerBody' is not a member of the 'GameBaseData' data block class
game/server/game.cs (152): Register object failed for object ctarget of class AIPlayer.

I dug around in the scripts and it seems like the player customization isn't loading a default player, so a null player is trying to be created.

I also saw references to ctarget having problems in the log. I noticed in the scripts that you've named a camera and the AIPlayer both ctarget. I don't know if this was by design or accident, but that will probably cause problems down the line, if it isn't already.
#3
03/10/2008 (8:10 am)
hmmm... let me look into this scott. Thanks for pointing it out.


*edit - ha... deleted a file. Never good.

The link to the tech demo has been updated.
#4
03/10/2008 (10:18 am)
It's always the little things. :)

I just played with it and it's working for me now. Looks excellent!
#5
03/10/2008 (12:37 pm)
Sounds like a great fix for the lack of anim-based transforms... and thanks for posting the script, I think it will help us alot in Ruin.

DL'ing the demo now, looking forward to checking this out.

Jondo
#6
03/10/2008 (1:33 pm)
@David, good work man! I remember your first post and I'm glad you stuck with it. Torque can be a pain to get started with, but you've proven it can be done with some elbow grease and forum posts.
#7
03/10/2008 (2:36 pm)
Stock Torque supports animation-based movement and rotation through the use of animations with ground transforms. That being said, you'd need to add about a half dozen lines of code to something like the player class to get it to work properly (it already does for death animations, just not other ones).
#8
03/10/2008 (6:31 pm)
This looks like it id going to be a blast to play!
#9
03/12/2008 (2:37 am)
Thank You for helping a newbie like me out, with making a wrestling game for torque. I have created a wrestling game with 3d gamestudio, but the only draw back with that engine, is that, it doesn't support shared animation, and coming from two developers, that know wrestling games, it is very important to have that feature, because of the massive amount of moves, from execution to selling. Please keep me updated with your progress, because I promise, you and I both will change the torque engine for newbies who wants to make fighting games.

P.S. Let's make M.Dickie step his game up, and help bring him over to torque. NO Mercy Killer.
#10
03/12/2008 (5:17 am)
@robert wow - i can't believe it doesn't support that?

@Dream, Scott - thanks!

@Daniel - I did look into modifying the Death sequences so that all sequences would act as such. It's just that this solution worked quicker than that one.

@Ross - Thanks man... hopefully I haven't been a pain in the forums. :) I really try to do the research as much as i can before i post.
#11
03/16/2008 (9:42 pm)
Any new progress, on your wrestling game?