• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Camera tweaks

uly

Landlubber
Hello everyone. I originally posted this on Playlogic's forum, but following one Lord Drow (a Captain here?), I suppose this may be a better forum to ask for help.

So here's what I posted:

<i>I just started playing AoP2, and quickly remember why I gave up on Seadogs and PotC... It's got probably one of the worst 3rd person camera ever. It's perfectly fine on the sea, but on the land it's motion-sicknesstastic. I couldn't even finish the first Peter Blood quest without taking a few breaks!

So just wondering, is it possible to at least make the camera stops gliding and drifting all over the place when moving, and just snap to whatever position it's trying to get to instantly? That alone would go a long way in alieviating my stomach...</i>

And some more clarification:

<i>Whether the camera stays fixed at one point, or follow steadily behind the character, either way would be fine for me. What I can't stand is how the camera swing along lazily like a drunkard on greasy skates.

I'd appreciate it greatly if you can whip up a mod for this, but if not I can try my hand on it if you can point me to the files that control these things.

Oh, and I play 3rd person. The problem exist with 1st person indoors, too though.</i>

Thanks in advance and good sailing.
 
**waves** Good to see you Uly.

There are several files that control the camera settings for the game. Some of them are .c files and others are .ini files.

The files reside in both the program and the resource directories.

There are a variety of settings in each one and only some of the code is fully understood at this time.

Hope that helps at least a bit.

Cap'n Drow
 
PotC Build Mod has it some camera tweaks dat, if'n set up in BuildSettings, prevent de camera from swingin' 180 degrees at doorways, etc. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> Mebbe de same changes kin be moved on o'er! <img src="style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
I'm not quite sure what's the problem with the camera. In PotC, the camera just follows the player character without any delays or anything.
Fred Bob does make a good point about the 180 degree swings in doorways. That should be a fairly simple fix if it's handled the same way as PotC.
 
Hi all!

I'm just curious...Is there some way to change camera distance from character in 3d person?...Cheers
 
Aye, there is though I don't know the exact lines of code to change off the top of my head.

Have a look through each of the camera related files. It should be fairly easy to find once you start looking.

Cap'n Drow
 
<img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> Can you tell us which one is camera related file?...Thank you
 
Do ye a search, matey, fer all files named camera*! <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
 
I know that there are several files for camera...what I don't know which one is for 3D view when character is on land...I'm not very good in mooding but I would certainly like to change some 3D camera parameters...and there is one file which name is CameraDialog.dll file...How can I open that one?...Thank's

..and Hey Captain Drow,what is going on with SoFS mod translation...any progress?
 
The .ini, .c, .h and .txt files are the only ones we can edit. Those are all in plain text. The .dll is not editable at this time.

I am still working on that translation, though work has slowed down a tad since CoAS has come out. **grins**

It will be done, but it won't be released until its perfect.

Cap'n Drow
 
Thank's again...I'll do some research and see if I can mod those files,that you mentioned...I'm glad to hear that you didn't abandon your translation project...


...I found how to enable totaly free camera if someone is interested... <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<!--quoteo(post=330192:date=Jun 18 2009, 02:25 AM:name=Oby)--><div class='quotetop'>QUOTE (Oby @ Jun 18 2009, 02:25 AM) <a href="index.php?act=findpost&pid=330192"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->...I found how to enable totaly free camera if someone is interested... <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->

Please post it in the minimods thread so we all can enjoy you great work <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />, personally I'd like to give it a go <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> .
 
In "totally free camera" mode, can you still control your character? I know in PotC free camera mode, your character won't move.
 
I managed to enable free camera, but only for 3D sea mode...one negative thing is that the starting position of camera is far away from ship-must be some solution for that,don't know yet...so far it is possible to stear your vessel,rise and lower sails,etc except fiering cannons...(thought I must assign different key for fireing,but it didn't work...)

..it's very easy to enable it---open AICameras in <i>Age of Pirates 2\Program\SEA_AI</i> with notepad and edit <i>void SeaCameras_Switch()</i>

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>void SeaCameras_Switch()
{
if (!bCanSwitchCameras) return;

int bSwitch = false;
switch (SeaCameras.Camera)
{
case "SeaFreeCamera":
SeaCameras.Camera = "SeaShipCamera";
Crosshair.OutsideCamera = true;
Sailors.IsOnDeck = 0;
bSwitch = true;
break;
case "SeaShipCamera":
if (!LAi_IsDead(&Characters[nMainCharacterIndex]))
{
SeaCameras.Camera = "SeaDeckCamera";
Crosshair.OutsideCamera = false;
Sailors.IsOnDeck = 0;
bSwitch = true;
}
break;
case "SeaDeckCamera":
//SeaCameras.Camera = "SeaFreeCamera"; break; // Debug : SeaFreeCamera, release : SeaShipCamera
SeaCameras.Camera = "SeaFreeCamera";
// boal -->
if (locCameraEnableFree)
{
SeaCameras.Camera = "SeaFreeCamera";
}
// boal <--
Crosshair.OutsideCamera = true;
Sailors.IsOnDeck = 0;
bSwitch = true;
break;
}
if (bSwitch) SeaCameras_UpdateCamera();</div>

..you must also reassign keys for free mode...this is already done in <i>Age of Pirates 2\Program\Controls\init_pc</i>...just find code for free camera and change to:

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> // free camera
CI_CreateAndSetControls( "", "FreeCamera_Turn_V", 257, INVERSE_CONTROL, false );
SetControlForInverting("FreeCamera_Turn_V",true);
CI_CreateAndSetControls( "", "FreeCamera_Turn_H", 256, 0, false );
CI_CreateAndSetControls( "", "FreeCamera_Forward", CI_GetKeyCode("VK_LBUTTON"), 0, true ); //VK_LBUTTON
CI_CreateAndSetControls( "", "FreeCamera_Backward", CI_GetKeyCode("VK_RBUTTON"), 0, true ); //VK_RBUTTON
</div>

...that's it...camera can be enabled with default camera switch key...use it with mouse, together with shift and ctrl key for acceleration...


...here are some screenshots from free mode...

screen_5.JPG [attachment=3188:screen_2.JPG] [attachment=3189:screen_6.JPG]
 
In PotC we have the following code in PROGRAM\Locations\locations_camera.c:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void locCameraInit()
{
    locCameraEnableFree = false;
    locCameraEnableSpecialMode = false;
    //locCameraEnableFree = true;
    locCameraCurMode = LOCCAMERA_FOLLOW;
}<!--c2--></div><!--ec2-->
Set <i>locCameraEnableFree = false;</i> to true and you can use camera-switch to go to free camera mode ashore too.
You can't actually control your character, but it's nice for exploring and making screenshots.

In PotC we haven't solved the "free sea camera starts far from far away" issue either, but then we never did try. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
Using time compression helps to move your camera quick.
 
I managed to enable free camera, but only for 3D sea mode...one negative thing is that the starting position of camera is far away from ship-must be some solution for that,don't know yet...so far it is possible to stear your vessel,rise and lower sails,etc except fiering cannons...(thought I must assign different key for fireing,but it didn't work...)

..it's very easy to enable it---

Hi, thank you for this, this is exactly what I've been looking for! Sorry but I have a quick question please if you don't mind me asking?

After editing the above files exactly as described (checked and triple-checked for accuracy) the Free Camera isn't behaving as expected. Instead of going to a point far away as you say, after pressing the camera switch key (TAB) twice, the camera is dropped in a fixed position. So for example if I'm sailing along and I press TAB twice, the camera switches first from the normal external view to deck view and then on the second press remains in position with the ship sailing on. This wouldn't be a problem of course, except that I'm not able to rotate or move the camera... it's fixed in position!

I've been pulling my hair out editing various strings to sea if something would work (thinking maybe there might've been a typo in the above code?)... but after a couple of hours of trying various edits I'm about to give up... :(

If there isn't any errors in the code, then I'm guessing perhaps there's some other flag or string I should set in maybe another file first? For example, should I only be using the Free Camera in "debug/cheat/test/normal mode" or is that irrelevant? Sorry guys I'm a newbie at this game so maybe I missed some obvious unspoken setting not mentioned here to enable the free camera?

If it makes any difference, I'm using the wonderful Combined Mod 3.2. Or at least it looks great but I've only just escaped the Plantation as Peter Blood and haven't been playing too long yet! I was afraid to get too far in case I need to start a new game. Well I actually started a new game anyway after editing the free camera to check, but it didn't make any difference.

Thanks!

PS: Thank you Pieter for putting this site together, it's awesome!! :onya
 
Hi Captain_Blackadder!

There were some experiments with camera files more than one year ago...It seems that the only parameter that could be usefull to change and the only one that works, is the camera perspective...Expecially if you are using higher resolution or widescreen monitor...I think other parameters are hard coded in .dll file and changing them in camera related files has no effect...

There is a post on forum,how to change camera perspective...

For free camera: there is quicker solution and it works quite well,although the far away position problem still exists...First you must enable dev mode in file program/_mod_on_off.h ->#define MOD_BETTATESTMODE = "On"
Then when in game simply press F11 and then installation in lower right corner...Then select free camera and pres X in upper right corner(don't press OK)...You can switch betwen cameras with TAB...(and you don't need to start new game!).

Hope I help and greetings! :keith
 
Hi Captain_Blackadder!

There were some experiments with camera files more than one year ago...It seems that the only parameter that could be usefull to change and the only one that works, is the camera perspective...Expecially if you are using higher resolution or widescreen monitor...I think other parameters are hard coded in .dll file and changing them in camera related files has no effect...

There is a post on forum,how to change camera perspective...
Ahoy there Oby!! Thank you sir! Already knew about the perspective, changed it already. Thanks anyway though. :onya

For free camera: there is quicker solution and it works quite well,although the far away position problem still exists...First you must enable dev mode in file program/_mod_on_off.h ->#define MOD_BETTATESTMODE = "On"
Then when in game simply press F11 and then installation in lower right corner...Then select free camera and pres X in upper right corner(don't press OK)...You can switch betwen cameras with TAB...(and you don't need to start new game!).

Hope I help and greetings! :keith
Thank you! Excellent, that's what I wanted to know! Um, thing is though... after doing exactly that, I got exactly the same thing as before! That is on the second TAB press, the camera remains fixed in position from the 1st person deck view and can't be moved or rotated. I thought maybe I might've edited some other string inadvertently (or my earlier pressing "Reinit" on the options screen might have made some difference), so I thought the best thing to do at this point was to do a complete re-install. To be even safer, that is for testing purposes for the community (I try to be helpful like you) I did a fresh install on a completely different computer, well actually on my XP 32 dual boot (I installed it under Windows 7 x64 previously) and guess what? Same thing! :modding

If your good self or someone could please do what I just did under the same test conditions, that is a complete clean install of CoAS + CM 3.2 (Backup those Saves first or better yet use a different PC like I did!!)? Then as you said, once in the game sailing in 3D external cam, press F11, then click on Installation and click on enable the Free Camera, exit out the console w/ escape or press X and finally press TAB twice... what do you get? Far away Free controllable camera, or like me the fixed unmovable camera? Wait... do I still have to edit the code like before, specifically the controls to enable the mouse button control of the Free Camera? It's as if the Free floating Camera IS working, the only thing that isn't working for me is the movement of it! It's fixed in the game co-ordinates it was activated rather than free to roam.

EDIT: OK I just did that and it didn't work! :modding Ok... what if I edited init_pc.c to enable the Free Camera controls to use different buttons? Like say, the cursor keys rather than the Left and Right Mouse button? Would that work? I even tried plugging my xbox360 controller in to see if that would get the Free Camera moving, but after searching these forums it seems there's no joystick support after all. Not that I wanted to use it but hey!

But... I shouldn't have to do that though, should I? I mean, since you say the far away Free Camera is working great for you (and everyone else?) with L & R mouse buttons... but not for me? :modding

Cheers anyway! :cheers

EDIT2: Alright, I finally got it working! :woot I was pressing random keys and discovered the Freecam only works when NUMLOCK is off! Actually it wasn't so random really as I vaguely remembered reading a translation on a Russian forum about turning numlock off a few days ago, so all credit must go to whoever said it there. You see I thought that was only for PotC + the superb Build Mod, so I got it the wrong way round. Haha oh well if someone else has the same frustration as me maybe Google will pick this thread up with the updated info :) Speaking of updates, I should probably also mention (for the benefit of new Google searchers) that (at the time of writing) the Free Camera is now enabled in the Build Mod in the InternalSettings.h file under #define FREE_CAMERA with the flag set to "1" rather than the default "0". So I hope you don't mind me adding that in case anyone was confused with the older Code method you mentioned above, Pieter? Sorry for dragging this thread up from the locker, it's all good now.

Now, if only I could just press a key like F9 in the Build mod to hide the hud / interface while free roaming around for some awesome screenshots and movies! Wow, if only I could do that in CoAS! If only!!

PS: I love using Freecam in battles in the PotC Build mod... it's so cool to setup movie-like views down by the waterline parallel to a sea battle with loads of cannon-smoke in between the ships, not to mention those aerial perspectives to overview the action like a strategy game like in Napoleon Total war :) Now I'm going to sea how it works out in CoAS (although I expect it to be hard to beat the superb gameplay of Build!)

Thanks again guys for your help and all the best. I love you! :will :onya
 
Back
Top