Page 1 of 1

Shipyard.plist bug (has no one noticed this before???)

Posted: Thu Apr 03, 2008 12:24 pm
by Lestradae
Hi all,

After much testing now 100% sure that ...

Code: Select all

<key>techlevel</key>
 <integer>4</integer>
... does not work as intended (aka as it says in the Wiki)! :shock:

The actual minimum tech level is not one, but TWO tech levels higher in-game! Could it be that a "greaterthan" has made its way somewhere where it should have said "equals"?

This has two serious consequences for shipyard.plist`s: First, a minimum TL of 1 (in-game) can`t be defined because "-1" doesn`t work in the shipyard.plist (tried that) and all ships defined as ...

Code: Select all

<key>techlevel</key>
 <integer>14</integer>
... will actually never appear in a normal shipyard because its in-game tech level would have to be 16 :? ...

I suggest discussion about this and a few other core game bugs I found in the "Testing & Bugs" forum here: https://bb.oolite.space/viewtopic.php?t=4440

Sorry to post this also in the Expansion forum, but this will affect a lot of oxps. And could have to do with the as-yet undiscovered memory overrun issues.

8)

L

Posted: Thu Apr 03, 2008 5:55 pm
by Kaks
I think I've fixed this bug, but I need to do a bit more testing to make sure. I'll look into the other stuff asap! :)

Bug Fix

Posted: Thu Apr 03, 2008 6:56 pm
by Lestradae
Hye Kaks 8)
I think I've fixed this bug, but I need to do a bit more testing to make sure.
I assume you fixed the bug for the upcoming (?!) 1.71 version (trunk?), yes? (I use 1.70)
I'll look into the other stuff asap!
Very cool :D

I am quite surprised no one noted that equipment isn`t awarded as it should, though ... and the shipyards memory bug could be "IT" - the big memory overrun bug everyone was looking for, or at least a contributer to that.

Thanks for your work, Kaks!

L

PS: I found a workaround for the tech level problem for my oxp, but the issue will still affect a lot of other oxps around ...

Posted: Thu Apr 03, 2008 9:26 pm
by Kaks
Well, there's many factors affecting ships availability. The tech level is just one of them. After I wrote my bugfix I had to try about 40 times to see a tech 6 ship(<key>techlevel</key>
<integer>5</integer>) showing up for sale in a tech level 6 system.

It takes some special type of determination to make absolutely sure that things work exactly as you expect. For the vast majority of people, seeing their ships for sale at some point or other would be proof enough that their oxp worked. In this case, no-one else had tried to put a tech 15 ship for sale before.

From what I can tell from the code the equipment itself was always present in the right tech level systems, it's just ships availiability that's affected by this bug.

As far as ships' equipment inside the ships for sale, I'll keep looking into it!

Finally, memory leaks: you'll be pleased to know that carrying over shipyard contents from savegame to savegame doesn't seem to happen in trunk anymore, but I'm pretty sure there are more subtle bugs still to be found...

PS: yes, the bugfix applies to 1.71-trunk, though I haven't committed the change yet...

Posted: Thu Apr 03, 2008 10:50 pm
by another_commander
Lestradae wrote:
... and the shipyards memory bug could be "IT" - the big memory overrun bug everyone was looking for, or at least a contributer to that.
You will be pleased to know that "IT" has been already fixed in the trunk. It was not related to shipyard code, though.

-->

Posted: Fri Apr 04, 2008 7:04 am
by Lestradae
Hi!

@another_commander:
You will be pleased to know that "IT" has been already fixed in the trunk. It was not related to shipyard code, though.
Indeed, I am (pleased, that is) :)

@Kaks:
Well, there's many factors affecting ships availability. The tech level is just one of them. After I wrote my bugfix I had to try about 40 times to see a tech 6 ship(<key>techlevel</key>
<integer>5</integer>) showing up for sale in a tech level 6 system.
Which does, for all intents and purposes, mean it doesn`t work as intended in my book. This problem is, by the way, solved for my OXP - I just lowered ALL minimum tech levels by one and let the new upper span limit stay and now it works as intended on my system.

So, this does not have to be changed soon as far as it concerns me - but if you do change this in 1.71 or above, please tell me so that I can change my workaround back then ...
It takes some special type of determination to make absolutely sure that things work exactly as you expect.
[sarcasm] You mean like, for example, as in writing a shipyards OXP that tries to place ships into tech levels according to their technical prowess and wildly determined to have that work in-game - including TL15? [/sarcasm] :lol:
For the vast majority of people, seeing their ships for sale at some point or other would be proof enough that their oxp worked. In this case, no-one else had tried to put a tech 15 ship for sale before.
Yeah, well, see above ... as my OXP places ALL the ships differently, more than that is needed :)

It`s not even completely true. The "morrigan" oxp on the wiki page, for example, has a ship that was clearly intended for sale in TL 15 shipyards. But the author made a mistake, it would have appeared only in TL 16 shipyards, with the buggy distribution thingy added in de facto in TL 17 shipyards.

Actually, the morrigan.oxp does only work as probably intended with the upcoming Realistic Shipyards 1.07 in.
From what I can tell from the code the equipment itself was always present in the right tech level systems, it's just ships availiability that's affected by this bug.
As I found a Naval Energy Unit for sale in a ship in a TL 4 system once (for the small additional sum of, I think, 540.000 Cr) that should be correct.
As far as ships' equipment inside the ships for sale, I'll keep looking into it!
Yes please! That, if I understood you & another_commander right, is the last serious bug that affects my OXP left. And this one will affect a lot of oxps.

I will attempt to pinpoint which items of equipment skip the standard item distribution in-game when I find the time (next days look not so good), but I will try to get a repeatable erratic behaviour.

Thanks anyways for looking into it & both your work on this obsession-creating game! 8)

L

Posted: Fri Apr 04, 2008 10:11 am
by Kaks
Which does, for all intents and purposes, mean it doesn`t work as intended in my book.
Well, I suppose exceptionally bad luck counts as 'doesn't work as intended' for me too. The thing we might disagree with is how happy we are with the randomness of the shipyard market. I personally like the highly random nature of the shipyard at the moment. Kind of reminds me of real life :D
[sarcasm] You mean like, for example, as in writing a shipyards OXP that tries to place ships into tech levels according to their technical prowess and wildly determined to have that work in-game - including TL15? [/sarcasm] :lol:
Yes, something like that! The author of the morrigan oxp clearly wasn't as wildly determined as you! :D


After running a few more tests, I have committed the change for 1.71.

The equipment inside the ship can be any tech level, and afaik you could include oxp only stuff like cloaking devices & trumbles - now that I think about it, such a ship would be a very interesting purchase...:)
Of course, the shipyard techlevel only tells you which system will be likely to have those ships for sale, not which systems those ships have visited before their captain decided to sell them.

One important thing about equipment I haven't noticed on the wiki - it might well be there, but I haven't noticed - is that from time to time you get a bargain day, which also allows you to buy high tech equipment in lower tech systems. Again, that was done to increase the randomness & 'living universe' feel of Oolite, and working as designed.

I will try to get a repeatable erratic behaviour.
Thanks, that would certainly help, although it sounds a bit like 'reliable unreliability' - a concept I've encountered a few times before, and something that never fails to make me smile. :)

-->

Posted: Fri Apr 04, 2008 10:38 am
by Lestradae
Hi again!
The thing we might disagree with is how happy we are with the randomness of the shipyard market. I personally like the highly random nature of the shipyard at the moment. Kind of reminds me of real life
Well, not really. The ships are and still shall be randomly distributed - I just aim at having a different level of ships at a TL4 and a TL12 shipyard. Ultimately that`s the reason why the Realistic Shipyards are (and perhaps should be?) an oxp - everyone can choose.

Concerning the real life reminding, I disagree. If you visit some high-class mercedes outlet in germany, for example, you are not going to get a small budget car without additional equipment there :) At a small used-car budget car shop in western europe you might still not get something like the indian Tata car or the older east germany trabant car. And at an indian Tata car shop you won`t ever see a high-class mercedes!

It was actually thinking in that direction that made me create spans for ships to appear - but in those spans (actually, ships will always appear in four tech levels) they SHOULD appear as random as possible! 8)

Well, I don`t have to convince you and you don`t have to be convinced (as I said, that`s what oxps are for) :) , but that is my reasoning.
The author of the morrigan oxp clearly wasn't as wildly determined as you!
Well, only if "not wildly determined" means "irrelevant to me if my oxp actually works or not" :lol:
After running a few more tests, I have committed the change for 1.71.
Thank you very much!

Does that mean that the tech level thing will be one step up again or so from 1.71 on? Because then I will have to remove my workaround when the next version comes. Not complaining, mind you, just have to know 8)
The equipment inside the ship can be any tech level, and afaik you could include oxp only stuff like cloaking devices & trumbles - now that I think about it, such a ship would be a very interesting purchase...
I wanted to include the Naval Energy Unit and the Cloaking Device as built-in for the Condor Flagship and the Navy Leviathan, but found the "standard equipment not awarded properly bug" first, so didn`t bother (yet). If & when that`s repaired, perhaps this will be in version 1.08 or 1.09.
it sounds a bit like 'reliable unreliability' - a concept I've encountered a few times before, and something that never fails to make me smile.
Very fractal :)

Cheers Kaks,

L

Re: -->

Posted: Fri Apr 04, 2008 12:53 pm
by Kaks
Lestradae wrote:
Does that mean that the tech level thing will be one step up again or so from 1.71 on? Because then I will have to remove my workaround when the next version comes. Not complaining, mind you, just have to know 8)
Yes it does!8)


And thank you for finding these odd bugs. The more of them we find, the more chances we have to get a really nice 1.71 out.

About the ranges, the way I see it is: we're dealing with a whole planetary system here, not just the majority which will be at whatever tech level the system is classified as. I think the vast majority of American families will have about 2 cars and 3 tvs, but you would have a very hard time trying to buy a second hand car or tv from your average Amish family.

In other words, I see the ships market more like ebay than a car dealership. If you go onto ebay you can find all sort of stuff, from the most advanced gadgets to primitive stuff like, say, wooden boxes.

Anyways, that's my own reasoning, which doesn't stop me from thinking that realistic shipyards is a pretty good oxp! :)

Cheers,

Kaks.

...

Posted: Fri Apr 04, 2008 7:10 pm
by Lestradae
Hye Kaks,
And thank you for finding these odd bugs. The more of them we find, the more chances we have to get a really nice 1.71 out.
That`s in my own interest: The more of them we find, the more chance I have to play a really nice 1.71! :P
About the ranges, the way I see it is: we're dealing with a whole planetary system here, not just the majority which will be at whatever tech level the system is classified as. I think the vast majority of American families will have about 2 cars and 3 tvs, but you would have a very hard time trying to buy a second hand car or tv from your average Amish family.
I`ve been thinking about that ... and I might have a solution for that also. Speaking in riddles :) I have a few ideas for 1.08 already ... perhaps a certain Cptn is going to help me with them :wink:
Anyways, that's my own reasoning, which doesn't stop me from thinking that realistic shipyards is a pretty good oxp!
Thanks! :D

Cheers to you too 8)

L

Posted: Sat Apr 05, 2008 2:30 am
by TGHC
The Naval energy unit and cloaking device cannot be purchased individually, they are awarded on completion of generic missions as per the original Elite (the cloaking device has to be scooped), they can also be found available though in some ships for sale in the shipyard. I may be wrong, but I think when you have acquired them, they get "transferred" to a new ship when you purchase it. I think the price of a Naval energy unit is set at 54,000CR.

Posted: Sat Apr 05, 2008 8:34 am
by ovvldc
IIRC, the cloaking device is passed from ship to ship, while the naval energy unit is unlocked for purchase.

Best wishes,
Oscar

Posted: Sat Apr 05, 2008 2:25 pm
by Kaks
ovvldc wrote:
while the naval energy unit is unlocked for purchase.
Yep, once you complete the thargoid plans mission you can buy naval energy units in tech 14 & 15 systems, and repair them at tech 13+.