GTA5: Cloth-simulated meshes

Forum for discussing title-page news and events around ZModeler

Moderators: Oleg, _RicH_

GTA5: Cloth-simulated meshes

Postby Oleg » Fri Feb 09, 2018 3:41 pm

Image
ZModeler3 got an update featuring cloth-simulated meshes export for GTA5. The simulated cloth will response to host object movement and in-game wind.

Cloth geometry can use any shader and have to be named as .cloth in hierarchy. High-detailed geometry model (e.g. buffalo2_hi.yft with highest LOD) can be exported with no cloth, as game reads cloth mesh from main model file with default LODs (buffalo2.yft with L1, L2, L3)
Image


Limitations.
    To the moment (ZModeler build 3.2.0.1178, GTARage.zmf build 3.2.0.337) the following limitations apply:
  • Only .YFT file can contain cloth mesh. Ped models (.YDD) can not be exported with cloth meshes.
  • Cloth mesh can be attached to the main/first hierarchy entry. In case of vehicles, this is always a chassis object.
  • Only one .cloth object is allowed in scene (even thought file format assumes multiple cloth meshes support, game rejects such a file.
  • Non-collideable cloths are exported (cloth will not interact with player or any scene objects). Collide-able cloth meshes are available in game and under research.
  • Model with cloth meshes can not contain embedded textures (see remark below on exporting embedded textures in high lod model).

Settings and properties.
Cloth meshes are still under research, but in order to let you export them right away, some unknown properties are left to be edited manually via user-defined options.

    User-defined options set on .cloth object are:
  • Options - bit flags togging some features on/off. Can combine (comma-separated) values from 1 to 32. Default: 2.
  • Unk - two unknown value, the first one most likely to be in range -0.5 to +0.5, and the second is mostly -1.
  • Stiffness, Response and Elasticity are comma-separated values defining per-vertex level values. The purpose is guessed, you can suggest your own meaning for these options if you find something with trial and error. Value like 0.0001, 0.003, 0.009 assumes the first "Level" is 0.0001, the second "Level" is 0.003 and the third level is 0.009. Up to six levels can be used currently (see vertex options below). "Stiffness" is optional, some .cloth models have no it.

    Options set on vertices of .cloth object are available in Properties->GTA5->Options window:
  • Static point - point is attached to some object. Cloth need at least one vertex to be static to hang on, or entire cloth will fall through the ground immediately.
  • Point stiffness, Point response and Point elasticity are Level selectors. Actual level values are set as user-defined properties of the .cloth object itself. Thus, you can assign levels onto cloth vertices and adjust level values on export with trial and error approach.

Embedded textures issue.
When an exported model contain cloth-simulated mesh, the file is not allowed to store embedded textures. At least this applies to a .YFT file featuring combination of regular meshes and cloth meshes (e.g. vehicle model). On the other hand, it is known (and was proved by tests) the game does not need cloth object inside high-detailed model file (e.g. buffalo2_hi.yft can be exported with no cloth). Taking advantage of this game behavior, you can use embedded textures on high-detailed model if needed. However, ZModeler will not export embedded texture unless it is used by some material on an object that is being exported currently. Thus, for example, you can't embed cloth texture unless you export the geometry that uses cloth material. To bypass this problem, you can do the following:
1. Assign textures you like to a proper texture container, the regular way of specifying textures as embedded.
2. Remove L0 compound state from .cloth object using "Del" button on the right of "Convert to compound" in structure panel and having "L0" selected in a list earlier.
3. The removed L0 cloth will get detached as child of compound .cloth object (just delete it).
The compound cloth object should show L1 state in a list.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby TomcattersVF31 » Sat Feb 10, 2018 12:01 am

Thank you so much for the implementation. Just tried using modified Liberator flag on an entirely custom model and it works just fine! Perfect.

2 questions:

1. Can I import flag prop objects from around the map or does it have to be flags on vehicle models?

2. I think I'm missing something here, but regarding vertices and properties->gta 5->options... Where exactly is the GTA 5 option located in properties tab? I can't seem to see it.


Anyway, this is AWESOME news. Thanks again :D
TomcattersVF31
 
Posts: 88
Joined: Fri May 18, 2012 10:13 pm

Re: GTA5: Cloth-simulated meshes

Postby _Vlad_ » Sat Feb 10, 2018 12:07 am

Thats awesome news!
How can i edit this file properly ? x64k.rpf\levels\gta5\_citye\scentral_01\sc1_19.rpf\sc1_19_lspd_ban.yft
_Vlad_
Beginner
 
Posts: 159
Joined: Thu Aug 06, 2015 11:30 pm

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Sat Feb 10, 2018 1:21 am

@TomcattersVF31, GTA options have to be selected first in Settings->General->Compatibility->GTA5.
Cloth options will appear in properties window under "GTA5" -> "options", but they will toggle for selected vertices on object named .cloth. These will not appear on any other object (this is a part of ZModeler3.exe update involved).

You can use any cloth object or create your own, it doesn't matter. There are some unknown settings that I've used from "marshall" flag, but these seem to be very alike to "dune" and "barracks" models, so I suppose any object will work as cloth, the exporter will fulfill it with proper settings even if you miss to set them at all. Make sure to assign at least one point as "Static point".

@_Vlad_,
scenery cloth objects are a little different, and I haven't tested them. I suppose they might work already, just haven't tested them yet. They will be under research now, as they have a very interesting feature - they interact with scene and collide with player, so there is a hook to collide-able clothing support.

Also, I'm going to make some tests in attempt to attach cloth to .ydr files (haven't ever seen any .ydr file with cloth in OpenIV, if anyone has seen it, write me back please)!

P.S. the flag in a video is a brand-new, flat surface created as 36x24 points. Static points on the pole side, the rest of points use "Response" level of 0.0005 (original marshall flag had response 0.003 or 0.004 on all points and it give excessive stretch and wavy effect while driving). Response of 0.0005 looks like weighty drape, as it doesn't wave enough while driving even on high speed, but it looks damn cool when wind is turned on in game.

P.P.S. Also, I can't find any correlation or adjusting values for cloth behavior in response to wind and in response to vehicle movement. It might looks ok on static vehicle with wind and behaves dramatically while driving, or vise versa.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby carloxfranco » Sat Feb 10, 2018 1:38 am

I already updated my Zm3 but when I import a flag my Zm3 gives this message

ZModeler is ready.
No shader configuration avail for "cloth_default".

or else this happens

Image
pcGAMESmods by workgrafix
User avatar
carloxfranco
 
Posts: 71
Joined: Wed Apr 06, 2016 10:29 pm
Location: Portugal

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Sat Feb 10, 2018 3:04 am

what model file gives you this app crash? does it work fine with other files (e.g. non-cloth models are well-importable?)
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby Yoha » Sat Feb 10, 2018 3:48 am

Wonderful! !
Wait for this update for so loooong time~~ :D
User avatar
Yoha
 
Posts: 58
Joined: Fri Jun 05, 2015 4:57 pm
Location: China

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Sat Feb 10, 2018 3:57 am

@Yoha,
is your issue with ped (modified .yft file export) resolved, or I should take a look at this situation?
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby Yoha » Sun Feb 11, 2018 8:38 am

Oleg wrote:@Yoha,
is your issue with ped (modified .yft file export) resolved, or I should take a look at this situation?


Hi Oleg,
Thanks for put this in your mind.

I've just run the test, but the result is not good.
check below image.

I've updated ZM3 to the latest version.

If i only put new ydd into game, and change the texture in ytd, then run game.
The ped can be spawn succesfully.

But if I put new yft into game, it will crash, when I try to spawn that ped.

About yft, I didn't change anything, like bone position, size of bone, etc, nothing been changed.
Just import it into ZM3, and export it.

Here is the image:
Image
User avatar
Yoha
 
Posts: 58
Joined: Fri Jun 05, 2015 4:57 pm
Location: China

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Sun Feb 11, 2018 9:39 am

ok, i'm currently messing with ped models, will take a look by the chance.

bigger file created by ZModeler is OK, as it saves small thumbnail image into a file.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby carloxfranco » Mon Feb 12, 2018 10:06 am

Oleg wrote:what model file gives you this app crash? does it work fine with other files (e.g. non-cloth models are well-importable?)


Yes I can import other things and even yesterday I did the conversion of a car and it went well,

But when I import a flag prop_flag_us.yft it gives this error or else gives ZModeler is ready.
In the shader configuration avail for "cloth_default".

My Zm version:Image
pcGAMESmods by workgrafix
User avatar
carloxfranco
 
Posts: 71
Joined: Wed Apr 06, 2016 10:29 pm
Location: Portugal

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Mon Feb 12, 2018 10:11 am

ok, i'll check it few later.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby carloxfranco » Mon Feb 12, 2018 10:55 am

Oleg wrote:ok, i'll check it few later.


prop_flag_us.yft = No shader configuration avail for "cloth_default".

prop_flag_us_r.yft = bust with zmodeler

prop_flag_us_s.yft = bust with zmodeler

prop_flag_usboat.yft = bust with zmodeler
pcGAMESmods by workgrafix
User avatar
carloxfranco
 
Posts: 71
Joined: Wed Apr 06, 2016 10:29 pm
Location: Portugal

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Mon Feb 12, 2018 11:05 am

I haven't messed with scene cloth .yft files. Leave them for now, they might have a different format layout or setup inside.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby carloxfranco » Mon Feb 12, 2018 8:25 pm

Oleg wrote:I haven't messed with scene cloth .yft files. Leave them for now, they might have a different format layout or setup inside.


So how do I create banners with movement? I did not realize anything then. Would it be possible to create a video tutorial?
pcGAMESmods by workgrafix
User avatar
carloxfranco
 
Posts: 71
Joined: Wed Apr 06, 2016 10:29 pm
Location: Portugal

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Sun Feb 18, 2018 11:54 am

User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Thu Feb 22, 2018 12:29 pm

Ped cloth getting improved significantly, but I face a problem I can't fight in several days already.
The cloth on a ped model seem to respond into an opposite direction to the wind

ped_cloth_01.jpg


This becomes clearly visible when ped moves (or runs), the cloth intend to sway toward direction of movement. Especially bad effect when riding a bike:

ped_cloth_02.jpg


As expected, reversing on a bike makes cloth sway into back direction too:

ped_cloth_03.jpg


I thought I've messed something badly, but take a look at original model with cloth (minor hex editing to increase cloth freedom, no other changes, no import or export):

ped_cloth_04.jpg


having the same effect while riding a bike:
ped_cloth_05.jpg


So, my question follows: have you ever seen in game a ped model with cloth that has correct sway effect while ridding the bike? may be some accessory with straps, tapes that does act properly?

P.S. Just after posting this I thought of player_zero's jacket fields that do behave properly. will inspect this certainly.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA5: Cloth-simulated meshes

Postby Oleg » Thu Feb 22, 2018 2:36 pm

well, after some tests with Michael jacket (uppr_000 and uppr_029) I get pretty strange observations. Uppr_000 model has a bit different cloth data, so I tested uppr_029 mostly, as they seem to behave very alike.

Initial spawn gives incorrect model behavior with opposite-direction cloth sway while riding a bike.
However, after a deep crash (later found to be just "get out of bike") the sway becomes correct while riding:
ped_cloth_07.jpg


this is clearly seen on altered (high wind/movement freedom on cloth) model:
ped_cloth_08.jpg


even more, the model gets correct wind response while still riding a bike (stand still)
ped_cloth_09.jpg


but as soon as he gets out of the bike, wind effect changes to incorrect again
ped_cloth_10.jpg


Also, it is clearly seen the game "resets" cloth simulation during "get on the bike" and "get off the bike" animations playback, so I think we have some sort of a bug here (not sure whether the game is the cause or the model or the trainer).

P.S. was still unable to get correct sway on a test model (explicit editing of cloth and an export from ZMod). Making a superhero model with cloak is doubtful to the moment.
User avatar
Oleg
Site Admin
 
Posts: 8070
Joined: Fri Feb 06, 2004 3:54 am


Return to Site news and events

Who is online

Users browsing this forum: No registered users and 1 guest