21296 Posts in 3605 Topics - by 7505 Members - Latest Member: Phox

Author Topic: (super bad) BUG with crew :(  (Read 541 times)

Schakar

  • Newbie
  • *
  • Posts: 17
    • View Profile
(super bad) BUG with crew :(
« on: October 17, 2017, 05:10:15 AM »
http://steamcommunity.com/sharedfiles/filedetails/?id=1171818656

All started with fighter start/call back and ~600 pilots instead of 150.
After some time I suddenly had 2.7 BILLION Pilots (eu billions, not us).
Then I created a second ship (crew quaters only) and tryed to transfare the Pilots.

Now I have 4,3 bil Generals, Comanders and Miner + 2,7 bil Pilots.

I allready posted this bug month ago. It's still in and  as my friend has the same problem ... I am not the only one.

Hammelpilaw

  • Full Member
  • ***
  • Posts: 209
    • View Profile
    • Scrap Yard - Factory calculator
Re: (super bad) BUG with crew :(
« Reply #1 on: October 17, 2017, 07:39:31 AM »
We also have this problem on our server. Can't say whats causing this issue though...

Schakar

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #2 on: October 17, 2017, 07:36:06 PM »
Update: As soon as I now try to start my Fighter the hole server crashes :(.

Hammelpilaw

  • Full Member
  • ***
  • Posts: 209
    • View Profile
    • Scrap Yard - Factory calculator
Re: (super bad) BUG with crew :(
« Reply #3 on: October 17, 2017, 07:48:41 PM »
I think at least one or more of your fighters are bugged. Figure out wich one and destroy it, then it may work again.

Ny

  • Community Manager
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #4 on: October 18, 2017, 10:52:28 PM »
 There is a bug report about this behavior in this thread: steamcommunity.com/app/445220/discussions/1/1489987634021370405/ . We're still waiting for instructions on how to reproduce it. If anyone knows, please post there.

Hammelpilaw

  • Full Member
  • ***
  • Posts: 209
    • View Profile
    • Scrap Yard - Factory calculator
Re: (super bad) BUG with crew :(
« Reply #5 on: October 19, 2017, 04:57:33 AM »
Someone said a bugged fighter adds exactly 65536 pilots to the ship, wich is 2^16. On our server another one said he had 4 billions of pilots. Maybe it was 4.294.967.296 wich would be 2^32 (but cant say for sure).

Maybe this helps finding the issue.

Pyrax

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #6 on: October 19, 2017, 08:58:08 PM »
Someone said a bugged fighter adds exactly 65536 pilots to the ship, wich is 2^16. On our server another one said he had 4 billions of pilots. Maybe it was 4.294.967.296 wich would be 2^32 (but cant say for sure).

Maybe this helps finding the issue.

I thought this initially but didn't post the reply I had drafted because he said EU billions (10^12) not using the American/British short scale (10^9). Also he said 2.7 Billion so even if it was short scale (10^9) it doesn't check out. 2^31 = 2.147x10^9 not 2.7x10^9 so either way the numbers don't match his report. Although 4.3 Bil does match if you assume short scale because 2^32 = 4.295x10^9

---------------------

Therefore, assuming the reported numbers are incorrect, and they were actually 2.1 Bil and 4.3 Bil using the short scale (10^9) then I'd offer the following root-cause analysis:

I would venture to guess that the ship data in Avorion is stored in class-based instances which hold all pertinent ship information? I would further speculate that the crew values for that specific ship are stored in standard LONG data types (32-bit integers) since standard INT would only allow for about 32k of each crew type. This class data is probably accessed from the main Avorion code using data call functions in order to do displays and transfers.

My guess is that at some point that crew value became corrupted for the ship in question. Depending on the coding language used for Avorion source, this corrupt number may be equal to negative zero: (-)0. Negative zero in binary for a signed integer is (1000 0000 0000 0000 plus 16 more zeros). I would speculate that Avorion has code which checks for a negative numbers since they are not allowed for calculations. This is probably done by looking for numbers less than zero (crew < 0) and then forcing this number to be positive or zero depending on what the devs chose. Although (-)0 is not < (0) in many code bases, although (-)0 may or may not == 0.

If this is the case I assume that something in the code is forcing the signed complement (0111 1111 1111 1111 plus 16 more ones) which = 2^31 = 2.1 x10^9 (2.1 Bil in short scale units). This compliment is probably caused by whatever is calling for the corrupted data in the ship instance for doing the calculations.

When you go to transfer the corrupted value to the new ship, it transfers the values and now you end up with 2.1 Bil in each ship, so now you have 2^32 crew = 4.3 x10^9.

I would guess that ship #2 legitimately now has 2.1 Billion crew and if you did it a second time you now have 4.3 Bil in ship #2. But I'd guess if you transferred the ship #2 crew to another ship (#3) then ship #2 would actually be empty. It's probably just ship #1 with the corrupt instanced data, but from this you could theoretically farm Billions of legitimate crew at a time doing crew transfer.


TLDR: Probably an issue with the integer bit math (2^31), and/or a signed integer issue with +/- zero, and/or a 1's or 2's complement issue. If you can crack into the stored data for the ship's instances you could probably see what the saved value was in that table and then figure out the problem from there. If you can view this data from the server files have the owners send you the files dictating the name/location of the ship in question so you can view the crew values the engine is referencing.
« Last Edit: October 19, 2017, 09:03:26 PM by Pyrax »

Schakar

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #7 on: October 20, 2017, 08:48:31 AM »
Therefore, assuming the reported numbers are incorrect, and they were actually 2.1 Bil and 4.3 Bil using the short scale (10^9) then I'd offer the following root-cause analysis:

Did you check the screenshot at all?
4.294.967.124
4 eu billion
294 eu million
967 thousend
124 hundret

And well, there IS a screenshot. That hard to check it before post?

PS: in before "but this isn't EXACT (whatever)" ... I tryed to fix it by dismissing some via mouse wheel down = left click and fast spin the wheel.
« Last Edit: October 20, 2017, 08:55:31 AM by Schakar »

Pyrax

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #8 on: October 20, 2017, 06:26:45 PM »
So first, I did view the screenshot before posting. The number shown is short scale billions 10^9, not long scale billions 10^12. I am not familiar with EU counting as I am an American engineer. Based on what I read on the wiki about long scale usage I assumed the EU used long scale since it says most of Europe:
https://en.m.wikipedia.org/wiki/Long_and_short_scales

That is why I was questioning the validity of the reported numbers.

I specifically have been using scientific notation (10^exponents) to avoid linguistic confusion.

There was no screenshot showing the 2.7 billion so I can't confirm if it was actually 2.1 or 2.7 billion.

---------------

I appreciate that you posted the screenshot and wanted to make sure I viewed it, but trying to flame me with your comments is unnecessary and not productive for getting this bug resolved.

Hammelpilaw

  • Full Member
  • ***
  • Posts: 209
    • View Profile
    • Scrap Yard - Factory calculator
Re: (super bad) BUG with crew :(
« Reply #9 on: October 22, 2017, 08:23:29 PM »
In steamforum we currently talk about fighting the guardian wich may have caused this issue.

May it be that fighters pick up ejected pilots from killed fighters and this triggers the issue? Can anybody confirm?

Hammelpilaw

  • Full Member
  • ***
  • Posts: 209
    • View Profile
    • Scrap Yard - Factory calculator
Re: (super bad) BUG with crew :(
« Reply #10 on: October 22, 2017, 09:52:45 PM »
May it be that fighters pick up ejected pilots from killed fighters and this triggers the issue? Can anybody confirm?

That should it be. Did more tests:

  • Have a small wreckage few km away of your ship
  • Have... lets say 2 fighter squads of mining fighters -> required pilots 24
  • Let mining fighters mine the wreckage (just gives them anything to do they will not finish, so you get time for testing)
  • Select one of your fighters and when its near the wreckage type /destroy
  • Be sure the pilot ejected
  • Another fighter will pick up the pilot
  • Call all fighters (23 cause you killed one) back into hangar
  • Required pilots still 24, for only 23 fighters. I think its the same issue that pumps required fighters even higer into billions.

Schakar

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #11 on: October 25, 2017, 06:10:17 AM »
Yea sorry, I just have one mouse pointer Pyrax. But the numbers are correct.
Well, why the hell should I fake them if I want the bug to be fixed. Would be stupid, not?

And again, it is NOT related with the fighters. They might have a bug on their own. But a fighter bug could never explain my Generals, Commander and Miners!

Even more as this bug exist FAR longer then the fighter-patch!

Pyrax

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #12 on: October 25, 2017, 06:46:23 AM »
Do you know which ship started the problem? If so, can you do the following test:

1) Transfer crew to from ship with the original problem to a new ship (Ship #2).
2) Confirm that Ship #2 now has the issue
3) Transfer crew from Ship #2 to yet another ship, Ship #3 (do not let Ship #3 interact with Ship #1)
4) Report back if Ship #2 still has the issue and if Ship #3 has the issue

Following those specific steps may shed some light on if the problem is infectious, as in stays permanently with intermediate ships by messing up their instances thus enabling them to spread the issue. Or if it only affects the original Ship #1 and the excess crew in Ship #2 is just crew duplication.

Schakar

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #13 on: October 29, 2017, 03:47:41 PM »
This

http://steamcommunity.com/sharedfiles/filedetails/?id=1184739338

happens, when I build a new/fresh ship (same blueprint) and move full crew.

And realy guys. It is NOT (only) a fighter problem! It is a crew (quater) problem.
Fighter have no Miners, Commander etc.

Interesting to see:
The bug allready happens at crew-level 1 (first class officers). While first class officers level 2 and 3 are OK.
On the other side level 1 miners are ok but level 2 and 3 are bugged.

So it starts with level 1 and carries over to 2 and 3.

And it can happen with just a view crew members as you normaly don't have many Officers (this ship needs ~150 workpower of first class officers for example > 50 "crew"*3).
« Last Edit: October 29, 2017, 03:55:15 PM by Schakar »

albert0015

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: (super bad) BUG with crew :(
« Reply #14 on: November 01, 2017, 06:09:17 AM »
this also happen to me. this happen when i start recalling my fighter all at once . then they start to circle around my ship not going in for about 1-2 min then suddenly they did and each time i command them to reenter will triger the bug more and more until the server crash. leaving and saving the server will not remove the bug.

My suggestion is why not try to recalculate the ship and fighter each time u login and out so that the number will go back like. but this doesnt remove the bug with duping pilot. just my 2 cent.