Just when I thought I was out...

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

Moderators: another_commander, winston

Post Reply
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Just when I thought I was out...

Post by Roberto »

...it pulled me back in!

OK, after a year away from OXP-ing, I'm going to try and ease myself back in by sprucing up my Taranis OXP a bit. Trouble is, I seem to have hit an instant brick wall on the two things I want to do!

The first thing I'm attempting is to have my station spew out the occasional ship (which will either hyperspace out or head to the system station). I tried following Eric Walsh's recent suggestion in the New Galactic Navy thread, and created a new AI state (TRAFFIC) in which the dice-rolling would occur (if I put it in IDLE the player would constantly receive greeting messages - previously I had a long pause to stop this from happening):

Code: Select all

    IDLE = { 
        ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "OFFENCE_COMMITTED" = (setTargetToFoundTarget, "markTargetForOffence: 15", launchDefenseShip, increaseAlertLevel); 
        ENTER = (); 
        EXIT = (); 
        "INCOMING_MISSILE" = (fireECM, increaseAlertLevel, setTargetToPrimaryAggressor, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, "pauseAI: 5.0", "sendTargetCommsMessage: [taranis-greeting]", "setStateTo: TRAFFIC"); 
	UPDATE = (decreaseAlertLevel, "scanForNearestShipWithRole: player"); 
    }; 
    TRAFFIC = { 
        ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "OFFENCE_COMMITTED" = (setTargetToFoundTarget, "markTargetForOffence: 15", launchDefenseShip, increaseAlertLevel); 
        ENTER = (); 
        EXIT = ();
        "INCOMING_MISSILE" = (fireECM, increaseAlertLevel, setTargetToPrimaryAggressor, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "ROLL_1" = ("launchShipWithRole: taranis_traffic");
        UPDATE = ("rollD: 5", "pauseAI: 120.0"); 
    }; 
I've edited the shipdata to include a ship with the role "taranis_traffic" (though I haven't assigned it an AI just yet). But it's not working - the station appears to be behaving exactly the way it was before, i.e. sending me a repeat greeting message after a long pause (I previously had "pauseAI: 120.0" in IDLE). How could it be greeting me and *not* going to TRAFFIC, or going to TRAFFIC and then leaving it (without being fired upon)?! It's almost as if Oolite isn't reading my changes, even though I'm editing in the AddOns folder (as always). Anyone know what I'm missing? I've just installed version 1.70 - could that be it?

The second thing I'd like to do is emulate the texturing of the rather gorgeous Navy Station to some degree. And, having looked at its shipdata info (in the Assassins OXP) and the textures the model's using (in Oolite itself), I've absolutely no idea how to do this! Some kind of magic must be going on behind the scenes to merge all the metal textures together into a nice pattern, and to give the docking bay its blue glow, but I can't see where it's being done :( Clearly I've been away too long...
User avatar
matt634
Deadly
Deadly
Posts: 206
Joined: Tue Mar 21, 2006 6:32 pm
Location: Colorado, USA

Post by matt634 »

It's almost as if Oolite isn't reading my changes, even though I'm editing in the AddOns folder (as always). Anyone know what I'm missing? I've just installed version 1.70 - could that be it?
Eric and I have both experienced this problem and it is related to 1.70 - for some reason its more sensitive to the cache than previous versions. For a change in the addon folder to take effect make sure you press and hold "shift" while Oolite is loading. This should fix the problem - worked for me anyways.
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 »

Yes, in general that's right, but it's neither a "problem" nor from "some reason" nor related to 1.70. The new cache management and the functionality to explicitely flush the cache by pressing SHIFT while starting the game were both implemented in 1.69.

So it's not a strange thing that you and Eric have encountered in 1.70, but it is a general feature of Oolite for all users since 1.69.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

@Roberto. On the Texture there's no magic, the Navy Station is just using the normal textures for the docking bay and metal of the station used by all the native stations. However, when I took this screenie for the Wiki the copy of Oolite I was using had Sung's replacement textures installed (which replaces the normal ones with these custom ones). If you have this pack installed then all the stations which use native textures (Dodec Iso, Corollis etc look like this), Note to self: Better update the pic on the Wiki with a pic from Oolite 1.70 to avoid confusing peeps like this! :wink:
Last edited by LittleBear on Thu Dec 06, 2007 7:10 am, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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 »

@ Roberto: First of all the Taranis station should always have spewn out the occasional ship (and I'm sure it did and does!), because that's a behavior hard-coded to everything that is a station or a carrier. Before 1.70 you couldn't even prevent it from doing so.

Since 1.70 there is the shipdata-key has_npc_traffic, which can be set to false in order to make sure that a station doesn't spit out anything, which sometimes can be a desired behaviour (e.g. if you want to script an abandoned station that the player has to dock with). The default, however, is set to true. So without explicitely setting it to false in shipdata, the Taranis station should and will spew out the usual suspects, Adders, Worms, Transporters, trader-ships of all kinds. (Strange observation said aside: Since in another thread we talked about Thargoid Carriers being able to spew exactly these usual ships, but never actually doing it, the Thargoid Carriers in my Oolite spew yellow blips every single time I encounter them.)

So if you want some traffic going on around your station, you don't have to do anything. It just happens.

Eric's suggestion comes into consideration when and if you are not happy with the usual Transporters and Worms being spewn out, but want to specifically spew it a custom ship. So only then you need a modification to the AI and to define your spew-ship of choice. And if you want only this ship to be spewn, you have to set has_npc_traffic to false as well.

And finally a remark to your AI: Now it's never going to return to the IDLE state or otherwise leave the TRAFFIC state, unless it's attacked. Is this intentional?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

matt634 wrote:
Eric and I have both experienced this problem and it is related to 1.70 - for some reason its more sensitive to the cache than previous versions. For a change in the addon folder to take effect make sure you press and hold "shift" while Oolite is loading.
I disagree with this characterization. The cache in Oolite 1.65 basically did not notice changes to the Add-Ons folders at all; the only way to flush the cache was to manually delete it. On the other hand, it only cached models, not plists.

Oolite 1.70 (and 1.69) does notice changes to the Add-Ons folders (specifically, items added or removed or modification dates changed), but it doesn’t look inside OXPs. I maintain that this is exactly the correct trade-off for normal end users who do not modify the contents of their OXPs. However, I recognize an option to be more sensitive or always flush the cache would be useful to OXP-makers.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Thanks guys :)

OK, now I know where those textures are! And I'll remember to keep flushing the cache.

I imagine the reason why the HQ doesn't spawn ships automatically is because it doesn't have the role "station". I'm reluctant to include this, as I suspect it'll have lots of unforeseen effects (plus I'd have to put something like "station(0.0001)" to reduce the odds of it replacing a system station, right?). In any case, with the cache flushed, and an adjustment to the dice-rolling, I have now got it spawning my test ships. Unfortunately, though, something else is now puzzling me!

My TRAFFIC AI state looks like this...

Code: Select all

    TRAFFIC = { 
        ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "OFFENCE_COMMITTED" = (setTargetToFoundTarget, "markTargetForOffence: 15", launchDefenseShip, increaseAlertLevel); 
        ENTER = (); 
        EXIT = ();
        "INCOMING_MISSILE" = (fireECM, increaseAlertLevel, setTargetToPrimaryAggressor, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "ROLL_1" = ("launchShipWithRole: taranis_traffic");
        UPDATE = ("rollD: 5", "pauseAI: 20.0"); 
    }; 
...and seems to generate a reasonable amount of "traffic". However, there's no reason why traffic shouldn't be generated when the player's out of scanning range, so I added some dice-rolling to IDLE too (IDLE being the state the AI should go to first, as GLOBAL sends it there):

Code: Select all

   IDLE = { 
        ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "OFFENCE_COMMITTED" = (setTargetToFoundTarget, "markTargetForOffence: 15", launchDefenseShip, increaseAlertLevel); 
        ENTER = (); 
        EXIT = (); 
        "INCOMING_MISSILE" = (fireECM, increaseAlertLevel, setTargetToPrimaryAggressor, launchDefenseShip, "sendTargetCommsMessage: [taranis-warning]", "setStateTo: DEFENSE_MODE"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, "pauseAI: 5.0", "sendTargetCommsMessage: [taranis-greeting]", "setStateTo: TRAFFIC"); 
        "ROLL_1" = ("launchShipWithRole: taranis_traffic");
	UPDATE = ("rollD: 5", decreaseAlertLevel, "scanForNearestShipWithRole: player"); 
    }; 
For some reason, now the station is spewing out test ships about every five seconds, which doesn't make any sense to me at all! OK, it *would* make sense if the AI were stuck in IDLE, as I've forgotten to add a pause there (will do in a second), but I'm only getting one greeting message, which suggests it's going from IDLE to TRAFFIC as it should. Anyone know why my AI is apparently developing its own intelligence? :)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Roberto wrote:
(plus I'd have to put something like "station(0.0001)" to reduce the odds of it replacing a system station, right?)
This at least is not a problem. The system setter-upper uses the roles “coriolis”, “dodecahedron” and “icosahedron” to select stations.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Ah - I didn't know that. But I assume "station" has other effects aside from generating traffic, right?

The AI does definitely seem to be "stuck" in IDLE (unless fired upon) - despite sending me only one greeting message. I'm scratching my head 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 »

Roberto wrote:
Ah - I didn't know that. But I assume "station" has other effects aside from generating traffic, right?
Yes it has other side effects, and yes, you definitely need these side effects. It will have influence on your station orientation. But it also unlocks the station commands like: increseAlertLevel, launchDefenseShip.

And as Ahruman said, you can just include "station" as role without the (0.00001) as nobody will call for a station by this role. (You don't know what type of station you than will get).
Roberto wrote:
The AI does definitely seem to be "stuck" in IDLE (unless fired upon) - despite sending me only one greeting message. I'm scratching my head here...
Ah Ahruman put a very powerful debugging tool in for this. "Target_key_dump". Select the target, press capital "H" and look inside Oolites logfile. You will see a lot of the ships characteristics, including the AI state it is in.

Your IDLE state definitively needs a pause. Now it is constantly launching ships until you arrive. But there is a minimum spacing between launches. So when you arrive is switches states, but there remains a long launching cue until all ships from the previous state are out.

Further, increasing AlertLevels makes only sense when you do what with the results YELLOW_ALERT and RED_ALERT

Further there is a hidden bug. On greeting the player you set him as the primary target to be able to send the message. But in TRAFFIC you use the command "setTargetToPrimaryAgressor". This will have a 25% chance of switching to the new target that attacks you station. The other 75% of the times it remains the old target (which is the player) and he will attack the player no matter he had done anything wrong. So it should be "setTargetToFoundTarget". In general: be very selective with the use of "setTargetToPrimaryAgressor" because of the build in chance factor.
EDIT: On second thought I think it works as intended because the change function is only active when it is attacking, otherwise it always switches. But I had some trouble with this function in the past leading to attacks on unwanted objects.
Ahruman wrote:
Oolite 1.70 (and 1.69) does notice changes to the Add-Ons folders (specifically, items added or removed or modification dates changed), but it doesn’t look inside OXPs.
I have always seen this as a feature to speed up the startup. But in 1.69 I had never witnessed the effects. I always changed AI, script and shipdata plist and changes were always recognized immediately. So I thought it is just not happening with my system setup.
Last edited by Eric Walch on Thu Dec 06, 2007 10:30 pm, edited 1 time in total.
User avatar
Captain Hesperus
Grand High Clock-Tower Poobah
Grand High Clock-Tower Poobah
Posts: 2312
Joined: Tue Sep 19, 2006 1:10 pm
Location: Anywhere I can sell Trumbles.....

Post by Captain Hesperus »

Ahruman wrote:
The system setter-upper
Oh, Ahruman. I do wish you wouldn't use such hi-tech words, they baffle me....:wink:

Captain Hesperus
The truth, revealed!!
Image
User avatar
matt634
Deadly
Deadly
Posts: 206
Joined: Tue Mar 21, 2006 6:32 pm
Location: Colorado, USA

Post by matt634 »

Eric and I have both experienced this problem and it is related to 1.70 - for some reason its more sensitive to the cache than previous versions. For a change in the addon folder to take effect make sure you press and hold "shift" while Oolite is loading.
Sorry, Ahruman

I didn't mean to intimate that the "problem" was 1.70. The problem was most certainly ME! I was trying to highlight the new sensitivity (a good thing to be sure) of cache and how it effects testing of OXPs. I am admittedly ignorant of 1.69 and how it functioned other than what I've read on the boards, so my comparison was to 1.65 :oops:
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Captain Hesperus wrote:
Ahruman wrote:
The system setter-upper
Oh, Ahruman. I do wish you wouldn't use such hi-tech words, they baffle me....:wink:
Well, the correct name is -[Universe setUpSpace].
User avatar
Captain Hesperus
Grand High Clock-Tower Poobah
Grand High Clock-Tower Poobah
Posts: 2312
Joined: Tue Sep 19, 2006 1:10 pm
Location: Anywhere I can sell Trumbles.....

Post by Captain Hesperus »

Ahruman wrote:
Well, the correct name is -[Universe setUpSpace].
Ah, now I understand. ;-)

Captain Hesperus
The truth, revealed!!
Image
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

@Eric.

That explains why the Space Bar wasn't launching defense ships! Doh! I made a templete for the Bar (which includes the role station) but (so that each bar has its own name on the ID computer) the ones in came are all like-shiped to the template. BUT I only came them their custom role in the like ship version!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Post Reply