Game Development Community

Mounting Items to A Player - New Mount class?

by Dave Young · in Torque Game Engine · 05/08/2006 (7:43 am) · 6 replies

This is a discussion on the pros and cons of the various practices of mounting objects to players.

Conside a RPG world which contains players, and a large variety of items which can be mounted to players. The game would have at least 10 different player models, and at least 200 unique mesh items.

The pros of node hiding and mesh hiding seem similar, in that the modeller would have to attach the meshes for every possible object during the modelling practices. Due to the multiple player models and mountable meshes, this seems like a solution that doesnt scale very well. It's a nightmare for the modeller/animator, and seems like it would result in massive file sizes.

Using shapebaseimages for mounting also seems cumbersome, as the shapebaseimage class is pretty heavy in terms of functionality. There is also the limitation of 8 mounted shapebaseimage objects, though it can be extended, it has been theorized to cause a lag of objects and the players they are mounted to.

The requirements are simply to create a mountable object that can be mounted to a named mount point on a player (mount0-mount31), that can call the mount and unmount script functions. Thus, we achieve the appearance of mounted objects, they inherit the transforms of the object they are attached to, but don't have all the heavy functionality requirements of shapebaseimages. Any calculations that get done to Armor Values, etc, can be done in script. It also has to be easily pushable to all networked clients, and not add a huge bogdown to the engine. A bonus feature would be to let the objects have collision meshes as well, so something like selecting the weapon a player is holding is possible.

I am not sure if this is something that should be done by extending ShapeBase, or by scaling down ShapeBaseImageData.

On the other hand, if I missed something about the pros and cons of the typical solutions, please let me know.

All input welcome!

#1
05/08/2006 (4:57 pm)
Obviously you wouldn't want to extend from ShapeBase if you're trying to avoid that class' bloat. Go from GameBase, and and you can probably cut out the base rendering and mounting functionality from the shapebase class into that. I've heard Item is a pretty good example of a minimal class, so maybe look at how it's setup too. It might cause some slight graphical bugginess, but I'd try setting up the class to only ghost the existance of the mounted object over the network, while letting the transform data be updated only on the client, since syncing that data isn't really crucial to any gameplay. I think that's probably a lot of the reason why normal mounts can cause so much lag when there's a lot of them.

Course I'm no expert on that stuff, m'just guessing at what sounds right.
#2
05/08/2006 (5:01 pm)
Hey, thanks for the suggestion, it means a lot to me.
#3
05/08/2006 (6:23 pm)
Dave, greetings.

I was starting to ponder along similar lines, but had another thought... and this might be completely stupid cause I am in no way a programmer so please feel free to tell me to shut up.

My thoughts werethat rather than use mount points, which as I understand it, would need those defined in the model which would be beyond me, is to use the "names" of the bones and allow for rotation and translation for positioning.. eg using "Bip01 R Hand" for right hand or "Bip01 L Clavicle" for the arm etc.

This way, the mount points wouldn't need defining per-se and so a non artist like me would still be able to use the system on models with not many mount points embedded.??

As I say this may be totally non-feasable, but hey its a discussion right? :)

Regards

Graham
#4
05/08/2006 (6:50 pm)
Mountpoints aren't any different from nodes/bones, they're just a simpler locational reference than getting the bones, though I think you can still get that info with findNode or somesuch. Using the mountpoints is generally easier for setting up your reference points, and you can link them to any bone of the players animation so they'll transform how you want.
#5
05/08/2006 (7:07 pm)
Ahhh okay, my bad.. thanks Paul. I kinda thought that mountpoints had to be added to the model itself which as a non-artist aint gonna help me:)

Regards

Graham
(Project Endeavour)
#6
05/09/2006 (12:21 am)
In the standard shapebaseimage mounting, it will look for the bones named mont0, mount1, etc. But Paul is quite right, the names arent so important as they are handy in general. What tipped me off to this was Showtool where you can mount anything to any bone.