Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

v 1.73 problem "Bang, you're dead"

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

Moderators: winston, another_commander, Getafix

Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

v 1.73 problem "Bang, you're dead"

Post by Screet »

Hi,

it turns out that my craft is regularly destroyed by wreckages, even when there's no ship close to me.

To track this, I did enable the damage logging for the player and I find many entries about wreckages doing scrape damage or destroying me :(

The last such thing did read as follows:

Code: Select all

[player.ship.damage]: Player <PlayerEntity 0xb02b288>{"Hammer of Sorrow" ID: 100 position: (-2779.63, -1092.92, 144851) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT} took 4328.491 scrape damage from <ShipEntity 0x1efbf048>{"Wreckage" ID: 758 position: (-13184.3, 7541.88, 486573) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
The strange thing is, that the positions do read like the wreckage was extremely far away - am I right on that? If so, any ideas how this could destroy me?

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

You have been hit by the rescaling bug currently in trunk. Any rescaling on any mesh will result in said mesh being saved to the cache in its scaled size. The only model in the core game where rescaling takes place is the wreckage. Because of this, after a few jumps wreckages start to become noticeably larger and if you go for long enough they actually become so large that they destroy you even if they have been created hundreds of clicks away.

Nobody has dived into this yet. It is a pretty complex one but is definitely one of the showstoppers for 1.73. The only thing I can tell you is that you can temporarily fix it by rebuilding the cache, which will make all meshes go back to their original model file size. If you feel like it, by our guest and have a go at trying to fix it. I, for one, would appreciate it a lot.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Do you have any details on how to reproduce the scaling error? I cannot find a berlios bug for it, and running in the debugger it all seems to behave as expected.
User avatar
_ds_
Deadly
Deadly
Posts: 180
Joined: Thu Jan 22, 2009 5:34 pm
Location: In a cloaked ship behind you

Post by _ds_ »

another_commander wrote:
You have been hit by the rescaling bug currently in trunk. Any rescaling on any mesh will result in said mesh being saved to the cache in its scaled size. [...]

Nobody has dived into this yet. It is a pretty complex one but is definitely one of the showstoppers for 1.73.
Quite possibly somebody might have had the renaming of various member objects been done in a separate commit… this time it was ahruman who was the guilty party (usually, from what I've seen, it's kaks who mixes up several million things in one commit; as one who's made good use of bisection searches with both mercurial and git, I find this practice somewhat abhorrent these days, understandable though it is with CVS SVN).
http://tartarus.org/~ds/oolite/patches, Buzzer OXP etc.
Solas
Dangerous
Dangerous
Posts: 70
Joined: Sun Jan 04, 2009 7:26 am

Post by Solas »

To be honest I don't think this error is down to Ahruman.
Firstly .. he's read a previous post on this .. https://bb.oolite.space/viewtopic.php?p= ... ght=#72049
Secondly .. I can't find any relevent mention of rescale, wreckage or wreck in the SVN log back as far as 23/5/07 and Ahruman is AFAIK meticuous in annotating changes he submits.
Thirdly .. Oversights of this nature run counter to my experience of his sharpness.
I could be wrong. Maybe the person who submitted the code could get around to removing it or finishing it.
The problem seems to be rescaling the reference mesh(es) rather than creating a new one for each new wreckage object.
User avatar
_ds_
Deadly
Deadly
Posts: 180
Joined: Thu Jan 22, 2009 5:34 pm
Location: In a cloaked ship behind you

Post by _ds_ »

Solas wrote:
To be honest I don't think this error is down to Ahruman.
[...]
Secondly .. I can't find any relevent mention of rescale, wreckage or wreck in the SVN log back as far as 23/5/07 and Ahruman is AFAIK meticuous in annotating changes he submits.
The patch which I have reverted locally is "OOMeshes are now dynamically sized". I don't think that there's anything else in it, short of tweaks to accomodate later changes.
[...] The problem seems to be rescaling the reference mesh(es) rather than creating a new one for each new wreckage object.
No argument there.
http://tartarus.org/~ds/oolite/patches, Buzzer OXP etc.
Solas
Dangerous
Dangerous
Posts: 70
Joined: Sun Jan 04, 2009 7:26 am

Post by Solas »

Hi _ds_
The patch which I have reverted locally is "OOMeshes are now dynamically sized".
I'm not a C programmer so you'll have to help me out here.
those changes Ahruman made look to me to be to accomodate rescaling.
the rescaling of wreckage seems to be in ShipEntity.m ( rev 2122 ) line 4674 [wreck rescaleBy: scale_factor];
the code seems convoluted to me but I tried to follow it around.
have a look anyway .. let me know what you think.

+ edit ..
the line [wreck rescaleBy: scale_factor]; was committed at revision 642 two years ago.
I have no idea what else has changed since then to produce the growing wreckage bug.
were wreckages successfully rescaled and cached prior to the trunk version ?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Solas wrote:
+ edit ..
the line [wreck rescaleBy: scale_factor]; was committed at revision 642 two years ago.
I have no idea what else has changed since then to produce the growing wreckage bug.
were wreckages successfully rescaled and cached prior to the trunk version ?
The problem is that in 1.72.2 this line does not seem to produce any erroneous behaviour However, I am not entirely convinced that rescaling works at all in 1.72.2 either. The bug we are seeing now could be introduced anywhere in the mesh code (and I know for a fact that rescaling works in the trunk, just not the way we'd want to), or even in the cache handling code. It is a definintive b... to track, as the code changes are too extensive between revisions.

@Cmdr James: Reproducing the scaling error is quite easy. Just play the game for half an hour or so, saving at every station. It won't be long before you start seeing wreckages bigger than the ships they originated from.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

another_commander wrote:
@Cmdr James: Reproducing the scaling error is quite easy. Just play the game for half an hour or so, saving at every station. It won't be long before you start seeing wreckages bigger than the ships they originated from.
I was afraid that this rescaling could be the cause, however, I'm not entirely sure with that.

I just rebuilt my cache and launched. Less than 5 minutes into the game, this happened:

Code: Select all

[player.ship.damage]: Player <PlayerEntity 0xea04548>{"Hammer of Sorrow" ID: 100 position: (-7281.7, 10850.5, 147257) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT} took 12283.124 scrape damage from <ShipEntity 0x114ae718>{"Wreckage" ID: 682 position: (-29524.1, -14617.8, 425778) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
Sometimes I do see explosions around me (without a ship being around before that explosion), but I really never saw big wreckages...it's more feeling like somewhere else a ship blows up and then the game adds a collision with me for it, regardless how far away it is.

Furthermore, I would expect other ships/hermits close to me also to be blown up by such an event if the wreckage would turn that immensely big within such a short time. With the above thing, I had a hostile Adder and a hermit (pirate cove) around, but I only saw my ship explode :(

Screet
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Hi,

I just did add a report to wreckage rescaling (is that necessary anyway?) and although I flushed the cache upon load, it was few minutes until I was killed by another wreckage from somewhere else. I doubt that the rescaling is the source, but this wreckage appears also to have impossible high damage settings to me:

Code: Select all

[Wreckage]: scaling factor 1.38117
[Wreckage]: scaling factor 1.52403
[Wreckage]: scaling factor 1.06875
[Wreckage]: scaling factor 1.77125
[Wreckage]: scaling factor 5.06721
[Wreckage]: scaling factor 4.83766
[Wreckage]: scaling factor 5.07688
[Wreckage]: scaling factor 4.07935
[Wreckage]: scaling factor 3.12246
[Wreckage]: scaling factor 3.13913
[Wreckage]: scaling factor 3.18995
[Wreckage]: scaling factor 2.90761
[Wreckage]: scaling factor 3.6715
[Wreckage]: scaling factor 2.51593
[Wreckage]: scaling factor 2.73263
[Wreckage]: scaling factor 2.26203
[Wreckage]: scaling factor 2.11855
[Wreckage]: scaling factor 1.87458
[Wreckage]: scaling factor 1.3454
[Wreckage]: scaling factor 4.46417
[Wreckage]: scaling factor 4.50938
[Wreckage]: scaling factor 4.28397
[Wreckage]: scaling factor 2.10426
[Wreckage]: scaling factor 2.2388
[player.ship.damage]: Player <PlayerEntity 0xc9aea38>{"Hammer of Sorrow" ID: 100 position: (-4087.4, -6434.03, 147065) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT} took 34333890.718 scrape damage from <ShipEntity 0xcd93bb0>{"Wreckage" ID: 540 position: (42981.2, 27970.7, 400950) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
[player.ship.damage]: Player destroyed by <ShipEntity 0xcd93bb0>{"Wreckage" ID: 540 position: (42981.2, 27970.7, 400950) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT} due to scrape damage
[Wreckage]: scaling factor 1.04576
I believe this clearly shows that it must be something else...

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Three things just to clarify a bit:
1) Did you enter a station at any point during your test?
2) What happens if you remove completely the line in the code that rescales the wreckage? Do you still get destroyed? (a cache flush would be needed before doing this test).
3) What happens without any OXPs installed?

The high damage value could easily be a result of a very high mass value used in the calculation of scrape damage. The damage received by the entity colliding with you is dam1 = m2 * v2b * v2b / 50000000 according to the -collideWithShip method in ShipEntity.m. The other candidate for generating high damage is v2b, but I don't see a reason why this value would yield strange results only for the wreckage. However, the mass of an object is directly related to its mesh volume, so your best candidate for the problem would be the mesh itself growing larger every time a cache write takes place. This is why I believe it is a scaling/cache problem. Although I have not really tested the situation lately, so things could be somewhat changed by now, I have seen in the past the huge wreckages flying about.
Last edited by another_commander on Tue Apr 07, 2009 4:09 pm, edited 1 time in total.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

another_commander wrote:
Three things just to clarify a bit:
1) Did you enter a station at any point during your test?
2) What happens if you remove completely the line in the code that rescales the wreckage? Do you still get destroyed? (a cache flush would be needed before doing this test).
3) What happens without any OXPs installed?
Can only answer question 1 right now: I did launch oolite with cache flushing, launched my primary commander, made one jump and shot down three ships. Then I was suddenly dead after all hostiles were gone...thus I also had not a single docking within that time. On other attempts, I was docking at a pirate cove and got the deadly bang few seconds after launching from it.

The above log lines thus include ALL wreckages with rescaling that were created since cache flushing.

Guess piratecove and OSE do increase the number of wreckages by adding more (hostile) ships, but at least without OSE I was experiencing the same scrape-kills...

Screet
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

It ought to be pretty simple to update the player.ship.damage logging to add mass of whatever scraped the player.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

I just run a quick test. Jumped into two anarchy systems (Ladigeso, Edrebi in G5) and fought all the way to the station in both. I was not hit by any wreckage, but during fights it was obvious that the whiteout of the explosions was huge and in more than one cases enormous wreckages were jetissoned.

Logging the actual mass during a scrape hit would be indeed very easy. What would be difficult is a) replicating Screet's situation (I can't seem to be able to get myself hit by wreckage) and b) finding again the time to run such a test. Screet, it would be great if you could try this and let us know what it logs for you.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

OK, I've just added a few more infos to the log, but it turns out that without the scaling the problem is entirely gone.

Guess I'll leave it that way, as that results in a playable trunk oolite for me ;)

Screet
Post Reply