SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
06-09-12, 10:13 AM | #1441 |
Grey Wolf
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
|
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 |
06-09-12, 10:19 AM | #1442 | |
Black Magic
|
Quote:
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 |
|
06-09-12, 10:23 AM | #1443 |
Grey Wolf
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
|
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 |
06-09-12, 06:01 PM | #1444 |
Black Magic
|
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. |
06-09-12, 07:57 PM | #1445 |
Watch
Join Date: Dec 2009
Posts: 20
Downloads: 91
Uploads: 0
|
It's a new dawn!
|
06-09-12, 10:02 PM | #1446 |
Black Magic
|
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. |
06-09-12, 10:20 PM | #1447 | |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
Quote:
Not to be ignorrant. But can you please explain this in simpler speak and what it means to the game?? |
|
06-09-12, 11:46 PM | #1448 | |
Black Magic
|
Quote:
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. |
|
06-10-12, 01:19 AM | #1449 |
Grey Wolf
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
|
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 |
06-10-12, 01:54 AM | #1450 |
Medic
Join Date: May 2006
Location: Near Lake Leman and Geneva, FRANCE
Posts: 162
Downloads: 150
Uploads: 0
|
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 |
06-10-12, 02:36 AM | #1451 |
Grey Wolf
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
|
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. |
06-10-12, 06:46 AM | #1452 |
Black Magic
|
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 |
06-10-12, 07:09 AM | #1453 |
Black Magic
|
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. |
06-10-12, 08:08 AM | #1454 |
Black Magic
|
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.
|
06-10-12, 09:09 AM | #1455 | |
Admiral
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
|
I completely agree with your statements jean74 , in my opinion this is one of the most important threads of the Subsim forum
Quote:
__________________
What we do in life echoes in Eternity |
|
|
|