Previous Blog Next Blog
Prev/Next Blog
by date

Homebrew Wrestling - 1 step forward, 5 back

Homebrew Wrestling - 1 step forward, 5 back
Name:David Horn 
Date Posted:Feb 08, 2008
Rating:3.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
I'm getting closer and closer to realizing that making a non-first-person-shooter or racing game in Torque is more of an uphill battle than I really wanted it to be. I've made some major progress and have conquered some major milestones. However, I've run into a couple HUGE walls that may be unsalable unless I spend months and months of C++ study. Hopefully I'm overreacting.

Let's start with the good. This addition of the HBW blog contains a Tech demo that hopefully some other people will be able to use. It's the character select screen. Right now, I have the wrestlers defined by XML documents.


<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<presets>
<wrestler>
<props name="The Undertaker" bodyshape="powertall_longhaira" id="taker"/>


</wrestler>
</presets>


So far, these documents define the id, name and bodyshape (dts). In the future I hope to define other things like the moves, the music, etc. So that when I implement the Create-A-Wrestler feature, I can have the final output be this xml file (along with the textures) so that people can easily share new wrestlers. The program dynamically searches for all xml docs in a particular folder and loads them into the drop down. Then, the program searches for all of the corresponding textures. So if you choose The Undertaker, all files starting with the id of "taker" will be loaded. Then if you want to add another texture/outfit later on down the line, simply drop a jpg that's name starts with "taker" and it will find it and load it. Neat, huh?



Once you select the 2 wrestlers, I load 2 AiPlayers and position them. Then I load a third dummy in there with a transparent skin. This dummy always stays between the 2 wrestlers and acts as the camera target. Setting the dummy's SetMoveDestination to the average of the x and y coordinates of the wrestlers; I can get some pretty smooth camera work.



Now the bad. Oh, the bad.

I happily created animations for the walk, side, etc. of my AiPlayer wrestler. I learned how to use the arrow keys to move him about. I basically use more SetMoveDestination commands to move the AiPlayer. I can even use my Xbox 360 analog controller. Then I realized one thing. I HATE datablocks. Anyone who says they can give me a million reasons why making datablocks static is a good thing, I'll give them 2 million reasons why they aren't a good thing - at least for non-FPS games.

Let's back up for a second. If you look at the code... by the way, as usual, since this is a hobby and non-profit, ALL of my code is available for free. Please find something that you can use for your game, and use it freely. You can download it here.

www.homebrewwrestling.com/HBWCharSelect.zip


I'm hoping that this is enough compensation for all the help I ask for :)

If you look at the code, you'll notice that I have different datablocks for different types of players. One for normal/long hair, one for power/longhair and one for powertall/longhair. This is because I can't dynamically tell the Torque engine which dts to load in. If I want a tall fat bald guy, I have to make and entirely new datablock for that dts. I think that's ridiculous. I should be able to pass a dynamic file for the baseshape - or shapefile. Not sure what the difference between the baseshape and the shapefile is - seems redundant? I really wanted to use the hidemesh code, but it doesn't seem to work in 1.5.2?
That's fine - and really the least of my problems.

The big problem is animation.

Animation sequences are tied with a particular dts as defined in the datablocks. You can only have up to 127 (some say more with alteration in code) STATICALLY defined sequences/animations. These 2 facts are detrimental to my project. Let me explain.

Let's say for example I want it to work like this: when you press the "s" key, Hulk Hogan does a bodyslam. In Torque, I add 2 sequences for the power/longhair datablock that define the bodyslam and the bodyslam receive animations. 3 problems...

1 - if I bodyslam The Undertaker - who's datablock is powertall/longhair, he can't do it because he has no idea what a bodyslam is because it's not a sequence that is in his datablock. So I have to add the two bodyslam animations to his datablock.

2 - Now when The Undertaker hits "s", let's say his move is a piledriver. I can't define his "s" move as a piledriver because it's already defined as a bodyslam because of reason number 1

3 - what happens when I create another wrestler that uses the same power/longhair dts model as hulk Hogan. But that wrestler happens to do a bear hug when I hit "s" - that's impossible because the power/longhair datablock already has a bodyslam for that sequence.

So every wrestler's datablock would almost need to have every animation possible hard-coded into the sequences. I'll have hundreds.

When I did this game originally in Macromedia Director and Shockwave, I dynamically searched for all of the moves (I kept them in a particular folder) and loaded all of the animations into the world. Then any wrestler I created would have access to perform any move they wanted to. In addition, they weren't static, so I could add new moves in at any time. If I have to program this functionality into the C++ engine, I'm going to cry.

Another side-note weird thing is that when you choose Hulk Hogan as the wrestler, I added the functionality of hitting the "a" key to punch by using SetActionThread("puncha",false,false) however this won't work when he's moving??? And there is a 1 second pause after the animation is over before he starts into his idle animation again. Not sure what's causing those 2 problems.

Can anyone help out with any of these issues? There's beer in it for anyone who can help me. Ok, maybe not. But there's a free game in it for you :)

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!

Brian Kirchgessner   (Feb 08, 2008 at 18:14 GMT)
Suggestion to solve your problem with the datablocks

Custom Shape Mod (havent tried it personally yet)
Hide mesh (works if you do it right, if you need help w/ 1.5.2 i can show you my files)

We are trying to utilize the hidemesh in our game, as we are learning we have no idea how to tackle this beast, but we are trying to utilize the sqlobject or the saveloadobject to be able to save the character so he/she can load into the game with the appropriate clothes, hair, etc.

With the hidemesh you can use 1 skeleton, 1dts object, and 1 datablock to make literally hundreds of characters (3ds max tho). Then if you add static presets (or dynamic) using the custom shape mod, you could have tall fat long haired guy do bodyslams like the bald midget wrestler...

Edit: Added more info
Edited on Feb 08, 2008 18:18 GMT

Brian Kirchgessner   (Feb 08, 2008 at 18:20 GMT)
then looking threw one or both of these you can start programming in your dynamics in the datablocks
Variable/Dynamic Movement
Dynamic Agility

David Horn   (Feb 08, 2008 at 18:31 GMT)
Actually, if you look at the very last post of the Hide Mesh link you posted - it's me lol. I tried that and couldn't get it into 1.5.2 successfully. I probably didn't do it right. Thought I get no errors on my clean build.

But actually saving and loading is something I can do. Download my tech demo and from there you should see the code that I have for creating and saving arena presets. I do it by reading and writing XML.

I'll take a look at the other 2 resources you sent about the dynamics...

Scott Burns   (Feb 08, 2008 at 18:37 GMT)
OK, I have suggestions for you that I think could help here. I haven't looked at the code yet, so this is all based off what's in the post.

My first suggestion is that you may want to rethink how you do your avatars. Stick to a couple generic base avatars that are capable of all the moves, which it looks like you're kind of already doing to some degree, but this leads in to my next suggestion.

There's a dts scaling resource, I'll see if I can dig up the link, this resource allows you to scale the model based on each node in the skeleton. I've used it before and it works extremely well. So now if you want a big fat guy and you don't want to create an entirely new db, you only have to use the resource to scale the skeleton, save the scaling factors out and when that character is loaded his model will be scaled to how you want it.

That's just couple of ideas that immediately came to mind from the time I worked on character customization.

edit:
That Custom Shape Mod that was linked was the resource I was referring to. The agility one is also another good one I've used before.
Edited on Feb 08, 2008 18:41 GMT

David Horn   (Feb 08, 2008 at 18:54 GMT)
I did look into the Custom Shape Mod, but really that's not too much of a big deal IF I can successfully implement the Hide Mesh code. If I can do that, I can add all of the hair styles into the DTS files, read from the XML docs to see which one to set to visible, and then I'd really only have 3 or 4 avatars at the most - even without using the Custom Shape Mod.

My main problem (other than the pause after the setActionThread and the fact that I can't activate the punch while walking - which is a major setback), is the fact that any wrestler needs to be able to access any of my dsq files. That datablock is going to have TONS of sequences.

I'm almost thinking of somehow reading in all of the external dsq files into an array, resetting the sequence buffer size so Torque doesn't choke on hundreds of sequences, then dynamically build the datablock through some type of elabotate eval statement. :)

Brian Kirchgessner   (Feb 08, 2008 at 19:31 GMT)
Ill pack up my 1.5.2 changes to the hidemesh and ill send them to you.

I played with it for several days til i got it to work, now it loads and even works in the console, the only thing I cant figure out is how to do it within guiobject view, but I worked around that with having my main menu load a level instead.

Scott Burns   (Feb 08, 2008 at 19:35 GMT)
That problem's a bit tougher, as I haven't hit the wall on dsq's in anything I've done myself, so I wouldn't really know where to start looking for that one.

I have encountered the punching one before, but I never got the chance to solve as it was part of some experimental code that was later abandoned. I think the problem involved setActionThread not working how I expected it to work. I had multiple positions in that one and I ended up rewriting how pickActionAnimation worked.

David Horn   (Feb 08, 2008 at 19:41 GMT)
Where's that? in the player.cc file?

I also tried the playThread command, but that really screwed up the walk/slide animations.

If you happen to download it, use hulk hogan and hit "a". you'll see the pause. I have the command inside the WrestlerInput.cs file

Thanks, Brian!
Edited on Feb 08, 2008 19:43 GMT

Brian Kirchgessner   (Feb 08, 2008 at 20:14 GMT)
I added the code to the end of the HideMesh resource just download the zip and check the changes with winmerge, they are simple but they work.

Note winmerge will probably not catch it all because I renamed my skinon statements, its at the bottom of the resource.

H.W. Kim   (Feb 09, 2008 at 13:26 GMT)
Ran HBWDemo.exe and click 'start' menu. It lead ring selection stage but then what should I do for next?

I cant see any player or A.I. select menu either?

How to play?

David Horn   (Feb 09, 2008 at 16:12 GMT)
You should just have to hit continue and that will take you to the select screen. I took off the code for the preview button for the moment.

I think I found some code in player.cc that might help with the problem I'm having where the wrestler won't punch while moving. But any ideas on how do deal with the delay? surely someone has called SetActionThread before and had this happen?


Brian - that code worked perfectly. Thank you!


*Edit - I solved/hacked the problem of not being able punch while walking. I just directly stop the movement if "a" is hit. Now I just have to nail down this setActionThread pausing problem
Edited on Feb 09, 2008 20:04 GMT

Jacobin   (Feb 10, 2008 at 02:59 GMT)
Quote:

I think I found some code in player.cc that might help with the problem I'm having where the wrestler won't punch while moving. But any ideas on how do deal with the delay? surely someone has called SetActionThread before and had this happen?


The running animation -is- the action thread. You need to use playThread() in order to blend on top of it.

David Horn   (Feb 10, 2008 at 04:17 GMT)
I tried that, however the playThread() destroys all of my standard walk/slide animations - the wrestler moves around, but doesnt walk - just slides around motionless like a statue.

I was about to look into the cause of this, but the forums seem to be down for the moment...

Jacobin   (Feb 10, 2008 at 05:33 GMT)
The playThread() animation shouldn't destroy your other animations, unless of course the leg/feet/etc nodes were exported with the animation. For your punch, open the animation up in showtool. Make sure that it's a blend animation and that only the required nodes are being exported. Set it up right and you'll be able to throw that punch whether the char is motionless, running or jumping.

David Horn   (Feb 10, 2008 at 16:09 GMT)
I'll definitely need to export and play animations that require all nodes. The punch is just one of many. If I need to do a dropkick, I want the wrestler to do a dropkick, then return to his original idle state and still be able to evoke his walking animations. Rught now, he loses the ability to walk and stand idle whenever I use playthread. I'll try the blend option...

Jacobin   (Feb 11, 2008 at 00:45 GMT)
For animation like drop kick, you'll likely need to use action animations yes. Look at the various resources for adding new positions for assistance with that. However for a punch or headbut that doesn't require all the nodes, but in fact requires you to blend it in with the running animation, then playThread is exactly what you need.

I couldn't fathom how to implement situations like bodyslams or piledrivers, where you need to mount one player to another. That would get quite interesting.

David Horn   (Feb 11, 2008 at 03:24 GMT)
Actually, the blend worked like a charm - with all body parts moving. Hopefully the other moves will work too :)

David Horn   (Feb 14, 2008 at 15:56 GMT)
Except now I have a big big problem. I need a way for animations to control the player's position. In otherwords, the player currently snaps back into position after playing an animation. If I keyframe the bounds, the player doesn't move at all, just stands there.

This is a big problem...

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