Author Topic: 4.2 Bugs  (Read 6249 times)

0 Members and 1 Guest are viewing this topic.

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #45 on: August 12, 2009, 11:39:20 PM »
Quote from: "rdgam"
Entered a new system and the program went into an endless loop.  I killed it with the task manager.  When I restarted the new system (planetless) was there but no WP links.  I deleted it and forced a new system from the system generation window.
I have seen this but it is extremely rare (perhaps one in a dozen campaigns will encounter it) and I have no idea what is causing it. The problem is recreating it so I can track down the problem. The workaround is to delete the affected system as you realised so its annoying but not a showstopper. There used to be a bug with certain star types that caused this problem but I fixed it several versions ago, This may be related in some way. Do you happen to remember the star type of the affected system?

Steve
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #46 on: August 12, 2009, 11:46:41 PM »
Quote from: "sloanjh"
I just mentioned over in a mechanics thread a terraforming bug I ran into a few days back.  If you start terraforming a world with no atmosphere, and your terraformer doesn't have enough oomph to get an amount of gas that rounds to a number greater than zero when converted to currency, then you get a divide-by-zero error whenever Aurora tries to calculate gas percentages (both in environment tab of pop (F2) screen and in system screen (F9) - there might be more places too).  This continues until you've added enough gas that it will round to 1.e-4.
In the UpdateAtmosphere function, the gases use the currency data type, although I have checked in the database and both the SBGas table and the SystemBody table use single data types for all the pressure-related data. I have changed the  data types of the code variable to singles to match the DB so that should solve the problem.

Steve
 

Offline Beersatron

  • Gold Supporter
  • Rear Admiral
  • *****
  • Posts: 996
  • Thanked: 7 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
Re: 4.2 Bugs
« Reply #47 on: August 13, 2009, 12:12:26 AM »
Quote from: "SteveAlt"
Quote from: "Beersatron"
I was able to restart Aurora and progress the time by another couple of 5-day increments after each hang.

If you are stepping through the code, you might want to look at the mineral stuff? I can't remember who, but somebody mentioned they noticed the hang happening whenever an NPR was low on a mineral (probably Duranium). So I went into the DB and found their homeworld mineral entries and upped their Duranium which was nearly gone from what I could tell. I didn't get the error for another couple of months after that.
The evidence is definitely mounting in that area. I have reduced an NPR to no minerals in my game but couldn't get the errors so I think it must be a combination of a mineral shortage and something specific that an NPR tries to build. I haven't tracked it down yet though.

Steve

This could possibly be it or related in some way:

In the ProductionQueue table two new entries appeared, one for a fuel refinery and another for 'Dracon Anti-ship Missile'. The amount for the refinery was 1 but the amount for the missile was 0. The refinery completed ok and the row was deleted. There has since been another construction order added that was converting mine to automated and it has completed successfully.

The missile order with amount of 0 is still sitting there. Could it possibly be a memory leak? i.e. there is a function that is running, and then running again and then running again because it sees that record but the amount is zero so it isn't cleaning itself up?
 

Offline Beersatron

  • Gold Supporter
  • Rear Admiral
  • *****
  • Posts: 996
  • Thanked: 7 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
Re: 4.2 Bugs
« Reply #48 on: August 13, 2009, 12:49:51 AM »
I am running the v4.23 exe.

I have a Naval Yard at 4500tons that is currently tooled for a 4500ton GE and has no activity. I am trying to retool it to a CT of 4500tons but nothing is happening when I click on set activity. A side effect from the fix you put in for the repeat retool maybe?
 

Offline alanwebber

  • Warrant Officer, Class 1
  • *****
  • a
  • Posts: 99
Re: 4.2 Bugs
« Reply #49 on: August 13, 2009, 01:45:03 AM »
I am running a 4.2 campaign and am having problems raising shields. The amount added to each shield changes depending on the increment length but then reverts to zero. It's almost as though it's setting the new strength to the calculated increase rather than adding it to the previous value. I've tried using an order on the task orders screen, the raise shields button on the orders screen and the raise shields button on the combat screen. All seem to have the same result.

Alan
Regards

Alan Webber
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #50 on: August 13, 2009, 02:04:30 AM »
Quote from: "Beersatron"
I am running the v4.23 exe.

I have a Naval Yard at 4500tons that is currently tooled for a 4500ton GE and has no activity. I am trying to retool it to a CT of 4500tons but nothing is happening when I click on set activity. A side effect from the fix you put in for the repeat retool maybe?
Yes, a new bug :)

I'll put out v4.24 in the next few minutes

Steve
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #51 on: August 13, 2009, 02:19:31 AM »
Quote from: "alanwebber"
I am running a 4.2 campaign and am having problems raising shields. The amount added to each shield changes depending on the increment length but then reverts to zero. It's almost as though it's setting the new strength to the calculated increase rather than adding it to the previous value. I've tried using an order on the task orders screen, the raise shields button on the orders screen and the raise shields button on the combat screen. All seem to have the same result.
Yes, I have got that problem too. The new shield strength isn't being saved to the database. Easy fix and I guess it will soon be v4.25 :)

Steve
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #52 on: August 13, 2009, 01:45:24 PM »
Quote from: "Beersatron"
In the ProductionQueue table two new entries appeared, one for a fuel refinery and another for 'Dracon Anti-ship Missile'. The amount for the refinery was 1 but the amount for the missile was 0. The refinery completed ok and the row was deleted. There has since been another construction order added that was converting mine to automated and it has completed successfully.

The missile order with amount of 0 is still sitting there. Could it possibly be a memory leak? i.e. there is a function that is running, and then running again and then running again because it sees that record but the amount is zero so it isn't cleaning itself up?
I think a memory leak would have presented itself in the games I am running - on the other hand I do have 8Gb RAM so its possible I am just not hitting the problem for that reason. On the gripping hand, Aurora is a 32-bit app so it will only address 4GB anyway. A memory leak would vanish after a reboot so it would be interesting to see if that fixed the problem for those who have encountered it.

My best guess at the moment though is an infinite loop. I still haven't managed to recreate it though, despite reducing an NPR to zero minerals. I have also removed everything from the build queue to see if allocating builds with no minerals was the trigger but that worked fine as well. I'll keep trying different scenarios.

Steve
« Last Edit: August 13, 2009, 02:03:04 PM by SteveAlt »
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #53 on: August 13, 2009, 02:02:43 PM »
Quote from: "sloanjh"
Quote from: "Beersatron"
I am getting game freezes after after a minimum of 10days increment.

That is to say, that at the 11th 1 day increment it has hung and became 'not responding' with 1 CPU core running at 100%.

No error messages and I can't think of anything that I am doing that may be causing it. So probably an NPR?

I just got a hang (in the econ update) 12 years into my game.  I'm fairly certain it's due to an NPR running out of Duranium.
It just occurred to me (and I am not sure why it took this long) that the game doesn't hang when a player race runs out of Duranium. Once the production orders are placed, it is exactly the same code for NPRs as it is for players so it's very unlikely the bug is in the production code. It must be somewhere in the NPR planning code, which at least narrows things down a little.

Steve
 

Offline SteveAlt

  • Global Moderator
  • Rear Admiral
  • *****
  • Posts: 820
  • Thanked: 8 times
Re: 4.2 Bugs
« Reply #54 on: August 13, 2009, 02:46:59 PM »
Aha! I think I have found it!

I haven't managed to recreate it but by narrowing down the location, partly through the logic that it must be a piece of code only applicable to NPRs, partly because of the evidence of NPRs without Duranium being affected and partly because of John's comment in the v4.0b bugs thread that mineral extraction was working but not construction when the hang occurred, I think I have found it by reading through the code. There is a section in NPR Planning which looks at different things to build. There is some preliminary code that ensures sufficient quantities of basic installations have been built and then a section for random selection of installations to build. Each item in the random selection checks for sufficient quantities of minerals. If insufficient minerals are available the selection code loops and randomly selects something else. I was already aware of the possibility that nothing may be found so the code counts each loop and when it reaches five loops, it exits automatically - or so I thought!

A variable holds the count of the number of loops and when that variable hits 5, the loop ends. However, I realised that the line of code that initialises the variable to zero was before the random selection but inside the loop! Which means that the variable is reset to zero at the start of each loop and will never reach 5. So if there are insufficient minerals to build any of the nine different installations in the random selection, the loop will never end and the program will hang.

I have now moved the line of code that initialises the variable to zero outside the loop, which should fix the problem. Thanks to everyone who contributed to tracking this down!

Steve
 

Offline James Patten

  • Lt. Commander
  • ********
  • J
  • Posts: 257
  • Thanked: 2 times
Re: 4.2 Bugs
« Reply #55 on: August 19, 2009, 09:10:38 AM »
I clicked on the 5-day increment advance.  I had sub-pulses set to 1 hour, I think.  Aurora started to do stuff, and then I waited about 20 minutes before giving up and forcing Aurora to shut down.

I could not get back into Aurora at all.  I kept getting repeated error messages about uncompleted events.  Looks like now if Aurora is an unknown state it cannot continue.  I had to replace the database with the 4.2 patch.