Page 1 of 11
Just when I thought I was out...
Posted: Thu Dec 06, 2007 12:22 am
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...
Posted: Thu Dec 06, 2007 1:42 am
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.
Posted: Thu Dec 06, 2007 6:53 am
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.
Posted: Thu Dec 06, 2007 7:05 am
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!
Posted: Thu Dec 06, 2007 7:10 am
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?
Posted: Thu Dec 06, 2007 10:13 am
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.
Posted: Thu Dec 06, 2007 4:38 pm
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?
Posted: Thu Dec 06, 2007 5:02 pm
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.
Posted: Thu Dec 06, 2007 5:16 pm
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...
Posted: Thu Dec 06, 2007 8:09 pm
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.
Posted: Thu Dec 06, 2007 9:34 pm
by Captain Hesperus
Oh, Ahruman. I do wish you wouldn't use such hi-tech words, they baffle me....
Captain Hesperus
Posted: Thu Dec 06, 2007 9:34 pm
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
Posted: Thu Dec 06, 2007 9:53 pm
by JensAyton
Captain Hesperus wrote:
Oh, Ahruman. I do wish you wouldn't use such hi-tech words, they baffle me....
Well, the correct name is -[Universe setUpSpace].
Posted: Thu Dec 06, 2007 10:49 pm
by Captain Hesperus
Ahruman wrote:
Well, the correct name is -[Universe setUpSpace].
Ah, now I understand.
Captain Hesperus
Posted: Thu Dec 06, 2007 11:13 pm
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!