collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: DDLullu, your help will be precious!  (Read 514 times)

Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
DDLullu, your help will be precious!
« on: January 26, 2020, 07:53:43 PM »
Greetings!
I found latest DDLullu's tools on modelling really great! But it's too sad we still can't merge our achievements together into the one project... Since the custom modelling interest grows for modders, especially while completely new mods like Prelude or WWII have been released, the modelling side of the current unofficial SDK becomes a main bottleneck. I'm too weak on MDL format reversing and there's nothing I can do in the SDK myself anymore for years. It would be really great if DDLullu would agree to watch the current SDK's StudioMDL source code and probably fix it by his knowledge on bone structures and maybe animations too. This would be a huge contribution to the development of the SDK project, and finally would make it fully functional for modding. I could guarantee your name as one of main developers, and even make possible donation!

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6469
  • Reputation: +882/-28
  • Unofficial Patcher
Re: DDLullu, your help will be precious!
« Reply #1 on: January 26, 2020, 09:06:26 PM »
Yeah, it would be cool to have the two latest MDL tools by DDLullu integrated into the SDK, these would be the sheet LOD removed and the MDL solidy fixer...

Offline endthewars

  • Neonate
  • **
  • Posts: 92
  • Reputation: +0/-0
  • BOOM! Love Jack :)
Re: DDLullu, your help will be precious!
« Reply #2 on: January 27, 2020, 12:22:28 AM »
This is a brilliant idea! DDLullu's last tool was a lifesaver, a lot more could be accomplished if we combine your knowledge with his. :)



Psycho-A, I know I sometimes talk smack about the tools you made, but without them I would not have been able to do anything at all, so thank you. I only complain because they made me suffer so much. :D


Between studiomdl (compiler) and the decompiler, latter burned me the most. I had to start from scratch several times because almost all of the models I decompiled had some sort of issue. Most has a incomplete qc files, many of them had missing data and majority of them were sized incorrectly (randomly sized more like),  I basically had to delete everything I created before yesterday, decompile them with "crowbar", correct them again (because crowbar doesn't actually fully support Bloodlines) and edit them all over again. As I learned, even DDLullu uses crowbar for decompiling. Wish I knew that before I started.


Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
Re: DDLullu, your help will be precious!
« Reply #3 on: January 27, 2020, 06:31:01 AM »
endthewars, to save even more of your time, please check my latest SDK update :)

About "my" tools - Model Decompiler isn't my tool, it has been written by other guy about ten years ago for dead ancient Bloodlines Revival project. There's nothing I can do about it, as I'm not Java coder...
As for Crowbar - I honestly don't like it because of lots of garbage settings and lacks of collision data while decompiling in QC, and you need to add it there manually.
If you encounter scaling issues, add $scale 2.0 before $model string in .QC where "2.0" is a multiplier for original scale (usually 2.0 helps to return normal size in that cases).

Offline endthewars

  • Neonate
  • **
  • Posts: 92
  • Reputation: +0/-0
  • BOOM! Love Jack :)
Re: DDLullu, your help will be precious!
« Reply #4 on: January 27, 2020, 11:43:28 AM »
endthewars, to save even more of your time, please check my latest SDK update :)

Thank you! I have no doubt it will be brilliant :)

About "my" tools - Model Decompiler isn't my tool, it has been written by other guy about ten years ago for dead ancient Bloodlines Revival project. There's nothing I can do about it, as I'm not Java coder...
As for Crowbar - I honestly don't like it because of lots of garbage settings and lacks of collision data while decompiling in QC, and you need to add it there manually.
If you encounter scaling issues, add $scale 2.0 before $model string in .QC where "2.0" is a multiplier for original scale (usually 2.0 helps to return normal size in that cases).

Sorry, I didn't know that. Either way I believe it is time to retire that tool. It caused me so much grief I can't even begin to tell.

I tried scaling many times, 2.0 was still too small and anything higher was too large. Not to mention it was rotated 180 and off the center. Trying to correct it would have been a futile attempt. Also QC it created is basically useless as it doesn't give you the full settings models should have and it doesn't decompile models with lod properly. (It decompiles them, but merges the model and its lods together with no way to separate them ever again) Also, models I decompiled with our current decompiler has a weird bug thats difficult to describe. (It happens after you compile the model again, I should post a video about that)

Lastly, it doesn't decompile some models properly at all. They lose all shape and appear fully flat, like a plane. (You can test yugo model for example)

Crowbar isn't perfect either, model was rotated 90 (which was easy to fix), but it actually decompiles it correct size with full settings. Lods are separated and I it didn't matter I had to edit QC, because with our compiler I had to do that anyway and to a greater extent.. Also, it doesn't have that weird bug. 

Please trust me when I say while it does some issues, crowbar is still leagues better than what we have. What we need is our version of that. Please check out the source code:

https://github.com/ZeqMacaw/Crowbar/releases/tag/v0.65

If anyone can make heads and tails out of that stuff, it is you.

Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
Re: DDLullu, your help will be precious!
« Reply #5 on: January 27, 2020, 06:59:52 PM »
endthewars,

To void models 90-degree rotation on decompiling, you should mark them as Static Prop in the tool. Most of models requires this but it disabled by default.
As for Crowbar - I'll look into it's source code and maybe will able to do Bloodlines-only version without any unneeded functionality. Btw, I mistaken about attaching collision models to QC - latest version does it well!

Offline ZeqMacaw

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +2/-0
  • Author of Crowbar (Source-Engine Modding Tool)
    • Steam Profile
Re: DDLullu, your help will be precious!
« Reply #6 on: January 27, 2020, 09:10:34 PM »
I am willing to create a different Crowbar  (CrowbarVtMB, for short) limited to features specific to VtMB. I had not already done so because it did not appear that anyone was interested in such a tool. I have not done any modding for VtMB, but it seems to have the same general model setup as other source-engine games. The main problem is not having the game developer's original model compiler tool or model viewer.

As a start, I would have just the following tabs in CrowbarVtMB: Unpack, Decompile, Compile, View, Options, About, Update.
Unpack tab unpacks VtMB VPK files.
Compile tab would be changed to point to SDK model compile tool.
View tab would be changed to point to SDK model viewer.
Options tab would have fewer options.

For VtMB models, I have Crowbar decompiling almost all of the model data for the various model types. The biggest trouble has been deciphering the flex data (i.e. vertex animations or face flexes). It looks like I have the correct vertices that change, but not the correct values or correct method for how they transform.

:)

Offline endthewars

  • Neonate
  • **
  • Posts: 92
  • Reputation: +0/-0
  • BOOM! Love Jack :)
Re: DDLullu, your help will be precious!
« Reply #7 on: January 27, 2020, 11:14:03 PM »
That would be awesome. Between you three (Psycho-A, DDLullu and ZeqMacaw) I am sure everything can be fixed.  :) There are simply way too many limitations to the tools we use right now, it halts every project we could possibly have.


Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
Re: DDLullu, your help will be precious!
« Reply #8 on: January 28, 2020, 05:40:31 AM »
I am willing to create a different Crowbar  (CrowbarVtMB, for short) limited to features specific to VtMB. I had not already done so because it did not appear that anyone was interested in such a tool. I have not done any modding for VtMB, but it seems to have the same general model setup as other source-engine games. The main problem is not having the game developer's original model compiler tool or model viewer.

The modelling is now alive for game, so that would be really nice :)! You could use my SDK to test all your developments, as it's the only DevKit that's available.
You better keep ability to decompile models from other Source engine games, so they may be re-imported to use in Bloodlines.

As I know about all about the SDK, I made Crowbar screenshots with concept on features to be removed or changed, so take a look...

I use StudioMDL.bat wrapper over legacy studiomdl.exe to provide some extra features and fix old bugs, so .BAT is better to use as default in the SDK-adapted version. It does log output to Crowbar window the same way as .Exe, so no problems.

Also, "Format for stricter importers" feature must me always enabled and hidden, as VtmB's StudioMDL doesn't like comments inside of QC files. It also doesn't support .QCI includes, so all QCI stuff must be disabled.

On compiling model page, it's better to say to studiomdl compiler command line the whole QC path, not only the name and it's working dir. In most cases it allows to avoid issues with my .BAT wrapper or if compiler changes working directory itself (it happens).

Also, for some reasons Hammer editor runs with no GameCfg.ini detected from "View" tab, probably it starts from wrong working directory, not where it's .exe located (that's correct for Bloodlines).

The "Pack" tab might be used to create our own VPKs from any dirs, but I guess there's a lot of work on it, because there's no ready command line tool like vpk.exe, so it must be done by the internal program means. Just at your discretion (SDK already has my own VPK packer).

As for model decompiling, there are still some issues for generic world models.
If the model originally compiled as static prop, the Crowbar output provides their references turned to 90 degrees. The physics model stay turned as intended though. So, compiling model back to MDL, reference and collision stays turned to 90 degress to each other. Adding "$origin 0 0 0 -90" after "$staticprop" to .QC helps to tweak both reference and collision, but then bounding and sequence boxes become turned to 90 degrees. Just check it using SDK's hlmv.exe. It allows to view all subsequent data (except animations - I have no knowledges to make it to do).
« Last Edit: January 28, 2020, 05:42:44 AM by Psycho-A »

Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
Re: DDLullu, your help will be precious!
« Reply #9 on: January 31, 2020, 04:16:30 PM »
Just copy my message here in hope it increase chances of seeing it...

DDLullu, if you're reading this, I want to let you know that there is an issue in your Solidity-fix tool. When we shoot compiled and fixed model, it goes dark from side we shot to. It looks like... I don't know - like the shooting decals are stretched and zoomed to the whole model side (it goes darker the more we shoot). I'm seeing this on most of models I tried, so this may seriously stop modders from use custom models. Something's still wrong in model structure if this happen...
« Last Edit: January 31, 2020, 04:31:38 PM by Psycho-A »

Offline endthewars

  • Neonate
  • **
  • Posts: 92
  • Reputation: +0/-0
  • BOOM! Love Jack :)
Re: DDLullu, your help will be precious!
« Reply #10 on: January 31, 2020, 06:32:52 PM »
Just copy my message here in hope it increase chances of seeing it...

DDLullu, if you're reading this, I want to let you know that there is an issue in your Solidity-fix tool. When we shoot compiled and fixed model, it goes dark from side we shot to. It looks like... I don't know - like the shooting decals are stretched and zoomed to the whole model side (it goes darker the more we shoot). I'm seeing this on most of models I tried, so this may seriously stop modders from use custom models. Something's still wrong in model structure if this happen...

Damn it.. I hadn't noticed that. :(

Then again, I never tried to shoot the cars I made.. Damn it.


Psycho-A, please post this here as well:
https://forums.planetvampire.com/bloodlines-tech-support/model-request-to-ddlullu-and-others!/msg151903/#new

He originally posted this fix there and he might check there again.
« Last Edit: January 31, 2020, 06:34:37 PM by endthewars »

Offline DDLullu

  • Neonate
  • **
  • Posts: 83
  • Reputation: +208/-1
Re: DDLullu, your help will be precious!
« Reply #11 on: February 01, 2020, 06:58:02 AM »
Somehow the game doesn't like the 11 written by the compiler.(look at the picture just above the MOVE 1 TO A)

I change it to one (01) like the trunklid of the lightingbird and the model don't turn black anymore when hit by a bullet, sadly we see the fume or sparkle but no mark. I guest, that the better we can do for now. Of course the value 11 is a flag of some sort and i don't know exactly what it does except maybe it's for staticprop. For example for a NPC the value will be (0001) with two bytes. The game read the VTX and must think it's not a staticproc but the flag 11 tell it otherwise. Maybe that what is happening and the game don't know what to do? (Just some speculation from my part)


Here some explanation for the picture, we have to the left, an original MDL and to the right the compiler one.

number 1: I think it's the $illumposition value, 12 bytes offset from the compiler one.
..........and $eyeposition for a npc at the place of $illumposition. Not needed for a $staticprop.
number 2: What make it solid.
number 3: What make it no crashing the game. I have seen other values there (34 74 f4)???
number 4: May be not necessary. I have try to make it like the original MDL. It's the sequence part.

i include a new fix with code to change the 11 for a 01. Don't use the fix on an already fix mdl, it won't work. But you can use an hexeditor, look the picture for the location (offset e4 or 228).

Oh another thing,  puting $hboxset "default" in the QC will disable the automatic hitbox writing of the compiler! Better leave that out.



Offline ZeqMacaw

  • Fledgling
  • *
  • Posts: 8
  • Reputation: +2/-0
  • Author of Crowbar (Source-Engine Modding Tool)
    • Steam Profile
Re: DDLullu, your help will be precious!
« Reply #12 on: February 01, 2020, 02:09:03 PM »
DDLullu, I could easily figure out what values change and what they mean if you answer the following questions:

1. What is the model used in the image from the previous post? Is the model from the game or the Unofficial Patch? If the model is not from the game or patch, would you link it so I can debug with it?
2. Is the "fix_compiler1.exe" linked in previous post intended to replace something in the SDK? ("studiomdl.exe"? "studiomdl-fix.exe"?) Is it intended to be used after using studiomdl.exe or studiomdl-fix.exe?
3. Would you provide the source code for "fix_compiler1.exe"? I can compare what it does with what Crowbar does and see what else needs changing.


EDIT:
Figured out answer to 1 by converting some of the hex values to model name "scenery\furniture\tvs\vestelevision.mdl" and verifying by opening the file in a hex editor.
By debugging with Crowbar, these are the values I have figured out. I have not done much testing to verify these, so for example, illuminationPosition might be swapped with the unknown values. Sadly, there are still some unknowns.

[Number 1 in image]
9C - A7: illuminationPosition
A8 - B3: unknown01, unknown02, unknown03

[Number 2 in image]
1A4 - 1A7: unknown08

[Number 3 in image]
230 - 233: bone.flags
As a first guess, I would expect the flag values to be the same as used in Valve's Half-Life 2 code, listed below.
'FROM: SourceEngine2006_source\public\studio.h
#define BONE_PHYSICALLY_SIMULATED   0x01   // bone is physically simulated when physics are active
#define BONE_PHYSICS_PROCEDURAL      0x02   // procedural when physics is active
#define BONE_ALWAYS_PROCEDURAL      0x04   // bone is always procedurally animated
#define BONE_SCREEN_ALIGN_SPHERE   0x08   // bone aligns to the screen, not constrained in motion.
#define BONE_SCREEN_ALIGN_CYLINDER   0x10   // bone aligns to the screen, constrained by it's own axis.

[Number 4 in image]

2F4 - 2F7: eventOffset
value is not used because eventCount (previous 4 bytes) is 0

574: aSequence.autoLayerOffset
value is not used because autoLayerCount (previous 4 bytes) is 0

59C: aSequence.ikLockOffset
value is not used because ikLockCount (previous 4 bytes) is 0

5A4: aSequence.keyValueOffset
value is not used because keyValueSize (previous 4 bytes) is 0

5AC: aSequence.unknown03

5D0: aSequence.unknown05(1)
« Last Edit: February 01, 2020, 03:12:58 PM by ZeqMacaw »

Offline Psycho-A

  • Russian Board Moderator
  • Methuselah
  • *
  • Posts: 265
  • Reputation: +28/-1
  • Bloodlines SDK developer
Re: DDLullu, your help will be precious!
« Reply #13 on: February 02, 2020, 08:04:22 AM »
Somehow the game doesn't like the 11 written by the compiler.(look at the picture just above the MOVE 1 TO A)

I change it to one (01) like the trunklid of the lightingbird and the model don't turn black anymore when hit by a bullet, sadly we see the fume or sparkle but no mark. I guest, that the better we can do for now. Of course the value 11 is a flag of some sort and i don't know exactly what it does except maybe it's for staticprop. For example for a NPC the value will be (0001) with two bytes. The game read the VTX and must think it's not a staticproc but the flag 11 tell it otherwise. Maybe that what is happening and the game don't know what to do? (Just some speculation from my part)

Thanks, I've included your fix in updated SDK version (also added my own -90 degree rotation fix for decompiled model)!
You can also look into the SDK's source code here, on PV's downloads - it's completely open as well as StudioMDL and MDL structures. Maybe there's a chance for you to get more info or even fix bad StudioMDL code which I'm not able to do myself.

As for -90 degree rotation fix,    ZeqMacaw, you should look how model is rendered in game and HLMViewer and how it's look being compiled back. For some reasons if model is static, it's reference SMD turns 90-degree-rotated comparing collision mesh. Looks like Troika used Idle sequence to turn reference mesh on 90-degs but the decompilers don't takes account on it. For dynamic models (with anims or two-more bones), we already have physics mesh (but not always) and animations being 90-degree rotated.

Offline Another Wizard

  • Fledgling
  • *
  • Posts: 15
  • Reputation: +0/-0
Re: DDLullu, your help will be precious!
« Reply #14 on: February 05, 2020, 04:54:26 AM »
I would kill to see good modelling support for VtmB. I have so many ideas for things like new guns and player skins

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal