Appearing, Then Disappearing Rock Hermits

For test results, bug reports, announcements of new builds etc.

Moderators: another_commander, winston, Getafix

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by Switeck »

Commander McLane wrote:
Starting Oolite:

Code: Select all

> S.shipsWithRole("rockhermit")
[[Station "Rock Hermit" "Rock Hermit" position: (13019.6, 9819.2, 88881.1) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT]]
...
Quitting and restarting again:

Code: Select all

> S.shipsWithRole("rockhermit")
[[Station "Rock Hermit" "Rock Hermit" position: (-57010, 198605, 282384) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT]]
Definitely totally random. Neither the number of rock hermits nor their position is in any way stable.
Edge question:
(Why) In flight?
Where is the Rock Hermit going...in such a hurry...that it's flying along?! :lol:

Sounds like if what Eric Walch said is correct...then there may be different asteroid group locations. If you got a Rock Hermit in the same group location, it might be very close to another Rock Hermit using the same asteroid group location. That might explain the not-so-rare case of me seeing asteroids near but almost never right AT the witchspace beacon...which sometimes include a Rock Hermit.
The asteroid number variation probably could be a little wider now, as I almost never see only 1 or 2 or more than about 12. (But if there's more than 12 in one general area, that probably should only happen in a relatively unpopulated system otherwise.)
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by cim »

Commander McLane wrote:
Eric Walch wrote:
It looks like the random generator is reset to the system seed just before adding the asteroid groups. So, the system should add the asteroid groups always at the same position and in the same size. Only if they are added is random for a given system.
If that's the intended behaviour, then it clearly doesn't work as intended:
Witchpoint-planet asteroid clusters are positioned using gen_rnd_number which works off the system seed. However, the placement selection formula also considers the total number of ship groups in the system (which isn't based on the system seed, and was calculated before the gen_rnd_number RNG reset), so this won't be consistent. According to the comments, all of these clusters, however many there are, are all supposed to be in the same region of the spacelane ... and it doesn't do that either.

Sun-planet asteroid clusters are just positioned randomly not based on the system seed. (It resets the gen_rnd_number seed, but then doesn't use gen_rnd_number for anything). There is no comment here that they are supposed to be concentrated in a single area of the spacelane, so I shall assume that they aren't.

Additionally, the formula for calculating whether a rock hermit actually appears depends on the number of asteroids in the group (more likely in larger groups) ... but the calculated number of asteroids is then not passed to the function which actually adds the asteroids, which then makes up a completely different number (with the same probability distribution of 2d6-1).

(The problem with comments that don't describe what the following code actually does is that it's hard to tell if the comment is correct and the code is buggy, or if the code has been intentionally changed but the comment hasn't been updated to follow it. So I shall experimentally change it to follow the comment and see if it looks better that way; if not I shall change the comment to follow the code...)
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Appearing, Then Disappearing Rock Hermits

Post by SandJ »

SandJ wrote:
I shall have to spend an hour or so re-loading the same system and see how long it takes to completely fill the space station with minerals, gold and platinum from freshly-restocked Rock Hermits. :twisted:
I did this last night and by stripping Rock Hermits of stock then saving and re-loading the game, I made 11,548 credits within one Oolite day and without leaving the system. I visited 6 different Rock Hermits during that time with between 0 and 3 in the system after each re-start.

I thought I needed to exit the game and re-enter; this morning I discovered I just need to re-load a saved game.

I have just had a go at re-loading the same saved game a number of times and here are the Rock Hermits that came up (including from last night's flying about) and are all from the same system on the same Ooniverse day:

Code: Select all

  19:18:27.200 [universe.objectDump]: Ent:  57  StationEntity "Rock Hermit" "Rock Hermit" position: (186461, 355951, 373818) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 406585 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  19:18:27.201 [universe.objectDump]: Ent:  69  StationEntity "Rock Hermit" "Rock Hermit" position: (222894, 374616, 379706) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 439625 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  20:14:40.998 [universe.objectDump]: Ent:   1  StationEntity "Rock Hermit" "Rock Hermit" position: (179853, 342404, 395794) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 2434.99 (visible: yes) mass 6.15497e+07 AI: rockHermitAI.plist:IDLE
  20:41:42.074 [universe.objectDump]: Ent:  71  StationEntity "Rock Hermit" "Rock Hermit" position: (-12787.1, -6572.77, 184515) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 495620 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  20:41:42.077 [universe.objectDump]: Ent:  92  StationEntity "Rock Hermit" "Rock Hermit" position: (203763, 340254, 391992) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 532254 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  20:41:42.078 [universe.objectDump]: Ent:  98  StationEntity "Rock Hermit" "Rock Hermit" position: (182093, 361481, 374477) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 554019 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  08:52:01.362 [universe.objectDump]: Ent:  26  StationEntity "Rock Hermit" "Rock Hermit" position: (193767, 345626, 391741) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 534554 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  08:53:43.214 [universe.objectDump]: Ent:  29  StationEntity "Rock Hermit" "Rock Hermit" position: (170024, 305343, 415200) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 483813 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  08:54:44.408 [universe.objectDump]: Ent:  19  StationEntity "Rock Hermit" "Rock Hermit" position: (153760, 271525, 446260) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 436494 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  08:54:44.410 [universe.objectDump]: Ent:  44  StationEntity "Rock Hermit" "Rock Hermit" position: (199415, 354995, 359690) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 560291 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  09:01:26.840 [universe.objectDump]: Ent:  28  StationEntity "Rock Hermit" "Rock Hermit" position: (173346, 321563, 413499) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 498956 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  09:01:49.732 [universe.objectDump]: Ent:  31  StationEntity "Rock Hermit" "Rock Hermit" position: (187830, 326677, 396632) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 514852 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
  09:02:49.065 [universe.objectDump]: Ent:  16  StationEntity "Rock Hermit" "Rock Hermit" position: (175439, 307129, 408635) scanClass: CLASS_ROCK status: STATUS_IN_FLIGHT range: 489687 (visible: no) mass 6.15497e+07 AI: rockHermitAI.plist:CHECK_FOR_ROCKS
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by Switeck »

I don't recall seeing asteroids very near the sun or very near the planet along the WP<->planet route. Are those zones excluded from possible placement?
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:

Re: Appearing, Then Disappearing Rock Hermits

Post by Commander McLane »

Switeck wrote:
I don't recall seeing asteroids very near the sun or very near the planet along the WP<->planet route. Are those zones excluded from possible placement?
It's possible that asteroids very close to the sun don't survive long enough for you to see them. However, I have repeatedly encountered asteroid fields very close to the planet, sometimes inside the station aegis. This happens usually when there are many asteroid fields on the WP-P route.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by cim »

Switeck wrote:
I don't recall seeing asteroids very near the sun or very near the planet along the WP<->planet route. Are those zones excluded from possible placement?
There's an exclusion on the planet route from the immediate vicinity of the witchbuoy, and a separate exclusion from the immediate vicinity of the planet. For a large planet, the exclusion zone near the witchbuoy will be larger, but the one near the planet will be smaller (as measured from the surface). Neither zone is necessarily particularly large, though, and in extreme cases they could be much less than scanner range, as their size depends on other factors. Hermits will not be placed within the last third of the witchpoint-planet route.

On the planet/sun route the route for asteroids starts at 6x planet radius and ends at 4.5x solar radius. Within that route, rock hermits do not appear in the third closest to the planet. So asteroids close enough to overheat should not be placed.
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: Appearing, Then Disappearing Rock Hermits

Post by Eric Walch »

cim wrote:
So asteroids close enough to overheat should not be placed.
At least not by the populator. Scripts still might do that, but generally they do that in combination with a station so you normally know they are script added.
cim wrote:
Witchpoint-planet asteroid clusters are positioned using gen_rnd_number which works off the system seed. ....
You are right, I didn't check the code through. I noticed it reset the seed value, so I just assumed it was to reset the random generator for the used numbers. But, as you write, it only resets the seed for he random positioning. And for the sun route, not even that and the whole seed resetting is an unused remnant of a C&P action.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by cim »

cim wrote:
(The problem with comments that don't describe what the following code actually does is that it's hard to tell if the comment is correct and the code is buggy, or if the code has been intentionally changed but the comment hasn't been updated to follow it. So I shall experimentally change it to follow the comment and see if it looks better that way; if not I shall change the comment to follow the code...)
"Consistently" placing the rock clusters doesn't make a lot of difference, since the number of rock clusters in the system is still completely random (and is often zero), as is their size and whether they have a hermit or not. I think I'll just fix up the comments here to be accurate, make the rock hermits actually appear in the larger clusters (won't change their frequency at all, just how many rocks they have nearby) and leave it at that.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by Switeck »

Commander McLane wrote:
Switeck wrote:
I don't recall seeing asteroids very near the sun or very near the planet along the WP<->planet route. Are those zones excluded from possible placement?
It's possible that asteroids very close to the sun don't survive long enough for you to see them. However, I have repeatedly encountered asteroid fields very close to the planet, sometimes inside the station aegis. This happens usually when there are many asteroid fields on the WP-P route.
cim wrote:
On the planet/sun route the route for asteroids starts at 6x planet radius and ends at 4.5x solar radius. Within that route, rock hermits do not appear in the third closest to the planet. So asteroids close enough to overheat should not be placed.
I'm pretty sure I could get to the near-sun asteroids fast enough before they die in my tests...at the least the number of entities in-system would quickly drop if not. Maybe "cinder" type asteroids should be specially spawned near the sun?

The sun-planet route seems to OFTEN put asteroids near the station, at least barely in visibility range if not within the 25km scanner range. I usually check these to see if there's a nearby Rock Hermit to visit.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Appearing, Then Disappearing Rock Hermits

Post by Kaks »

Thread necromancy powers, go! :)


And - to keep with the horror theme - Renfield mode, activated: ooh, this looks like a juicy bug!

please stay tuned... ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Appearing, Then Disappearing Rock Hermits

Post by Kaks »

Update: as of trunk rev5285, the position and number of hermits in any system is still subject to change over time (hermits come, hermits go... same old, same old).
However, hermit population changes are now dependent on the game clock, rather than being totally random as before... :)

Provided I've made no snafus, this particular oddity should be gone from the nightly trunk & loading a savegame should give you back the same hermit(s) in a reassuringly consistent fashion! ;)


Cheers,

Kaks.


PS: On a personal note, it looks like I'm back to Oolite in a slightly more consistent way than I was expecting to be... Oolite coding & RL following parallel paths? Spooky! :P
Last edited by Kaks on Sun Sep 02, 2012 6:52 pm, edited 1 time in total.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Appearing, Then Disappearing Rock Hermits

Post by Cody »

Kaks wrote:
... this particular oddity should be gone from the nightly trunk & loading a savegame should give you back the same hermit(s) in a reassuringly consistent fashion!
Excellent!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Appearing, Then Disappearing Rock Hermits

Post by Cody »

Kaks wrote:
... hermit population changes are now dependent on the game clock, rather than being totally random as before...
I'm liking these longer-lasting hermits, Kaks... thanks.

Question: how long does it take the game to replace a hermit's nav buoy (I use Rock_Hermit_Locator1.3.3.oxp)? I shot one up, you see, and though the hermit itself was still there when I returned to that particular system, its nav buoy was missing. Or do hermit nav buoys not get replaced? Ah, on a subsequent visit, the nav buoy had been replaced... cool!

I wonder if it's possible for the Random Shipnames OXP to maintain the same name for hermits?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Appearing, Then Disappearing Rock Hermits

Post by Cody »

On the subject of rock hermits - I'm seeing some odd gfx when launching from Griff's hermits (r5418):

Image
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Appearing, Then Disappearing Rock Hermits

Post by cim »

I noticed much the same from normal stations. It seems to be connected to Svengali's new OXPs, and gets worse every time you jump (there is a less noticeable but still strange effect on docking, where the break pattern ends early). I suspect some bug in the way break patterns are being handled which is somehow connected to those OXPs, though I haven't tracked down what yet.
Post Reply