Previous Blog Next Blog
Prev/Next Blog
by date

HBW new demo, now we're getting somewhere

HBW new demo, now we're getting somewhere
Name:David Horn 
Date Posted:Mar 10, 2008
Rating:5.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for David Horn

Blog post
Well things are starting to shape up a little.




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.



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.



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.



Please have fun and any comments are appreciated.
God bless
...til next time

Recent Blog Posts
List:11/03/08 - Homebrew Wrestling Official Demo
07/31/08 - Homebrew Wrestling - gameplay video and pics
05/19/08 - Homebrew Wrestling - first gameplay video
03/10/08 - HBW new demo, now we're getting somewhere
02/08/08 - Homebrew Wrestling - 1 step forward, 5 back
01/08/08 - Homebrew Wrestling Tech Demo
12/06/07 - The start of the Arena
12/02/07 - Homebrew Wrestling intro

Submit ResourceSubmit your own resources!

J.C. Smith   (Mar 10, 2008 at 14:45 GMT)
That's looking pretty good, nice work.

Scott Burns   (Mar 10, 2008 at 15:02 GMT)   Resource Rating: 5
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.

David Horn   (Mar 10, 2008 at 15:10 GMT)
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.
Edited on Mar 10, 2008 15:22 GMT

Scott Burns   (Mar 10, 2008 at 17:18 GMT)   Resource Rating: 5
It's always the little things. :)

I just played with it and it's working for me now. Looks excellent!

Jondo   (Mar 10, 2008 at 19:37 GMT)
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

Ross Pawley   (Mar 10, 2008 at 20:33 GMT)
@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.

Daniel Eden   (Mar 10, 2008 at 21:36 GMT)
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).

DreamPharaoh   (Mar 11, 2008 at 01:31 GMT)
This looks like it id going to be a blast to play!

Robert Gascow   (Mar 12, 2008 at 09:37 GMT)   Resource Rating: 5
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.

David Horn   (Mar 12, 2008 at 12:17 GMT)
@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.

Robert Gascow   (Mar 17, 2008 at 04:42 GMT)   Resource Rating: 5
Any new progress, on your wrestling game?

You must be a member and be logged in to either append comments or rate this resource.