Log in

View Full Version : Milk Cows and Complications


Stiebler
12-14-05, 11:53 AM
One of the omissions from SH3 was the availability of submarine tankers (‘milk cows’, U-boat Type XIV) during 1942 to 1944, when they were available for supplying other U-boats. I wanted to added a basic form of milk cow to my own edition of Rub. The principle is easy enough: place a German naval base in the middle of the ocean, and have a tanker circle the base, so that the player would have something to look at when approaching the base.

So I took the type IXC U-boat folder from the data\submarine file, copied it as a new folder ‘Type9C14’, modified it a little for new appearance, equipment and AI control (rather than player control), added a suitable entry to the roster folder and made entries for a new base and the new U-boat type circling the base in campaign_scr.mis. In testing, by creating new campaign careers for 1941, 42, 43 and 44, everything worked fine. The milk cows appeared when expected, and the bases functioned. So far so good.

The problem came when I ran a complete campaign through Rub from 1939 - just pleasure-playing, not testing. Everything ran well until the very first load of a saved game in 1942 (the first year of appearance of the milk cows). Then the program refused to load while in port. Investigation showed that the problem was because I was trying to run a type IXC boat for myself, as well as for the AI-submarine tanker. If I played with a type IXB (or other U-boat), no problem. Conversely, if I now constructed an AI-submarine tanker from a type IXB boat, I could play the whole campaign happily with a IXC boat - but the program wouldn’t load in port if I was playing a type IXB boat.

The bottom line is that - in my experience - you cannot operate two identical U-boat types together, one for the player and one for the AI. Also you cannot create a new U-boat type (such as type 14), and you cannot fool the SH3 by making the AI-submarine tanker into a surface vessel, by placing it in the data\sea folder.

This has some important consequences:
Sansal created a ‘milk cows mod’ some months ago, using a naval base as described above with a circling surface tanker. This seems to be stable, since it is not using a U-boat type.
Rubini appears to use the same method as me for his ‘Harbour Traffic 1.46’ mod. I would expect this to show the same behaviour - has anyone noticed it? (Rubini is using a type IXB copy as the AI-tanker.)
Sergbuto has created two AI-controlled U-boats for his ‘AI-subs’ mod. He supplies the U-boats; you are expected to provide their patrols in one of the campaign files. I would expect this mod also to be affected.

Solutions:
1. I may simply be wrong. Perhaps I’ve overlooked a file somewhere that I should have altered to tell SH3 that I need a new U-boat type controlled by AI. If this is the case, then someone please let me know!
2. Otherwise, players who use milk cow mods must avoid playing those U-boats that are also used by the AI as duplicates for the milk cows. (So arguably the IXC boat is the best U-boat to pick for the milk cow, and for everyone else to avoid using - play with the IXB or IXC/40 instead).
3. Or perhaps some kind modder would create a German surface tanker that behaves in all respects like a surface tanker, but looks like a type IX U-boat with flak guns only?

It's interesting, though, that SH3 only loads into memory enough data for its immediate needs, say about six months worth.

Incidentally, I’m aware of all the problems of delays in base when using naval bases as substitute milk cows in this way. Please don’t divert this thread into a discussion of time delays.

Stiebler.

sergbuto
12-14-05, 01:46 PM
My AI-subs mod was specifically created to overcome the problem you describe as well as to eliminate passive behavior of the AI- subs when they (stock subs) just sit in water and doing nothing.

It is not always useful to re-discover the bicycle. :)

You have crashes because object digital IDs for 3D models of the player sub and the AI-sub are the same when the same type of stock subs is used. This can be avoided by cloning the sub with pack3d or manual hex-editing.

thecaptain
12-14-05, 03:54 PM
Hey Serg,
Can you tell me if the problem with destroyed flak guns was ever fixed? I remember that being a problem for some folks using the Milkcow mod when it first came out. Thanks!

The Captain

sergbuto
12-14-05, 05:12 PM
I think it was fixed.

thecaptain
12-14-05, 05:18 PM
Thanks!! I'll check it out.

The Captain

Stiebler
12-14-05, 06:44 PM
Sergbuto said:
It is not always useful to re-discover the bicycle. smile

You have crashes because object digital IDs for 3D models of the player sub and the AI-sub are the same when the same type of stock subs is used. This can be avoided by cloning the sub with pack3d or manual hex-editing.

Thank you for this partial answer.
I agree completely (that 'it is not always useful to rediscover the bicycle').

Therefore can you tell me, please, in which file, or files, to find the "object digital ID" (since it certainly does not have that name in any of the submarine files). I do not have any difficulty with hex-editing.

Many thanks,
Stiebler.

sergbuto
12-14-05, 08:04 PM
They are in the model files. Each 3D object in SH3 has its unique 8-byte digital ID. That is how the object is identified by the game. These have been discussed multiple times on the forum but I do not have any thread at hand. Try to do some search.

Just use option "Clone" in Pack3D to duplicate a sub model by changing those IDs.

Stiebler
12-15-05, 10:34 AM
Thanks for this information, Sergbuto.

However, I have to say that searches through SubSim forums for the key words "digital ID" and "3D object" produce no relevant hits, and I have been unable to locate them by private discussion with other forum members. "Pack3D" as a keyword is found *only* in this thread and in "New ship mods required". Nowhere is it stated where one can download this program. A Google search was confusing, since the name "Pack3D" (or "Pack 3D") has been used for several unrelated programs. However, I managed to download "pack3D.jar" from a Spanish webiste for SH3. This download distinguished itself by having no operating instructions whatsoever.

After trial and error, I remain completely baffled. When you say Just use option "Clone" in Pack3D to duplicate a sub model by changing those IDs., what exactly is supposed to happen? For example, I load NSS_Uboat9b.dat into Pack3D, then press key "Clone". What happens, and how is it supposed to help?

In particular, every time I load the .dat file into Pack3D, I notice that the ID (of the 1st item) changes. What am I supposed to make of that?

Have any instructions for Pack3D been produced, or have I just been unlucky with my download site?

Thanks
Stiebler.

Stiebler
12-15-05, 01:31 PM
I've managed to answer some of my own questions:

Pack3D takes a .dat file (eg NSS-Uboat9b.dat). After loading, pressing the 'Clone' button changes at least three ID values all the way through the .dat file. The file is updated, not saved, so that confusingly the file date is not re-stamped. The file is also not re-loaded and shown on screen. You must actively reload the (apparently-unaltered) file.

Manual hex editing:
The ID values start at fixed location 0x00005F (origin of .dat file = 0x000000), and comprise 8 bytes each. Change these 8 bytes with any random numbers to give a new ID. Subsequent copies of the ID in the .dat file do not occur at fixed displacements, so must be searched and located. Then change them to the new ID now inserted at 0x00005F.

Since my last post complained about not being able to find anything by searching the forum, perhaps I'd better add these keywords:
Pack3D, submarine ID, U-boat ID, milk cow, U-Tanker.

Stiebler.

Rubini
12-15-05, 03:40 PM
Stiebler,

Sansal milk cow and my "redone" on milk cow mod already fix all these "problems" that you wrote here. I use a cloned uboat to do the job as a type XIV. So just install and enjoy the HT 1.46 with a complete and realistic milk cow features. Ah, in time, the next HT release comes in a week, ok? :up:

Rubini.

sergbuto
12-15-05, 04:06 PM
In addition to DAT file of some sub you need to have CAM, DSD, SIM, VAL, and ZON files in the same folder. Load DAT file in Pack3D and press the Clone button. The binary IDs will be change to some arbitrary numbers in the DAT and all the other files mentioned above. Be careful, Pack3D does make backups.

Make search for posts by Sansal. This should bring more info about Pack3D.

Stiebler
12-15-05, 05:07 PM
Thanks for these posts, Rubini and Sergbuto.

A search for Sansal did indeed bring up much information about Pack3D.

The reasons I'm persevering with my own versions of milk cows are: firstly that you learn more from doing things yourself than from using someone else's 'black box'; secondly, I have my own ideas about the implementation of milk cows, which may not be the same as yours.