Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

Deep thoughts on DC/SH2 model/ texturing
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> Silent Hunter II, Destroyer Command & Classic Subsims
View previous topic :: View next topic  
Author Message
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Thu Aug 12, 2004 6:02 pm    Post subject: Deep thoughts on DC/SH2 model/ texturing Reply with quote

Well, My vacation is nearly at an end, and we've got a hurricane supposed to come through here soon, so I've got some big things that have all converged on my mind as of recently. Bear with me here for a minute Wink

Okay, Previously I talked to Covet, maker of the texturing tools, on a small discovery I had made. EVERY model except 1 in SH2/DC uses a 256x256x24 texture. That exception is the T2 Tanker model.
It's main texture is a 512x512x24. Oddly Enough, its damage tex is still only a 256.

This has led me to believe that it would be possible, If Possibly Covet would be willing to lend a hand, To allow 512x512 textures on ANY model. It may be a longshot, but I personally find it worthy of a serious endeavor in investigating this.

This mostly is directed toward Sergbuto and his Hex editing experience, as I can tell it would be needed to change the offsets and stuff for the bigger texture, and Covet as He wrote the program, and possibly Floater because he seems quite adept at programming.

With some combined and concerted effort, And I know everyones working on big stuff like Graf Spee and KD 2, but who knows. With double the texture size, the ammount of detail would DRASTICALLY change the look of the ships. Compare the T2 to any other ship in the game. The textures just look crisper and cleaner, less stretched.

Maybe I'm dilusional, but for some reason I feel this is very possible.

I tried just a direct resizing of the textures for the Alabama to 512, and it inserted them fine with no crash by the Windows interfaced Covet tools, but DCViewer crashed with a BD3d Error, and I ASSUME that it was caused by the textures having the wrong coordinates.

If it is possible to change the boundaries of the textures using a hex editor, then perhaps this will be a possibility, but I'm not sure.

I noticed that by using the object viewer by Covet, that most of the 256 textured ships shared the same values for the size column, usually it was a value like 262672, or something like that, where the size value was the same between the main and damage texture.

But on some ships, like the troop transport and T2, the main textures size vale is different than the damage value.

I'm hoping that maybe Serg could look into this and let me know I havent gone completely Insane here........
Back to top
View user's profile Send private message Send e-mail AIM Address
sergbuto



Joined: 14 Sep 2002
Posts: 2530
Location: Sweden

PostPosted: Sun Aug 15, 2004 5:12 pm    Post subject: Reply with quote

I think that in addition to an insertion of the 512x512 texture, a re-mapping of nodes onto the large size texture will be necessary. Otherwise, they will be still referring to UVs of the 256x256 texture. Even if I knew how to do this re-mapping via hex-editing it would be a hardly- possible job to complete due to a large number öf poly points to go through. Sad
Back to top
View user's profile Send private message Send e-mail
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Mon Aug 16, 2004 2:04 am    Post subject: Reply with quote

Thats what I assumed. I'm hoping that maybe an extension of covets object wiewer might be made that could pick out those points, and allow editing of them. If some sort of interfacing program could be done up, then it might make it a little easier.
Back to top
View user's profile Send private message Send e-mail AIM Address
Seeadler



Joined: 14 Mar 2001
Posts: 1992
Location: Germany

PostPosted: Mon Aug 16, 2004 9:23 am    Post subject: Reply with quote

sergbuto wrote:
I think that in addition to an insertion of the 512x512 texture, a re-mapping of nodes onto the large size texture will be necessary.

The UVW map is not the problem, it would be auto resized by the graphic engine, the problem is the loading routine for the textures. The texture size is hardcoded to 256x256, except some model which have hardcoded 512x512 textures. Now if the graphic engine loads the texture of a model which has 512x size but allocate only memory for 256x, it overwrites other space in memory. Sometimes it will run if the space are emty and sometime it will crash if other stored data are overwrite.

Without access to the SH2 sourcecode to write a flexible texture loading routine which allocate memory based on the needed size of the texture, there is no chance.
Back to top
View user's profile Send private message Send e-mail
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Mon Aug 16, 2004 4:36 pm    Post subject: Reply with quote

So its the game again........
Damn

I'll keep piddling with it, I dont really give up on anything till its really truly dead.

But I've still got something on my mind

I hope that the Covet tools object viewer could be turned into a simple editing program.
I'm going to contact him and see if he might still be willing to make such a change and add in the ability for the program to see the uv points for textures, and the smoke/bridge nodes, because I REALLY need to edit those.
Back to top
View user's profile Send private message Send e-mail AIM Address
R Hardman



Joined: 31 May 2001
Posts: 805
Location: 29 Palms, Ca.

PostPosted: Wed Aug 18, 2004 11:06 pm    Post subject: Reply with quote

turnerg wrote:
I'll keep piddling with it, I dont really give up on anything till its really truly dead.


I like your attitude! Thumbs Up
Back to top
View user's profile Send private message
Covet



Joined: 11 Jan 2001
Posts: 22
Location: Washington State

PostPosted: Thu Aug 19, 2004 4:37 am    Post subject: Reply with quote

The textures dimensions and bitdepth are defined in the JRF. And the textures are compressed in some funky format which is probably considered a standard but I decoded myself 'cause I have nothing better to do. Razz

Anyhow, the first part of the texture records note their width and height, plus bitdepth. I figured out how to decode the 256x256x32 textures, I never figured out the others (or tried), obviously. Or else the txtdmp program wouldn't spit out broken textures for (T2) 512x512 or the 8 bit heightmaps used to define the terrain.

(The whole T2 thing is from memory. I beleive turnerg told me that the T2 512x512 texture didn't dump correctly, and if you replaced it the game would crash.)

As for textures looking as being the same size... my program does that... the JRF's use a RLE encoding scheme to compress the textures, my programs dont' do "compression", they follow the scheme (hence they work) but they don't actually compress, so any texture inserted by my programs end up the same size as another. (I'm lazy)

From looking at the source code, I've never seen anything hardcoded for any of the ships (except conning tower offsets for the stock player controlled ships)

(Edited to try and make badhat's following post not make sense, probably didn't work tho' Wink


Last edited by Covet on Thu Aug 19, 2004 1:30 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
badhat17



Joined: 07 Jul 2002
Posts: 385
Location: hub o de universe

PostPosted: Thu Aug 19, 2004 8:31 am    Post subject: Reply with quote

Ping SMARTASS ALERT Ping
Back to top
View user's profile Send private message Send e-mail
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Thu Aug 19, 2004 5:04 pm    Post subject: Reply with quote

I don't see an ass :huh:

Covet, have you seen/used Ortegas interface for your tools?
one of the buttons opens your objlst program in a window and displays all of the model pieces, textures, etc looks like this

jrf_objlst; version 0.2; Copyright (c) Michael Turner 2002, 2003
Name Type Size Offset
---- ---- ---- ------
NBBSdakota NODE 120254 32
good_sl MODEL 4576 120286
good_low_r1_hull MODEL 624 124862
good_med_r1hull MODEL 1098 125486
good_high_r1hull MODEL 1266 126584
bad_med_r1hull MODEL 1098 127850
bad_high_r1hull MODEL 1266 128948
good_low_r2hull MODEL 468 130214
good_med_r2hull MODEL 468 130682
good_high_r2hull MODEL 468 131150
bad_med_r2hull MODEL 468 131618
bad_high_r2hull MODEL 468 132086
good_low_r3hull MODEL 520 132554
good_med_r3hull MODEL 676 133074
good_high_r3hull MODEL 676 133750
bad_med_r3hull MODEL 676 134426
bad_high_r3hull MODEL 676 135102
good_low_l1hull MODEL 768 135778
good_med_l1hull MODEL 1450 136546
good_high_l1hull MODEL 1434 137996
bad_med_l1hull MODEL 1450 139430
bad_high_l1hull MODEL 1618 140880
good_low_l2hull MODEL 664 142498
good_med_l2hull MODEL 664 143162
good_high_l2hull MODEL 572 143826
bad_med_l2hull MODEL 664 144398
bad_high_l2hull MODEL 664 145062
good_low_l3hull MODEL 664 145726
good_med_l3hull MODEL 924 146390
good_high_l3hull MODEL 786 147314
bad_med_l3hull MODEL 924 148100
bad_high_l3hull MODEL 924 149024
good_low_deck1 MODEL 416 149948
good_med_deck1 MODEL 4600 150364
good_high_deck1 MODEL 4600 154964
Alpha1 MODEL 2060 159564
bad_med_deck1 MODEL 4600 161624
bad_high_deck1 MODEL 4600 166224
18inchg24 MODEL 1328 170824
18inchg21 MODEL 2428 172152
18inchg27 MODEL 1444 174580
18inchg19 MODEL 2380 176024
quad_40mmg32 MODEL 388 178404
quad_40mmg34 MODEL 860 178792
quad_40mmg28 MODEL 1356 179652
quad_40mmg35 MODEL 560 181008
quad_40mmg33 MODEL 756 181568
quad_40mmg19 MODEL 1044 182324
MG1g27 MODEL 220 183368
MG1g26 MODEL 318 183588
MG1g28 MODEL 220 183906
MG1g19 MODEL 416 184126
good_low_deck2 MODEL 6592 184542
good_med_deck2 MODEL 39322 191134
good_high_deck2 MODEL 41086 230456
Alpha2 MODEL 1870 271542
g197 MODEL 2096 273412
g328 MODEL 2096 275508
g330 MODEL 2096 277604
g334 MODEL 2096 279700
bad_med_deck2 MODEL 37998 281796
bad_high_deck2 MODEL 39246 319794
5inchg15 MODEL 1304 359040
5inchg23 MODEL 1460 360344
5inchg24 MODEL 988 361804
good_low_deck3 MODEL 416 362792
good_med_deck3 MODEL 5092 363208
good_high_deck3 MODEL 5952 368300
Alpha3 MODEL 1882 374252
bad_med_deck3 MODEL 5092 376134
bad_high_deck3 MODEL 5092 381226
NBBSdakotaMat MATERIAL 984 386318
NBBSdakota TEXTURE 262672 387302 256x256x24
NBBSdakota1 TEXTURE 262672 649974 256x256x24


If you could make something up so I could change those values ie the offsets and size values, it would be really awesome :know:

It seems that the bridge and smoke entries don't show up in here, but serg knows how to edit them, so maybe yous guys could figure a way to get the program to recognize those parts of the model....

I've really got to find out how to move the Bridge and Main bat director viewpoints because I intend that all of my ships be Drivable.
Back to top
View user's profile Send private message Send e-mail AIM Address
sergbuto



Joined: 14 Sep 2002
Posts: 2530
Location: Sweden

PostPosted: Thu Aug 19, 2004 7:02 pm    Post subject: Reply with quote

Main bat director position can adjusted without hex-editing, by using TRANSLATE command in the UDF.
Back to top
View user's profile Send private message Send e-mail
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Thu Aug 19, 2004 7:15 pm    Post subject: Reply with quote

OOOOOHHHHH

I though translate was related to the height the ship rides in the water though, guess not!

Cool!

Oh, might you eventually give insight on how todo things like give other ships the High guns?
Back to top
View user's profile Send private message Send e-mail AIM Address
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Fri Aug 20, 2004 2:17 am    Post subject: Reply with quote

I guess what I'm mostly hoping for is to make a program or interface that allows for people less knowledgable than Serg to edit the models, jike with objlst but with editing capability :hmm:
Back to top
View user's profile Send private message Send e-mail AIM Address
Covet



Joined: 11 Jan 2001
Posts: 22
Location: Washington State

PostPosted: Mon Aug 30, 2004 3:06 am    Post subject: Reply with quote

erm, objlist was made to help other ppl try and decode the JRF's. The offset you mention from it is it telling you where the object starts in the file, and the size is well.. it's size. (helps hex editing)

(Offset 100, size 100.. means it takes up the byte position from 100-200, for example)

And yeah, I've seen (haven't used) Ortega's gui interface, I think he did a good job (he asked me if it was ok to release my tools before he released them). I'm pretty impressed with how well he integrated them.

The JRF_* tools were just prototypes for a library I was writing that read/wrote JRF's (jrf_objlist, etc are just programs statically linked to the library) but I lost interested in the game and stopped developing it. I was originally planning to release a small Wavefront OBJ -> jrf converter using my library, then releasing the library seperate so other ppl could make whatever converters they wanted, etc.

(Wavefront .OBJ is a text based model format that's really easy to understand, and most modeling programs can read/write it, even if they need a plugin...)

I dunno why what's his name said the texture sizes are hardcoded, since they aren't.. objlist obviously pulls the size from the JRF itself. Just my code doesn't decode/re-enecode them correctly (or like I said, the terrain heightmaps (which are 8bit) would extract correctly, and they don't) As I told you before, if you REALLY want me to do it, I'll fix the programs so they can deal with non 256x256x24 bit textures... but I have no incentive to right now (I haven't had the games installed in about a year)

As for changing the offset of the viewing position of the conning tower, whatever...

That IS hardcoded... the (stock) player boats have their viewpoint set to the top of the bounding box of whatever portion of the boat you're viewing from. Butr the non-stock units use the center of the bounding box to pick the viewpoint.

To quote David Twist (from Ultimation when it still existed)...

--- Begin quote
Heh. Sorry guys. I can't send out our original source files at will. It appears that the observation eyepoints for ships other than the US destroyers are being calculated erroneously. They should take the bridge bounding valume and put the eyepoint a meter *above* it, but instead it's being placed at the center of the volume. I'll note that as bug and if we have time to add it to a future patch, I'll relay the info to you guys. To be honest though, something like that is a very low priority, as it's not problem for standard gameplay.
--- End quote

Your choices are... expand the bounding box around the conning tower to raise the view (which also increases the "size" of the conning tower) or change the code to make ALL boats align the viewpoint with the top of the bounding box.

Or of course, do the translate thing...

For fun, I made a DD with a hull bounding box that went down about 1000 meters...

You could ram subs when they were at their max depth, fun stuff. Razz 'course... you ran aground all the darn time...

And for kinda sick... the main reason I wrote the program to replace textures... was to reply to a thread that said it couldn't be done. Gotta prove the world wrong and all that. Razz

JRF's are nothing different than say... .ZIP files... it's a archive of a buncha different "files" (Objects), and all JRF_OBJLST does is list those objects out for you, where they are in the file, how much space they take up. Of course, each of those "objects" are encoded in their own way and why I wrote the program to list them out, figured out ppl would figure out how to decode them.

I'm gonna edit this message more times than should probably be allowed. Razz

My programs DON'T handle any texture other than 256x256x24 correctly. It's not that the game can't handle larger (looking at the source, there's no limit) but mine TRY to handle others right, they obey the x/y/bitdepth correctly... but only for how I decoded 256x256x24... You'd think others would work right, but they don't, it's a bug in my programs that stops you from replacing the T2 textures, etc.

That could be fixed, probably take me a day or two using the T2 as an example to figure out why 512x512 textures aren't getting stuffed back into the JRF correctly, probably the same for the terrain heightmaps...

And btw, 1024x1024 or larger textures woulda rocked. Razz
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
turnerg



Joined: 18 Jan 2004
Posts: 1088
Location: Dallas, Texas

PostPosted: Mon Aug 30, 2004 12:36 pm    Post subject: Reply with quote

I understand what you mean about kinda leaving the game to set. After doing all that painting, I got to the point I couldn't play it at all.

But, If you are willing to thake the time to figure how to get the 512 or bigger textures, then it would be absolutely awesome. the simple thing is that I have absolutely no programming knowledge whatsoever, so i can think up ideas but i have no way of personally figuring it out.

Interesting thing with the model conversion stuff. If you were actually able to pull off a converter, you'd be revered as a, well, computer god! Very Happy

Anyways, anything you are willing to do out of your own heart to help us out would be much obliged by most likely everyone who plays this game. Yep
Back to top
View user's profile Send private message Send e-mail AIM Address
sergbuto



Joined: 14 Sep 2002
Posts: 2530
Location: Sweden

PostPosted: Mon Aug 30, 2004 2:14 pm    Post subject: Reply with quote

Yes, it would be really great to have a converter.

As to re-texturing, according to my tests, even if the 512x512 or 1024x1024 texture is inserted to JRF or applied in some other way, only 256x256 part of the larger texture plate is used for the hull and decks of the ship model, anyway. On the other hand, the larger textures can be applied to the nodes from "guns_good_deckX" sections or nodes which are independent on the main part of the ship and their positions can be adjusted with respect to the hull and decks. Nodes, such as guns, torpedo launchers, observation bridge with rails on US DDs, radars, etc.

Below, screenshots of the T-class US sub bridge (look at the periscope base and the floor) show the results of the use of larger textures.

Original periscope base and the bridge floor with 256x256 textures.


Periscope base and the floor after applying large textures: 1024x1024 texture for the bridge and 2048x2048 (!) texture for the floor.


Last edited by sergbuto on Tue Aug 31, 2004 1:27 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> Silent Hunter II, Destroyer Command & Classic Subsims All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group