SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   "SH3Gen" Campaign enhancement (version 0.6.0) (https://www.subsim.com/radioroom/showthread.php?t=88438)

GlobalExplorer 01-27-06 08:24 AM

Great!

We should start very simple. If you can provide me with some info about the most important targets in HT1.47, it should be my task to come up with a convincing demo. Once this is accomplished, we can think about the concept another time, and more seriously.

For the beginning, an unformatted text file with 10-20 units would do. I would analyze it and make a list of all the different types of entities I find, as well as make a proposal for the metadata format. In the interest of analysis, it might be better if you try to write down one example of every type of unit you can thnk of, but of course not every single entity of this class. One is already enough.

IMO, the most important types of units would be:

- suppliers (docked or milchcows)
- commerce raiders (Atlantis)
- warships and taskgroups (Weserübung etc)
- concentrations of landing crafts or troop ships (d-day)
-german and italian convoys (north africa)
- concentrations of U-Boats (wolfpacks)

For some reason, atm I can't think of any more, but there are loads.

All should be from static layer (SCR), because I think this information should be reliable.

The info should always contain:

[Group/UnitId from Campaign_SCR, so I can match the info, this is very important!]
Name=<Historic or fictional name>
Class/Type=try to verbalize the type of unit
Why is is there?
What type of action does perform (i.e. warship patrol, commerce raiding, etc), could also be put into Class/Type
Anthing else I didn't think of.

I don't need info about waypoints, EntryDate, ExitDate, etc, because this is already in Campaign_SCR, and we should never duplicate data.

As I said, lets keep it very simple. I have already been approached with some grand ideas, but I prefer to work on something that will work, and without the user having to understand it.

The metadata strategy always works, because the application will check if the metadata file is available, and if it's not, work as usual.

Rubini 01-27-06 09:05 AM

Ok GlobalExplorer,

Can you send your email adress to me? This way we can share files easily. Contact me by PM. ;)

Rubini.

NoLine 01-27-06 09:46 AM

Quote:

- concentrations of landing crafts or troop ships (d-day)
Ok finaly my LCVP is gonna be scripted in the campaign :D

http://img353.imageshack.us/img353/7060/flag5xh.jpg

NiKuTa 01-27-06 10:35 AM

I have still error :(

Instaled:
XP SP2
.net 1.1
Sh3Gen 0.3.0
commander 2
RUB 1.45
HT 1.47

Mesage :

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Sh3Gen2.Database.Campaign.Interpreter.CInterpreter .prime(CGroups Groups)
at Sh3Gen2.Database.Campaign.Interpreter.CInterpreter .Run()
at Sh3Gen2.Database.Campaign.CCampaign.initializeCamp aignData()
at Sh3Gen2.Applications.MapGen2.CMapGenerator.Run(Str ing PatrolGrid)
at Sh3Gen2.Applications.MapGen2.CMapGen2.Button_OK_Cl ick(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
Sh3Gen2
Assembly Version: 1.0.2216.30497
Win32 Version: 1.0.2216.30497
CodeBase: file:///F:/Gry/SilentHunterIII/Sh3Gen/Sh3Gen.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

GlobalExplorer 01-27-06 03:27 PM

Version 0.3.1 has been uploaded. I made some changes in reaction to the problem posted above. Because this is related with the way I use quadrants, I have added the missing arctic quadrants AA,AB,AC,AW and AT. Unfortunately UBI left these quadrants from Sh3, but they are easily locateable. Basically they are an extension to the north of the current quadrants, stretching from Greenland to Novaya Semlja.

NOTE: This version exludes every unit outside the current quadrant system, so at the moment there will be no info about traffic in the Black Sea and Eastern Mediterranean. Who can give me information about Kriegsmarine Grid system used in these regions?

@NiKuTa: Check your pm.

NiKuTa 01-27-06 04:30 PM

Oki, but where is a link to new ver of Sh3Gen?????? :)

ref 01-27-06 05:16 PM

Quote:

Originally Posted by NiKuTa
Oki, but where is a link to new ver of Sh3Gen?????? :)

Page 1 of this thread :

http://www.global-explorer.de/

ref 01-27-06 05:19 PM

I don´t know if this is related to sh3gen or a bug in my save files, but when I use sh3 commander and try to update my personell file I got an error message "list index out of bounds", anyone else is getting it?.


Suggestion, for those of us with slow machines, a progress bar should be appreciated.

@global explorer, thanks for the file.

GlobalExplorer 01-27-06 05:34 PM

This must be a problem when Sh3Commander reads the changed .clg file. I had been in contact with JScones, and he said there should be no problem, but since I have changed the output recently this deserves review.

How about that: I could offer an option to remove all Sh3Gen entries after the patrol is finished.

JScones 01-27-06 08:01 PM

SH3Cmdr does not read any "in mission" save files - when creating a Personnel File, SH3Cmdr reads:

From the selected career folder
Careers.cfg
Careers_0.cfg
Patrols.cfg
Patrols_0.cfg
Log_x.cfg files

From SH3
**_menu.txt
Basic.cfg
UboatAces.cfg
EnglishNames.cfg/GermanNames.cfg

If SH3Gen doesn't modify any of the above files, email me the career files and I'll have a look.

GlobalExplorer 01-28-06 02:39 AM

@JScones: Thanks for coming :)

I am indirectly modifying the following files:

Log_x.cfg

That is of course, because the <savegame>.clg file gets copied after the patrol.

So it's pretty much obvious that my entries cause this problem when Sh3Commander reads the Log_x.cfg files.

I have uploaded a sample Log_0.cfg. Could you please have a look?

http://www.global-explorer.de/Log_0.cfg

I have two suggestions how this can be solved:

1st: I offer an option two remove Sh3Gen entries after the patrol (why would you look at them anyway). Hoewever that it is somewhat awkward.

2nd: I could use a format that is easily recognizable. For instance I could make use of the entrytitle property and make my titles always begin with "---", not just sometimes. Also, right now I am not using the entrytitle property, but I think I should do that.

Could it be a solution that you simply skip reading all entries without entrytitle? I don't need it because it is useless for formatting. The first entry with the patrol dates doesn't use the title either, so as I assume you are reading only the sinking´s and summary, you could consider these entries as a new class which is non-relevant.

JScones 01-28-06 03:46 AM

Yeah, I can see where SH3Cmdr is getting upset. Whilst the sample file is fine, if you insert an entry that contains less than three elements (ie "<data>|<data>" or just "<data>"), SH3Cmdr will error with "List index out of bounds (2)". This is because SH3Cmdr is expecting three elements for these entries.

Of course, the flow on is that even where the added entry does have three or more data elements, the resulting HTML file won't be formatted correctly for those "new" entries.

The easiest fix is for you, and anyone else writing to the log file, to write a non-zero number to the "Type" key. I can then add one line to SH3Cmdr to ignore any entry where Type <> 0.

But, whilst this workaround is very simple, I won't be in a position to release an updated version of SH3Cmdr for a few weeks at the earliest, although I could provide just the updated SH3Cmdr.exe file to anyone who's using SH3Gen.

And also, this fix (presumably) won't exclude the extra text from displaying in the relevant Patrol Log summary displayed in SH3 - is this an issue (I assume SH3 will still present the entries OK, but is this what you/users really want)?

GlobalExplorer 01-28-06 04:34 AM

Quote:

Originally Posted by JScones
The easiest fix is for you, and anyone else writing to the log file, to write a non-zero number to the "Type" key. I can then add one line to SH3Cmdr to ignore any entry where Type <> 0.

This won't do, as Sh3 will not display entries with Type <> 0

Quote:

Originally Posted by JScones
But, whilst this workaround is very simply, I won't be in a position to release an updated version of SH3Cmdr for a few weeks at the earliest (although I could possibly provide just the updated SH3Cmdr.exe file to anyone who's using SH3Gen).

I' say it would be already very nice if we could have a fix with the next version of Sh3Cmdr, whenever it's released. Sh3Gen is still Beta, and the reason is to identify / solve this kind of problem. In any case I'm glad that you offer your help to make the two apps compatible.

I'm also indebted to Ref for being the first one to report this problem. I have offered him my help for a manual fix, which is in fact pretty simple. Every one else with this problem is invited to contact me for the manual solution.

Quote:

Originally Posted by JScones
And also, this fix (presumably) won't exclude the extra text from displaying in the relevant Patrol Log summary displayed in SH3 - is this an issue (I assume SH3 will still present the entries OK, but is this what you/users really want)?

Yes. That's why I will have to offer a 'remove Sh3Gen entries from patrol log' function anyway. It could be run after the patrol, before Sh3Cmdr is used. I just don't want it to be a must. It should be no problem if the user doesn't mind the extra entries.

As far as Cmdr is concerned, I think the check for entries without EntryTitle might be better.

Something like:

try
{
EntryTitle = ClgFile.Read("Log entry " + index, "EntryTitle");
//proceed with reading the entry
//...
}
catch
{
//EntryTitle doesn't exist, so entry will be skipped
}

KaleunPeter 01-28-06 04:39 AM

Seems quadrant AH is also needed?

1.4b, RUB 1.45, HT 1.47, TeddyBear Campaign RND and LND.
New career 09/39, 2. Fltl, started via SH3Commander.

Quote:

Item has already been added. Key in dictionary: "AH Key being added: "AH".

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Sh3Gen2.Database.Campaign.Interpreter.CInterpreter .prime(CGroups Groups)
at Sh3Gen2.Database.Campaign.Interpreter.CInterpreter .Run()
at Sh3Gen2.Database.Campaign.CCampaign.initializeCamp aignData()
at Sh3Gen2.Applications.MapGen2.CMapGenerator.Run(Str ing PatrolGrid)
at Sh3Gen2.Applications.MapGen2.CMapGen2.Button_OK_Cl ick(Object sender, EventArgs e)

mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573

Sh3Gen2
Assembly Version: 1.0.2218.37244
Win32 Version: 1.0.2218.37244
Output snipped a bit to save space.

Edit: Forgot to mention: SH3Gen 0.3.1

GlobalExplorer 01-28-06 06:15 AM

@KaleunPeter: You really helped me by pointing to Teddy Bär's NYGM campaign. I could reproduce your error! Problem was that he has hand edited the entries for hospital ships, and mixed up the order of two properties. Seems to be only a problem for Sh3Gen, as I am reading sequentially.

I have uploaded 0.3.2, which fixes this problems. NiKuTa should download the new version, too. I think he had the same problem.

KaleunPeter 01-28-06 06:19 AM

Now that was a fast fix...

Just installed 0.3.2 and ran it on my savegame from out of Wilhelmshaven. Generation completed without errors. Good work. :)

GlobalExplorer 01-28-06 06:36 AM

Quote:

Originally Posted by KaleunPeter
Now that was a fast fix...

Just installed 0.3.2 and ran it on my savegame from out of Wilhelmshaven. Generation completed without errors. Good work. :)

Don't wonna lose you as a customer :)

Btw, 9/1939 is about the strangest month in the whole war. You will get twice as many contacts during this time than during the rest of the war. I will have to talk with campaign designers why this is the case. It could be intentional to simulate easy picking during the first weeks, but I find it overdone.

And yes, this should mean that there is generally more traffic in 9/1939. Maybe nobody has noticed this yet, as Sh3Gen is the first application that can visualize the traffic during a patrol.

JScones 01-28-06 06:55 AM

Quote:

Originally Posted by GlobalExplorer
This won't do, as Sh3 will not display entries with Type <> 0

How inconsiderate of it. Curiously, where *does* the text added by SH3Gen display within SH3?

Quote:

Originally Posted by GlobalExplorer
As far as Cmdr is concerned, I think the check for entries without EntryTitle might be better.

Something like:

try
{
EntryTitle = ClgFile.Read("Log entry " + index, "EntryTitle");
//proceed with reading the entry
//...
}
catch
{
//EntryTitle doesn't exist, so entry will be skipped
}

Peh. Just gotta add if (not iIdx in [0,slEntries.Count - 1]) and (Length(iniFile.ReadString(slEntries[iIdx], 'EntryTitle', '')) = 0) then continue; as the first line in the loop. ;)

I still need to ensure that the first and last entries are included even though they have no EntryTitle, hence the first test. The second test explicitly looks for an EntryTitle value, as this is more robust than just checking for the existance of the key.

I must admit that I'm not a big fan of this solution as it means that no user added entry can utilise the "EntryTitle" key (plus I suspect that this design decision will come back and haunt me when I get into the expanded patrol log feature) - I'd almost suggest that a new key should be written when manually adding entries which SH3Cmdr can check for and exclude. Something such as "NonSH3Entry=1" or whatever. Either way, though, it's only one extra line of code.

EDIT...Reflectively thinking...Perhaps by writing a unique key you can save yourself some hassle when removing your changes from the Log files? For instance, SH3Cmdr won't care whether the "NonSH3Entry" value is 0, 9, 99, 354.66 or PurpleMonkeyDishwater, so you could specifically write "NonSH3Entry=SH3Gen" and then check for the presence of this value when removing your entries.

GlobalExplorer 01-28-06 08:22 AM

Quote:

Originally Posted by JScones
I'd almost suggest that a new key should be written when manually adding entries which SH3Cmdr can check for and exclude. Something such as "NonSH3Entry=1" or whatever. Either way, though, it's only one extra line of code.

EDIT...Reflectively thinking...Perhaps by writing a unique key you can save yourself some hassle when removing your changes from the Log files? For instance, SH3Cmdr won't care whether the "NonSH3Entry" value is 0, 9, 99, 354.66 or PurpleMonkeyDishwater, so you could specifically write "NonSH3Entry=SH3Gen" and then check for the presence of this value when removing your entries.

Yes. Thats so much better than my proposal. And seems to work too. I have just loaded a file with additional properties NonSh3=true and it showed up fine. I must do some more testing of course.

In fact this idea will help me implement some new features easily :up:

JScones 01-28-06 08:39 AM

Quote:

Originally Posted by GlobalExplorer
Yes. Thats so much better than my proposal. And seems to work too. I have just loaded a file with additional properties NonSh3=true and it showed up fine. I must do some more testing of course.

In fact this idea will help me implement some new features easily :up:

Be careful though - whilst SH3Cmdr won't care, users of SH3Whatever which also writes to the log may get upset if you strip all entries where NonSH3=true, 'cause you may take out more than just your own! For that reason, I'd set a (string) value which will be unique to SH3Gen, so you can query it with full confidence that you're not gonna strip out someone else's added text.

For that reason, can we perhaps change the keyname to "EntrySource"?

BTW, my one line of code looks much neater now...
if iniFile.ValueExists(slEntries[iIdx], 'EntrySource') then continue;


All times are GMT -5. The time now is 10:35 PM.

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