Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

The Feudal States

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

I've had a more detailed look and have been able to get hold of some of the other ship information, including thrust, missile capacity and a possible way of checking for turrets in the player's subentities. I'll try putting a new formula together that can take this into account.

Unfortunately I'm having a bit of trouble updating the script for 1.74. The screens and choices work OK, but for some reason the name and rank generator isn't resetting properly. Instead of choosing new names, houses and genders for each challenge it sticks with the first one it came up with, even though I've included a whole load of resets and nulls to avoid this. It's as if the script is picking the same entries in the descriptions.plist each time.

Are there any known issues about selecting entries from descriptions.pist non-randomly?
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ramirez wrote:
. It's as if the script is picking the same entries in the descriptions.plist each time.

Are there any known issues about selecting entries from descriptions.pist non-randomly?
Its a know "feature" of oolite. Every time a ship asks for the witchpoint location, the system seed is reset. So in systems with a lot of hunters and police flying to the witchpoint you have a large change of getting always the same description. It does give a system a kind of personal style in its messages.

Personaly I think more oxp's suffer from this feature than profit from it. I deal with it by selecting a random string from an JS array of strings when I really want some randomness.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

I've looked into this in more detail and things are still looking strange. I go into the debug console in v1.74 and type the following:

Code: Select all

missionVariables.feudal_challenger_house = expandDescription("[feudal_house_"+[galaxyNumber]+"]")
This is the line that the script uses to choose a feudal house. The console successfully returns one of houses at random, and if I keep typing the same line in I'll get a different selection.

Yet, when I have the same line within the script, and I keep re-running the script through the mission screen, it keeps picking the same house (Esredice) from the list in the descriptions.plist, which looks like this:

Code: Select all

 <key>feudal_house_0</key>
      <array>
         <string>Tibedied</string>
         <string>Oreseren</string>
         <string>Edzaon</string>
         <string>Gelaed</string>
         <string>Geinona</string>
         <string>Aronar</string>
         <string>Digebiti</string>
         <string>Esredice</string>
         <string>Onusorle</string>
         <string>Tibecea</string>
         <string>Ededleen</string>
      </array>
I can't understand why the script is behaving differently from the console. I do get a slight lag when selecting choices on the mission screen, which usually suggests something's not right, but I haven't able to identify anything as yet.

If need be I can convert all the description.plist arrays into proper javascript arrays but this involves quite a bit of work, so I'd only want to do this if I really have to. Also I'd like to know if I need to change any my other OXPs that make use of the descriptions.plist as a quick way of making random selections.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ramirez wrote:
I can't understand why the script is behaving differently from the console. I do get a slight lag when selecting choices on the mission screen, which usually suggests something's not right, but I haven't able to identify anything as yet.

If need be I can convert all the description.plist arrays into proper javascript arrays but this involves quite a bit of work, so I'd only want to do this if I really have to. Also I'd like to know if I need to change any my other OXPs that make use of the descriptions.plist as a quick way of making random selections.
Between mission page display there is probably something that keeps resetting the seed for the random generator that is not happening when in the console. But as said before: add 20 police ships to the system and than redo your expansions in the console. You'll notice it will come up much more often with the same result.

For random hits that was a pain. I noticed LB had all kind of referenced and double referenced keys to make sure the three different mark pages generated different results. And even than, the next time in the system you often got the same offer again. The amount of text did not encourage me to concert those to JS strings. What did help was shaking the random generator a bit before creating the pages by using first:

Code: Select all

var count = Math.round(Math.random()*15);
var name = "";
for (var i=0; i<count; i++) name = expandDescription("[nom11]");
It just does a random number of dummy string expansions before I start expanding the strings I need. Now I get a random enough distribution without the feeling it is always the same. Not efficient, but for displaying a missionpage, time is not a real issue.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

After a long exchnge of PMs with Eric I've realised that it was my savegames that were causing most of the problems, so that's one thing sorted out.

I've now updated the various feudal states scripts for the new missionscreen handling in 1.74. I've modified the challenges further by setting an upper limit on the odds, plus I've also given opponents an option to refuse a challenge if they think the odds are too far stacked against them. I'm now in the process of adding some slavic themed stuff for galaxy 5 - I've got the scripting all done but I just need to draw up some new shields for the ships. Then it's a case of doing the copying and pasting for the shipdata.

One thing I haven't addressed as yet is what should happen when a player has a feudal rank and moves to another galaxy. My early thought is to have one of the new houses offer the player a chance to join their service at the same level. A few lines of script and a suitable mission screen will be enough to sort this out.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
dmipet
Above Average
Above Average
Posts: 19
Joined: Sat Jul 19, 2008 4:01 pm

Post by dmipet »

Thank you for this OXP, Ramirez :) I would like to contribute from my playing experience.
First of all, I'd say trimming down challenging odds is a very good idea. I got 35:1 once in v.1.3 (that's 3,500,000, Cr for a five-minute work, for sure :) ). Fortunately, this seems to be addressed in 1.4. Now I mostly get 0,5:1 to 1.5:1 (still a huge profit compared to milkruns, of course).
Second, the challenging itself is *very* easy. They mostly ran around you for a while, than fly back and stick to your six firmly at some constant distance (usually it is about 10 to 15 km). Easy target for my aft mil.laser, naturally - simply aim and press fire, release when it says "I give up".
Third: something must be wrong with names in my version (v.1.4). When I scanned through available challenges, the second and the third ones were styled like "feudal_firstname__she feudal_lastname_, feudal_middle__she_rank van Digebiti is currently visiting our system and has offered...". When I challenged the noble Lady feudal_fistname__she, it appeared that it is indeed her name, since her ship bears it, too :)
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

Thanks for the comments. I've played around with the AI a little and I think I've made the opponents slightly more aggressive by making more use of the interceptAI.plist - this is what the police vipers use and they seem to be quite persistent when it comes to attacking. At the moment knights only have a beam laser, so it seems sensible to upgrade this to a military laser.

With 1.74 there are more possibilities of adding equipment to NPCs by script, rather than hard coding it in the shipdata. This means that when the ships are spawned for challenges I can try giving them things like extra energy units, and in theory the basic versions of the same ships can by used by the OXP in other situations without being quite so deadly.

Having said that, does anyone have any other ideas about how to make NPCs more aggressive and dangerous, other than just ramping up the usual stats? Maybe a more advanced AI can be produced by having the AI.plist use a ship script to check what the player's doing and then react accordingly, instead of defaulting to the usual intercept behaviour.

The problem with Digebiti is a minor typo in the feudal-ranks.js script, where I miss-spelt the system name. Replace the instance of 'Digibeti' with 'Digebiti' and it should work OK.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Ramirez wrote:
Having said that, does anyone have any other ideas about how to make NPCs more aggressive and dangerous, other than just ramping up the usual stats? Maybe a more advanced AI can be produced by having the AI.plist use a ship script to check what the player's doing and then react accordingly, instead of defaulting to the usual intercept behaviour.
Problem is that performAttack is hardcoded and controls the behaviour when called. It even overrules settings done after calling it as long as the ship is in that behaviour. It's the main reason why I'm not doing anything for a new Localhero, because you often encounter single ships in it's missions and the engine is still based on odd/even for setting the behaviour. In v1.72 it was possible to make them more aggressive by a very dirty hack, but since v1.73 this is not working anymore. So it's on ice until I can find a way to work around this problem without blowing up the scripts. And ramping up the stats feels pretty wrong for me too. Yes, I know that you can do a lot with scripts, but this won't change the basic situation (50/50 chance, based on ID). We could need a way to influence the ATTACK_TARGET_XYZ behaviour... hmmm...
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

I'm still thinking about what to do with the NPCs, but I think I've reached the same point as Svengali and am a bit lost as to what do. To be honest I'd like to focus on my other mission OXP for a while so maybe after a bit of a break from all things feudal I'll have come up with some new ideas to improve the challenges.

For the moment though, I've packaged up the current version which should so some improvements. Note that this version will only work with the trunk build (v1.74) as I've altered the scripts to use the new mission screen handling.

The Feudal States v1.5

I'm having pdf problems again so I've left the readme as a separate download - the only change is the addition of houses for Galaxy 5.

The Feudal States Readme
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
caracal
Deadly
Deadly
Posts: 205
Joined: Wed Jun 25, 2008 11:31 am
Location: The Desert, USA
Contact:

Post by caracal »

I finally read all the way through this thread (with some wistfulness, as you may imagine) and found this in the very last message:
Ramirez wrote:
Note that this version will only work with the trunk build (v1.74) as I've altered the scripts to use the new mission screen handling.
Ah-haaaa! So despite the wiki page saying "This OXP requires, and has been tested on, Oolite v1.73.4.", and no mention of 1.74 on your download page or in the readme, this is probably why I'm getting "TypeError: mission.runScreen is not a function" in my log, and no, um, "feudal" activities at the Royal Hunting Lodge, when trying to use it under 1.73.4, eh?

No matter, 1.74 will be here soon enough, and I have my hands full with a lot of other stuff in the ooniverse right now.

I do regret not having had the opportunity to pursue my own Feudals.oxp back in 2008, but I take comfort in knowing that at least the idea, and maybe some of the code, did serve a useful purpose. And heck, there are still four out of the eight government types that don't have flavor OXPs yet (Corporate Retreats? Oonited Nations? Voting Booths? Lots of possibilities.), not to mention there's been limited exploitation of the economy type, too. And I'm guessing there might be some interest in a less ... ummm ... impactive flavor OXP for anarchies. The current Anarchies.oxp is a work of art, don't get me wrong, but you'd better be darned ready for it when you install it.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Yep, unfortunately the new super-duper mission.runScreen is slightly broken atm but, nevertheless, work is proceeding apace towards 1.74 . :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

Hi Caracal, cheers for dropping by. From all the posts you'll see it's been a bit of a long road, over a year's worth of work with many highs and lows inbetween. Sorry about the confusion with the versioning - the wiki was down when I released the latest version and I forgot to go back and update the page. I had to drop the pre-trunk version as it lacked a lot of the features I needed to really make things work well, and it was getting v difficult to have two versions running in parallel.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
caracal
Deadly
Deadly
Posts: 205
Joined: Wed Jun 25, 2008 11:31 am
Location: The Desert, USA
Contact:

Post by caracal »

Ramirez wrote:
Hi Caracal, cheers for dropping by.
Thank you sir!
Ramirez wrote:
From all the posts you'll see it's been a bit of a long road, over a year's worth of work with many highs and lows inbetween.
Yeah, it looks like quite the accomplishment. Of course in the beginning stages you always visualize the end result, never all the hard work it will take to get you there. You have really put in the hours, and now have something you can justly be proud of.
Ramirez wrote:
Sorry about the confusion with the versioning - the wiki was down when I released the latest version and I forgot to go back and update the page. I had to drop the pre-trunk version as it lacked a lot of the features I needed to really make things work well, and it was getting v difficult to have two versions running in parallel.
Oh duh, I didn't stop to think that of course the wiki was down for all that time! It was actually down the first time I thought I'd "go see what oolite is up to these days", so I came out here to the boards and found out it was a hardware issue, and dutifully came back in a couple weeks, finding to my delight that it was back.

And yeah, I've been drooling over all the new stuff that's coming in 1.74; as I mentioned elsewhere, I got an idea for a silly little OXP that it turns out requires one of those new methods. So I'll be making that jump soon enough, for sure, and then I'll get to swim in the Feudal ocean for a while.

Kudos to you for your excellent work, and thanks for making such a cool OXP!
FlammableFlower
Average
Average
Posts: 8
Joined: Fri Mar 26, 2010 4:05 pm

Post by FlammableFlower »

For some reason I can't dock with the Hunting Lodge: my Caduceus collides, fatally, every time I try to dock.

What's going on?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

FlammableFlower wrote:
For some reason I can't dock with the Hunting Lodge: my Caduceus collides, fatally, every time I try to dock.

What's going on?
A problem with the Caduceus which will hopefully be gone in Oolite 1.74. Until then there are certain structures which you cannot enter with a Caduceus. We apologize for the inconvenience! :)
Post Reply