Page 32 of 46

Re: The Feudal States

Posted: Tue Dec 13, 2011 3:48 am
by CommonSenseOTB
Ramirez wrote:
Evenin' all. It's been a while since I've been doing any Ooliting but I thought I should do a few updates to the OXP in response to comments. So, I've added some fixes to the mission, challenge and tournament screens to avoid the game-breaking problems you get when launching instead of using the menu options. I've also added a little bit of business that adds a note to the planet descriptions (the F7 screen) identifying those systems that are members of the Feudal States.

The pdf readme is still clocking in at over 6 meg (I still don't know why), so I've kept it separate from the OXP zip file. Also if anyone knows why I still get that funny noise at the end of the piece of music that plays at the royal court then do let me know. The ogg file sounds fine on its own, it's only when played inside Oolite that I hear it.
Yeah there's a little bit of junk at the end of the ogg file. Use audacity or something to zoom in and snip it off. Or if you're feeling adventurous, check your PM's for a download link for something interesting. :D

Re: The Feudal States

Posted: Wed Dec 14, 2011 3:43 am
by Wildeblood
Ramirez wrote:
I've also added a little bit of business that adds a note to the planet descriptions (the F7 screen) identifying those systems that are members of the Feudal States.
Image

Bogus. :D The changes are saved in the player's save-game, in the section local_planetinfo_overrides, and on each reload your script addends the note again. You need to set and check a flag so it only ever runs once per galaxy.

Re: The Feudal States

Posted: Wed Dec 14, 2011 3:31 pm
by Ramirez
I'm going to pretend that was a deliberate error to see how many people downloaded the update!

I'll get this fixed a.s.a.p., although I'll need to have a little think about how to do the galaxy check in an efficient way - maintaining an OXP over multiple maps is getting complicated!

I've got a fix for the music file as well so I'll aim to include that in a revised v1.13.

b.t.w Wildeblood, what HUD are you using there? It looks nice!

Re: The Feudal States

Posted: Thu Dec 15, 2011 4:44 pm
by Wildeblood
Ramirez wrote:
Wildeblood, what HUD are you using there?
The one in your in-box. :wink:

Re: The Feudal States

Posted: Thu Dec 15, 2011 7:15 pm
by Ramirez
OK, I've made another v1.13 and this time the planet description thing should work as intended. Even if someone insists on going on a repeat trip around all the galaxies, the text shouldn't get repeated.

I can't say I've found a foolproof way to remove the notes if the OXP is no longer present, but I can save that particular challenge for another day.

Re: The Feudal States

Posted: Sat Dec 31, 2011 6:04 pm
by Jon
Hi

First time poster here. I just recently discovered Oolite and it brings back memories playing Elite on my C64. I'm like the OXP aspect and am enjoying v1.13 of the Feudal States.

I'm currently attempting to finish Event 3 of the tournment (Quartet) and have run into an issue. I'm finding it impossible to complete because the competition is spawning so close to the drone.

Being a programmer myself, I had to see what is happening and at the same time learn a bit about OXP programming.

Looking at lines 351-354 of feudal-tournament.js, I see

Code: Select all

system.legacy_addShipsWithinRadius("feudal-drone", 1, "wsm", [0, 122000, 0], 2000)
system.legacy_addShipsWithinRadius(expandDescription("[feudal_house_"+[galaxyNumber]+"]")+"-knight", 1, "wsm", [0, 120000, 0], 5000)
system.legacy_addShipsWithinRadius(expandDescription("[feudal_house_"+[galaxyNumber]+"]")+"-prince", 1, "wsm", [0, 120000, 0], 5000)
system.legacy_addShipsWithinRadius(expandDescription("[feudal_house_"+[galaxyNumber]+"]")+"-lord", 1, "wsm", [0, 120000, 0], 5000)
Not knowing much about the OXP API but assuming the "addShipsWithinRadius" adds ships randomly within a specified sphere, I interpret the drone being anywhere from 0 (since the spheres overlap) to about 7000 away from the spawned ships (I don't feel like doing any a^2+b^2=c^2 solving to verify maximum distances right now). However, the lodge is spawned at ("wsm", [0, 100000, 0]) and according to my interpetation making my ship appearing about 20000 away (i.e. much farther).

Is this intentional? If so, I will continue to try to win it as designed. I've got some ideas to try to fire on everyone to get them to focus on me but there isn't much time for me to orientate and hit them with all 3 ships being so far away. I changed scripts so that the competition ships to spawn centered at [0,100000,0] but now it just seemed too easy to catch the drone then.

edit: Had the wrong mission title. Event 3 is "Quartet", not "The Chase."

Re: The Feudal States

Posted: Sat Dec 31, 2011 6:39 pm
by JazHaz
You can tinker with the scripts if you wish, with three caveats:

1) read the license for the OXP in question.

2) don't use Windows Notepad (as that adds extra characters). Use a programmers editor, such as Notepad++ instead.

3) on reloading Oolite hold down shift, as that forces the program to refresh its caches, and reload all OXPs.

Re: The Feudal States

Posted: Sat Dec 31, 2011 7:26 pm
by Cody
What JazHaz forgot to add was... welcome aboard, Jon!

Re: The Feudal States

Posted: Sat Dec 31, 2011 7:38 pm
by Kaks
Well, the code above asks for the drone to spawn within 2000 Oolite metres of position X+2000(the offset being along the y axis), then asks the other 3 ships to spawn within 5000 metres of position X.

In other words, the drone's 'spawn sphere' is wholly contained within the 3 other ship's - identical - spawn sphere, if off centre by 2000 metres...

As others said, welcome to the friendliest board this side of Riedquat... :)

Re: The Feudal States

Posted: Sat Dec 31, 2011 8:14 pm
by Jon
First, while I did identify the mission as event 3, the title is "Royal Tournament Event 3: Quartet" not "Chase." Chase is event 2. I was looking at the code to closely and not the descriptions.
Kaks wrote:
Well, the code above asks for the drone to spawn within 2000 Oolite metres of position X+2000(the offset being along the y axis), then asks the other 3 ships to spawn within 5000 metres of position X.

In other words, the drone's 'spawn sphere' is wholly contained within the 3 other ship's - identical - spawn sphere, if off centre by 2000 metres...
Thanks for doing the math for me :).

Now I am just asking if this is the desired result of the OXP author.

The mission description states:
The target drone is located near the tournament buoy. Your three opponents will start the event alongside you just outside the Hunting Lodge.
The spawn for the lodge/buoy in feudal-challenge.js is:

Code: Select all

if(system.countShipsWithRole("feudal-hunting-lodge") == 0)
system.legacy_addShipsAtPrecisely("feudal-hunting-lodge", 1, "wsm", [0, 100000, 0])
		
if(system.countShipsWithRole("feudal-buoy") == 0)
system.legacy_addShipsAtPrecisely("feudal-buoy", 1, "wsm", [0, 122000, 0])
So to me, I think the 3 ships should spawn near [0,100000,0] to be "alongside" (maybe add them "Precisely" offset by the radius of the lodge and a bit), but not right on top of the "federal-buoy" +/- 5000m.

However, I am just asking if it is possible to win the mission with the spawning locations as written. As written I seem to lose the mission seconds after exiting the lodge. It took me 3 tries before I even noticed the drone on the scanner before it was "captured" by my opponents. I thought I was doing something wrong since the opponents just seemed to sit there next the the buoy doing nothing until I shot at them.
Kaks wrote:

As others said, welcome to the friendliest board this side of Riedquat... :)
Thanks for the welcome.

I didn't want to do go into the OXP code so much to be able to maintain a level of mysticism in how they work in Oolite. Now I want to dig into the API guide to see what other APIs there are. Can I add a ship with a specific orientation (perhaps with a direction vector or position matrix)? What about setting an initial velocity? I just need to keep reminding myself that code writing is for work, playing games is for free time. I can't play games at work. I shouldn't write code at home :) . I wonder what my customers would say if I was billing them to write code for a game.

Re: The Feudal States

Posted: Sat Dec 31, 2011 10:09 pm
by Kaks
You might have a point or two there! There's quite a lot of stuff happening with them Feudal States, and the present code could be a bit of a snafu - speaking from my own personal experience, I seem to do those quite regularly, no matter how extensively I check my own code...

Anyway, I'm sure Ramirez will be along at some point with the full story, and I'm equally sure he'll appreciate any improvement you have in mind, especially if it means you've done all the testing already! :D

All the options you mentioned: specific orientation, position & speed are very much doable, and more: to give you a starting point, most of the js possibilities are covered here:

http://wiki.alioth.net/index.php/Oolite ... ject_model

And there's a lot more to OXP making than just js - a lot of OXPs out there barely use - or indeed need - any js whatsoever... :)

Ok, I better go now... Happy New Year everyone! :)

Re: The Feudal States

Posted: Sun Jan 01, 2012 6:19 pm
by Ramirez
Kaks wrote:
Anyway, I'm sure Ramirez will be along at some point with the full story, and I'm equally sure he'll appreciate any improvement you have in mind, especially if it means you've done all the testing already! :D
Did someone call? Hi everyone, been away for the Christmas/New Year break, now it's back to business!

Jon, I think you've identified that the script can be improved. The intention was to put the other three ships near your position at the beginning of the event, with all ships having a roughly equal chance of capturing the drone. However, placing them in such a large radius around the buoy is a bit random and I admin can be a bit unfair (if not impossible!). Since writing the Feudal States I've got a bit better at doing this - a better approach would be to place the opponents' ships relative to your position, e.g.

Code: Select all

system.addShips([feudal_house_"+[galaxyNumber]+"]")+"-knight", 1, player.ship.position, 5000)
which would appear as if all four ships have launched from the station at roughly the same time.

Give this a try and see how the event plays. The idea is that as all the ships have similar top speeds you need to attack them with laser fire (or just collide with them), forcing them to engage you in self-defence rather than being able to chase off after the drone.

Re: The Feudal States

Posted: Tue Feb 28, 2012 1:44 pm
by Ramirez
I'm revisiting this OXP in an attempt to improve the feudal challenges which at the moment aren't really that challenging. A simple trick I thought I'd try is to give the opponents a fixed ball turret, similar to what I've done for the Kraits in Resistance Commander.

So now I'm tweaking the settings and I'm using the new style subentity declaration, but as far as I can tell, the weapon_energy setting makes no difference. Whether it's 0.5 or 50.0, it still takes about 5 hits from an NPC to reduce my front shields to zero. Similarly, weapon_range doesn't seem to do much, at least if I set it to 3000m I'll still get an NPC firing its turret from beyond 4000m. Strangely though, fire_rate does work as expected.

The kind of entry I have in the shipdata is as follows:

Code: Select all

 subentities =         (    
				{	type = "ball_turret";
            				subentity_key = "feudal-ship-turret-green";
            				position = (0.0, 0.0, 19.0);
            				orientation = (1, 0, 0, 0);
					weapon_energy = "50.0";
					fire_rate = "1.0";
					weapon_range = "3000";
				}
				);
Is this a bug or have I not understood the documentation properly?

Re: The Feudal States

Posted: Wed Feb 29, 2012 5:27 pm
by snork
Not that I would know, but do you not need to define feudal-ship-turret-green in it's own proper entry in shipdata.plist ?
So roughly (very !) like this ?

Code: Select all

 [...]
       subentities =         (    
				{	type = "ball_turret";
            				subentity_key = "feudal-ship-turret-green";
            				position = (0.0, 0.0, 19.0);
            				orientation = (1, 0, 0, 0);
					
				}
				);

"feudal-ship-turret-green" =
	{
	   like_ship = "ballturret"
		name = "your_name";
		roles = "your_role";
		weapon_energy = "50.0";
		fire_rate = "1.0";
		weapon_range = "3000";
	};





hth :?

Re: The Feudal States

Posted: Wed Feb 29, 2012 5:44 pm
by Ramirez
I do have the turret defined separately in the shipdata and so in that sense the turrets are working in-game, it's just the parameters that don't seem to make much difference.