Author Topic: Bugs & Crash Reports  (Read 1470717 times)

Offline guiliar

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Bugs & Crash Reports
« Reply #1845 on: September 12, 2017, 01:12:20 pm »
Hello.
I've updated 0.99G.5->0.99H in the middle of battle (enemy base - Traders). Perhaps not the most wise choice, but I've immediately noticed, that my SEDUCTRESSes lost their powers (could use them, but no effect, even after 5 or 6 seduction attempts on basic GO unit in one turn, reloaded couple of times.
I've also noticed, that SEDUCTRESS outfit description disappeared from my Bootypedia, which seemed weird, because only change mentioned in changelog was different computation of Evasion.

Is this a bug, or perhaps there was some other change in techtree and I have to rediscover powers of seduction?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Bugs & Crash Reports
« Reply #1846 on: September 12, 2017, 01:26:18 pm »
A bug... fix is here: https://openxcom.org/forum/index.php/topic,4187.msg87520.html#msg87520

PS: and do not update during battlescape... please.

Offline guiliar

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Bugs & Crash Reports
« Reply #1847 on: September 12, 2017, 03:40:58 pm »
A bug... fix is here: https://openxcom.org/forum/index.php/topic,4187.msg87520.html#msg87520

PS: and do not update during battlescape... please.

Thank you very much.
And no, I will not any more :-)

Offline RSSwizard

  • Commander
  • *****
  • Posts: 759
    • View Profile
Re: Bugs & Crash Reports
« Reply #1848 on: September 18, 2017, 04:13:18 am »
Upgrading from G5 to H1 most of the way into year 2.

I run a custom mod for xpiratez but I turned it off and retried to see if this would happen and it still did. I did upgrade during a battlescape mission but this problem happened in geoscape.

After getting back from a (small supply ship) mission that landed at an enemy hideout, the time counter rolled over to the next day and the game crashed without an error message. Music continued playing, window became unresponsive. No information was noted in the log file.

This isn't a research issue because none of my research projects were scheduled to complete, and it wasn't the end of the month either. So this would have to do with something other than research most likely.

(since it takes about a minute to load the game for me I don't want to do any more debug on this, im just going to start a new save game and just have this one on the back burner)
« Last Edit: September 18, 2017, 04:28:17 am by RSSwizard »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Bugs & Crash Reports
« Reply #1849 on: September 18, 2017, 09:13:29 am »
Attach the save?

Offline RSSwizard

  • Commander
  • *****
  • Posts: 759
    • View Profile
Re: Bugs & Crash Reports
« Reply #1850 on: September 18, 2017, 09:36:47 pm »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Bugs & Crash Reports
« Reply #1851 on: September 19, 2017, 12:26:39 pm »
After getting back from a (small supply ship) mission that landed at an enemy hideout, the time counter rolled over to the next day and the game crashed without an error message. Music continued playing, window became unresponsive. No information was noted in the log file.

This isn't a research issue because none of my research projects were scheduled to complete, and it wasn't the end of the month either. So this would have to do with something other than research most likely.

Doesn't crash for me... just freezes for 2-3 seconds until it figures out all the research dependencies.

Then it resumes and gives me the following research popups:
- destroyed mk.801
- hypno panel
- decrypted data disc

EDIT: when using debug version, it froze for about 1 minute for me, then recovered:
- if you're compiling your own version, make sure to build a Release build, not Debug build
- if you're not compiling yourself, maybe you have a bit slower machine... just wait until it finishes... and let me know how long it took please
« Last Edit: September 19, 2017, 12:34:52 pm by Meridian »

Offline RSSwizard

  • Commander
  • *****
  • Posts: 759
    • View Profile
Re: Bugs & Crash Reports
« Reply #1852 on: September 21, 2017, 11:19:17 pm »
Quote
EDIT: when using debug version, it froze for about 1 minute for me, then recovered:
- if you're compiling your own version, make sure to build a Release build, not Debug build
- if you're not compiling yourself, maybe you have a bit slower machine... just wait until it finishes... and let me know how long it took please

Im not a programmer and dont have a clue how to compile something. So im just using your standard stock executable. I do have a slow machine (single core 1600mhz, 2gb ram, windows 7) and it takes about 1 minute for the game to startup after running it.

I also frequently have a Browser with Facebook Messenger loaded in it which competes for memory, but it almost never has any real problems because of this (I need to have other things open just because I have contacts I have to stay connected to through the day).

Any idea why it could freeze for so long? I would also ask why it takes up 1 Gb of ram since piratez itself is only about 150mb at best...

Edit - I decided to let it sit there and chug at whatever it was doing and I guess after 30-60sec it finished the research dependencies bit and I was able to continue playing. Thanks for giving that insight.
« Last Edit: September 21, 2017, 11:38:28 pm by RSSwizard »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Bugs & Crash Reports
« Reply #1853 on: September 22, 2017, 12:03:48 am »
Any idea why it could freeze for so long?

Because it has to calculate a lot.
The piratez tech tree is huge and the ruleset engine is too powerful... it allows too much and all that costs CPU time.
It can be improved either by making it less powerful (for example removing the "zero cost research" would save tons of time) or by making a new one (with simpler rules or just different rules, that are easier to check in such huge trees).
Both solutions would break compatibility... so... yeah.

I would also ask why it takes up 1 Gb of ram since piratez itself is only about 150mb at best...

When resources are loaded into memory, they are not compressed... you wouldn't want to decompress a GIF or PNG each time you want to draw it on the screen.
« Last Edit: September 22, 2017, 12:08:19 am by Meridian »

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Bugs & Crash Reports
« Reply #1854 on: September 22, 2017, 01:14:48 am »
Because it has to calculate a lot.
The piratez tech tree is huge and the ruleset engine is too powerful... it allows too much and all that costs CPU time.
It can be improved either by making it less powerful (for example removing the "zero cost research" would save tons of time) or by making a new one (with simpler rules or just different rules, that are easier to check in such huge trees).
Both solutions would break compatibility... so... yeah.

When resources are loaded into memory, they are not compressed... you wouldn't want to decompress a GIF or PNG each time you want to draw it on the screen.
One possible improvement that do not change functionality is change of memory layout of data that program use. Slowest operation on current architecture is memory access (nearly 100 time cost of add instruction). Even more if we prepare some light weight auxiliary data structure that have only needed data we could reduce it even more. Look what I did with new lighting, game need do 100 time more calculations but overall speed is not reduced that much.
Something similar could be applied too to research tree.

Offline RSSwizard

  • Commander
  • *****
  • Posts: 759
    • View Profile
Re: Bugs & Crash Reports
« Reply #1855 on: September 22, 2017, 04:56:22 am »
When resources are loaded into memory, they are not compressed... you wouldn't want to decompress a GIF or PNG each time you want to draw it on the screen.
Understandable about the freezes. Though point of fact, when a program is chugging like that windows declares it to be non-responsive if you click on it (grays the window out) and may ask if you want to terminate the program.

Also in this case with the save file I posted I had underestimated the sheer amount of changes that had been made to the research tree between versions, which the game had to fully process. Guess that was the equivalent of when the patch update happened I just didnt expect it there.

One possible improvement that do not change functionality is change of memory layout of data that program use.

If you're taking up 1 Gb of ram, apparently it is loading ALL of the resources for the entire mod (and game) all into memory and then just leaving it there until it references it. I had no idea it was doing this so I was thinking there was something wrong with the way it was operating in memory.

Easy solution for that is don't load resources from the hard drive (only keep them queued) until the program actually needs to use them. Then for example at certain points where those resources wont be needed for awhile... unload them from memory. When a ground mission ends (also would apply to all tactical musics)... when you close the ufopedia...

(you could even go as far as to defer loading on demand for certain classes of images, such as only loading the paper dolls for units that you've actually seen the inventory screen of - how often does one successfully mind control an enemy unit for the majority of the game...)

Even on my computer the HD bump to load those resources would be barely noticeable, and on a modern machine it wouldn't even register.

There are a ton of game resources that you will probably never see until very late in the game, that are being loaded and just left there in memory unnecessarily.

Only exemptions I can think of for this would be anything in the native game package formats like the .dat files and terrain stuff. Safe to say that probably no modder, dioxine included, will package up the bulk of their mod into the arcane vanilla formats.

(for example if resources were being loaded on demand someone could technically modify some inventory or ufopedia graphic on the hd, open the ufopedia and look at the item and it would be different because it wouldnt have been retained in memory; rinse and repeat. There is no real functionality for this and I wouldnt care for using it that way, but its to illustrate an example)

Less resources floating around may also reduce stability problems and other overhead.

----

Possible Bug:
In my playthrough (which started on .99 G5) it seems that Spartan Ships are being used by Raiders, and Raider Ships are being used by Spartans. Screenshot attached. There's nothing wrong with the battles or anything, its just this switch is something that has been consistently going on ever since they showed up.


Offline Dioxine

  • Commander
  • *****
  • Posts: 5420
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Bugs & Crash Reports
« Reply #1856 on: September 22, 2017, 06:01:13 pm »
1. As it currently goes, Piratez is not reccomended for machines with less than 3GB RAM. I'd welcome any performance improvement, but I'd be more grateful to increase drawing speed so the game doesn't slow down to a crawl with a maximized display and a very large map on my i5 quad core with 12GB RAM.
2. @Paperdolls: you do realize that you don't need to MC enemy units to see their paperdolls, right?
3. @Spartans/Raiders: it's all explained in game.

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Bugs & Crash Reports
« Reply #1857 on: September 22, 2017, 07:49:37 pm »
If you're taking up 1 Gb of ram, apparently it is loading ALL of the resources for the entire mod (and game) all into memory and then just leaving it there until it references it. I had no idea it was doing this so I was thinking there was something wrong with the way it was operating in memory.

Easy solution for that is don't load resources from the hard drive (only keep them queued) until the program actually needs to use them. Then for example at certain points where those resources wont be needed for awhile... unload them from memory. When a ground mission ends (also would apply to all tactical musics)... when you close the ufopedia...

(you could even go as far as to defer loading on demand for certain classes of images, such as only loading the paper dolls for units that you've actually seen the inventory screen of - how often does one successfully mind control an enemy unit for the majority of the game...)

Even on my computer the HD bump to load those resources would be barely noticeable, and on a modern machine it wouldn't even register.

There are a ton of game resources that you will probably never see until very late in the game, that are being loaded and just left there in memory unnecessarily.

Only exemptions I can think of for this would be anything in the native game package formats like the .dat files and terrain stuff. Safe to say that probably no modder, dioxine included, will package up the bulk of their mod into the arcane vanilla formats.

(for example if resources were being loaded on demand someone could technically modify some inventory or ufopedia graphic on the hd, open the ufopedia and look at the item and it would be different because it wouldnt have been retained in memory; rinse and repeat. There is no real functionality for this and I wouldnt care for using it that way, but its to illustrate an example)

Less resources floating around may also reduce stability problems and other overhead.
Of corse, but this is easier to say than done, it would require rewriting half of engine to support it. I only suggest optimization without refactoring whole game.
In many places OXC code is written suboptimal and with couple of tricks you could speed up everything 10 or more times.

Offline RSSwizard

  • Commander
  • *****
  • Posts: 759
    • View Profile
Re: Bugs & Crash Reports
« Reply #1858 on: September 22, 2017, 10:25:10 pm »
1. As it currently goes, Piratez is not reccomended for machines with less than 3GB RAM. I'd welcome any performance improvement, but I'd be more grateful to increase drawing speed so the game doesn't slow down to a crawl with a maximized display and a very large map on my i5 quad core with 12GB RAM.
2. @Paperdolls: you do realize that you don't need to MC enemy units to see their paperdolls, right?
3. @Spartans/Raiders: it's all explained in game.

1) news to me, figured specs were identical to standard openxcom
Personally I play the game windowed at 640x400 with x2 resolution (effectively 320x200), and no filters. There's alot of scrolling and minimap jumping involved.

2) have no idea how to do that, the only paperdolls ive seen for them are the ones referenced in bootypedia splashes

3) Okay no problem. I guess I just haven't done enough research to find out yet.

Offline Yankes

  • Commander
  • *****
  • Posts: 3210
    • View Profile
Re: Bugs & Crash Reports
« Reply #1859 on: September 23, 2017, 12:37:10 am »
@Meridian
There commit that speedup 2x research checks: https://github.com/Yankes/OpenXcom/commit/226a404f1e4423a06023fe52b2e86736bf24ba91
Biggest grain is from sorting, probably another refactoring could increases this again 2x, but I will leave it for another time.