SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 06-09-12, 10:13 AM   #1441
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Ok,i have see, "Bump map" in the new material and in the other "standart" and more Granny Thing ,
But all see to work ,i have take a look in the view detailed mesh list->material binding and all seem good
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 06-09-12, 10:19 AM   #1442
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post
Ok,i have see, "Bump map" in the new material and in the other "standart"
and more Granny Thing ,But all see to work ,i have take a look in the mesh list->material binding and all seem good
Other than the incorrect extendeddata it's perfect. Due to not having the correct extendeddata nothing will be able to read the ambient, diffuse, specular, or emissive material properties because they don't exist. This, of course, is a problem. The new material is useless without these.

I found the bug that's caused this and corrected it. Now I have another problem. I wrote an extendeddata cloner that will take pointers to an existing item's extendeddata, clone/copy it, then populate the new extendeddata with the item's pertinent information. There are a couple problems with this cloner/copier currently if the extendeddata contains pointers that point to some other data. I have to fix these problems now
TheDarkWraith is offline   Reply With Quote
Old 06-09-12, 10:23 AM   #1443
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Great work again TDW
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 06-09-12, 06:01 PM   #1444
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

There are times when I just sit in front of my computer screen with my jaw wide open saying "did that just really happen?". I just had another one of those times.

I finished writing the code for creating a new material and being able to define x number of maps for it. I had to fix the bugs in the ExtendedData class's cloner function and once those bugs were worked out I commenced test #1.

Now let me back up before commencement of test #1. The ExtendedData class's cloner function is a work of art. The human brain cannot follow or even begin to comprehend the amount of recursion that is going on simultaneously. That is what made it so hard to write the code and even harder to debug it. I ended up writing 'helper' code to spit out what was going on with all these recursions so I could try and peace together what happened and why when it didn't work. Reviewing the output of the helper code was a task in itself. After 2 straight days I finally worked out all the bugs. Now why it's a work of art (in a code way): the function is given a pointer to existing extendeddata and a pointer to the new extendeddata. It then creates the needed space in the new extendeddata to house all the 'old' data. It starts reading the old data and copies what it reads to the new data. If the extendeddata only contained numbers it would've been simple but no, it also contains pointers, and pointers to lists, and pointers to char arrays, etc. The other pointers sometimes contain pointers to the same items mentioned and those other pointers...well you get the picture. Everytime the function encounters one of these pointers it has to create more space in the GR2 file to house the data it contains and also create new pointers for the data. This single cloner function contains everything needed to handle all of these so when it encounters one of these it calls itself. The second 'calling' could end up calling itself again...and that could end up calling itself again...and that could...well, you get the picture again. The human mind cannot follow all that recursion, it's impossible. The amount of calls for space allocations and pointer creations alone would drive you mad trying to follow it.

back to commencement #1...I created a new material with 3 maps. I clicked the Accept button and let it rip just waiting for a breakpoint to trigger saying "You idiot....ERROR!"...but nothing happened. The window just disappeared. I checked the material treeview and my new material was listed. Whoa. I opened the file's Sentinel window and asked for the chain for section 0 (linked list). Sentinel reported no breaks in the chain No way. I clicked File-->Save as... and saved the file as a new name in case there were errors. Fired up GrannyViewer and opened the file. GrannyViewer says all is good. I check the extendeddata for my new material and everything is populated Unbelievable. My jaw dropped

Last edited by TheDarkWraith; 06-09-12 at 10:15 PM.
TheDarkWraith is offline   Reply With Quote
Old 06-09-12, 07:57 PM   #1445
Kaicokid
Watch
 
Join Date: Dec 2009
Posts: 20
Downloads: 91
Uploads: 0
Default

It's a new dawn!
Kaicokid is offline   Reply With Quote
Old 06-09-12, 10:02 PM   #1446
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

The second importer (a loose import) can now import variable geometry and variable number of subsets You are no longer tied to what the mesh was originally. You can go crazy now

If you'd like to be a tester then PM me.
TheDarkWraith is offline   Reply With Quote
Old 06-09-12, 10:20 PM   #1447
reignofdeath
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by TheDarkWraith View Post
There are times when I just sit in front of my computer screen with my jaw wide open saying "did that just really happen?". I just had another one of those times.

I finished writing the code for creating a new material and being able to define x number of maps for it. I had to fix the bugs in the ExtendedData class's cloner function and once those bugs were worked out I commenced test #1.

Now let me back up before commencement of test #1. The ExtendedData class's cloner function is a work of art. The human brain cannot follow or even begin to comprehend the amount of recursion that is going on simultaneously. That is what made it so hard to write the code and even harder to debug it. I ended up writing 'helper' code to spit out what was going on with all these recursions so I could try and peace together what happened and why when it didn't work. Reviewing the output of the helper code was a task in itself. After 2 straight days I finally worked out all the bugs. Now why it's a work of art (in a code way): the function is given a pointer to existing extendeddata and a pointer to the new extendeddata. It then creates the needed space in the new extendeddata to house all the 'old' data. It starts reading the old data and copies what it reads to the new data. If the extendeddata only contained numbers it would've been simple but no, it also contains pointers, and pointers to lists, and pointers to char arrays, etc. The other pointers sometimes contain pointers to the same items mentioned and those other pointers...well you get the picture. Everytime the function encounters one of these pointers it has to create more space in the GR2 file to house the data it contains and also create new pointers for the data. This single cloner function contains everything needed to handle all of these so when it encounters one of these it calls itself. The second 'calling' could end up calling itself again...and that could end up calling itself again...and that could...well, you get the picture again. The human mind cannot follow all that recursion, it's impossible. The amount of calls for space allocations and pointer creations alone would drive you mad trying to follow it.

back to commencement #1...I created a new material with 3 maps. I clicked the Accept button and let it rip just waiting for a breakpoint to trigger saying "You idiot....ERROR!"...but nothing happened. The window just disappeared. I checked the material treeview and my new material was listed. Whoa. I opened the file's Sentinel window and asked for the chain for section 0 (linked list). Sentinel reported no breaks in the chain No way. I clicked File-->Save as... and saved the file as a new name in case there were errors. Fired up GrannyViewer and opened the file. GrannyViewer says all is good. I check the extendeddata for my new material and everything is populated Unbelievable. My jaw dropped

Not to be ignorrant. But can you please explain this in simpler speak and what it means to the game??
  Reply With Quote
Old 06-09-12, 11:46 PM   #1448
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by USNSRCaseySmith View Post
Not to be ignorrant. But can you please explain this in simpler speak and what it means to the game??
You can now take an existing GR2 file and turn it into something else (new geometry and materials). An existing GR2 file is just a shell to hold your new data.

Here's what you could do: take the LifeBoat.GR2 and turn it into another ship...or an airplane...or a sub....or whatever you want. It all depends on what you import into the existing meshes.
TheDarkWraith is offline   Reply With Quote
Old 06-10-12, 01:19 AM   #1449
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

Bonjour à tous

TDW you are the master of the geniuses
Even the guys at MIT should be jealous not to have you
Incredibly, the job you have done
I'll try the new version immediately
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok
BIGREG is offline   Reply With Quote
Old 06-10-12, 01:54 AM   #1450
jean74
Medic
 
Join Date: May 2006
Location: Near Lake Leman and Geneva, FRANCE
Posts: 162
Downloads: 150
Uploads: 0
Default Incredible

TheDarkWraith

I follow your posts and the developpment of your editor since you started. Due to real life I can't test and help you as Bigreg does.

What you have done is unbelievable !!! I can't imagine the complexity of the code of your GR2 Editor. I would like to have 0.01% of yours skills !

Without you SH5 would be certainly dead (new UIs, new Ai, new FXs, new tools,...),

So many thanks for all your work, and RESPECT from me

Best regards,


Jean
jean74 is offline   Reply With Quote
Old 06-10-12, 02:36 AM   #1451
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Default

v1.218.1 report:

I try to create a material with 3 maps for the rock4 , in the undersea.gr2

- Add texture: rock4.dds and rock4_N.dds - OK

- Creation of maps: material type: map with no texture

one for the diffuse: Map#rk4diff - OK
one for illumination: Map#rk4ill - OK
and one for the bump:Map# rk4bump - OK

- Creation of material: No texture with map (named rock4)

add diffuse illumination, bump create rather

and i have this error:



Bad procedure from me

I have try with just the diffuse and that work,but if i assign more maps i have the same error
__________________
~~~~BigReg~BigRegOne~~~~



"Better watch where you do not go, because where were going, we will know what it is when we get there, and anyway, it will never be only water."

Proverbe Shadok

Last edited by BIGREG; 06-10-12 at 02:52 AM.
BIGREG is offline   Reply With Quote
Old 06-10-12, 06:46 AM   #1452
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Looking into it.

I just created 3 materials (type no maps with texture - diff, illum, and bump). Created ok. Tried to create a new material (type maps with no texture) and added all 3 new materials as the maps. Clicked Accept and got the same error as you...Now stepping through it in VS 2008 to see why
TheDarkWraith is offline   Reply With Quote
Old 06-10-12, 07:09 AM   #1453
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

I see the error but it's not really an error because the data it's trying to find doesn't exist in the undersea.GR2 file. What I need to do is not let you create a material with certain types of maps if the data it needs doesn't exist in the GR2 file. I'll correct the code.

The extendeddata datatype definitions for a material with 3 maps doesn't exist in undersea.GR2. It was trying to get the pointer to this data structure and the call failed. Since the app had already modified the memory of the file it had no option but to fail gracefully and close the file so you would not be able to save a corrupt version of it.

I have been putting off creating these data structures as it's going to be a royal pita to code. In the meantime the app has just been grabbing pointers to the data structures it needs from existing items and if they didn't exist I didn't let you create the item. Creating a material with maps slipped through the cracks as I forgot to check if the data structure needed exists first before letting you try and create the material with maps. Like I said I'll correct the code so at least you can't try and create it if the data it needs doesn't exist.
TheDarkWraith is offline   Reply With Quote
Old 06-10-12, 08:08 AM   #1454
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BIGREG View Post
- Creation of material: No texture with map (named rock4)

add diffuse illumination, bump create rather

and i have this error:
The main reason you are getting this error is because an embedded string doesn't exist in the GR2 file. I'm adding some code that will automatically add the 'essential' embedded strings to the GR2 file if they don't exist upon load.
TheDarkWraith is offline   Reply With Quote
Old 06-10-12, 09:09 AM   #1455
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

I completely agree with your statements jean74 , in my opinion this is one of the most important threads of the Subsim forum

Quote:
Originally Posted by jean74 View Post
TheDarkWraith

I follow your posts and the developpment of your editor since you started. Due to real life I can't test and help you as Bigreg does.

What you have done is unbelievable !!! I can't imagine the complexity of the code of your GR2 Editor. I would like to have 0.01% of yours skills !

Without you SH5 would be certainly dead (new UIs, new Ai, new FXs, new tools,...),

So many thanks for all your work, and RESPECT from me

Best regards,


Jean
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.