Game Development Community

Engine Crash with New Weapon DTS Model

by David Wyand · in Torque Game Engine · 03/18/2002 (10:04 am) · 4 replies

Greetings!

Well, I've been working on my LightWave to DTS exporter, and as I was testing out the generation of nodes, I've run into a problem that is crashing the FPS demo. Here's what's happening and what I've found out so far (I've been working on this for quite a few hours now):

I've created a weapon using LW that mimics the rifle in the demo. I then replace the existing weapon.dts file with my own. Just in case, I delete all of the compiled scripts that refer to the rifle (rifle.cs.dso, player.cs.dso, game.cs.dso). I then launch the Water World mission.

With the default player, I run up and grab the riffle ammo and then the rifle. No problem with the player equipping the new rifle and holding it in his hands. I then fire the rifle, and I get the following error:

Screenshot with error message

Interestingly, if I first pickup the rifle, and then walk over the ammo, I receive the same error.

My object is built with the following nodes in LW:
muzzlePoint
mountPoint
ejectPoint

which seem to be required based on the demo rifle. I've compared my LW generated object and the demo one in a Hex editor, and other than the obvious mesh differences and the fact that I export a Root node (ala MilkShape) as opposed to the 'Unassigned' one in the demo file, they appear to be identical.

I've looked through the SceneGraph::rezoneObject(SceneObject* obj) function that the above error occurs in, and have traced it as best as I can. It looks like it eventually calls an Interior:: based function that checks for zones. Unfortunately, this part of the Engine is currently over my head...

So, onto my questions:

1. Anyone have an idea as to what is going on? Ever experienced this yourself with a rifle replacement weapon? Any idea as to how this part of the engine functions?

2. Has anyone been able to replace the demo rifle with one that has been built in MilkShape using the 1_1_1 engine release? As my code relies heavily on this, it would be great if someone could send me a working DTS weapon that was created in MilkShape so I could disect it.

If you'd like to take a look at it, here's my DTS weapon:
weapon.dts

Thanks!

- LightWave Dave

About the author

A long time Associate of the GarageGames' community and author of the Torque 3D Game Development Cookbook. Buy it today from Packt Publishing!


#1
03/18/2002 (10:15 am)
I have never used the lightwave exporter, but I am assuming that it has something to do with either the weapon collision/bounds boxes or one of the dummies that are missing in the hierarchy. I am not sure how lightwaves exporter handles this, but in max it wont even export without every little thing being perfect.
#2
03/18/2002 (10:32 am)
Greetings!

Thanks for the reply, Brian. I am actually the one that is creating the LightWave exporter, so I can have it do whatever I want :o)

I've thought about the arrangement of nodes (or dummies as you've put it) and have tried to make it match the weapon.dts file in the demo. As for collision/bounding boxes, I am creating a default box based one (which I've tested with static objects).

As all of my code is based off of the MilkShape exporter, I'd be curious if someone else has managed to replace the demo rifle using a MilkShape one. If it does work, then I'd like to compare the DTS files to try to determine where I've gone wrong.

- LightWave Dave
#3
03/18/2002 (1:26 pm)
Looks like something is going wrong with ejecting shell casings. The call stack when the assertion fires is:

ShapeBase::ejectShellCasing()
Debris::init()
SceneObject::setPosition()
SceneObject::setTransform()
SceneGraph::zoneInsert()
SceneGraph::rezoneObject()

I guess I would take another look at the eject point node.
#4
03/19/2002 (11:42 am)
Greetings!

Thanks for the suggestion, CJ. While the problem turned out not to be specifically tied to the ejectPoint node, your suggestion did get me thinking.

After comparing my DTS weapon to the demo one byte-by-byte, I discovered that I had a double (from LW) to float (for DTS) conversion error in my code. This was causing nodes to be placed out of range. As the engine wanted to place a shell at the ejectPoint node's out-of-bounds location, this was causing the crash.

A little fix and some Realm Wars later :o), and now I'm on my way again. I'll be posting my progress to the usual LightWave thread sometime today or tomorrow on how all of this has turned out.

- LightWave Dave