SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   DW Mod Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=196)
-   -   LuftWolf and Amizaur's Weapons and Sensors Realism Mod (https://www.subsim.com/radioroom/showthread.php?t=83132)

LuftWolf 10-30-05 12:26 PM

Just to be sure it wasn't the anti-cavitation routine the Mod uses, I tested the stock SubAvoidWeap doctrine, and the same grounding problem exists, so it isn't anything we've done, just something we haven't fixed yet. :up:

Amizaur 10-30-05 12:29 PM

Quite simple to check - replace SubAviodWep doctrine by standard one and play the scenario again. BTW Luftwolf have you checked your doctrine changes with SCDoctrineChecker ? To check all spaces, quotes, bracket balance ect. ? Original doctrine shows 8 errors and your 16 :-/ I should have checked it :oops:

P.S. I hope they are caused only by no space after ;
Nope, your comments were causing that... strange, were interpreted as commands somehow... taking them into quotes helped. Don't know if the same happened in the game, maybe not (checker is sometimes more restrictive than original SCS doctrines) but it's good to try avoid such possible errors. Worse when DoctrineChecker don't show anything but game interpreter has problems, MUCH harder to find :-/
I seen this only once, when I had keywords and calcs in comment, they were tried to be taken as commands... but usually don't matter what's in the comment, whole lines of code are disabled by adding ; before them :hmm:

LuftWolf 10-30-05 12:43 PM

Yes... :-?

I mean no. :oops:

Well, all I did was change some numbers and add a couple comments to the CIWSAttack and SubAvoidWeap doctrines and then tested the heck out of them in game... I specifically didn't add any clauses or anything because I don't have a programming editor on my computer that adds those nice color codes, plus I dropped out of my programming course in college. :lol: :oops:

In any case, I was very very careful not to do anything that would necessitate me dealing with syntax and then I tested everything in the game, so we shouldn't need to worry about it, but in the future I will do that when I change anything. Thanks for reminding me. :sunny:

LuftWolf 10-30-05 12:46 PM

Yes, I just checked them as well, it is caused by the lack of whitespace after the comment, all eight of them.

:damn: :damn: :damn:

Still, it won't effect the operation of the doctrine in game... I think.

LuftWolf 10-30-05 12:51 PM

Ok, so we are ok...? :up:

I have tested these doctrine a bunch, and there have been no problems, so I think the interpretor is ok with my comments.

Amizaur 10-30-05 12:52 PM

Are you sure ? I added the space after ; (I have no spaces after the comment txt anywhere :hmm: ) and still showed errors. Will check again.

:hmm:

LegCourse = ( TgtBrg + 100 + rnd 40 mod 360 ) ; LW edit to 100 to 140
*** Unknown word or variable present ***
*** Unknown word or variable present ***
*** Unknown word or variable present ***
*** Unknown word or variable present ***


But moving whole comment to next line helped too :) I usually use them this way (in separate line)

LuftWolf 10-30-05 12:53 PM

I ran the SC checker on a some of the stock doctrines just for the heck of it, and it returns errors all over the place.

I think there are some things that have been modified and added in the DW interpretor that the SC checker doesn't account for.

LuftWolf 10-30-05 12:58 PM

Yeah, the doctrine checker doesn't like comments on the same line as commands, regardless of whitespace. the DWInterpretor seems fine with it however, or the doctrine changes I have made would cause a total failure of the doctrine in the tests I've done, and I tested every effect after I made changes.

So we are in the clear on that issue.

Time for some football! :rock: ;) :lol:

Amizaur 10-30-05 01:00 PM

Because it's SC checker, not DW :)

But when you learn first what errors are "legal" i.e. showed even on original DW doctrines (new keywords for example) then checker is VERY!!!! helpfull in finding new ones !! I usually check how many errors were before modifications and after, if number is the same then usually OK :).
If my doctrine shows more errors, then I check if those are real errors or caused by checker/DW incompatibility. In 99% of cases it turns out to be my error (something unbalanced, no space, ect.). Couldn't work without this tool :yep: I hope jsteed will relase DW version.

LuftWolf 10-30-05 01:02 PM

Doh! We are posting past each other. :lol:

Deathblow 10-30-05 01:24 PM

Quote:

Originally Posted by LuftWolf
Just to be sure it wasn't the anti-cavitation routine the Mod uses, I tested the stock SubAvoidWeap doctrine, and the same grounding problem exists, so it isn't anything we've done, just something we haven't fixed yet. :up:

Hm.... how to fix this... :hmm: It might be with the subs preception of the layer in the SubAvoidWeap doctrine, or maybe the minalt settings.

In the stock SubAvoidWep doctrine

Code:

; Set Depth Opposite Layer
                        IF TgtAlt < LAYER THEN {
                                SETALT ( -100 - RND 50 )
                        } ELSE {
                                SETALT ( LAYER - 100 )  ;set depth to 100 ft below layer
                        } ENDIF

It could be a layer problem. In the FFGatekeeper mission, the seafloor is at 200meters, but an XBT launch will report a layer depth of 300meters. Perhaps the AI is trying to set its evasion depth to an obtainable layer depth.

But in the modded doctrince...
Code:

; Set Depth Opposite Layer
                        IF TgtAlt < LAYER THEN {
                                SETALT ( -600 - RND 50 )
                        } ELSE {
                                SETALT ( LAYER - 400 )
                                ; set depth to 400 ft below layer
                        } ENDIF

                        ; Setalt ( ( MinAlt / 0.3048 ) + 100 )
                        ; DebugOut "MinAlt + 100 feet set"

Seems like it could be the same problem. The AI might be using a layer depth that is actually below the seafloor depth. It probably happens when part of the map is above the continental shelf and the other part in the open ocean.... The AI might be using a layer thats inappropriate.

Perhaps another IF statement could remedy the problem...

Code:

IF MinAlt > LAYER
          Setalt ( (MinAlt / 0.3048) + 100)
ELSE
          IF TgtAlt < LAYER THEN {
            SETALT ( -600 - RND 50 )
          } ELSE {
            SETALT ( LAYER - 400 )
            ; set depth to 400 ft below layer
          } ENDIF
ENDIF


Just guessing for now.

LuftWolf 10-30-05 01:29 PM

I've also not ruled out the possiblity that the combination of a hard-turn plus rapid acceleration might be making the subs drift deeper, just as happens with player subs as well.

To test whether it is a layer or not, you could set the environment type to be bottom limited, thus removing the layer entirely.

I should test this.

Deathblow 10-30-05 01:29 PM

One question. Is SETALT measured in feet where MinAlt is measured in meters? Trying to understand why the MinAlt is divided by 0.3048.

Oh, and does anyone know what "TgtSilos" controls?

LuftWolf 10-30-05 01:33 PM

Nope, its not the layer issue, because even in Bottom Limited environment the subs ground. :hmm:

Quote:

One question. Is SETALT measured in feet where MinAlt is measured in meters? Trying to understand why the MinAlt is divided by 0.3048.

Oh, and does anyone know what "TgtSilos" controls?
The doctrine is fed information from the game engine in meters, but all doctrines are interpreted in feet, so... :dead:

In terms of TgtSilos, I have *no* idea at all. :stare:

Deathblow 10-30-05 01:50 PM

Just ran a test of the above missoin with bottom limited conditions (Layer = 0meters). The sub still ran aground.

Then again, it still might be a layer problem. Isn't the default evasion depth set at 400 ft below the layer? So in a bottom limited sea, (layer =0 ) would that make the AI got to 400ft no mater what?

More testing coming.


All times are GMT -5. The time now is 06:09 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.