Page 1 of 2

It's confirmed, there's a bug in Random Hits

Posted: Wed Aug 06, 2008 11:12 pm
by Cmdr Wyvern
Every once in awhile, I'm attacked leaving the seedy bar on a contract.

- It's a random attack, and doesn't happen often.
- It's always by two ships that for some reason don't appear on the scanner, and I can't get a missile lock on.
- It's random types of ships, yet always two of the same class.
- They're NOT cloaked, I can see them clearly with none of the cloaked ship flickering effects. Not ghosts either, I can shoot them with my lasers.


This time I was able to confirm they're bounty hunter ships from Random Hits. It was a pair of Ferdys, and I forced them to use their escape pods. When they bailed, I was able to get missile locks, and on both ships the STE showed 'Fer-de-lance (Gunslinger)'.

Running RH on Oolite 1.71.2, Win XP

Re: It's confirmed, there's a bug in Random Hits

Posted: Thu Aug 07, 2008 7:25 am
by Eric Walch
Cmdr Wyvern wrote:
Every once in awhile, I'm attacked leaving the seedy bar on a contract.
- They're NOT cloaked, I can see them clearly with none of the cloaked ship flickering effects. Not ghosts either, I can shoot them with my lasers.
Not sure if this is a bug. oolite also support an other kind of "cloaking". Not really cloaking, but just jamming the radar. probably one type of LB's ships has that equipment on board. Also in UPS and Local Hero there are some ships that have it on board. It's normal behaviour, just seldom used. (There exists even an counter-measurement for this so the player can see them again.) It just needs an idea to use these equipment in a sensible way by a mission OXP.

Posted: Thu Aug 07, 2008 5:04 pm
by LittleBear
I haven't given any of the Random Hits ships the Military Jammer in shipdata. Also all random hits ships have custom roles but no native roles, so should only appear when added by Script rather than the in-built system populator. The only exception to this is the NPC bounty hunters that the Bar launches if attacked or to intercept pirates / thargoids / offenders. These all have the role "random_hits_patrol". I haven't given any Military Jammers. But when bounty hunters are flying a native ship (eg a Fer de Lance), I have like_shiped to the native version. Although a "random_hits_patrol" ship will only appear when launched by a Bar in response to detecting bad guys once they've cleaned up the town, about 10% will go off on a long patrol. The rest will just scoop up any cargo lying about and jump out. You could therefore encounter a random_hits_patrol ship in the space lanes, but I don't understand how it could be cloaked. A random hits patrol Cobra III for example is just the standard in build ship (but better armed and with a custom AI). Puzzeling.

The fact that both those Fer-de-lance ships had a rank (Gunslinger) after their names means they were random hits patrol ships. I can only assume that the native game does give Fer-de-lance ships a chance of having a jammer. So not really a bug, as my intention was to have the bounty hunter piolt use a ship that anybody could use, but I didn't know that this meant they could somtimes have the jammer. Was there behaviour OK? IE:- They should never fire on Clean Commanders (unless attacked) or they spot you committing an offence.

Edit: Mmm I checked the native entry for the Fer de Lance and it has no key for Military Jammer. Is it an inbuilt feature of Oolite that there is a chance of any ship doing this? I can't see anything in my Shipdata that would cause this. Here's the entry for the Fer-de-Lance hunters:-

Code: Select all

<key>random_hits_patrol_ferdelance</key>
<dict>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitspatrolAI.plist</string>
</array>
<key>like_ship</key>
<string>ferdelance</string>
<key>name</key>
<string>Fer de Lance (Sheriff)</string>
<key>roles</key>
<string>random_hits_patrol</string>
<key>ai_type</key>
<string>randomhitspatrolAI.plist</string>
<key>bounty</key>
<string>0</string>
<key>scanner_range</key>
<real>25000</real>
<key>forward_weapon_type</key>
<string>WEAPON_MILITARY_LASER</string>
<key>aft_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>has_shield_booster</key>
<real>0.95</real>
<key>has_shield_enhancer</key>
<real>0.85</real>
<key>has_escape_pod</key>
<real>0.99</real>
<key>has_fuel_injection</key>
<real>0.95</real>
<key>fuel</key>
<integer>5</integer>
<key>has_ecm</key>
<real>0.99</real>
<key>has_scoop</key>
<real>1.0</real>
<key>missiles</key>
<integer>2</integer>
<key>unpiloted</key>
<false/>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>

<key>random_hits_patrol_ferdelance1a</key>
<dict>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitspatrolAI.plist</string>
</array>
<key>like_ship</key>
<string>random_hits_patrol_ferdelance</string>
<key>name</key>
<string>Fer de Lance (Enforcer)</string>
<key>roles</key>
<string>random_hits_patrol</string>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>

<key>random_hits_patrol_ferdelance1b</key>
<dict>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitspatrolAI.plist</string>
</array>
<key>like_ship</key>
<string>random_hits_patrol_ferdelance</string>
<key>name</key>
<string>Fer de Lance (Hunter)</string>
<key>roles</key>
<string>random_hits_patrol</string>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>

<key>random_hits_patrol_ferdelance1c</key>
<dict>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitspatrolAI.plist</string>
</array>
<key>like_ship</key>
<string>random_hits_patrol_ferdelance</string>
<key>name</key>
<string>Fer de Lance (Provost)</string>
<key>roles</key>
<string>random_hits_patrol</string>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>

Edit Again. Grr should have read your post better!

The fact that it has gunsliger after its name means that it was a victim's escort. The will appear in groups (but should only appear near a victim). Sometimes though they get separated if a Victim flees an NPC attack. However, this ship should ONLY be encounted if you have a random hits mission running and are in the system where the victim is. Were you? This still doesn't explain the Cloaking, but this ship definatley should not be appearing except with a victim. This is the entry:-

Code: Select all

<key>random_hits_escort27</key>
<dict>
<key>like_ship</key>
<string>random_hits_patrol_ferdelance</string>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitsescort27AI.plist</string>
</array>
<key>roles</key>
<string>random_hits_escort27</string>
<key>ai_type</key>
<string>randomhitsescort27AI.plist</string>
<key>bounty</key>
<string>57</string>
<key>name</key>
<string>Fer de Lance (Gunslinger)</string>
</dict>

Posted: Thu Aug 07, 2008 6:02 pm
by Cmdr Wyvern
LittleBear wrote:
Was there behaviour OK? IE:- They should never fire on Clean Commanders (unless attacked) or they spot you committing an offence.

The fact that it has gunsliger after its name means that it was a victim's escort. The will appear in groups (but should only appear near a victim). Sometimes though they get separated if a Victim flees an NPC attack. However, this ship should ONLY be encounted if you have a random hits mission running and are in the system where the victim is. Were you? This still doesn't explain the Cloaking, but this ship definatley should not be appearing except with a victim.
They behave normally in combat, except for having the jammer.
And I'm Clean. I'd never be able to approach the bar for docking if I'm Offender or Fugitive.
As I mentioned, the attacks happen at random times, by random classes of ships, but always as I'm leaving the bar, and always in pairs. And they always fire on me first. Usually I've accepted a contract when the attack occurs. Often I have to make several jumps across the galactic map to attack the victim, so this happens well before I engage my contracted target.
Before the Ferdys, it was a pair of Cobra 2-X, and before that a pair of Cobra 3s.

Posted: Thu Aug 07, 2008 6:21 pm
by LittleBear
Ok thats definatley a bug, but I'm stumped as to what's causing it!

It looks like whats happening is that for some reason 2 ships with the role "random_hits_escort" are being added near a bar. There's nothing in my script that does this and the only ships with "random_hits_escort" as there escort ship are Random Hits Victims. I can't think of anything in the OXP that would cause this. Is it a bug in Oolite itself? Or is there something in my shipdata that's causing it. Each Victim Ship (50 different Victim Ships in the OXP and their behaviour is randomised by their AIs). Each one has an entry like this:-

Code: Select all

<key>random_hits_mark_phaze</key>
<dict>
<key>like_ship</key>
<string>random_hits_patrol_phaze</string>
<key>launch_actions</key>
<array>
<string>switchAITo: randomhitsmark3aAI.plist</string>
</array>
<key>script</key>
<string>oolite-random-hits-mark41.js</string>
<key>escorts</key>
<integer>6</integer>
<key>escort-ship</key>
<string>random_hits_escort27</string>
<key>forward_weapon_type</key>
<string>WEAPON_MILITARY_LASER</string>
<key>aft_weapon_type</key>
<string>WEAPON_MILITARY_LASER</string>
<key>name</key>
<string>Purple Haze (Contract Target)</string>
<key>bounty</key>
<integer>78</integer>
<key>roles</key>
<string>random_hits_mark_phaze</string>
<key>ai_type</key>
<string>randomhitsmark3aAI.plist</string>
<key>has_energy_bomb</key>
<real>0.99</real>
<key>has_shield_booster</key>
<real>0.99</real>
<key>has_shield_enhancer</key>
<real>0.99</real>
<key>has_escape_pod</key>
<real>0.0</real>
<key>has_fuel_injection</key>
<real>0.99</real>
<key>fuel</key>
<integer>47</integer>
<key>has_ecm</key>
<real>0.99</real>
<key>has_scoop</key>
<real>0.99</real>
<key>missiles</key>
<integer>4</integer>
<key>missile_role</key>
<string>EQ_HARDENED_MISSILE</string>				
</dict>
The shipdata entry "random_hits_escort27" should only ever appear as an escort to the entry "random_hits_mark_phaze". As both entry's only have this custom role, they shouldn't ever appear without their mother. Is there somthing in my shipdata causing this wierdness ?


HHM could the fact that I've used the word "escort" in their role be causing Oolite to sometimes treat them as general escorts. That would explain why they're appearing when they shouldn't.

As a test could you open up the Random Hits shipdata. Then do a search and replace for "random_hits_escort" to "random_hits_markguard". That'll rename every role and entry to avoid the word escort. Can you give that a try and see if you meet them?

Posted: Thu Aug 07, 2008 8:23 pm
by Eric Walch
LB,

A role of "random_hits_escort" will not be seen as "escort". This is probably the Oolite bug were is sometimes selects the wrong ships. When you make an target dump of the ship you probably see that it has a new role in the role-list that was never defined in shipdata and it is added in that role. I have seen similar things often. e.g. when I sometimes shoot a rock, instead of a splinter, an other ship is generated. It has the scanclass of a splinter and a primary role of splinter. Everything else is of the other ship.

In this case it is probably mixed up with an item with scanclass "NO_DRAW" and a role of ???. This would be invisible on the radar because of its scanclass. Only problem is that you need a lock on the target to make the target dump to be sure of my hypothesis. When you just make an entity dump of all entities it will include the crucial information about the scanclass.

pause the game and press o (for object dump). In the log you will get all objects in the system in order from closest to the player.
e.g.

Code: Select all

		<DustEntity 0x517a000>{ID: 171 position: (0, 0, 0) scanClass: CLASS_NO_DRAW status: STATUS_ACTIVE} mass 0.00 (null)
  Oolite [universe.objectDump] -[Universe obj_dump] (Universe.m:575): -> Ent:2		<RingEntity 0x8411000>{ID: 234 position: (67153.7, -29193.7, 530264) scanClass: CLASS_NO_DRAW status: STATUS_EFFECT} mass 400000.00 (null)
  Oolite [universe.objectDump] -[Universe obj_dump] (Universe.m:575): -> Ent:3
Find your gost ships and look at the scanclass.

In my experience the bug shifts to an other location (other type of switch) by adding or removing oxp's. I assume there is a bug in the role selecting system. But as Ahruman is completely rewriting this for 1.72 this will probably get solved automatically (and new ones added??)

Posted: Fri Aug 08, 2008 1:54 am
by Cmdr Wyvern
I changed the random_hits_escort entries to "random_hits_markguard" as LB suggested, and so far so good. As the bug tries to do a random hit on me, time will tell if it worked.

If I get jumped by another pair of scan-proof ships upon launching from the bar, I'll do a dump.

Meanwhile, I found another possible bug. Some of the victims flying large cruisers, Pythons, Boas and Anacondas, launch "Worm robot fighters" like Thargoids launch Thargons. I'll assume these Worms are supposed to go inactive when the mothership gets destroyed? They don't, instead they act like fully independent, piloted ships.

Posted: Sat Aug 09, 2008 4:27 pm
by LittleBear
Nah. They Worms are meant to independant. They'll keep attacking even if their mother ship is destroyed.

Posted: Tue Aug 19, 2008 10:30 am
by tinker
While checking for what is causing my scaner problem I have got sidtracked onto checking my oxp's for case sensitive problems as Linux is case sensitive. I found this in RandomHits.oxp

asp2.dat textures used: asptesa.png file missing
mine_satellite.dat calls beatletex.PNG file is beatletex.png
navicengine.dat and navicengine2.dat textures used: icour_engine_nav_tex.png file missing
navicourier.dat textures used: imp_cour_nav_tex.png file missing

The case problem will not cause any problems other than on Linux systems but the others could. Hope this helps.

Posted: Tue Aug 19, 2008 11:24 am
by LittleBear
Oops. I'll include those in the next version. I thought I'd c&ped all the ship texture files in to avoid OXP inter-dependance. I'll mean if you don't happen to have Wolfwoods Varients and Imperial Courier installed, some of the Mark's ships will have blanks in their paintwork. Should be cosmetic rather than fatal, but I'll fix it for 1.3! Thanks. :wink:

Posted: Tue Aug 19, 2008 11:42 am
by tinker
No problem, just trying to help.

I also got this error message when I docked with a bar while an offender.

Code: Select all

2008-08-19 13:35:16.688 oolite[9097] [general.error.inconsistentState]: ERROR: status is STATUS_DOCKED, but dockedStation is nil; treating as not docked. This is an internal error, please report it.
at least I assume it was when I docked withthe bar.

Posted: Tue Aug 19, 2008 11:50 am
by LittleBear
Thinks thats a bug in Oolite, as its reporting an internal bug. If docked (and at a space bar and an offender) something nasty should happen to you.

Posted: Tue Aug 19, 2008 12:00 pm
by Commander McLane
LittleBear wrote:
Thinks thats a bug in Oolite, as its reporting an internal bug. If docked (and at a space bar and an offender) something nasty should happen to you.
...in the course of which you maybe get launched? This would be the best explanation for this error, but I don't have Random Hits, so I can't check it.

Posted: Tue Aug 19, 2008 12:13 pm
by tinker
Yep got a page of text telling me how bad I was, lost all my fuel and got launched.

Reported it here as the error said report it but not where to post, should I post it somewhere else?

Posted: Tue Aug 19, 2008 12:27 pm
by Commander McLane
Actually it's not harmful, and probably it has been fixed for the next release already.

Internally Oolite sets two vaiables: one for the current status (like STATUS_DOCKED, STATUS_IN_FLIGHT, STATUS_EXITING_WITCHSPACE), and one with the name of the station you're currently docked with (and lots of other flags and variables as well, of course). It seems that when you get auto-launched, the variable that stores the station name is reset, but for a very brief moment the status-variable remains STATUS_DOCKED, before it changes to STATUS_LAUNCHING. If (and I think only if) another script happens to check these two variables in this very moment, the engine notices that there is confusion and gives out the error message. Whatever would be done if you still would be docked isn't done. And factually that is correct behaviour, because you are not docked anymore.

I think the fix was to simply suppress the irritating error message.