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: another_commander, winston

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

Re: The Feudal States

Post by Ramirez »

The way the OXP's designed at the moment is that all the houses have the same initial rank, that of a Knight, which doesn't change depending on the language used. So, I only need the 5 ranks from Gaishira to Daimyo, at least as far as the player's concerned. Ultimately it's a case of seeing what looks right once it appears in-game.

The hunting lodges are indeed placed at 30% along the witchpoint-sun line; it shouldn't be a major issue to change this into an absolute value of a few hundred km.

I hadn't thought about involving the lesser feudal systems. Currently the deliveries are made to other 'proper' feudal states, of which there are just a handful in each galaxy. A slightly more complex script would allow the destination to be chosen from amongst the other feudal systems.

The idea of zones of control around a feudal state sounds good but I'm not sure if the distribution of feudal systems across each of the galaxies would make this workable - I'd need to check the maps. Also I'd want to make sure anthying like that could be done without introducing too much hard coding.
Download Resistance Commander plus many other exciting OXPs HERE
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: The Feudal States

Post by m4r35n357 »

Just got this with Oolite 1.75.1 and The Feudal States v1.9.6

Code: Select all

20:10:36.209 [script.addShips.failed]: ***** SCRIPT ERROR: in <anonymous actions>, addShipsAtPrecisely: could not add 1 ships with role 'Tuison-prince'
any ideas?
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: The Feudal States

Post by m4r35n357 »

ahem, meant to say, I set up a challenge, remembered to sell my missiles first this time, and placed a 10000CR bet on myself. Imagine my surprise when no-one turned up . . . hence the error message.
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

Re: The Feudal States

Post by Ramirez »

Ah, looks like a typo in the descriptions.plist:

Code: Select all

<key>feudal_house_4</key>
      <array>
         <string>Zagearbe</string>
         <string>Rizace</string>
         <string>Atbiarxe</string>
         <string>Enlaonus</string>
         <string>Tuison</string>
         <string>Erxearis</string>    
      </array>
Edit the 'Tuison' entry to say 'Tiuson'.
Download Resistance Commander plus many other exciting OXPs HERE
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 271
Joined: Thu Jan 01, 2009 9:45 am

Re: The Feudal States

Post by DGill »

I seem to recall the error arises because Tiuson is spelt "Tuison" in the descriptions.plist - may also be linked to galaxy 4 feudal planets being omitted from the feudalrankgenerator function in the file feudal-ranks.js

I thought Ramirez corrected this a while back - so long ago I can't remember the details.
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: The Feudal States

Post by m4r35n357 »

Ramirez wrote:
Edit the 'Tuison' entry to say 'Tiuson'.
OK thanks! Ian.
The Black Albatross
Above Average
Above Average
Posts: 22
Joined: Thu Mar 10, 2011 8:24 pm

Re: The Feudal States

Post by The Black Albatross »

Some more observations:

I noticed that you need to do 4 delivery missions to be invited to join a house, but when you decline the offer, your feudal_score variable is set to 0, so you have to start over with the deliveries and do 4 more before you're invited again. This seems to conflict directly with the text you get when you decline, which says that the offer will stand as long as the player is in good standing with the Feudal states. It was pretty confusing when this happened; maybe you can modify the text so that it's clear that you need to keep running deliveries to get more invitations.

Now that I'm a Knight of the House of Ededleen, my first mission was to intercept Onusorle's platinum shipment and return them to my royal house. Unfortunately, I fly an Asp, which has neither compatibility with scoops or space to put the cargo in. On top of that, it wasn't very clear that I was expected to scoop cargo beforehand (this was perhaps due to my own lack of foresight), so I got to the point where I'd blown up the convoy ship and was staring at the platinum canisters floating in front of me before I realized that I couldn't scoop them up. I don't know if you intended to completely exclude Asps from completing raid missions, but I would have appreciated some instruction about what I was supposed to do in concrete game terms, or advance warning that I would have to switch out my ship.
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:

Re: The Feudal States

Post by Commander McLane »

The Black Albatross wrote:
I don't know if you intended to completely exclude Asps from completing raid missions, but I would have appreciated some instruction about what I was supposed to do in concrete game terms, or advance warning that I would have to switch out my ship.
It's possible to check whether the player ship has fuel scoops and/or enough cargo space before the mission starts, and alter the mission accordingly. (Like you say, alert the player that he has to change ships, or offer another way of achieving the mission.)
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

Re: The Feudal States

Post by Ramirez »

I think I reset the feudal score variable simply as a quick way to stop the promotion offer being repeated while you're at the royal court, thus blocking the mission offering screen. I'll revisit this and use something more robust like a jumpcount to control this.

Re-reading the mission text it's not that obvious you need a fuel scoop to complete the raids; the same applies to the ransom missions. My preference would be to explain these requirements better in the text rather than modifying the script, as I don't want the mission selection to be affected by the player's equipment.

Duly added to the v1.10 to-do list!
Download Resistance Commander plus many other exciting OXPs HERE
zsozso
Above Average
Above Average
Posts: 23
Joined: Tue Apr 12, 2011 3:54 pm
Location: Toronto, Canada

Re: The Feudal States

Post by zsozso »

Hi All!

I'm a new member of the forum and fairly new to Oolite as well (started playing a few weeks ago), however, I was a dedicated (obsessed?) Elite player back at the end of the 80's first on my Enterprise128 home computer (any of you ever seen one of those ?), then on my first 286 PC under DOS -- good ol' days 8)

So I recently discovered Oolite and I am LOVING it!!! It is soo nice that I can play this wonderful game under Linux, plus all the additions OXP's -- plenty of fun! Many thanks to all the developers of Oolite as well as the OXPs!!!

Of course, I have downloaded a whole bunch of OXPs and starting go through the missions and so on. So far I have done all Galaxy 1 & 2 missions that can be played at my current rating (Dangerous with ~1600 kills) and recently arrived to Galaxy 3. In the process I had run into one problem that I have managed to solve: The "BlackJacks Bullion" OXP had a series of javascript errors due to version differences as far as I could tell -- I am running 1.75 while the OXP had referred to some function that did not exists but I could fix those by a little reading on the wiki page and replacing the function calls.

However, I just ran into another problem with "The Fedual States" -- yeah, I finally got to the on-topic part :wink:
I docked at a Royal Hunting Lodge and took up some challenges. The first one went OK, I won got back to the lodge, got my money. Then I took up a second one, seemingly won again (opponent fired the green flare and said that I have beaten him), but when I docked back at the station I got the message that I have forfeit the challenge because I came back! Huh ? I took another (3rd) challenge and the same thing repeated. I checked the Latest.log and I see these errors:

Code: Select all

[ai.error.stackOverflow]: ***** ERROR: AI stack overflow for <ShipEntity 0x10862ca0>{"Prinz-Class Zerstoerer (Erinain)"} in feudal-challengerhomeAI.plist: G
O_TO_STATION -- stack:

  [ai.error.stackOverflow.dump]:  31: route1traderAI.plist: HEAD_FOR_PLANET
  [ai.error.stackOverflow.dump]:  30: feudal-challenger2AI.plist: ATTACK_SHIP
  [ai.error.stackOverflow.dump]:  29: feudal-challengerhomeAI.plist: FLEE
  [ai.error.stackOverflow.dump]:  28: feudal-challengerhomeAI.plist: FLEE
  [ai.error.stackOverflow.dump]:  27: feudal-challengerhomeAI.plist: FLEE
...
all the way to:
...

Code: Select all

  [ai.error.stackOverflow.dump]:   1: feudal-challengerhomeAI.plist: FLEE
  [ai.error.stackOverflow.dump]:   0: feudal-challengerhomeAI.plist: FLEE
[exception]: Squashing exception OoliteException:AI stack overflow for <ShipEntity 0x10862ca0>{"Prinz-Class Zerstoerer (Erinain)" position: (-143579, -273677, 464696) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} in AI handler feudal-challengerhomeAI.plist:GO_TO_STATION.WAYPOINT_SET
[ai.error.stackOverflow]: ***** ERROR: AI stack overflow for <ShipEntity 0x10862ca0>{"Prinz-Class Zerstoerer (Erinain)"} in feudal-challengerhomeAI.plist: FLEE -- stack:
then the whole thing repeat again:

Code: Select all

  [ai.error.stackOverflow.dump]:  31: route1traderAI.plist: HEAD_FOR_PLANET
  [ai.error.stackOverflow.dump]:  30: feudal-challenger2AI.plist: ATTACK_SHIP
  [ai.error.stackOverflow.dump]:  29: feudal-challengerhomeAI.plist: FLEE
and it keeps repeating several more times.

I am using the latest 1.96 version of the OXP download.
Any idea what could be wrong ?

I am willing to dig in and try to debug the code. I am a programmer, although I have very little javascript experience, but I am fluent in C++ and java, but I am not familiar with the Oolite scripting yet, so I need some time to catch up to speed and some pointers where to start...
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: The Feudal States

Post by Cody »

Hi zsozso and welcome... good first post.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: The Feudal States

Post by Smivs »

hi zsozso, and welcome. I can't help with your question :roll: but just wanted to say 'Hello' :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
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

Re: The Feudal States

Post by Ramirez »

Hi zsozso, I think this is the classic AI stack overflow problem that's caused by using too many 'setAI' commands. I thought I had resolved this in my various OXPs (I think I first came across it in Missiles and Bombs) but it seems I've left some loopholes in this one.

I'm not sure how easy it is to reproduce the overflow, but if you go into the feudal-target.js script, you'll find lots of mentions of 'this.ship.setAI("xxx")'. If you change these to 'this.ship.switchAI("xxx)' that should solve the problem.
Download Resistance Commander plus many other exciting OXPs HERE
zsozso
Above Average
Above Average
Posts: 23
Joined: Tue Apr 12, 2011 3:54 pm
Location: Toronto, Canada

Re: The Feudal States

Post by zsozso »

Thanks Ramirez!

In the meantime I have managed to "cover-up" the problem by switching around the instructions in feudal-target.js where the VICTORY condition is granted, the script was calling the setAI first, then assigned the missionVariables.feudal_challenger to VICTORY after. By switching it around, I managed to get the victory screen when returning to the Hunting Lodge even though the log still contained the errors.
Tonight I'll try again with the setAI changed to swithAI and hopefully this will solve it. So the relevant part of the script will look like this:

Code: Select all

this.shipEnergyIsLow = function()
   {   if(missionVariables.feudal_challenger === "RUNNING" && this.ship.primaryRole == [missionVariables.feudal_challenger_role])
        {
                missionVariables.feudal_challenger = "VICTORY"
                this.ship.spawn("feudal-flare", 1);
                this.ship.commsMessage(expandDescription("[feudal-yield]"))
                this.ship.switchAI("feudal-challengerhomeAI.plist")
        }
   }
Oh BTW, I can reproduce the situation fairly easy. It happens when I fire long bursts of my millitary laser against the strongest challenger ship type, it suffers some damage, starts fleeing, but not yet give up. Then I go after him but can only shoot very short bursts as my laser is overheated, so it is a cycle of wait - shoot - wait ...
I thought the repeated FLEE cycle in the state machine was caused by the circular assignment in the file feudal-challengerhomeAI.plist:

Code: Select all

        FLEE =
        {
                ENTER = ("setDesiredRangeTo: 25600", performFlee);
                ATTACKED = (fightOrFleeHostiles, "setStateTo: FLEE");
However, taking out the setStateTo: FLEE part from the ATTACKED action did not fix the problem.
zsozso
Above Average
Above Average
Posts: 23
Joined: Tue Apr 12, 2011 3:54 pm
Location: Toronto, Canada

Re: The Feudal States

Post by zsozso »

I tried with all setAI replaced by switchAI in feudal-target.js, but the stackOverflow errors still occur. The only difference is that now the log does not mention the script feudal-target.js, only feudal-challengerhomeAI.plist such as :

Code: Select all

[ai.error.stackOverflow]: ***** ERROR: AI stack overflow for <ShipEntity 0xe80eed0>{"Prinz-Class Zerstoerer (Erinain)"} in feudal-challengerhomeAI.plist: FLEE -- stack:

  [ai.error.stackOverflow.dump]:  31: feudal-challenger2AI.plist: ATTACK_SHIP
  [ai.error.stackOverflow.dump]:  30: feudal-challengerhomeAI.plist: FLEE
  [ai.error.stackOverflow.dump]:  29: feudal-challengerhomeAI.plist: FLEE
...
Then this keeps repeating several times. So there seems to be some internal problem in the AI plist state-machine itself.
Post Reply