Unknown keys

General discussion for players of Oolite.

Moderators: winston, another_commander

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Unknown keys

Post by Chaky » Mon Nov 16, 2009 12:27 am

As I was goung through those logs I posted earlier today, I can't help but to think that alot of OXP makers are using non-existing keys:

has_energy_unit
likely_scavengers
port_weapon_type
starboard_weapon_type


.. the list goes on and on.

User avatar
Commander McLane
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane » Mon Nov 16, 2009 9:45 am

Yes, there are many guys who just work on "The Principle of Hope".

So they come up with keys of themselves, just hoping that they might actually do something (I think Charlie was particularly fond of this, but I could be wrong).

Anyway, apart from creating error messages with the OXP verifyer, non-existing keys don't do any actual harm. So it is not a very urgent problem.

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid » Mon Nov 16, 2009 12:41 pm

A number are also due to like_ship and is_template. The use of the former for example to make player ships from NPC ships (or vice-versa) can introduce invalid keys into one from the other. And is_template doesn't seem to be parsed correctly at the moment, for example on name key requirements and such.

But as McLane correctly says, in most cases it's nothing to worry about. Although there are some in the logs which are genuine errors (bouy rather than buoy in a couple of places for example).

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Unknown keys

Post by Eric Walch » Mon Nov 16, 2009 1:25 pm

Chaky wrote:As I was goung through those logs I posted earlier today, I can't help but to think that alot of OXP makers are using non-existing keys:

has_energy_unit
likely_scavengers
port_weapon_type
starboard_weapon_type.
As others already remarked, most warnings are harmless. Some, like "max_missiles" and "port_weapon_type" were even present in oolite 1.65 own shipdata for npc ships. And I assume a lot of ship creators just copied those entries not realising those keys were not used in the original. And even when it was known that they were not used, there could have been future plans to use them so they were just added to be on the sure side. The shipdata.plist on the wiki is only 3 years old. Before ship designers had no real database that contained valid keys so most were just copied from existing work and others were just added because of likelihood with existing keys.

Even when the most are harmless, your list does contain some more serious errors and all real errors/warnings should be removed on a next release of those oxp's.
Last edited by Eric Walch on Mon Nov 16, 2009 9:10 pm, edited 1 time in total.

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky » Mon Nov 16, 2009 8:55 pm

Well, since "is_template" doesn't get parsed, I can't really trust OXP-Verify code, right?

I intend to implement shipdata.plist-purging feature to my baby and use OXP-Verify as internal check.

Since there are allot of benign warnings (like "max_missiles not used for this kind of ship") that clog the logs, I want to make it automatically purge as much as possible those ever-repeating errors, leaving "real" problems to be solved manually.

The problem is, it is not reliable as it should be, and I don't want to make a piece of code that kills OXPs...

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 » Mon Nov 16, 2009 9:07 pm

Contributions welcome. ;-)

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky » Mon Nov 16, 2009 9:13 pm

Another valid key not parsed:

scan_class

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 » Mon Nov 16, 2009 9:25 pm

Chaky wrote:Another valid key not parsed:

scan_class
Fixed in r2754.

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky » Mon Nov 16, 2009 9:54 pm

Ahruman wrote:Fixed in r2754.
Thanks for the info.


Seems like the "principal of hope" applies to "scanClass" types too.. and heavly.

CLASS_HOSTILE
CLASS_MINE
CLASS_NEUTRAL
CLASS_NONE
CLASS_SHIP
...

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 » Mon Nov 16, 2009 10:13 pm

Chaky wrote:Seems like the "principal of hope" applies to "scanClass" types too.. and heavly.
...
CLASS_MINE and CLASS_NEUTRAL are real scan classes. CLASS_MINE does definitely set the correct scan_class for a mine and is needed when spawning a mine by script. And CLASS_NEUTRAL is just the default value (yellow lollypops) when no class is defined so it is not needed.

There are probably much more things missing as that file used by the verifier is not really updated recently while a lot of new keys were added.
Last edited by Eric Walch on Mon Nov 16, 2009 10:22 pm, edited 1 time in total.

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky » Mon Nov 16, 2009 10:16 pm

In that case Wikipages should be updated...
.. and OXP Verify code, for that matter.

OXP Verify mentions "CLASS_NOT_SET" as valid scan class. Same as "NEUTRAL"?

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 » Mon Nov 16, 2009 10:24 pm

Chaky wrote:In that case Wikipages should be updated...
.. and OXP Verify code, for that matter.

OXP Verify mentions "CLASS_NOT_SET" as valid scan class. Same as "NEUTRAL"?
No, with CLASS_NOT_SET you don't get the "clean/hostile" status.

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 » Mon Nov 16, 2009 10:28 pm

Actually, the default is not CLASS_NEUTRAL, it’s CLASS_NOT_SET. There are several classes which can be set here but which are not supported, and which may cause problems if used. The supported classes are:
  • CLASS_NOT_SET
  • CLASS_BUOY
  • CLASS_CARGO
  • CLASS_MILITARY
  • CLASS_MISSILE
  • CLASS_POLICE
  • CLASS_ROCK
  • CLASS_STATION
  • CLASS_THARGOID
Note: CLASS_MINE is not on the list because a mine’s class is always set when it’s launched, but a missile doesn’t have to be CLASS_MISSILE (notably, it can be CLASS_THARGOID).

Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky » Mon Nov 16, 2009 10:39 pm

So, if someone is to make a ship with "CLASS_MISSILE" as scan class, it will not be shown as missile on scanner?.. or does that apply only to entries with role "missile"?

What if missile with scan class of, say, "CLASS_NOT_SET" is used? Will that still be shown as missile on scanner?

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 » Mon Nov 16, 2009 11:04 pm

Chaky wrote:So, if someone is to make a ship with "CLASS_MISSILE" as scan class, it will not be shown as missile on scanner?.. or does that apply only to entries with role "missile"?
As it stands, I believe it will.
Chaky wrote:What if missile with scan class of, say, "CLASS_NOT_SET" is used? Will that still be shown as missile on scanner?
That would invoke undefined behaviour. (It would be sensible for CLASS_NOT_SET to be treated as CLASS_MISSILE when a missile is launched, but it isn’t currently. It looks as though it would currently be yellow on the scanner.)

Post Reply