PDA

View Full Version : Cloth Physics?


bobmanJCT
04-18-2008, 01:05 PM
Now, I'm not aware of these being in hammer, but it would be damned useful if somebody could tell me there is.

Specifically, I need to make sails for a ship - I'm not worried about them reacting to the wind just yet (If cloth would react with any wind entities it would be uselful, though) - All I want for the moment is some sails for a ship.

I tried using still models and they just looked fairly bad - Tried using hinges on small areas but i didn't work either. I'm not any good at creating animated models I'm afraid, and even if I were, I don't think they'd be dynamic enough.


So if anybody has a solution to this problem, it would be excellent.



On a side note, what do you beleive would be the best implementation of a ship control system in TF2? I've thought about a simple stern you shoot, but that's a bit hard to control, and I've thought about using small areas you stand on for left and right - But these don't really seem to be great... The same Idea would work with shootig I guess. Also, I have very simple cannons on the side - You shoot the fuse, and the cannon fires a high velocity ball with impact damage surrounding it a set angle away from the ship. Not sure about how you would go about repositioning these in-game, though, for conflicts.

Craziestdan
04-18-2008, 01:16 PM
Now, I'm not aware of these being in hammer, but it would be damned useful if somebody could tell me there is.

Specifically, I need to make sails for a ship - I'm not worried about them reacting to the wind just yet (If cloth would react with any wind entities it would be uselful, though) - All I want for the moment is some sails for a ship.

I tried using still models and they just looked fairly bad - Tried using hinges on small areas but i didn't work either. I'm not any good at creating animated models I'm afraid, and even if I were, I don't think they'd be dynamic enough.


So if anybody has a solution to this problem, it would be excellent.



On a side note, what do you beleive would be the best implementation of a ship control system in TF2? I've thought about a simple stern you shoot, but that's a bit hard to control, and I've thought about using small areas you stand on for left and right - But these don't really seem to be great... The same Idea would work with shootig I guess. Also, I have very simple cannons on the side - You shoot the fuse, and the cannon fires a high velocity ball with impact damage surrounding it a set angle away from the ship. Not sure about how you would go about repositioning these in-game, though, for conflicts.



ok, i believe there are no sale props. if you cant make them into models, the you will have to just make the sales out of many brushes.

heres a TF2 map, that has a ship with sails, im not sure what he done with the sails, so you will need to check ingame, or decompile theis map:

http://www.fpsbanana.com/maps/42378

bobmanJCT
04-18-2008, 01:50 PM
Tanks for the link, any ideas on cloth physics?

Craziestdan
04-18-2008, 02:15 PM
sorry not sure, i havent tried it out myself so i wouldnt know. try looking thru the valve developer community.

bobmanJCT
04-18-2008, 04:52 PM
Ok, had a look at that map - Apart from being horribly designed, the sails just stay in place - though he has made them look pretty nice. I like the way they bulge the opposite way to where the ropes are being pulled. ;)

Snipergen
04-18-2008, 05:06 PM
Well if you want a flag animated you will have to use bones, since cloth physics are not possible in source. They are pretty heavy though depending on the detail, it's like 100's of ragdolls you spawn since its the same principle.

IcarusNine
04-18-2008, 05:59 PM
There are no cloth physics for Source, and I'm doubtful there's a way to make and stimulate ragdolls to act like cloth. Either you get a decently animated model, or you settle for still sails.


As far as the ship controlling... Standing in a trigger next to fake controls and having the ship do its stuff seems fine.

TheWallF
04-19-2008, 04:33 AM
you could try jigglebones. i haven't worked with them yet, but there's a thread about them on the forum (think it's in the art and sound section)

Karlos_Modder
04-19-2008, 05:09 AM
Here is a better option. If the boat(s) don't move and you don't care if the sails move. You can make a four sided displacement. So you can create a nice bend in the sails or a ripple affect.. ect

bobmanJCT
04-19-2008, 05:46 AM
The whole point was that the boats and sails move... I've been thinking about animating it, but I'm just not sure whether it would be dynamic enough - I suppose people wouldn't mind that much... I'm inexperienced with animating models, though.

Is there any way to create, say, 3 'dots' or very small objects, then create a dynamicly stretching 'sheet' betwen them, that would always join, like a membrane, between them, depending on the positions? I mean, that's my understanding of how a polygon works... Then, I could perhaps find a way to rope the dots together in a sort of comb, thus creating a moving sheet?
I doubt this is possible in source, but anyone know if it is?

turk645
04-22-2008, 12:29 PM
The only way i could think of is the way its done in oblivion. There the cloth is basicly just a ragdoll. The model has like a grid of bones that could give the effect of cloth. So you would have to packrat in the custom ragdoll for that to work.

Sp_nce
04-22-2008, 12:31 PM
I don't believe TF2 supports cloth physics (or even Source at all)

All the characters in TF2 are polygonal meshes with skeletons inside.

What you need to do is set up a clean low poly mesh of a sail, then rig it with some bones and then animate the bones to bellow in the wind. I think you could use a stretchy IK spline.

XSI and Maya support this but probably only in the full versions.

bobmanJCT
04-22-2008, 03:27 PM
I don't believe TF2 supports cloth physics (or even Source at all)

All the characters in TF2 are polygonal meshes with skeletons inside.

What you need to do is set up a clean low poly mesh of a sail, then rig it with some bones and then animate the bones to bellow in the wind. I think you could use a stretchy IK spline.

XSI and Maya support this but probably only in the full versions.

Could you give me some more details on that? I'm new to the whole modelling scene, to be honest I've had no real need to try it out until now.

On a brighter note, I've got my friend to do some pretty awesome concept art, so I can hopefully get an idea of what it'll look like soon, map should follow on from that not too slowly, as I haev 12 weeks of nothingness to burn after my exams. To be honest it's a pretty gimmicky map, but I'll try and actually finish this one for release, and I'll still try to balance it out.

dreambill
04-23-2008, 08:47 AM
im new to hammer, maybe less than 100 hours of mapping and i can do it, funny that some experienced mappers dont have a clue....

about 1 month ago, i needed a kind of "goal net" and i want it to act like a real net (physic) i made it under 30 min. the same patern with a white texture instead of a "net" texture should work fine.

I HATE TYPPING so im not going to make a tutorial, if your interested, msg me and i will send you the source of the physic "goal net"(vmf) so you can look how is built, then you can make your sail act as physic.

vecima
04-23-2008, 08:56 AM
i'm interested to see this... how FPS friendly is it?

dreambill
04-23-2008, 09:29 AM
i'm interested to see this... how FPS friendly is it?

i didnt noticed any frame drop, but my net is about 10 feets by 30 feets and its made of about 25-30 physic brush, so if you made it 100 feets by 300 feets by sticking 250 physics brush togetter...... maybe you will see some fps drop.....

the goal is to built it with a minimal number of physic brush, just enaught to look "real"

bobmanJCT
04-23-2008, 12:27 PM
im new to hammer, maybe less than 100 hours of mapping and i can do it, funny that some experienced mappers dont have a clue....

about 1 month ago, i needed a kind of "goal net" and i want it to act like a real net (physic) i made it under 30 min. the same patern with a white texture instead of a "net" texture should work fine.

I HATE TYPPING so im not going to make a tutorial, if your interested, msg me and i will send you the source of the physic "goal net"(vmf) so you can look how is built, then you can make your sail act as physic.

I would like to see this, presumably it has takes a lot of resources? Either way, it would be interesting, maybe useful if I can actually implement it.

dreambill
04-23-2008, 12:54 PM
omg, i looked in my sdk folder, and i didnt find the "goal net" source, i got some problem with TF2 about 2 weeks after re-installing it.... when i saw that, i completly uninstall steam and i lost a lot of my .vmf and customs textures.... yeah its sad.

....but you are lucky, cause i find an old "hammer autosave" with the net in it, unfortunately the "net" isnt completly finished in this save, but is enaught to show you what the physic look like in game:

http://www.wegame.com/watch/physic_goal_net/

again, if you want the .vmf PRIVATE MSG ME and give me an email adress where i can send you the .vmf(i will copy it from my map to a box map with the physic net in it)

anybody interested to get it, msg me.

vecima
04-23-2008, 01:37 PM
that's pretty neat... what entities were you using? func_physbox and phys_constraint? or phys_hinge?

FrostbiteX
04-23-2008, 01:50 PM
Best bet is either animations or jiggle bone, although jigglebone doesn't collide with anything.

dreambill
04-23-2008, 01:58 PM
the brush are func_physbox and i link them together with phys_ballsocket also you have to put an phys_constraintsystem on each brush for grouping them(this tell the engine to calculate the physic of all brush as a single physic object) if you dont, all the brush will fight each other for their own physic space.

see: http://www.wegame.com/watch/messed_up_physic_goal_net/

bobmanJCT
04-23-2008, 02:02 PM
Presumably you can do this in more than two directions? If you can, that's cool, but I can't imagine it would work based on solid physitems.

dreambill
04-23-2008, 02:41 PM
what the problem? THESE ARE SOLID PHYSBOX HANGING ON ROPE
push left they go left, push right they go right, push up they go up,push forward they go forward

bobmanJCT
04-23-2008, 03:02 PM
The problem is that you cannot hinge the individual cuboids on more than two sides - if you turn them into a netting formation - otherwise it creates an impermeable wall - unless your system gets around this?

dreambill
04-23-2008, 03:30 PM
if you took the time to read my post i said i lost the FULLY COMPLETED NET
but i found an old save with a part of the net on it.

i also said the original net was 10 feets by 30 feets and its made of about 25-30 physic brush. this isnt a net formation for you???

what you mean by "creates an impermeable wall"

bobmanJCT
04-23-2008, 03:39 PM
I mean like this...

The blue lines represent links where things can flex. The red lines represent where the grid will lock up.

http://img292.imageshack.us/img292/9149/linksvn9.jpg

Could you please specify if your system gets around this, if so how, and also if so how do you prevent gaps apearing between the solid physobjects?

dreambill
04-23-2008, 03:51 PM
why do you say it will lock?
and the way you built it is wrong(i didnt built it that way)

dreambill
04-23-2008, 04:32 PM
if i have the time tonight or tomorow i will built a ugly boat with a sail and mast, moving with wind, so if it work fine i will send you the vmf

bobmanJCT
04-24-2008, 04:39 AM
if i have the time tonight or tomorow i will built a ugly boat with a sail and mast, moving with wind, so if it work fine i will send you the vmf

That would probably be best - I'm having trouble seeing how this would work...

Varsity
04-24-2008, 07:33 AM
You can create basic cloth physics with a prop_ragdoll and a suitable model.

There's also some code in the SDK specifically talking about cloth, but I don't know if it amounts to anything usable yet.

dreambill
04-24-2008, 10:56 AM
like i tough, everything is fine, the sail do not lock, every parts of the sail is moving, but.....

.....but its not looking so good.

with the net texture its fine because you cannot really see all the individual func_physbox because the texture is about 80% filled with transparency, but when using a plain color(ex:white) you can clearlly see all the intersect.....

maybe you can try to hide the intersect with fog.....(built a fog zone with the same shape as the sail)


so, do you want my to finish the .vmf anyway?

bobmanJCT
04-24-2008, 12:29 PM
That's the problem I thought you might have - but it doesn't lock up at all? That's cool, I would have expected it to. I guess you could finish the VMF if you like, but it looks like my best option is to go for an animation - Thanks for everybody's help though.