Game Development Community

Blender, the hitbox resource, and player bounds

by Daniel Buckmaster · in Artist Corner · 04/05/2008 (10:04 am) · 21 replies

This resource, for the record.

I'm trying to get this working with an extremely simple player model made in Blender. One issue is that my Bounds object never seems to be exported, and the second is that the resource doesn't work :P I'll tackle them one at a time :P

My 'player' model is pretty simple and stupid: two cubes, each with a different material and UV texture, each enclosed by another box which I use for collisions. Both boxes are enclosed by a 'Bounds' box, which is another cube with no material. The two boxes export nicely, and when I name the collision boxes col0 and col1, they work well in the engine. LoD works. However, the bounding box of the shape when used as a Player is the default sized box, rather than my Bounds object. I see no reference to Bounds being exported in the log file, either. I've tried parenting it under one of the detail nodes, under the shape node, and not parenting it at all.

Next problem :P. I've installed Davide Archetti's hitbox resource, and it compiles fine. I renamed my collision boxes to HB01_32 and HB02_32, and they're being found and put into the array. However, nothing collides with them. I thought the problem might be the bounds box created by the Player class - the Player bounds box only intersects with my hitboxes in a small area, so it would only be that area that registers hits (since the check for hitboxes comes after the bounding box check). However, I've tried shooting in that location, but still no dice.
I've debugged and tracked the problem down to MeshObjectInstance::castRayEA. At the start of that method, *meshList is referred to. However, I find that meshList is always null.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!

Page «Previous 1 2
#1
04/05/2008 (11:52 am)
...
#2
04/05/2008 (12:26 pm)
That's for the info on the bounds box... I tried taking the datablock line out, which defines a string like "1 1 1.2" or something. However, now my object's box is even smaller - I assume it's the standard box size in Player's constructor.

The problem with the hitboxes doesn't seem to be in the loading of the meshes - my hitbox index array gets filled up correctly. But I'll try that anyway, thanks.
#3
04/05/2008 (12:44 pm)
...
#4
04/05/2008 (1:11 pm)
Well, I changed the object names and the dSprintf in ShapeBaseData::preload to use an X, and nothing seems to have happened.
#5
04/05/2008 (1:17 pm)
...
#6
04/05/2008 (1:34 pm)
In TSShapeInstance::buildInstanceData, everything seems fine. Gotta check where else meshList is modified. The VS2005 debugger is really irritating... arrays like 'names' only show me their first element, no matter how large they actually are. That would help with debugging...

EDIT
There is nowhere else :P. So everything's fine until castRayEA is called, then the values suddenly get screwed?
#7
04/05/2008 (2:18 pm)
...
#8
04/05/2008 (2:54 pm)
...
#9
04/05/2008 (11:38 pm)
How about both? :P
This is with Bounds not parented to anything... um... yeah.
I did just realise that I'm using exporter 9.4, but that shouldn't be a huge proglem, should it?
Quote:
Torque Exporter 0.94
Using blender, version 243
Processing Scene...
Cleaning Preference Keys
Exporting...
Writing shape to 'H:\things\Blender\40k\TorqueTesting\cubism.dts'.
Processing...
> Shape Details
> Nodes
^^ Bone [Exp-Catch-Root] (parent -1)
> Objects
'Cube1' : Standard Standard Standard
'Cube2' : Standard Standard Standard
'HB01X32' : Null Null Null Standard
'HB02X32' : Null Null Null Standard
> Materials
skinLGreen
skinDGreen
skinLBrown
skinDBrown
skinRed
skinBlue
> Detail Levels
Detail-1 (size : 100)
Detail-2 (size : 50)
Detail-3 (size : 32)
Collision-1 (size : -1)
Smallest : Detail-3 (size : 32)
> Internal Sequences
Writing out DTS...
Done.
Finished.
#10
04/06/2008 (5:24 am)
I should also probably mention that I had to change something in the resource for it to work-
char buff[6];
  dSprintf(buff,5,"HB%02d_",i+1);
Becomes
char buff[8];
  dSprintf(buff,sizeof(buff),"HB%02d_32",i+1);
I had to add the '32' to the end, because my objects were being exported with the _32 on the end. So searching for HB01_ turned up nothing, when the actual name was HB01_32.
#11
04/06/2008 (8:58 am)
...
#12
04/06/2008 (9:09 am)
I can send you my modified files if you want. I'm sure I haven't botched any of the implementation. Maybe a fresh install is needed... though I don' think I've made many other resource changes to shape instance stuff.
#13
04/06/2008 (9:13 am)
...
#14
04/06/2008 (2:52 pm)
...
#15
04/07/2008 (9:25 am)
I'm eating my head in excitement!








[That wasn't meant to sound sarcastic, just stupid :P I really am hanging out for your reply :)]
#16
04/07/2008 (10:37 am)
...
#17
04/08/2008 (11:30 am)
You are an absolute hero. Thank you so much for this :)
Quick question - how would I go about finding what detail level collision0 meshes are stored in? (I don't have TSTPro.) Does Blender export them in any default way?
#18
04/08/2008 (2:04 pm)
...
#19
04/09/2008 (11:51 am)
Ooh. I always wondered what that meant. Thanks so much for all this!
#20
04/09/2008 (12:54 pm)
...
Page «Previous 1 2