PDA

View Full Version : questions about the deck gun stabilisation


Sammi79
05-02-10, 10:01 AM
Hi all, sorry for dragging this ancient topic up again. I've trawled through hundreds of posts relating to the deck gun stabilisation, most of which are 2+ years dead now and were relevant to pre 1.5 versions of the game, I've downloaded 'real deck gun mod' although have yet to test as I play Op monsun I just wanted to see if I could implement the same change therein, and nope I can't. In cameras.dat the stabilsation seems to be linked to the AimCannon entry which has no settings, If I remove it the stabilsation is gone (the sight is still stabilised however by the MoveCannon entry) but the cannon will not move - this could be usefull, if the camera was setup with 0 rotation on the X-axis, it could be used to tell when the boat was level to give the fire command while the sights could be used purely to set azimuth/elevation, unfortunately when coming back out of the sight view the camera becomes unlinked from the boat and stays in the same position while the boat moves on.

Questions :-

Is there a way to get rid of the stabilisation of all the deck guns and their sights?

As the AimCannon and MoveCannon entries seem to be calls to SHControllers.act is there anyway to edit this file? Its 99% garbage in notepad/wordpad is there a specific program for editing these files?

I assume not because I've never seen a modified .act file in any mod and I assume the answer to my first question is no because it does not seem to be implemented in any of the mega mods (have not tried RFB yet though), but perhaps someone could just put my mind at rest on this? I've been bashing my head against and mutilating these files for a good while now. I even put SHcontrollers.act into a hex editor and started randomly deleting sections of code, how desperate is that!:damn:

Sammi79
05-05-10, 05:49 AM
Hmmm. Taboo subject? It should be in the mods forums I guess only I didn't want to post twice (ATO/Fleet boats).

So anyone? no idea at all?

Fishbreath
05-05-10, 10:16 AM
IIRC the guns in RFB are not stabilized. Or at least that's how it feels to me; firing coming over the top of a wave has sent my shot high more times than I can count.

Sammi79
05-05-10, 10:27 AM
OK, thankyou Fishbreath for your reply I shall have a look at RFB before I give up on this completely.

Wilcke
05-05-10, 10:31 AM
OK, thankyou Fishbreath for your reply I shall have a look at RFB before I give up on this completely.

PM LukeFF on the topic, this is something that has always been a compromise, but he did delve into and has the knowledge base regarding stabilization. Good luck!

Sammi79
05-05-10, 10:38 AM
Wow 2 replies in 1 afternoon? must be my lucky day :D. Thankyou Wilcke I shall PM LukeFF and see if he can help or at least tell me why it ain't possible.

To be continued...

KlassenT
05-05-10, 11:03 AM
I don't mean to burst your bubble, Sammi, but I dug this up out of the Subsim Archives:

http://www.subsim.com/radioroom/archive/index.php/t-149571.html

From the looks of that post, there's no known utility for opening and editing .act files, which would indicate to me that they're likely either a proprietary format, or raw hex / binary files. If they end up being hex or binary, it would be *possible* to modify them, maybe even to the extent of rewriting the stabilization system, but the big problem is knowing what to look for and what to modify.

Edit: Thought I'd save you a bit of trouble; I opened up SHControllers.act in XVI32 (Hex editor) and... well, it's not pretty, lol. Quite a bit of the file still shows up as gibberish, so it's not just hex-encoded. That's not to say there isn't ANY hex encoding in the file, because there are quite a few readable hex characters in it, insofar as some filename references, but one that raised a red flag was a reference to `MoveCannon.cpp'. If you're curious as to what you might be getting into...

http://i42.tinypic.com/w0jf5y.jpg

If they have a source file for it, it's probably not going to be easy by a long shot to do any sort of modification (Unless the source is available somewhere, but that seems pretty unlikely.) Hopefully LukeFF can weigh in with some more useful information than me shattering your dreams, but you might be barking up the wrong tree with the .act files until you get some solid details on the format. :(

I promise that my intention was to help a brother out, I just hit a brick wall! :damn:

Sammi79
05-05-10, 11:19 AM
I don't mean to burst your bubble, Sammi

'Pop..' :cry: Awww...

:haha: Only jokin'... Yeah I was kinda thinking that was probably the case. Like I said I loaded it into a hex editor and started ripping it up a bit but as yet the only results I've had are 1.No change at all (which is a bit spooky, I mean I just overwrote a load of information with 0s) and 2.CTDs on load (now that's more like it!) and it's very much a case of me trying to repair a circuit board with a flamethrower so I'm not too hopefull on that. sighs...

Anyway maybe LukeFF can give me some further info on it, otherwise I will just have to admit defeat.

Rockin Robbins
05-05-10, 02:06 PM
We've tried many times over the past two years to remove the stabilization. However, much of the gun's behavior is hard wired. As modders we're careful not to edit files found outside the /data subdirectory. Ubi was good enough to make that game moddable and we try to stay within the intended bounds. Messing with .act, .dll. or .exe files is outside the scope of legitimate modding and enters the field of hacking.

There was a short-lived mod called New Real Deck Gun that achieved destabilization at the cost of all usefulness and consistency of sighting the gun. It was a monstrous failure. If you'd like to play with it I might be able to scare it up from wherever it's hiding on my hard drive.

Sammi79
05-05-10, 02:24 PM
OK, Thankyou Rockin Robbins I think I understand now am going to leave those files alone (I very much doubt with my limited knowledge there is anything I'd be able to achieve anyway) I am certainly no 'Modder' by any standard let alone a 'Hacker', I used basic interpreters back in the day that's about as deep as my computing knowledge ever got. Did some scripting in Operation Flashpoint and Neverwinter Knights and would like to learn some higher level stuff, but I don't work in the industry so it's in my free time only... well, maybe one day when I get a life transplant. heh.

By the way that 'New Real Deck Gun' mod is that the same as 'Real Deck Gun' or is it perhaps a newer one? I only ask as I have already downloaded the latter, if there was another version I would love to take a look.

Anyway at least I can stop giving myself a headache over it,

Regards, Sam.

Rockin Robbins
05-06-10, 02:57 PM
:eek:OK, here's the state of the art. Keep in mind that I found this mod. Upon finding it with no identification in a readme file or anything I attempted repeatedly to find the author. Nobody would claim it. That might be a clue as to how successful it is....


It is still fun. Aiming is really lousy because the sights just don't work. Ideally you could set the sights for the proper range, wait on the uproll or downroll for the target to be in the crosshairs and pull the lanyard. Alas, it doesn't quite work that way.

However, I did stuff the thing with my patented Slightly Subnuclear Ordinance, so IF you happen to get a hit it will bring a smile to your face.:D

Oh, I bet you may want a link: http://www.subsim.com/radioroom/downloads.php?do=file&id=1824. (http://www.subsim.com/radioroom/downloads.php?do=file&id=1824)

Now it's in the wild. God help us all! :eek:

KlassenT
05-06-10, 03:33 PM
For all the 'dead' this topic might be, I have to weigh in on it one more time, and it'll probably die and get buried somewhere in Subsim land, but I actually put my programming cap on today and played a little game of Let's Pretend. If I were Ubisoft in this case, and there's no easy way to disable having a stabilized deck gun, I think we're looking at it from the wrong angle. Given the current behavior of the deck gun and watching a few skirmishes in multiplayer, I'm not entirely sure that deck guns are "stabilized" in the first place; I think it seems a lot more likely that the firing points were just treated as free-floating points from their inception; in a sense, an imaginary/invisible pseudo-model completely detached from the sub itself.

On the other side of the coin is the argument that there's no easy way to disable it because Ubi spent a whole ton of time and resources in getting it just right, then decided their work was so perfect that they declared it must be hardcoded, and no-one was to ever disable it! Possible, but not plausible, I say.

All in all, it really kinda seems to me like the issue isn't removing an existing stabilizing feature, but rather adding a destabilizing feature in... After looking at the New Real Deck Gun files in S3D, I'm sorta following the idea behind it, but I'll have to let it sink in for a bit and mull it over. I don't necessarily think it's a lost cause, but it's certainly not a weekend project, either. :06:

Sammi79
05-06-10, 08:47 PM
Hmmm.... curse my curious mind... I looked through the 'New Real deckgun' mod thank you kindly Mr Rockin Robbins, seemed the only real difference was in cameras.dat involving the 'ShocksCollision' entry, and the look at horizon in 'MoveCannon' was set to false. I think KlassenT is right, there may well be a more satisfactory way around this though it's going to be at least partly a case of adding more controllers to try to keep the camera in line with the boat as it pitches/rolls. I tried adding a 'FollowParent' controller after the 'ShocksCollision' and have succesfully negated the anti-roll however pitch is still automatically levelling... TBC

Another thing I notice is that the camera entries are split into 3 parts I.e :-

DeckGunCam
-label
-ctrl
--ctrl parameters
-ctrl
--ctrl parameters

-DeckGunCam1
--label
--ctrl
---ctrl parameters

--DeckGunCam2
---label

And controllers have markedly different effects depending on which part you place them in, I thought at first the reason for having 3 parts was the 3x Axis but it dosn't seem to work like this intuitively, but obviously with all the different controller types there a suitably large number of possibilities to test...

Rockin Robbins
05-07-10, 12:04 PM
Great detective work! It would be so great to be able to use the sight and have a destabilized gun so you would have to time the roll for the shot.

Admiral8Q
05-07-10, 08:18 PM
Great detective work! It would be so great to be able to use the sight and have a destabilized gun so you would have to time the roll for the shot.

I agree on that! I don't like zooming in because you lose the pitch and role. I only zoom in if I can barely see the target. But if this was fixed, that would make my day! :smug:

tater
05-07-10, 09:48 PM
kv29 managed to get ONE of the guns to properly destabilize, actually.

At the time we were sort of thinking inside the box. Strikes me you just clone that gun X times, with the clones pointing at the other models, change tham ammos, etc...

Might work. Let me find the mod for you.

http://www.subsim.com/radioroom/showthread.php?t=117430

Read the whole thread.

Sammi79
05-13-10, 11:59 AM
Right, I have now successfully enabled 'welded to the boat' behaviour for the deck gun zoom sights on both the German 8.8cm & 10.5cm with the result that instead of the crosshair following the true horizon, it now follows the horizontal plane of the boat. When the crosshair is inline with the true horizon, the boat can be considered a (fairly) level firing platform.

The guns actual elevation still tries to follow the preset range to the true horizon - I can't find a way to link the actual elevation with the boats horizontal plane. I am currently using KV29s nice simple method of setting the elevation speed low which significantly inhibits (not quite removes) the effectiveness of this auto-levelling. The end result so far is a much more challenging and presumably more realistic portrayal of deck gun operation. On a calm clear day the gun is easy enough to aim though ranges past about 6 Km hits are rare. With 5mph winds it is still possible to be accurate up to about 4 Km if the target is close to your 0' bearing though some timing of shots will be required. As the windspeeds and therefore wave effects increase, more timing of shots is required and the error multiplying effects of range further limit the ability to consistently hit anything unless firing carefully timed shots at closer ranges. In 15mph winds I found it very difficult to be accurate at more than 1.5 Km. It's not as hard as I thought it would be, you get used to firing when the crosshair passes the horizon quite quick and with practice you will always achieve a higher hit ratio than your crew can, as they do not seem to time their shots very well. The zoomed out view remains stabilised but as the gun itself is not it is very difficult to judge when the boat is level to give an accurate shot. I will have a look at the fleet boats for stock and TMO next but it is gonna take some time as I have to work.

The change involves editing the .dat file for each individual gun model, rearrangeing the hierachy somewhat specifically the camera positions are moved to different parent objects. Then Cameras.dat must be edited to set the actual positions of the deckgun cameras as they are no longer following their original position, also the movecannon parameter "lookathorizon" must be set to false. These fixes keep the zoomed sight level with the boat at all times.

The .sim file for each gun model must also be edited so the speed of the turrets elevation is too low to keep up with the pitch/roll of the boat (0.2 or less), this is AFAIK the best way to negate the gun auto levelling.

Sailor Steve
05-13-10, 05:00 PM
What you are doing is cool. Keep up the good work, and I hope you solve the last problems.:rock:

Rockin Robbins
05-13-10, 06:31 PM
I like what I'm hearing! Keep up the great work.:up:

LukeFF
05-13-10, 07:14 PM
Same here. :)

Sammi79
05-14-10, 11:03 AM
OK, I have put the modified files in a JSGME ready 'mod' package, compressed to .rar and uploaded to filefront :-

http://www.filefront.com/16441969/RDG_v00.rar

This is the first test version of my attempt to destabilise the deckguns, It is designed to work with SH4v1.5 stock.

There are still problems, but I've been having a lot of fun testing it so far so see what you think. I think it will be possible to do the same for the major mods also, they would need to be included in updates for these mods though as there are significant changes in Cameras.dat. There are 2 testing missions, 1 US and 1 German included and a readme for info regarding the actual modifications and instructions on how to install.

I would still like to find a way to stop the auto-elevation of the gun - have the aimpoint based on the imaginary horizontal plane of your boat as opposed to the actual horizon but as yet no idea how to go about that.

Any feedback would be much appreciated. Maybe this wasn't a hopeless endeavor after all?

Sammi79
05-15-10, 08:35 AM
Bear in mind that the wind/wave physics in the stock game are minimal so this will be the easiest version - I have working fixes for the OpMonsun files aswell but with the environmantal changes the mega mods bring It becomes much more challenging to place rounds on a target at any sort of range in 5mph+ winds.
ATM I'm hesitant to make complete versions of this mod specific to work with TMO or OpMonsun as I am not totally satisfied with the slow elevation fix, until I have exhausted all possibilities of truly stopping it. Slowing the elevation is beautiful for the fact it can be made easier(faster elevation) or harder (slower elevation) to suit taste/desire for realism, but there will always be a (however minimal) levelling effect. for true realism this should not move relative to the boat at all unfortunately if it is set to 0, the gun will no longer move up or down making targetting completely impossible. 0.2 seems to be a good balance between difficulty and slow gun movement.

Sammi79
09-23-10, 04:45 AM
As I have been working away since may-september this was put on hold. Now I've been back a few weeks I have some progress to report.

In my game currently, ALL the deckgun views are destabilised now.

As I tweak I have learned some interesting things.

in Cameras.dat the 'AimCannnon' controller is for the AI. You can remove it and the crew will no longer point or shoot the gun. It also resets the gun to its default position when the gun is unmanned.

The 'MoveCannon' controller allows the player to aim and fire the gun, without it there is no player control. Unfortunately the auto elevation of the gun is a factor of this controller, and AFAIK apart from inhibiting it there is no way to completely stop it.

So there it is, If anyone's still interested. I will keep tweaking it and see if I can come up with anything more.

rein1705
09-23-10, 05:23 AM
As it is right now on my boat...:doh:
My gun crew can hit a freighter at 2,000 yards one out of about every ten or fifteen shells in pretty good weather ...
That of course makes me cuss and holler...:stare: pace back and forth and sometimes throw things at them from the bridge before i storm down there and take the gun myself. :arrgh!:

Sammi79
09-23-10, 05:43 AM
Hi Rein1705, have you modified your files as I have? I would be interested to hear how you approached the problem. Oh, and which version do you play, PTO or ATO? with which mods?

rein1705
09-23-10, 12:35 PM
I have not changed the deck gun's property's myself no.
I play Fall Of The Rising Sun V1.5 (PTO U.S.) with RUIM and the Office links & .50 Cal mod, New Narwhale 1.8.4 and TMO interiors with several sub skin mods. The only modding ive done myself is put a 40mm AA gun on an S-42 class boat and figured out the rotational values of said weapon so it'd rotate 80 degree instead of 35* :D
When i was saying my crew fires wilder than a drunk Cowboy shooting at a rabbit i was being truthful but thats because i have a green crew right now in my current boat and they really are THAT bad.:har:

Sammi79
09-23-10, 04:09 PM
:D Yeah the AI has quite a defficiency encoded! even when they mature they'll still miss seemingly easy shots.

When you take the gun yourself though, it is far too easy. Of course you have to guess range at first, but when you've scored your first hit you can pretty much gaurantee successive hits, as the gun automatically levels against your boat pitching and rolling. Also the gunsight is unaffected as if the whole mechanism was gyroscopically computer stabilised very much like a modern tank cannon.

I've been working to make the operation more realistic, with some success, like I said in my current game the deckgun view & the sights are static with the boat now, and the gun elevation moves too slow to keep up with the pitching/rolling, so you have to wait for a firing window, when the boat is level (or as close as you can get). The red cross on the deckgun view and the crosshair on the sight tell you when the boat 'is' level as they pass the horizon, so if you want your shell to travel at the indicated range that is the time to fire. This makes the AI even less apt at controlling the gun however, as they simply fire as soon as the gun is loaded!

I've never tried FOTRS, I use TMO for US-PTO games, and for a while I've been stuck on U-Boats anyway.

Rockin Robbins
09-23-10, 06:26 PM
Sounds like you're making great progress!:up:

Sammi79
10-01-10, 06:48 AM
OK, here are some screenshots to describe the way the modified deckgun works. All shots were taken in a test mission with 7mph winds and clear weather. In all views there is no vertical movement, apart from the pitch/roll of the boat. First, the unzoomed deckgun view which is currently locked to the gun (no elevation - the gun moves relative to the view when adjusting range whereas moving left and right trains the view and gun), The red cross shows the particular pitch/roll of the boat ;
http://img26.imageshack.us/img26/662/sh4img20101001120619810.png
http://img215.imageshack.us/img215/3323/sh4img20101001120610595.png

Then at first level of zoom ;
http://img838.imageshack.us/img838/3834/sh4img20101001120632762.png
http://img215.imageshack.us/img215/6364/sh4img20101001120627793.png

Lastly at full zoom ;
http://img266.imageshack.us/img266/9178/sh4img20101001120643829.png
http://img291.imageshack.us/img291/8778/sh4img20101001120640891.png

In all views, the pitching of the boat is noticable and it the second full zoom view some roll is also apparent. The target is a stationary T3 tanker at about 5150 meters, from this point I commenced firing 10 rounds out of which 2 hit, considering that I knew the exact range and have had a lot of practice, this seems reasonably realistic to me.

Sailor Steve
10-01-10, 12:58 PM
An amateur historian at the old Warships1 boards did a lot of studying and calculated that overall the average hit rate for the entire war was about 7%, and that he narrowed it down to 12% under 10,000 yards and 2% at 20,000 yards. If I remember correctly he also said that those numbers mostly were from surface battles, which meant sophisticated fire control director equipment.

So 20% at 5000 yards using iron sights seems a little high to me, but on the other hand that's getting very close to point blank range, so it's probably about right.

Sammi79
10-01-10, 01:22 PM
An amateur historian at the old Warships1 boards did a lot of studying and calculated that overall the average hit rate for the entire war was about 7%, and that he narrowed it down to 12% under 10,000 yards and 2% at 20,000 yards. If I remember correctly he also said that those numbers mostly were from surface battles, which meant sophisticated fire control director equipment.


Was that WW1 or WW2? or both maybe. You are correct of course but consider that most warships had bigger guns than the 3.46 inch U-Boat deckgun, thus much better range. Also the target was a big one, a T3 tanker and was stationary, as was my sub. You could also say I simulated having a very accurate range finder as I measured the distance to within 25 meters in the mission editor!

To really test it I would have to fire a lot more shots at different ranges, which I have done but never recorded the results. Suffice it to say that at ranges of 6km or greater with moving targets it is pure luck to score a hit. I am considering buying FRAPS to record a video that would give a much greater impression of the effects of the destabilised sights/views and the intricacy of the firing window, as the gun is never truly stationary, it is always adjusting very slowly.

I wish I could stop it completely but it seems to be hard coded in the SHcontrollers.act file so I settle for a speed of elevation of 0.25

Sailor Steve
10-01-10, 01:30 PM
Was that WW1 or WW2? or both maybe.
WW2 only.

Yes, larger guns had longer range, but were no more accurate. Even with the best fire control systems hitting a moving target at long range involved a lot of luck. It looks to me like you're doing a great job. :rock:

Sammi79
10-01-10, 04:16 PM
WW2 only.

Yes, larger guns had longer range, but were no more accurate. Even with the best fire control systems hitting a moving target at long range involved a lot of luck. It looks to me like you're doing a great job. :rock:

You are very kind, Mr Sailor Steve. My efforts are based completely on the backs of others, firstly Ubisoft Romania who created the original piece of software, and left it open to modifying, and equally Skwasjer who released the S3D editor, which allows the organised and intuitive editing of the game files, and all the REAL modders who are a part of subsim, who have to my mind turned SH4 from a fantastic and yet bugged and limited game into the most in depth, realistic, best looking(my laptop won't run SH5) and enjoyable submarine simulation the world has ever seen.

Anywayz, next post should be a FRAPS video so you can see what I'm playing with. I find it funny - even in the stock game I would only ever use the deck gun to finish off unarmed crippled merchants or small fishing boats. Any ship that is armed in any way is more than a match for one 3-5inch deckgun. It seems like such a small part of the game to be fussy about, but I guess it is important to me. Real navigation is the next thing I'd like to look at.

Admiral8Q
10-02-10, 05:11 AM
I find it funny - even in the stock game I would only ever use the deck gun to finish off unarmed crippled merchants or small fishing boats. Any ship that is armed in any way is more than a match for one 3-5inch deckgun. It seems like such a small part of the game to be fussy about, but I guess it is important to me. Real navigation is the next thing I'd like to look at.
Unless you have a Narwhal class with two 6" guns! :03::cool:

I find I go for a Gato as soon as they're available though. After all, you're playing a submarine not a cruiser...:yep:

Keep up the good work, where can I d/l this mod? I know I know, deck guns on subs were obsolete already at the begining of the war... but who doesn't enjoy the big bangs and explosions? :D

Sammi79
10-02-10, 05:48 AM
Unless you have a Narwhal class with two 6" guns! :03::cool:

I find I go for a Gato as soon as they're available though. After all, you're playing a submarine not a cruiser...:yep:

Keep up the good work, where can I d/l this mod? I know I know, deck guns on subs were obsolete already at the begining of the war... but who doesn't enjoy the big bangs and explosions? :D

Thankyou for your interest, Admiral8Q. I will hopefully at some point in the near future be able to upload the files as a 'Mod' package, however,

The troubles for me releasing it as a mod are :-

1. the changes involve the files cameras.dat, and then the .dat & .sim files for each gun. The gun files are not a problem but cameras.dat is heavily altered by all of the major 'Mods' (aswell as many of the smaller mods). This means either creating separate versions for each major mod - with expressed permission from the Mods author, or, giving the edited files to the authors that want to include it in their Mods updates/patches.

2. The time I am able to allocate to exploring the myriad possibilities of editing the game files and testing is limited, although I have a fairly convenient job that does give me plenty of random days off, I could easily spend forever tweaking the files, and I get the feeling that It will be very difficult for me to be satisfied that I have done all I can do in regard to the limitations of the unmodifiable files.

watch this space though... I will update further as the work progresses. :salute:

Rockin Robbins
10-04-10, 10:06 AM
Welcome to Ducimus' Hell!:D:D:D

Condemned to forever tweak, never totally satisfied with your work and tortured by its imperfections, detectable by none but you. No! It's the stuff you're particularly proud of that the posters will complain about. Turn up that blowtorch! He's not done yet! Muahahahahahahahahaha!
http://i196.photobucket.com/albums/aa293/RockinRobbins13/smileys/devil.gif