Page 1 of 1

Crosshair alignment

Posted: Thu Jan 12, 2012 2:26 am
by jonboy
Hi all,

First may I congratulate everyone who worked on this game for an amazing job done. I played frontier as a kid but only dabbled with original elite, and now want to see how far I can get with the strict original elite mode.

One thing i've noticed is that the laser is not aligned with the centre of the crosshairs, but just below centre. I can understand the reasons for this (parallax error?) as the laser is mounted below the pilot, but in my copy of the original elite it lines up with the middle of the crosshairs, and I would like oolite to behave in the same way.

Is it possible to edit the settings to adjust this, or edit the crosshairs themselves?

Thanks a lot

Jon

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 7:19 am
by Cmdr. Maegil
Hi, jonboy, welcome to the Friendliest Board This Side of Riedquat!

To eliminate parallax, you have to align the laser with the view, and that'll require a quick bit of hacking - nothing complicated, really, it's simple enough that even I can do it...
But remember, always make a copy of the file you're about to tweak - even if you don't do something wrong, you may still want to roll back to the original.

Using a text editor such as jEdit or Notepad ++ (WARNING: do NOT use Notepad, it adds corrupting metadata), open the file shipdata.plist located in Oolite\oolite.app\Resources\Config. This file contains the ships' characteristics, and since you're talking about strict mode, that means you only need to change the Cobra Mk III.

Looking at the code, you'll find the Cobbie about a third down the file... but there are four of them: cobra3-trader, alternate, pirate and player; we want to change the latter.

Code: Select all

	"cobra3-player" =
	{
		like_ship = "cobra3-trader";
		energy_recharge_rate = 4;
		forward_weapon_type = "WEAPON_PULSE_LASER";
		max_energy = 256;
		max_flight_speed = 350;
		max_missiles = 4;
		roles = "player";
		thrust = 32;
		view_position_aft = "0.0 7.5 -32.5";
		view_position_forward = "0.0 7.25 16.25";
		view_position_port = "-30.0 4.75 0.0";
		view_position_starboard = "30.0 4.75 0.0";
		custom_views = .........[list of custom views]
From this we find out that this is like_ship = "cobra3-trader", meaning "a copy except for the following differences", and that its view_position_forward = "0.0 7.25 16.25".

To eliminate parallax, we have to align the view position with the laser mount- better yet, make it the same just to insure you don't end up looking at your own ship's bulkheads... but where is the laser?

Remember this is a like_ship copy? The original template is back up under the cobra3-trader, and we're looking for the forward weapon position - but since you're already at it, you may as well modify the others.

Code: Select all

		weapon_position_aft = "0.0 0.0 -32.5";
		weapon_position_forward = "0.0 0.0 27.5";
		weapon_position_port = "-40.0 2.17 -4.33";
		weapon_position_starboard = "40.0 2.17 -4.33";
Replace the view positions for these values, and your lasers will be centred spot-on with the sights.

Save, and restart Oolite while holding the shift key until the spinning ship appears to refresh the cache (or the changes won't take place) - this only needs to be done the first time you try out a modified file.

Hope it helps!

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 8:55 am
by Eric Walch
Cmdr. Maegil wrote:
Hi, jonboy, welcome to the Friendliest Board This Side of Riedquat!

To eliminate parallax, you have to align the laser with the view, and that'll require a quick bit of hacking - nothing complicated, really, it's simple enough that even I can do it...
Drawback of removing the parallax is that the laser fires from the viewpoint of the player, what looks awful.

One other option I never heard of anybody trying is to lower the cross hairs themselves by one or two pixels. e.g. by adding a custom version in the hud. That would mean the hud than only works for that ship of course. (and ships with the same parallax)
And the parallax will still be there, but on long distant shorts the reticle is aligned.

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 1:14 pm
by Commander McLane
Just one or two additions to Cmdr. Maegil's post:

First, directly editing the shipdata.plist (or any other file) inside Oolite.app is discouraged. Better copy and paste the relevant entry only into another file, which you then can save under the name of shipdata.plist in your AddOns-folder or in AddOns/Config/ (which you can create yourself). This way the program stays intact. Any plist inside AddOns/ will automatically override the corresponding plist in Oolite.app/Contents/Resources/Config/ .

Better yet, name the file you're creating "shipdata-overrides.plist" and let it contain only those keys you actually want to override. So your shipdata-overrides.plist should look exactly like this, provided you're flying a Cobra III:

Code: Select all

	"cobra3-player" =
	{
		view_position_aft = "0.0 0.0 -32.5";
		view_position_forward = "0.0 0.0 27.5";
		view_position_port = "-40.0 2.17 -4.33";
		view_position_starboard = "40.0 2.17 -4.33";
	}
Second: this works in the same way for all player ships. There are some OXP player ships which already have the same view- and weapon-positions, exactly for the purpose of eliminating the parallax. Most ships have the parallax, however. So, if you want to switch your ship and keep the non-parallax, you have to do the same thing as you did for the Cobra.

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 9:50 pm
by jonboy
Thanks for the quick and very detailed replies guys. I tried editing the shipdata but as Eric says, it does not look good although technically it solves the problem.
I did a fair bit of testing shooting the navigation buoy outside a coriolis station and realised that actually the laser is targeted right in the middle of the crosshairs, it just doesn't look like it. The laser appears to end as soon as it gets to 1 or maybe 2 pixels thickness, making it look 'shorter' than it really is. I think the ideal fix to this would be to make the laser taper to this thickness then continue at the same until it reaches the infinity point, if that's the right expression. However now I know the centre of the crosshairs is the area I should be placing on the target, it doesn't bother me.

Having the laser firing directly along the line of sight does make apparent what I think is a bit of a bug - the laser acts almost like a solid projectile in that if firing while the ship is moving, the laser image 'lingers' slightly, so if firing while moving rapidly, the pilot's perspective on the lsaer beam changes, whereas a light beam should always appear to be in the swame place relative to the pilot if the gun position is fixed. I guess it is acting more as a plasma than a laser beam - not sure if this is deliberate.

Anyway, enough wittering about minor details, I have some pirates to kill! Thanks again for the help.

Jon

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 10:30 pm
by SandJ
jonboy wrote:
I did a fair bit of testing shooting the navigation buoy outside a coriolis station and realised that actually the laser is targeted right in the middle of the crosshairs, it just doesn't look like it.
In the RealWorld™ environment, there are many stories and statistics about:
- how much lead was fired from muskets to kill each man in the American Civil War (approximately his body weight) despite much of it being shot at a range of 30 feet!;
- how many tons of iron was fired from cannon in Napoleonic naval engagements to kill each man;
- how many thousands of rounds were fired from WWII fighters for each one that hit part of another aeroplane;
- how many tens of thousands of rounds of anti-aircraft were shot for each German bomber that was hit;
- how many archers could fire a full quiver of arrows to hit one defender behind a castle battlement (usually all of them for no casualties);
- how hard it is to hit someone with a handgun at ten paces, never mind give them a fatal wound.

So, you intend to fire a 3mm wide laser beam at a target 5 metres high travelling at 0.4 LY at 15km range for one second and expect to hit it with enough energy to make a difference? When viewed at a 1280 pixel resolution that covers about 30 degrees of vision?

It's amazing we ever hit anything!

Re: Crosshair alignment

Posted: Thu Jan 12, 2012 11:04 pm
by Smivs
SandJ wrote:

It's amazing we ever hit anything!
Yeah, but we're good! :)

Re: Crosshair alignment

Posted: Fri Jan 13, 2012 5:50 pm
by Cmdr Wyvern
SandJ wrote:
jonboy wrote:
I did a fair bit of testing shooting the navigation buoy outside a coriolis station and realised that actually the laser is targeted right in the middle of the crosshairs, it just doesn't look like it.
In the RealWorld™ environment, there are many stories and statistics about:
- how much lead was fired from muskets to kill each man in the American Civil War (approximately his body weight) despite much of it being shot at a range of 30 feet!;
- how many tons of iron was fired from cannon in Napoleonic naval engagements to kill each man;
- how many thousands of rounds were fired from WWII fighters for each one that hit part of another aeroplane;
- how many tens of thousands of rounds of anti-aircraft were shot for each German bomber that was hit;
- how many archers could fire a full quiver of arrows to hit one defender behind a castle battlement (usually all of them for no casualties);
- how hard it is to hit someone with a handgun at ten paces, never mind give them a fatal wound.

So, you intend to fire a 3mm wide laser beam at a target 5 metres high travelling at 0.4 LY at 15km range for one second and expect to hit it with enough energy to make a difference? When viewed at a 1280 pixel resolution that covers about 30 degrees of vision?

It's amazing we ever hit anything!
Cannons, muskets, and medieval bows and arrows weren't known for accuracy. Longbows and crossbows could be accurate, but it took a lot of practice for an archer to make impressive shots.
Muskets weren't accurate to any degree until the invention of the rifled barrel (hence the volley fire method used in combat), and improved further with the introduction of the first bullet, the "miniball". Then came cartridge ammo and breechloading guns. Still, in combat the enemys are trying hard not to get shot, so there's a lot of dodging and covering on both sides, which leads back to volley fire of another kind: machineguns.
In WW2, air combat more involved trying to shoot down the aircraft, and many of those planes, American and German makes especially, were armored and could absorb a lot of abuse.

But that's talking ballistic projectile guns, where gravity, weather, and a lot of other variables apart from the shooter's skill determine where the bullet hits.

Lasers are a whole new ball game. A laser is a coherent light beam, so regardless of the energy used in firing, it always travels at the speed of light, and always in a straight line. Literately line of sight point and shoot. A laser weapon would be ultra accurate if the shooter does his part.

Re: Crosshair alignment

Posted: Fri Jan 13, 2012 5:57 pm
by SandJ
Cmdr Wyvern wrote:
A laser weapon would be ultra accurate if the shooter does his part.
... and not bolted immobile to the hull of the ship, requiring the entire vessel to be moved to aim it!

Re: Crosshair alignment

Posted: Fri Jan 13, 2012 9:52 pm
by Switeck
If we can assume ships/targets are traveling even 1% the speed of light, then even lasers will need to lead the target at long range.