Gildor's Forums

Author Topic: Battlefleet Gothic - Armada 2  (Read 1537 times)
venturion
Jr. Member
**
Posts: 77


View Profile
Battlefleet Gothic - Armada 2
« on: January 29, 2019, 09:02 »

https://store.steampowered.com/app/573100/Battlefleet_Gothic_Armada_2/

4.18 Override

Everything works





Logged
kingfisher13
Newbie
*
Posts: 20


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #1 on: November 29, 2020, 09:02 »

I'm having issues with BFG 2 Cubemaps not exporting correctly. I found the cube maps for the environments in the files, and they display beautifully in Umodel, but they export as empty transparent PNGs instead of proper cube sections.

I'm including examples of some of the cubemaps, and also the resulting exported PNGs.

https://drive.google.com/drive/folders/1_tdJ7ydnWQJEUShNt5ZwaPe69b3ZKsMQ?usp=sharing
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Battlefleet Gothic - Armada 2
« Reply #2 on: November 29, 2020, 10:03 »

You should remove the alpha channel from exported PNG somehow. I didn't success with that using Parint.NET (I'm not a "pro" with this tool) - the picture remains white. Exporting a TGA solved the problem.
I've made some fix for dropping alpha channel when it's entirely transparent (like in this particular case), however I can't submit the umodel.exe right now, because I'm in heavy development stage now, and other things might be broken.
Logged
g3stapo
Newbie
*
Posts: 4


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #3 on: November 29, 2020, 20:43 »

You should remove the alpha channel from exported PNG somehow. I didn't success with that using Parint.NET (I'm not a "pro" with this tool) - the picture remains white. Exporting a TGA solved the problem.
I've made some fix for dropping alpha channel when it's entirely transparent (like in this particular case), however I can't submit the umodel.exe right now, because I'm in heavy development stage now, and other things might be broken.
Gildor, watch Oceanhorn 2
Logged
kingfisher13
Newbie
*
Posts: 20


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #4 on: December 01, 2020, 01:30 »

Thanks Gildor, I figured it out! If you go into GIMP and colorize the alpha channel white, then resave the TGA, the image is restored. However, I don't know what configuration your cubemap exporter saves the various sections in. Do you have a map of which image, 0-5, goes where on the cubemap layout?

EDIT:

I'm guessing the layout would be like this, based on an image I found online:


corresponding to this:


EDIT 2:

This is NOT the formula your tool uses, the resulting combination did not match up.
« Last Edit: December 01, 2020, 01:39 by kingfisher13 » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Battlefleet Gothic - Armada 2
« Reply #5 on: December 01, 2020, 09:54 »

It uses standard defined in 3D graphics (D3D, OpenGL):
0 = POSITIVE_X
1 = NEGATIVE_X
2 = POSITIVE_Y
3 = NEGATIVE_Y
4 = POSITIVE_Z
5 = NEGATIVE_Z
Logged
qazwsxal
Newbie
*
Posts: 3


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #6 on: October 22, 2022, 01:21 »

BFGA2 creates ships at runtime by connecting together several static meshes via sockets.
Unfortunately, these sockets aren't parseable by UE Viewer, when exporting, this error message appears:
Code:
Loading StaticMesh4 ST_Tzeentch_Cruiser_Hull_Back_02 from package /Game/Ships/Meshs/BodyPart/Chaos/Tzeentch/Cruiser/Hull/ST_Tzeentch_Cruiser_Hull_Back_02.uasset
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_11"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_12"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_13"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_0"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_1"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_3"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_5"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_4"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_6"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_2"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_7"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_10"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_8"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_9"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_14"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_15"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_11"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_12"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_13"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_0"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_1"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_3"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_5"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_4"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_6"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_2"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_7"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_10"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_8"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_9"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_14"
WARNING: Unknown class "StaticMeshSocket" for object "StaticMeshSocket_15"
StaticMesh has 16 sockets

Dumping a model via the viewer shows the sockets array is picked up, but individual sockets are not parsed:
Code:
        StaticMaterials[22] =
        {
            MaterialInterface = MaterialInstanceConstant'/Game/Ships/Materials/AM/Imp_Reut/M_Ship_Imp_Dread_ProwOrnament_02.M_Ship_Imp_Dread_ProwOrnament_02'
            MaterialSlotName = Ornament2
            UVChannelData =
            {
                bInitialized = true
                bOverrideDensities = false
                LocalUVDensities[4] = { 398.296, 0, 0, 0 }
            }
        }
    }
    Sockets[11] = {  }
    ExtendedBounds =
    {
        Origin = { X=-106.11, Y=0, Z=-56.2683 }
        BoxExtent = { X=734.934, Y=365.379, Z=341.292 }
        SphereRadius = 780.54
    }

I'd love to be able to access these sockets as they're needed to align parts and make full meshes of the ships.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Battlefleet Gothic - Armada 2
« Reply #7 on: October 22, 2022, 02:17 »

I think I didn't implement StaticMesh sockets because I didn't have sample meshes. No samples yet, but I've made an attempt to support them, you could try the recently updated umodel for that (no idea if custom build is required for your game or not).
Logged
qazwsxal
Newbie
*
Posts: 3


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #8 on: October 22, 2022, 18:25 »

That's fantastic, thanks!
Most of the parsing seems to work, but unfortunately the RelativeRotation values are looking a bit weird:
Code:
  Sockets[6] =
        {
            SocketName = BatteryR3
            RelativeLocation = { X=415.485, Y=50.8864, Z=-25.076 }
            RelativeRotation = { Yaw=1119092736, Pitch=0, Roll=0 }
            RelativeScale = { X=1, Y=1, Z=1 }
            Tag = ""
        }
I've plugged these values into a hex editor as int32's and they make more sense as floats (Yaw here corresponds to 90.0 in float32) so I assume that's where the big values are coming from.
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 2226


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #9 on: October 22, 2022, 19:48 »

Currently FRotator is indeed using floats, but can't be sure it's safe to convert existing struct to floats, apparently in the past it was int32 and it may affect existing functions, breaking compatibility with some old games.
« Last Edit: October 22, 2022, 19:53 by spiritovod » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: Battlefleet Gothic - Armada 2
« Reply #10 on: October 22, 2022, 20:12 »

Please try again, with updated umodel. I've made a replacement for Rotator for UE4 (this affects SkeletalMesh sockets as well).
Logged
qazwsxal
Newbie
*
Posts: 3


View Profile
Re: Battlefleet Gothic - Armada 2
« Reply #11 on: October 23, 2022, 13:33 »

That's working perfectly, thanks!
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS