Page 1 of 8

Lave Academy OXP

Posted: Wed Mar 04, 2009 8:44 am
by Thargoid
Lave Academy OXP

Image
(the non-shader version from my laptop, with apologies to Griff)

Introduction

With the increasing popularity of its flight training courses, Lave Academy have expanded their operation and introduced a new orbiting station offering three new advanced courses. These are available to new pilots, but are also open to existing graduates of the Academy who would like to sharpen up and refresh their skills.

Lave Academy Orbital Station

Unsurprisingly, this can be found in orbit around Lave in Galaxy 1, just beyond the edge of the security zone of the main station. It is a large structure, visible from the main station (it is roughly at right-angles to the station-planet axis, use a side-view and roll your ship to locate it) or by following "A" on your Advanced Space Compass where fitted.

Due to its nature and purpose, the orbital station is fitted with a new prototype docking system to assist trainee commanders. All they need to do is fly into the blue glowing area at the centre of the station and automatic tractor beam systems will guide the ship into the docking bay safely. Alternatively docking computers may also be used where fitted.

As it is an academic establishment, trading of all forms (except for the purchase of witchspace fuel) is not allowed (especially trading in trumbles). In lieu of the normal marketplace, the station offers three training courses and tests (sub-games) via the F8 screen. Once selected, all the commander need do is launch and the relevant course buoy will hail you. Approach the buoy and the test will begin.

The station is also well guarded by the Academy Security patrol, using a small fleet of Viper and Viper Interceptor craft. They do not take kindly to pranks and offensive behaviour, from students or graduates alike.

Gunnery

Always a popular course, the "shooting gallery" as it's colloquially known features fifteen target drones which are launched from the buoy in sequence and which must be destroyed in the fastest possible time. They are grouped into three levels of five, with each level's drones being faster, more agile and difficult to hit.

The test will finish once all drones have been destroyed, or the player leaves the course area (the buoy must remain on your scanner at all times during the test). Each drone has a maximum lifespan of 30 seconds after which it automatically self-destructs. Your best time on successful completion of the course is also noted.

Piloting

This course is designed to test the commanders skills in ship control and astro-navigation. After the test is initiated, you will be hailed in sequence by a number of other buoys which must be approached. These buoys form a 3-dimensional course to be followed. To make things more interesting, the course also contains a number of asteroids which must either be avoided or destroyed (at a cost of a 2 second time penalty each).

Also appearing randomly around the course are some rings. If flown through these offer a 10 second bonus to your time. The course ends once all seven buoys have been approached and you have returned to the main buoy. Again the test is against the clock, and your best time is recorded.

Docking

The final and arguably most tricky test is docking. Once the course has begun, three sets of three drones are launched in sequence, each of which must be successfully flown through to pass.

The first set are simple rings, designed to familiarise the commander with the test. The second set are more tricky, with inserts being placed in the rings of gradually decreasing size (the last drone on level two has a gap equal in size to a standard docking port). The last set also have the docking gap insert, but rotate at gradually increasing speed over the set. The final drone has the same rotation as a standard station, so truly simulates a normal docking experience.

Each drone must be traversed within a 3 minute time window or else it will self destruct and the test continue on with the next one. And the main test buoy must be kept on the scanner at all times or else the test will be aborted. To make things easier all second and third level drones have green glowing indicators (christened the "trail of breadcrumbs" by students) marking the ideal central line through the drone to assist in craft alignment. The drones are also orientated at right angles to the main course buoy, which can be used in lieu of the normal navigation buoy at the main station.

Known issues and notes

  • The station is currently not compatable with player ships featuring turrets (e.g. the Caduceus) due to the bug in Oolite v1.72.2 (same issue as with the Fuel Station). Any attempt to dock using one will probably result in a space bar moment.
  • Take extra care with the docking test, and fly slowly. The drones are solidly built, and collisions are easily fatal.
  • To prevent distracting messages appearing, if the Planetary Information System (Welcome Mat) is fitted to your ship, it is temporarily disabled at the beginning of each test. Upon completion of the test or it being aborted, the system is re-activated automatically.
Credits
  • Coding and scripting by Thargoid.
  • Shaders and skinning of the main station by Griff.
  • With thanks to PAGroove and Lestradae for play-testing and ideas.
Download

- = = Download Lave Academy here, from Box.net = = -
[/color]

Posted: Wed Mar 04, 2009 6:10 pm
by Thargoid
Just spotted (and corrected) a minor oops :oops: . In the shipdata.plist file, the entity laveAcademy_targetDroneGeneric has scanClass = "CLASS_NEUTRAL"; when it should have scanClass = "CLASS_CARGO";

It will work as it is, but if any police happen to be around when you're doing the target practice course you may end up as Offender/Fugitive and get attacked.

Just edit the file and change the scan-class to CLASS_CARGO to fix it, or download the files again for a fixed version.

Posted: Wed Mar 04, 2009 10:43 pm
by pagroove
Congrats on the release. People I tried it and it's really nice. Gunnery practice is quite challenging :D

Posted: Wed Mar 04, 2009 11:05 pm
by DaddyHoggy
Going on the list of must-tries!

Nice one Thargoid - as imaginative as ever!

Posted: Thu Mar 05, 2009 1:34 pm
by Eric Walch
Great oxp idea. I just tried out the gunnery. I liked it much for an experienced player.

Pretty difficult for a starting Jameson though. :twisted: I assume you never tried it with a fresh Jameson? You initialise the variables on loading a saved game. When not starting from a saved game but with a fresh Jameson some used mission variables are not set yet. Nothing buggy but messages look wrong.

In my opinion the target time is to short for a Jameson. Targets are so small that they are only drawn on screen when the player is quite close. Of my first 15 targets, there were three that already timed out before they started to become visible to the naked eye. Difficult is okay, but the player should have a chance. Or you must explicit say that it is not for a Jameson and you need upgrades like an injector.

I also had very much difficulties finding the station. Yesterday I gave up and today also. I had to cheat by awarding my Jameson with an advanced compass with the console. With the naked eye it is not visible from the main station. At least not on a non-shader computer. And I think you intended this oxp also for starters. Maybe you should spawn a few buoys on the route to the academy for a Jameson.

Posted: Thu Mar 05, 2009 1:49 pm
by Thargoid
It is visible from the main station (my laptop is non-shader remember), although I admit now that it's got Griff's darker look to it (which is much superior to my lighter temporary texture) it is a bit more difficult to spot (plus I know what I'm looking for, which may well come into it too). But the idea of a marker buoy is a thought. I did actually consider it at one point, but it never got implemented as I didn't think it was necessary. Did you use the side-view/roll-ship maneuver I suggested in the read-me file to find the station?

As to the other point, I did try it with a "brand new" Jameson and I know the issue you're referring to. But there is no simpler way to get the scripts to talk to one another, so I took the decision to use it as-is. Where I could the variables are set/initialised, but for some reason it doesn't always seem to work (if I tried to initialise them on startup rather than reset). Once the player has a save-game file it all works fine though as you say, even if it's just saving before leaving the station for the first time. I think that's more a glitch with mission variables in general though.

But let's allow others to try it out and report back, and if people find 30s too difficult for the shooting gallery it's simple to up it to 60s. Or perhaps even 30s if they have injectors and 60s if they don't.

That said you don't lose anything or fail the test by them self-destructing, it just sets a maximum time for the whole test (7.5 minutes). If you initiate the test and just sit there, you'll get that time and a pass. The trick is to decrease the time by shooting the drones early ;)

Posted: Fri Mar 06, 2009 10:10 am
by Kaks
I had a similar problem with the startup event (mission variables cannot be reliably accessed from that event) I managed to find a workaround way back then, though! IIRC I had to add a this.mvarsDone=false flag in there then check for that flag on exiting the station...
It's been a while, so I'll need to double check my code... I'll have a proper look this evening & will post back then! :)

Posted: Fri Mar 06, 2009 10:24 am
by Griff
I haven't had a chance to play the final version yet, but i did have a go at the gunnery test in an early WIP version and i was gobsmacked at how cool it was, it was just like the training courses in the x-wing/tie fighter games! awesome stuff, they way the drones get harder to catch as you got along is great, the way the last few swim away from you when you try and line them up is great, really great fun to finaly blast them!
T, would you like me to provide a non-shader version of the lave academy texture, maybe brightened up a lot - or you could use your original texture for the non-shader version of the station by having it listed first in the shaders, eg:

Code: Select all

shaders = { 
			"Thargoids_original_no-shader_texture.png" = // make sure this png is referenced in the objects dat file
				{ 
				vertex_shader = "lave-academy-exterior.vertex"; 
				fragment_shader = "lave-academy-exterior.fragment"; 
				textures =	(
						"griff_lave-academy-exterior-diffuse.png", 
						{name = "griff_lave-academy-reflectionmap.png"; repeat_s = "yes"; repeat_t = "yes";}
						);
				uniforms =	{
						uColorMap = { type = texture; value = 0; };
						uReflectionMap = { type = texture; value = 1; };
						}; 	
				}; 
			};

Posted: Fri Mar 06, 2009 10:46 am
by Micha
Last night I briefly tried to have a go at this OXP with a new Jameson and I could never find the Lave Academy. And yes, I tried using the side-views and rolling around my axis after launching (and nearly hitting the NavBuoy!).

Either the Academy is too dark and small, or I need new vision enhancers installed. And that's despite running the 'who turned the lights on' OXP.

I must say I didn't give it tooooo much time (still too busy with other stuff) but an Academy should be pretty much instantly discoverable for a new Jameson IMHO.


When I get more time on the weekend I'll 'cheat' and give Jameson an advanced space compass, but IMHO that shouldn't be necessary...

Posted: Fri Mar 06, 2009 11:12 am
by Thargoid
I'll look at it next week (away this weekend), and add a buoy in so people have something to aim for. That's probably going to be the simplest way.

Will also look at squashing the mission variables for new Jamesons issue, and will up the drone lifetime to 60s.

Griff - I'd rather keep your textures as they are, even without shaders. The place looks exactly like I wanted it to, it's infinitely better than my old texture. I guess I'm just used to finding it as I know what it looks like from a distance.

But all good feedback guys, please keep it coming over the weekend then I'll issue a 1.01 version on Monday or Tuesday.

Posted: Fri Mar 06, 2009 12:32 pm
by Eric Walch
Kaks wrote:
I had a similar problem with the startup event (mission variables cannot be reliably accessed from that event) I managed to find a workaround way back then, though! .....It's been a while, so I'll need to double check my code... I'll have a proper look this evening & will post back then! :)
The problem you are referring to is already solved in 1.71. In older Oolite versions, mission variables were loaded after the reset() handler and thus were undefined at that moment. In current versions the reset() fires after mission variables have been read in and mission variables can be dealt with during the reset().

Problem was here at startUp(). Variables should already be initialised at startup as the reset() never fires for a Jameson at startUp. (reset does fire for a Jameson after the player gets killed). Best way to program is probably:

Code: Select all

this.startUp = function()
	{ 
	  // one time only code.
	  this.reset()
	}
This way you get easy readable code. Maybe a bit better but also more complex is the way Svengali does it in Vector.oxp. There he uses extra variables to save a few processor cycles on startup. With above code reset() will be called twice because at 99.9 % of the times the player starts with an saved game. But specially this oxp is one that is more likely to be played with a fresh game and should also work with a new game.

There is probably no golden rule for when to initialise. Old legacy scripting often checked it on every update and with JS you also could check it on every launch.
Thargoid wrote:
Will also look at squashing the mission variables for new Jamesons issue, and will up the drone lifetime to 60s.
I think 40 seconds would be enough as it only were a few seconds I missed on those occasions.

Posted: Fri Mar 06, 2009 1:40 pm
by Thargoid
Eric Walch wrote:
I think 40 seconds would be enough as it only were a few seconds I missed on those occasions.
What I'm going to do is take a base lifetime of 30s, and add 10s each for players:

  1. with score < 16 (ie ranked harmless or mostly harmless).
  2. with only pulse lasers as front weapons (if I can find a working way to check the equipment, I guess a hasEquipment check for EQ_WEAPON_PULSE_LASER_FRONT?).
  3. without fuel injectors.
Therefore a player with rank poor (or above), an upgraded front laser and fuel injectors will still get 30s, but a factory-fresh Jameson will get 60s. And the course buoy will also inform you of the drones lifetime at the start of the test.

For the mission variables, I'll look through the whole lot and see which ones are missing for a Jameson, and use the this.startUp for the main academy station to give them values. Should cover all bases then...[/color]

Posted: Fri Mar 06, 2009 2:55 pm
by Eric Walch
Thargoid wrote:
with only pulse lasers as front weapons (if I can find a working way to check the equipment, I guess a hasEquipment check for EQ_WEAPON_PULSE_LASER_FRONT?).
Currently it is not possible to check weapon type. Best alternative is:

Code: Select all

  if(player.ship.weaponRange == 12500)
weaponRange returns the range of the last used weapon. (default is front weapon). All range values are unique with only exception the pulse and mining that have the same range. With this check you know it is pulse or mining but nothing else.

Posted: Fri Mar 06, 2009 3:21 pm
by Thargoid
So I've just discovered. Your way should work well enough though I think for the purpose.

Anyway, new buoy now in place between the Academy and the main station Nav-buoy to aid orientation, and a few script tweaks to try and sort out the mission variables issues.

Will give it a deeper test and issue v1.01 next week, unless anyone else has any more feedback before then.

Posted: Fri Mar 06, 2009 5:58 pm
by Thargoid
By the way, below is the Lave Academy when viewed from just outside the main station (on my non-shader laptop), from the side-view of a new Jameson. It's to the right of the cursor.

For me it's perfectly visible, I'm surprised you lot can't see it?


Image