Product Chat / Collision meshes within models

Author
Message
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 19th Nov 2014 02:21
Hi All,

Is there a way to add a collision mesh (physics shape) inside a model file (e.g. a mesh in the file with a specific name). I am trying to get collision meshes working properly with trees and have no luck with any of the collisionmodes except polygons. It would seem the ideal solution to be able to add an additional mesh to use for collisions.

Many thanks,
Matt

GrumpyOne - the natural state of the programmer





Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Nov 2014 11:30
- Customising the FPE - Collision Modes
Depending on the type of item, the way in which collisions are handled can be specified by use of the COLLISIONMODE field.

If you have a basic model that does not require precise collision such as a crate, step
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 19th Nov 2014 13:11
Cheers for that Myke.

I didn't know you could import a model using F2 and add a collision box. Handy.

I am not sure of the meaning of limbs in the context of an x model. A single model can have several meshes as lods but I don't see anything in the x format specifications relating to limbs. In DBPro you can certainly combine several meshes or individual faces together and each is a limb. Rather confused by what collisionmode=200x means if the x only applies to a single face.

GrumpyOne - the natural state of the programmer





DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Nov 2014 13:41
As I see it the tree trunk would be the main object, set with polygon collision, and the leaves, branches would be a limb that is ignored. As long as they are both separate objects in your 3D package (not one single mesh) then you should be good to go. It works the same way in DB Pro as well. Not sure why you think it is per face, it is the limb number, nothing to do with faces. then again, I have not attempted to make a tree myself, so could be talking nonsense. Still, from the description, that is how I would imagine it works.



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 19th Nov 2014 13:47
Having played a little more with the collisionmodes I don't seem to be able to get 100x or 200x working...I guess the limbs apply to dbo models. The importer is good, but only allows a box to be specified.

It would be really useful if we could specify a mesh say called modelname_COL in the x file that is model specific. This would mean users of a model would always have an appropriate collision mesh. This would be particularly useful for more complex models.

GrumpyOne - the natural state of the programmer





GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 19th Nov 2014 13:57
Hi DVader,

Unfortunately I am writing an exporter for Forester Pro for FPSCR so I am writing the x file ....and there is no "limb" in the x file format. Good news is it works....bad news is collisions are problematic. I guess limb could mean "mesh"...writing each branch as a different mesh in the file....and then each LOD has a different postscript on the multiple meshes in each LOD. I will try this and see if it works. Soooo....difficult writing exporters when you have to guess the format requirements and write lots of different versions of the same exporter and test by trial and error.

GrumpyOne - the natural state of the programmer





Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Nov 2014 16:25
Limb normally suggests that the object has some kind of bone animation. TGC stock tree that are animated use this method. Might want to make some comparisons. Maybe import the xfile into your model program and see where the bones are.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 19th Nov 2014 16:32 Edited at: 19th Nov 2014 16:37
Several years ago when I was trying something in DBPro involving limbs on animated characters I needed to know what the limb numbers were. I wrote a little utility that would show me the limb names and numbers of an object. That was a few computers ago, but every time I upgrade, I try to back up all my stuff on an external drive and wipe the drive clean as to repurpose the old machine. I can't guarantee I'll find it as I'm not even 100% sure I backed that little program up, but I will take a look.





EDIT: I just remembered what I was trying to do! I was trying to do something like DVader's first person full-body script. I scaled down the player's head so I could place the camera on top of the neck and not look out through the head mesh. It worked, but not as well as DVader's script.

MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Nov 2014 16:37
Scene commander put one out for characters in classic. don't know if it will work. Should. Give the file a try and see what it does.

It is called Limb finder.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 19th Nov 2014 16:44 Edited at: 19th Nov 2014 17:39
Thank you for saving me from looking for that, Myke! BTW, here's a link to that thread:



http://forum.thegamecreators.com/?m=forum_view&t=180808&b=21





EDIT: That's the thread, but the download link is broken! Back to looking for mine!

LOL, I just found out it's in the tools folder in FPSC. Wow, wish I had known that years ago!

MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Nov 2014 20:57
Ah it sounds a little more complicated then! Not messed with making an actual x file from code personally! Used to thinking of limbs as just separate meshes in a 3D program. Used them since the original DB, and thought they were standard tbh. Perhaps not. Although when you send your x file to Reloaded, it should be converted automatically to a dbo and in reality only uses the dbo in the engine. Is there not some mesh number or such in the x file? It must know if an object has been merged or is made of individual meshes somehow..

I was going to suggest using DB to find out the limb numbers myself, but a utility would work as well



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 19th Nov 2014 21:32 Edited at: 19th Nov 2014 21:33
Yes the limb finder app will work on any mesh with a bone hierarchy in it.



I remember now for a classic level I did a set of draws that open when you use a hand as a weapon to reach for it. being able to open each draw separately depending on which one I touched.



It will give you the limb numbers you require. I am sure that they (TGC) used something on the trees to get the limb numbers that the needed.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 21st Nov 2014 23:13
Hmmm...so foliage animation is achieved using mesh animation in FPSC rather than using a wind shader... how quaint. Although it is the same for Skyrim models....truely horrible. Much easier to paint a model with vertex colours and let the shader do all the work. Much easier on the engine too.

GrumpyOne - the natural state of the programmer





Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 22nd Nov 2014 01:03
maybe some day, but this is how they are doing it right now. Vertex animation is possible in this engine, but that defeats the limb animation and collision detection also. quite a dilemma.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 4gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 22nd Nov 2014 19:16
Right so...

I've managed to rewrite my x file exporter to export trees with limbs, I've tested the models in dbpro and confirmed each trunk and branch are a separate limbs within the model and yet collisionmode=100x and collisionmode=200x produces a simple box collision, as does collisionmode=1... in fact the only collisionmode that seems to work is turning them off collisionmode=11.

Has anyone else managed to get limb collisions working...or polygon collision for that matter? Is there some undocumented part of the fpe file that prevents any collisions except for box?

GrumpyOne - the natural state of the programmer





DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Nov 2014 20:04
If I were you I would examine the trees included with Reloaded and see what they are set to. For instance Tree01 from the jungle pack has a collision mode of 58 and Tree02 of 50. So no idea how that corresponds to 100x or 200x. Perhaps the info is out of date? There must be someone who has made trees that can shed some light on this.



SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 24th Nov 2014 00:17
Ah ha....

Thanks for the suggestion. Went through all the fpe files and got a trunk collision only working using collisionmode=59. It was also necessary to include collisionscaling=100. Without that it didn't work.

Anyway..so now my exporter for Forester Pro is working with collisions and LODs. A simple exporter that makes trees and plants in one go with single atlas texture and an fpe file. Should be releasing the new version of Forester Pro in the next week (this version also included normal bending and per leaf normals editing).

GrumpyOne - the natural state of the programmer





LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 26th Nov 2014 00:32
@GrumpyOne : If you want to send me a sample tree with your collision mesh in there, I can add it to my V1.009 plans (as I think it would be very very cool to allow the engine to select a low poly collision mesh specified either through the FPE or detect

Login to post a reply

Server time is: 2024-11-22 18:29:36
Your offset time is: 2024-11-22 18:29:36