No more metal fragments?

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

Moderators: winston, another_commander, Getafix

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: No more metal fragments?

Post by Eric Walch » Mon Jul 21, 2014 6:40 pm

In my opinion it also looks if less metal is generated. However, without any codechange, it seems merely suggestion.

Going again through the code, I see the number of chunks is less than I previous stated. If the fragment_chance is true for a ship, the ship first generates fragments with role "wreckage" with the number of n_alloys. This wreckage is only short living (< 1.25 seconds) and has the size of the ship itself. This "wreckage uses up the alloys, so when the "wreckage" is generated, the n_alloys variable is lowered according:

Code: Select all

n_alloys = ranrot_rand() % n_alloys;
There it seems to go wrong as ranrot_rand() is not giving a even distribution.

As a test I exploded some traders, while logging the n_alloys variable based on mass and the value that Oolite is actually trying to add.

Code: Select all

20:23:08.614 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 2 original.
20:23:08.659 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:23:20.563 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 2 original.
20:23:32.319 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:23:40.413 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:23:49.274 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:24:00.457 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 2 original.
20:24:00.457 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 0. dropping 1, metal platings of 1 original.
20:24:00.497 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:24:21.938 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:24:52.568 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:24:59.346 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:25:19.129 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:25:28.760 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:25:36.623 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:25:45.922 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:25:45.923 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 0. dropping 1, metal platings of 1 original.
20:26:17.979 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:26:20.081 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:26:26.676 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:26:53.825 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 2 original.
20:27:18.847 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:27:21.856 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:27:27.244 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:28:30.860 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 0. dropping 1, metal platings of 1 original.
20:28:31.605 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:28:42.885 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:28:53.151 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:05.061 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:05.065 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:14.249 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 2 original.
20:29:17.216 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:31.494 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:42.491 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:42.794 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:29:55.413 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 1, metal platings of 2 original.
20:30:15.354 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:30:32.194 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:30:41.458 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:30:51.129 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:31:05.806 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:31:06.585 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
20:31:15.863 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 1, metal platings of 9 original.
20:31:18.219 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 0. dropping 1, metal platings of 1 original.
20:31:29.122 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 1, metal platings of 2 original.
20:31:54.149 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 0. dropping 1, metal platings of 1 original.
20:32:07.942 [ship.metalplating] ShipEntity.m:8569: fragment_chance: 1. dropping 0, metal platings of 1 original.
 
It seems that when fragment_chance is true, the n_alloys is always rounded to zero when is was 1, instead of only 50% of the cases.

It smells like the seed is reset to the same value every time this part of the code is entered.

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: No more metal fragments?

Post by Diziet Sma » Mon Jul 21, 2014 6:54 pm

Nice detective work!

So it would seem, we do have a bug..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied

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: No more metal fragments?

Post by Eric Walch » Mon Jul 21, 2014 8:14 pm

Diziet Sma wrote:Nice detective work!
Not that good. I was abuse with the % operator. It is correct that n_alloys always becomes zero after the "n_alloys = ranrot_rand() % n_alloys;" calculation when starting as 1. But, that means that this low amount of plating was always there, even when I remember seeing them more often.

Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: No more metal fragments?

Post by Neelix » Tue Jul 22, 2014 5:38 am

Eric Walch wrote:
Diziet Sma wrote:Nice detective work!
Not that good. I was abuse with the % operator. It is correct that n_alloys always becomes zero after the "n_alloys = ranrot_rand() % n_alloys;" calculation when starting as 1. But, that means that this low amount of plating was always there, even when I remember seeing them more often.
Be that as it may I'm certain that something has changed.

In my experience, even the smallest ships tend to drop at least one fragment. There seem to be less cargo drops than I'm used to too.

- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: No more metal fragments?

Post by cim » Wed Jul 23, 2014 2:16 pm

Cargo drops being smaller is probably intentional - the way NPC cargo is generated did get changed, so most ships drop less than they used to (especially pirates) - though freighters, including pirates freighters, will probably drop a bit more. Player ships also drop a bit more cargo than they used to.

Alloys ... as Eric says I don't think that code has been touched, but the mass calculations are a bit strange anyway, and there definitely are fewer alloys than there used to be. I wonder if the Griff hulls are lighter than the old hulls, perhaps? I might increase the alloy chances a little for next version.

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: No more metal fragments?

Post by Smivs » Wed Jul 23, 2014 2:27 pm

cim wrote:I might increase the alloy chances a little for next version.
Yes, that would get my vote. As I said earlier I feel there should be more, maybe even a 2:1 ratio with cargo.
Commander Smivs, the friendliest Gourd this side of Riedquat.

Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: No more metal fragments?

Post by Zireael » Wed Jul 23, 2014 2:35 pm

Smivs wrote:
cim wrote:I might increase the alloy chances a little for next version.
Yes, that would get my vote. As I said earlier I feel there should be more, maybe even a 2:1 ratio with cargo.
+1 from me, too.

Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: No more metal fragments?

Post by Neelix » Wed Jul 23, 2014 2:58 pm

Smivs wrote:
cim wrote:I might increase the alloy chances a little for next version.
Yes, that would get my vote. As I said earlier I feel there should be more, maybe even a 2:1 ratio with cargo.
Agreed.

The problem doesn't exist in 1.80 though, surely if the issue was with the Griff hulls, the change would already have been triggered in 1.80 no?

- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: No more metal fragments?

Post by cim » Wed Jul 23, 2014 10:07 pm

Well, that was strange. Anyway, should be fixed with the next nightly build.

(So far as I can tell, most of the alloys were coming from the short-lived wreckage which you sometimes see generating secondary explosions, not the ships themselves - a change in 1.81 meant that was inheriting the ridiculously high temperature of the wreckage and instantly exploding. It's now fixed to give I think something close to 1.76ish alloy behaviour by a different route)

Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: No more metal fragments?

Post by Neelix » Thu Jul 24, 2014 1:10 am

cim wrote:Well, that was strange. Anyway, should be fixed with the next nightly build.

(So far as I can tell, most of the alloys were coming from the short-lived wreckage which you sometimes see generating secondary explosions, not the ships themselves - a change in 1.81 meant that was inheriting the ridiculously high temperature of the wreckage and instantly exploding. It's now fixed to give I think something close to 1.76ish alloy behaviour by a different route)

Thanks. :-) I'll check that out.

- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]

Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: No more metal fragments?

Post by Neelix » Thu Jul 24, 2014 1:06 pm

cim wrote:Well, that was strange. Anyway, should be fixed with the next nightly build.

(So far as I can tell, most of the alloys were coming from the short-lived wreckage which you sometimes see generating secondary explosions, not the ships themselves - a change in 1.81 meant that was inheriting the ridiculously high temperature of the wreckage and instantly exploding. It's now fixed to give I think something close to 1.76ish alloy behaviour by a different route)

Still needs some tweaking I'd say. I just updated to 1.81.0.5908-140724-fc0f3e7 and decided to engage in some piracy to test this out.

The first Boa I took out dropped a lot of cargo, but only a few metal fragments (no more than 3)
a cobby 1 dropped 2 cargo and no fragments, several smaller ships still didn't drop anything.
the second boa I took out (fresh out of witchspace) dropped exactly 1 metal fragment, and the escape pod, but nothing else.

- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4018
Joined: Fri Nov 11, 2011 6:19 pm

Re: No more metal fragments?

Post by cim » Thu Jul 24, 2014 1:18 pm

Neelix wrote:Still needs some tweaking I'd say. I just updated to 1.81.0.5908-140724-fc0f3e7 and decided to engage in some piracy to test this out.

The first Boa I took out dropped a lot of cargo, but only a few metal fragments (no more than 3)
a cobby 1 dropped 2 cargo and no fragments, several smaller ships still didn't drop anything.
the second boa I took out (fresh out of witchspace) dropped exactly 1 metal fragment, and the escape pod, but nothing else.
That sounds about right for 1.76-like behaviour. With alloys being one of the better cargo types for price, I wouldn't want to bias it any further towards them.

Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: No more metal fragments?

Post by Neelix » Thu Jul 24, 2014 1:31 pm

cim wrote:
Neelix wrote:Still needs some tweaking I'd say. I just updated to 1.81.0.5908-140724-fc0f3e7 and decided to engage in some piracy to test this out.

The first Boa I took out dropped a lot of cargo, but only a few metal fragments (no more than 3)
a cobby 1 dropped 2 cargo and no fragments, several smaller ships still didn't drop anything.
the second boa I took out (fresh out of witchspace) dropped exactly 1 metal fragment, and the escape pod, but nothing else.
That sounds about right for 1.76-like behaviour. With alloys being one of the better cargo types for price, I wouldn't want to bias it any further towards them.
I'll have to take your word on that I guess... the first version I played was based on 1.77.1 so that's still a lot lower than what I'm used to.

- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]

Post Reply