November 13, 2024, 08:27:08 AM

Username
Password

Pages: [1] 2 3 ... 8   Go Down
Print
Author Topic: Portrait meshes  (Read 146411 times)
0 Members and 1 Guest are viewing this topic.
mattressses
Giant Scorpion
*
Offline Offline

Posts: 7


View Profile
« on: April 01, 2014, 03:02:31 PM »

Before I rifle through the game files in vain, I thought I had better check: Has anyone compiled a list of which PORTRAIT\*.M3D files are used for each unit? I couldn't see anything on the wiki.
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #1 on: April 01, 2014, 10:25:12 PM »

Not 100% sure but will investigate further. What I've recently been discussing with fellow modders, is to hopefully amend our Dark Omen to Blender Import/Export tool that successfully loads terrain maps (.m3d) but sadly can't load Dark Omen Portrait Heads (also .m3d), as I'm guessing it just expects a map information etc.. However, Crash's latest tools, can load .m3d heads and maps into his own 3d engine, so shouldn't be too difficult to fix. The original Dark Omen map viewer tool - New Boids also can display heads and maps.

Once we can add heads then I can use the excellent Call of Warhammer Total War 3d models, for their heads and face textures, to match up with the sprites generated from their 3d models. I hit this problem whilst making my Giant sprite, as no other head would do. Ogre was closest I think but jaw bone wasn't big enough!

Smiley
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
mattressses
Giant Scorpion
*
Offline Offline

Posts: 7


View Profile
« Reply #2 on: April 02, 2014, 07:29:47 AM »

What I've recently been discussing with fellow modders, is to hopefully amend our Dark Omen to Blender Import/Export tool that successfully loads terrain maps (.m3d) but sadly can't load Dark Omen Portrait Heads (also .m3d), as I'm guessing it just expects a map information etc..


Well, don't go to too much effort just yet! Rob's .m3d import tool seems to load them just fine, so long as the TEXTURE folder is a subdirectory of the MESHES folder (as it is in the 1pbat/B*_0* folders). Some of the texture names are incorrect/using the wrong format (e.g, 25.m3d expects VC_HEAD.tga as a texture, which doesn't exist, but saving VA_HEAD.bmp as a tga and changing the name gets it loading. You can check which texture is required in the header for the respective .m3d), but most of them seem to import/export without any issue as long as you move the TEXTURE folder. Gunther loads the correct texture without issue:

 

I've been messing around with the orc head mesh, and it seems to load back into DO without issue. Hoping to get a skaven head/texture thrown together, but for now here's a horrible distended Boar Boy!

« Last Edit: April 02, 2014, 10:22:47 AM by mattressses » Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #3 on: April 02, 2014, 09:41:15 PM »

Excellent!

Smiley
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #4 on: January 13, 2015, 11:32:14 PM »

Thanks to recent mods we can now have additional sprites, banners and shields but could really do with adding custom heads, since we have all the 3D Call of Warhammer models. I have added a new head to the Wh32Edit .xml database and assigned it to an extra slot new sprite and copied the Elf Head.m3d (DarkElfHead.m3d) and assigned it new DarkElfHead.bmp face textures, within Blender and exported back. However, the source code engine needs to be told about the new head, so it can appear in game, as currently no new 3d portrait is displayed. Is it possible to locate the Heads Table and .dll redirect it to a new custom lookup table perhaps?


Heads .m3d 1-20

* All10Small.jpg (73.28 KB. 973x278 - viewed 1287 times.)


21-40

* All21-40Small.jpg (61.28 KB. 932x226 - viewed 1253 times.)


41-67

* All41-67Small.jpg (81.16 KB. 1106x424 - viewed 1213 times.)



1.m3d elf body Bernhardt mb_body.bmp  
2.m3d body MB_BODY.bmp
3.m3d orc body BB_BODY.tga (copy BB_BODY.bmp and save as .tga)
4.m3d Scorpion group fo_body.bmp (copy SN_BODY.bmp and rename)
5.m3d SkeletonBody group SK_BODY.tga (copy SK_BODY.bmp and save as .tga)
6.m3d SpiderMovingBits group SP_HEAD.tga SP_BODY.tga (copy .bmp and save as .tga)
7.m3d Group01 tr_body.tga (copy TR_BODY.bmp and save as .tga)
8.m3d body FO_BODY.bmp (maybe shoudln't be Scorpion body as human body)
9.m3d treeman body group fo_body.bmp (copy KN_BODY.bmp and rename)
10.m3d Group01 fo_body.bmp (copy DK_BODY.bmp and rename)
11.m3d Group01 VS_HEAD.tga (copy VS_HEAD.bmp and save as .tga)
12.m3d HumanChubbyHead group bb_head.bmp (copy MY_HEAD.BMP and rename) by Michael A. Carr
13.m3d Group01 mb_head.bmp
14.m3d Group01 gs_head.bmp
15.m3d HumanLargeHelm kf_head.bmp
16.m3d FullHelm 1 group TT_HEAD.tga
17.m3d DwarfHead group AB_HEAD3.tga (copy AB_HEAD.bmp and rename/save as .tga)
18.m3d HumanHat group Il_Death.bmp
19.m3d Group01 wh_head.bmp
20.m3d NightGoblinHead NG_HEAD.tga (copy NG_HEAD.bmp and rename)
21.m3d Ogre Head group ur_head.bmp
22.m3d OrcHead group bb_head.bmp
23.m3d ScorpionTail group mb_head.bmp (copy SN_HEAD.bmp and rename)
24.m3d SkeletonHead group SK_head.tga
25.m3d SpiderBody group mb_head.bmp (copy SP_HEAD.bmp and rename)
26.m3d treeman face01 KN_HEAD3.tga (copy KN_HEAD.bmp and rename)
27.m3d TrollHead group TR_HEAD.tga (copy TR_HEAD.bmp and rename)
28.m3d Vampiress head VC_HEAD.tga (copy VA_HEAD.bmp and rename)
29.m3d Woman head MB_HEAD.bmp (copy CE_HEAD.bmp)
30.m3d head bb_head.bmp (copy DK_HEAD.BMP or NA_HEAD.bmp and rename perhaps)
31.m3d head group mb_head.bmp (copy SS_HEAD.bmp)
32.m3d ElfHead group EL_HEAD.tga (copy EL_HEAD.bmp and rename)
33.m3d neck TT_HEAD.tga (Grail Knights)
34.m3d neck SK_HEAD.tga (copy SK_HEAD.bmp and rename)
35.m3d neck VC_HEAD2.tga (copy VA_HEAD.bmp and rename)
36.m3d neck EL_HEAD.tga (copy EL_HEAD.bmp and rename)
37.m3d neck MB_HEAD.tga (copy MB_HEAD.bmp and rename)
38.m3d Collar Wilf_head.bmp (copy LF_Head.bmp and rename)
39.m3d crossbow SF_HEAD.tga (copy WF_HEAD.bmp and rename)
40.m3d Longbow group GA_HEAD.tga ZO_head.tga (copy GA_HEAD.bmp and ZO_HEAD.bmp and rename)
41.m3d Mace group MU_face.tga (copy MU_HEAD.bmp and rename)
42.m3d Pistol SW_HEAD.tga (copy SW_HEAD.bmp and rename)
43.m3d quiver group SF_HEAD.tga (copy WF_HEAD.bmp and rename)
44.m3d shield MB_HEAD.tga (copy MB_HEAD.bmp and rename)
45.m3d Tower Shield bb_head.bmp
46.m3d scimitar NG_HEAD.tga
47.m3d Scythe group WR_HEAD.tga H_head.tga (copy WR_HEAD.bmp IH_HEAD.bmp and rename)
48.m3d Staff SF_HEAD.tga IH_head.tga (copy WF_HEAD.bmp IH_head.bmp and rename)
49.m3d ShamanStaff group OS_HEAD2.tga IH_head.tga (copy OS_HEAD.bmp IH_head.bmp and rename)
50.m3d SkeletonArms group sk_head.bmp
51.m3d sword group MB_HEAD.tga (copy MB_HEAD.bmp and rename)  
52.m3d Group01 TR_HEAD.tga (copy TR_HEAD.bmp and rename)
53.m3d Axe group er_head.tga (copy ER_HEAD.bmp and rename)  
54.m3d Scorpion group mb_head.bmp (copy SN_HEAD.bmp and rename)
55.m3d spike BB_HEAD.tga (copy BB_HEAD.bmp and rename)
56.m3d sword group my_head.bmp
57.m3d club ZO_head.tga (copy ZO_HEAD.bmp and rename)
58.m3d ShamanHeadDress group OS_HEAD2.tga (copy OS_HEAD.bmp and rename)
59.m3d spike BB_HEAD.tga (copy BB_HEAD.bmp and rename)
60.m3d TreeTrunkHorns group OR_HEAD.tga (copy OR_HEAD.bmp and rename)    
61.m3d Karl Franz's helmet wings group kf_head.tga (copy KF_HEAD.bmp and rename)
62.m3d emperor wreath kf_head.tga (copy KF_HEAD.bmp and rename)
63.m3d Horns group wer_head.tga (copy SK_HEAD.bmp and rename)  
PORTBACK.m3d Box01 _1WEPON.bmp (copy IL_HEAD.bmp and rename)
PORTBACK2.m3d Box01 _1WEPON.bmp (copy IL_HEAD.bmp and rename)
EDITOR BODY.m3d body MB_BODY.tga (copy MB_BODY.bmp and rename)
EDITOR HEAD.m3d Group01 MB_HEAD.tga (copy MB_HEAD.bmp and rename)

Download
http://www.mediafire.com/download/1nbr5r77gxb7wu8/Portrait.zip

Smiley  

« Last Edit: January 14, 2015, 08:25:42 AM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #5 on: January 15, 2015, 12:19:35 AM »

can you explain it like I'm five?

How would one overwrite Bernhardt's head with a custom one?
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #6 on: January 15, 2015, 02:15:35 AM »

Morgan Bernhardt (MB) would probably use the following 3d models and textures ->

2.m3d body MB_BODY.bmp
13.m3d Group01 mb_head.bmp

Using the Call of Warhammer 3D models of say the Giant, I would export the Giant's Head in Blender as 2.m3d and the top half of his body as 13.m3d with its own unique textures saved as MB_BODY.bmp and mb_head.bmp .

Then when Dark Omen calls those models for Morgan it should show a Giant. However, I imagine the hard part will be to find where and how the engine knows to call those models for Morgan Bernhardt. If we can locate that list or table of heads and bodies, then we could possible add to the list rather than overwrite. I am currently learning & searching for "Portraits" functions with IDA.
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #7 on: January 15, 2015, 03:12:25 AM »

we can step right to sub_4018A0 by following the cross-ref of the first portrait in the sprite table
Code:
.text:004018A0 Portraits_something proc near           ; CODE XREF: sub_401950+33Ap
.text:004018A0                                         ; sub_401950+4D1p
.text:004018A0
.text:004018A0 arg_0           = dword ptr  8
.text:004018A0
.text:004018A0                 push    esi
.text:004018A1                 mov     esi, [esp+arg_0]
.text:004018A5                 cmp     dword ptr [esi], 0
.text:004018A8                 jnz     short loc_40191C
.text:004018AA                 mov     dword_5014D8, 1
.text:004018B4                 mov     dword_5014DC, 25h
.text:004018BE                 mov     dword_5014E0, 135h
.text:004018C8                 mov     eax, bkgnd_id
.text:004018CD                 mov     dword_5014FC, 0 ; counter
.text:004018D7                 lea     ecx, bkgnd_table[eax*8] ; MB_xx // background table
.text:004018DE                 mov     eax, offset unk_4CFBD0 ; first portrait
.text:004018E3                 mov     bkgnd_entry, ecx
.text:004018E9
.text:004018E9 loop:                                   ; CODE XREF: Portraits_something+74j
.text:004018E9                 mov     ecx, [eax]      ; sprite_slot.ref_count
.text:004018EB                 test    ecx, ecx
.text:004018ED                 jz      short loc_40190C
.text:004018EF                 mov     ecx, [eax+28h]  ; sprite_slot.loaded_index
.text:004018F2                 mov     edx, dword_5014FC
.text:004018F8                 mov     dword_501500[edx*8], ecx ; Loaded_Portrait_Array?
.text:004018FF                 mov     edx, dword_5014FC
.text:00401905                 inc     edx
.text:00401906                 mov     dword_5014FC, edx
.text:0040190C
.text:0040190C loc_40190C:                             ; CODE XREF: Portraits_something+4Dj
.text:0040190C                 add     eax, 2Ch
.text:0040190F                 cmp     eax, offset unk_4D09E8 ; last portrait
.text:00401914                 jb      short loop
.text:00401916                 mov     dword ptr [esi], offset dword_5014D8
.text:0040191C
.text:0040191C loc_40191C:                             ; CODE XREF: Portraits_something+8j
.text:0040191C                 pop     esi
.text:0040191D                 retn
.text:0040191D Portraits_something endp

which probably means the next function that is called ( sub_401E36 ) loads the portraits?

right now, I'm wondering how the hard-coded SpriteTable[slot].loaded_index plays into it.
If I change PT_Bernhardt loaded_index from 0 to 5 ... I get the ogre head (as expected?)


edit: or maybe it would be better to start by placing a hardware breakpoint on PT_Bernhardt -> ref_count and looking around there
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #8 on: January 15, 2015, 11:35:54 PM »

Nice!

Smiley
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #9 on: January 18, 2015, 11:09:23 PM »

the hard-coded sprite_slot.loaded_index appears to be an index into heads.db
offset 0x12 of the HEAD structure in heads.db is (?) the index of the (head?) meshes/%d.m3d file

 
 

 
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #10 on: January 18, 2015, 11:16:05 PM »

I see, good progress.

Thanks

Smiley
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
aqrit
Developer
*
Offline Offline

Posts: 85



View Profile WWW
« Reply #11 on: February 03, 2015, 06:49:33 PM »

added 64 new portrait slots
http://bitpatch.com/downloads/do_mod_helper_wip.zip

add new entries to the end of heads.db with a hex-editor
the first new entry (0x3F) == XSLOT 00, etc.

the other offset for the HEAD struct is 0x0D, IIRC

also new:
enabled the "3DDebug" registry options
so Fullscreen, etc can be toggled from the registry

( this update was more or less a code dump )
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #12 on: February 03, 2015, 09:21:50 PM »

Many thanks Aqrit, this will be fantastic to finally have new 3D heads and great idea to add the FullScreen Reg Option.


* FullScreenRegOption.jpg (136.27 KB. 773x718 - viewed 1162 times.)



« Last Edit: February 03, 2015, 11:09:25 PM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #13 on: February 03, 2015, 10:16:03 PM »

Made progress swapping Morgan's Head and Textures (13.m3d & MB_Head.bmp) to new Dark Elf Head (64.m3d & DE_Head.bmp)


* PortraitsMBtoDE2.jpg (140.51 KB. 613x438 - viewed 1275 times.)



* PortriatSwapinHeadsDB2.jpg (86.17 KB. 630x246 - viewed 1227 times.)



So will continue trying to add new Head block of data at end of Heads.DB for the new xslot Giant portrait to use.

« Last Edit: February 04, 2015, 12:14:47 AM by olly » Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
olly
Global Spokesperson
*
Offline Offline

Posts: 2298



View Profile
« Reply #14 on: February 06, 2015, 12:04:45 AM »

Eternal thanks again Aqrit, having new 3d heads is going to be amazing. We can now use all the Call of Warhammer (&possibly the Sundering mod) 3d models for new sprites and 3d heads for the meeting/talking cut scenes and in game Portraits.

A real shared dream come true - totally new Warhammer armies on new maps with new campaigns. It's finally here! Massive thanks to you all!

Early test - Giant 3d head converted into Dark Omen - will improve graphics and test new bodies and necks, then post guide

* InGameGiants3DPortrait22.jpg (177.76 KB. 954x538 - viewed 1190 times.)


Smiley


Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
Pages: [1] 2 3 ... 8   Go Up
Print
Jump to: