Page 1 of 1

Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 11:00 am
by Smivs
Can someone explain...

There are effectively two varieties of Python pirate, the regular python which (in the shipdata.plist) has a role of 'pirate' as well as 'trader' and also the Blackdog which is exclusively pirate. The Blackdog has what seems to be a unique role in shipdata.plist, namely 'Pirate Blackdog' (which in older versions of Oolite was 'pirate oolite-python-blackdog').
Does this unique role give the Blackdog any special qualities over and above the 'normal' pirate role such as the frequency they may appear, or even things like the number and types of escort ships it has etc? Can the 'Pirate Blackdog' role be applied to other ships (eg Boa) and what would the effect be (other than the obvious one of making them into pirates)?

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 11:34 am
by Commander McLane
You're welcome:

The Blackdog does have a unique role, namely 'blackdog'. The other role is the ordinary 'pirate'. (So it's two roles, not one, just like 'trader pirate' with the other variant. The 'SPACE' is a separator.)

This means that it won't be used as a 'trader', but only as a 'pirate'.

Why its unique role remained when the unique roles of all the other ships got swiped is anybody's guess. My personal guess is 'oversight'. :wink: (However, the cobra3-alternate also kept its equally useless 'cobra3-alternate' role. OTOH, the cobramk1-alt did not. The powers that be may have had an intention with that. Or not. Seems all very random to me.)

This gives you the power to specifically spawn a Blackdog variant using the 'blackdog' role. I don't think that this is done anywhere. You will only see the ship as a simple 'pirate'.

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 12:10 pm
by Smivs
Thanks McLane, that's interesting.
Still not sure what the Blackdog does different though....maybe I'll have a play around and spawn some as Pirates and some as Blackdogs - see if I can see any difference.

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 1:45 pm
by Commander McLane
The alternative role (in this case unique, but you could also add more roles, shared by certain subsets of ships) doesn't change a bit in the ship's behaviour. It's simply an alternative way and means to spawn it.

If you use the 'Create Ship' command from the Debug menu and enter 'pirate' (or use any other means of spawning a ship close to your own position), you will see any ship having the role 'pirate' among its roles appearing somewhere near you. May be an Asp or Mamba, a Cobra III or a Python, or any other ship fitting the role. But each of them will have its pre-defined stats (from shipdata) and pirateAI. So if the random ship selector happens to draw a Python Blackdog from the big bag of ships, you'll see that one.

If you use the 'Create Ship' command again, but this time enter 'blackdog', you will see a Python Blackdog (and only a Python Blackdog; this time no Asp or Cobra possible) appearing somewhere near you. Again, it will have the same stats as it would have in the first case, and pirateAI (that's because this is the pre-defined AI in its shipdata; if it had another AI defined, it would be spawned having that AI).

Given that in the first case the Blackdog would be the ship selected by the selector, you as player would see no difference whatsoever to the second case.

There is a notable difference, if you look a little deeper. In the first case, the ship would have 'pirate' as its primary role, and 'blackdog' as its secondary role. In the second case it would have 'blackdog' as its primary role, and 'pirate' as a secondary role. This doesn't automatically lead to different behaviour. It would make a difference, if for instance a script would count all ships currently in the system with a primary role of 'pirate'. The first ship would be counted, the second one wouldn't. It isn't too hard to imagine cases where this would have practical consequences. For instance you could have (and use) a missile that has an in-built safety in the form that it would only detonate if aimed at a 'pirate' ship (no such missile exists to my knowledge, but it could be created—I'm leaving the idea to be picked up). This missile would be effective in the first case, but useless in the second case.

It is possible to overcome this difference. If a script wants to spawn a ship with a unique role (simply to make sure that no other ship can be chosen by the random selector), but wants it to be indistinguishable from the standard ships once spawned, it can change it's primary role to one of the standard roles on spawning. The role used to spawn it will then automatically become one of its secondary roles (all roles specified in shipdata which are not currently the primary role become secondary roles anyway).

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 2:52 pm
by Smivs
I see (I think).
So the populator will call a 'Pirate' and any pirate (including the Python Blackdog) could be called, but from time to time it will call a 'Blackdog' and then of course only a 'Blackdog' can be used. If I invented a Boa Blackdog, and the populator calls for a 'Blackdog', then it would choose between the pre-existing Python Blackdog and the 'new' Boa Blackdog.
Is that it?

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 8:32 pm
by Commander McLane
No, not quite yet.

I was talking about you spawning a ship with one of the script methods (which you can use through the Debug menu, the console, or by putting a script into your AddOns folder).

The populator (the part of Oolite's engine which creates a system around you whenever you jump or launch) only knows and uses the generic roles:
  • 'trader'
  • 'hunter'
  • 'police'
  • 'pirate'
  • 'escort'
  • 'wingman' (same as 'escort', but for police ships; you wouldn't want a Viper to be escorted by Mambas)
  • 'thargoid'
  • 'coriolis'
  • 'dodecahedron' (could be one of the other roles; I'm not sure)
  • 'icosahedron' (ditto)
    (of the three roles above, only one is actually spawned in each system; the populator chooses which one depending on a pseudo random number, therefore it will be consistently the same role in any given system)
  • 'buoy' (for the station buoy)
  • 'buoy-witchpoint' (for the witchpoint buoy)
  • 'asteroid'
  • 'rockhermit'
This list is complete. No other role is ever used by the populator to spawn ships.

Other than these, the populator knows and uses the following roles for ships that are not spawned during system creation, but launched by stations later during gameplay under certain conditions:
  • 'miner'
  • 'shuttle'
  • 'scavenger'
And that's all the populator knows and does.

Any additional roles are purely for the purpose of scripts, and spawning ships via a script.

Example: let's say you wanted to create a group of three pirates at the witchpoint, each time the player jumps into a new system. But for some reason these groups shall only be composed of Mambas, Asps, and one ship you have designed yourself. You don't care whether each group is made of each of the individual ships, or sometimes it's going to be two Asps and a Mamba, and other times three of your ships. All that doesn't matter, your only condition is that there never be a Python or Cobra among them. What would you do? You would give each of the ships a new, custom role (of course the same custom role for all three of them), like 'smivs-pirate-triple'. Then you would write a script which adds three ships with role 'smivs-pirate-triple' each time the player is leaving witchspace. The game engine will look through all role definitions, find three ships which have the necessary role, and choose one of them, three times in a row.

But the populator is completely unaware of your shiny new custom role, and will never use it for anything.

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 9:11 pm
by Smivs
Thanks,
That's one reason I asked, because I wasn't aware of the 'Blackdog' role. If I understand (I really should stop trying to understand...it never works!) in the 'normal' game, the 'Blackdog' has no significance at all. It simply doesn't do anything.

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 9:18 pm
by Commander McLane
Smivs wrote:
If I understand (I really should stop trying to understand...it never works!) in the 'normal' game, the 'Blackdog' has no significance at all. It simply doesn't do anything.
Yep. That's about what I was trying to say in my first reply. (Seems we needed a slight deviation in-between to really get to that point 8) .)

Re: Unique 'role' for Python Blackdogs?

Posted: Mon Jan 10, 2011 11:22 pm
by Switeck
Commander McLane wrote:
For instance you could have (and use) a missile that has an in-built safety in the form that it would only detonate if aimed at a 'pirate' ship (no such missile exists to my knowledge, but it could be created—I'm leaving the idea to be picked up). This missile would be effective in the first case, but useless in the second case.
The military missile attempts to find pirate targets after being ECM'ed.

Re: Unique 'role' for Python Blackdogs?

Posted: Tue Jan 11, 2011 12:12 am
by JensAyton
Commander McLane wrote:
Any additional roles are purely for the purpose of scripts, and spawning ships via a script.
…except “1t-cargopod”, “alloy”, “boulder”, “cinder”, “escape-capsule”, “hermit-ship”, “interceptor”, “oolite-unknown-ship”, “splinter”, “sunskim-trader” and “wreckage”. (OK, “cinder” doesn’t count since it’s new in trunk.) Oh, and subentity and missile roles.

Re: Unique 'role' for Python Blackdogs?

Posted: Tue Jan 11, 2011 8:26 am
by Eric Walch
Some of the roles are explained on the wiki. Maybe that list should get completed by the additional roles from Ahrumans post.

Re: Unique 'role' for Python Blackdogs?

Posted: Tue Sep 18, 2012 1:31 am
by Wildeblood
BUMP*

Is there a definitive list of all the roles used by Oolite 1.76.1? Possibly with an accompanying statement that if your brilliant new model doesn't have a role on this list, it will never appear in-game unless you script it. Possibly with an accompanying statement that you don't need to script it, if you learn to use roles properly. A definitive list of all the roles? Anywhere?

I'm particularly intrigued to know why cargo pods have both a "cargopod" and "1t-cargopod" role, and whether there are other roles relating to cargo pods?

* Is it still thread necromancy month, or did that fad blow over?

Re: Unique 'role' for Python Blackdogs?

Posted: Tue Sep 18, 2012 6:58 am
by Eric Walch
It should have been on the [wiki]Role[/wiki] page. But it is not, only roles of flying ships are listed there. It would be a good page to also add the various station, cargo, debris etc roles.
1t-cargopod is a special role that is used to put the commodities in for the player ship on launch.

Commodity names, like Food, Textiles etc, are also used a role. Whenever a ship explodes, a formula decides which type of commodities are released. When it decides that it needs to release Food it has a 50% change of selecting a pod with role Food and a 50% change of selecting a pod with role cargopod. This mechanism allows for certain commodities being put in specific pods. :)
[wiki]Cargo_Wreck_Teaser_OXP[/wiki] makes use of this feature.
NB Only the internal mechanism can call pods by commodity role. Doing it by script will not fill them. :wink:

I must say that this part was already present in Oolite 1.65 but never realy documented. :?

Re: Unique 'role' for Python Blackdogs?

Posted: Tue Sep 18, 2012 11:45 am
by Shipbuilder
Other roles also include escape_pod and turret