aliens

Author Topic: [Deadly bug] The game cracks during tactical fight  (Read 9636 times)

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
[Deadly bug] The game cracks during tactical fight
« on: September 09, 2014, 11:21:31 pm »
Load the game from the attachment, and give move to the aliens. The game will crack.

In  openxcom_git_master_2014_09_09_0725, the message says:

vector::_M_range_check

In the version 1.0 the message is:

invalid vector<T> subscript

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #1 on: September 10, 2014, 12:58:06 am »
Almost the same happens to me in the attached savegame, already reported here since I am using that mod along with Hobbes terrain pack.

I stumbled upon this report and since it's quite the same I thought it might be okay to append my report.

My eror message is:

[09-09-2014 23:39:15]   [FATAL]   vector::_M_range_check: __n (which is 304) >= this->size() (which is 92)

92 is the number of nodes in the map as stated in the savefile.

Offline Infini

  • Colonel
  • ****
  • Posts: 109
  • Alien French Translator
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #2 on: September 10, 2014, 01:03:36 am »
Same here.  What is it, I don't know.
Mods, new builds (not sure)...

Virus... :o    :)

I start a new game (vanilla), and see.

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #3 on: September 10, 2014, 02:12:46 am »
I have found a possible solution!

The problem has caused most probably by errors in RMP files in non-genuine UFOs.

Some time ago, someone said that distances between nodes in routes maps are not things to worry about. This is not true! I have noticed that if zero is set as the distance between nodes, OXC may crash during an alien move (if this map is loaded). It is because an alien wants to move, and the game cannot count the distance. For some reason, either negative or more than 255 values appear, and this causes the crash.

The original game seemed to be resistant to such errors. Unfortunately, OXC is very sensitive in this point, and our otherwise great coders (many thanks for OXC!) said that they would not deal with it, and delete this problem as a bug. So, it is modders who must repair their maps instead...

What is a solution?

The solution for NOW: If you play a campaign, and just want to finish the battle which constantly crashes, you must edit your save. Find all alien units, and set their morale to 0. Your battle is practically won - but this will prevent crashes. It is so because alien units will not move on their own, only when panicked. If you make several turns, and the game will crashes again, you must edit again the save.

The long-distance solution is to stop playing Luke's Extra UFOs and/or Final Modpack (cause both contain wrong RMP's) until new versions will be ready. I am about editing them and make them work all right but it needs much time... If you cannot wait, use MapView and replace all naught-distances with their true values. MapView 1.12 can make them automatically. It is a very tedious job as you must check each node one by one... So better wait for a patched version of your mod.

Anyway, I have checked that this is a real problem. Parhaps thera are other reasons for game crashes - if you find any, write about them.

Offline skymarshall

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #4 on: September 10, 2014, 02:23:41 am »
If you hit bugs in the battlescape and want to get back to the geoscape, set the debug flag in your config file (My Documents\OpenXcom\options.cfg on windows) and then whenever you hit a problem, you can press ^D (to enable debug) and ^K (to kill the aliens).  No need to edit save files each time.

Offline Infini

  • Colonel
  • ****
  • Posts: 109
  • Alien French Translator
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #5 on: September 10, 2014, 03:25:27 am »
STRANGELY, I'm an Acronis user.  I did an entire "system restore" to a previous point.
I'm using another openxcom game (openxcom_git_master_2014_08_28_0308 ; complete fresh reinstall)
I had the problem with this build too (before restore), I'm trying to "avoid" something... what is it ?  Bad build, virus, etc

No problem since more than hour, many tactical combats.
Before, it was frequent.

I suspect something, but I hope that I'm wrong.

If someone want to test my suggestion, we'll see.

Mod installed: Latest Beta "Equal Terms" 1.975, no maps

I tried before with maps or not, CTD

TX

Problem appeared with a very recent build (probably)... or a new map  (probably)?  Not 100% sure
« Last Edit: September 10, 2014, 03:48:55 am by Infini »

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #6 on: September 10, 2014, 04:43:30 am »
Abductors (Extra UFOs) corrected (as for now, more to come...). The patch will affect new missions only.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #7 on: September 10, 2014, 05:12:59 am »
I have found a possible solution!

The problem has caused most probably by errors in RMP files in non-genuine UFOs.

Some time ago, someone said that distances between nodes in routes maps are not things to worry about. This is not true! I have noticed that if zero is set as the distance between nodes, OXC may crash during an alien move (if this map is loaded). It is because an alien wants to move, and the game cannot count the distance. For some reason, either negative or more than 255 values appear, and this causes the crash.

The original game seemed to be resistant to such errors. Unfortunately, OXC is very sensitive in this point, and our otherwise great coders (many thanks for OXC!) said that they would not deal with it, and delete this problem as a bug. So, it is modders who must repair their maps instead...
We don't use the distance values in RMP node links, so don't bother.

On openxcom_git_master_2014_09_09_0701 we put out a fix to RMP problems with mods with a lot of nodes. Clearly the fix wasn't enough, causing these new bugs. That's what you subject yourself to when using nightlies. :P

openxcom_git_master_2014_09_10_0421 should have a better fix, let me know if new missions work fine now. In-progress missions can't be fixed and will just have to be cheated away if the bug occurs.
« Last Edit: September 10, 2014, 05:57:35 am by SupSuper »

Offline Infini

  • Colonel
  • ****
  • Posts: 109
  • Alien French Translator
    • View Profile
Re: [Deadly bug] The game cracks during tactical fight
« Reply #8 on: September 10, 2014, 05:14:59 am »
Quote
We don't use the distance values in RMP node links, so don't bother.

On openxcom_git_master_2014_09_09_0701 we put out a fix to RMP problems with mods with a lot of nodes. Clearly the fix wasn't enough, causing these new bugs. That's what you subject yourself to when using nightlies. :P

openxcom_git_master_2014_09_10_0404 should have a better fix, let me know if new missions work fine now. In-progress missions can't be fixed and will just have to be cheated away if the bug occurs.

So, it's not a virus ?

Good news then !

 :)

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #9 on: September 10, 2014, 11:32:51 am »
If you hit bugs in the battlescape and want to get back to the geoscape, set the debug flag in your config file (My Documents\OpenXcom\options.cfg on windows) and then whenever you hit a problem, you can press ^D (to enable debug) and ^K (to kill the aliens).  No need to edit save files each time.

Enabling debugging is useful if you are skillful in C++ programming and can understand the messages, and it does not help you to pass the mission. Killing aliens will help in your playing - but you will not get any information of possible reasons. Editing a save with Notepad++ or a similar tool is really very simple unless you cannot understand the contains of the savefile at all (but then you may not be able to edit options.cfg either). Making aliens not move (by setting their morale to 0) does not stop your campaign, and allows you both to pass the mission and to learn something about possible reasons even without deciphering the debugging information (aliens do not move by themselves => the game does not crash).

Anyway, thanks for the info on debugging ;).

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #10 on: September 10, 2014, 11:47:14 am »
Same here.  What is it, I don't know.
Mods, new builds (not sure)...

Virus... :o    :)

I start a new game (vanilla), and see.

In such situations we should eliminate some possible reasons. First, do other programs crash on your system? If not, it is not a virus that causes crashes. There is no need to restore the system. Second, check the source of game files (those copied from UFO:EU to OXC installation). Third, check if you have applied the patch (Universal Patch) that is really needed to eliminate some bugs. And now learn if OXC crashes during playing an unmodified game. If yes, check it with older builds and with the stable 1.0 version. If not, the problem is surely connected to mods, and not viruses, not to new builds.

Equal Terms mod does not seem to contain new maps or routes. So, your problem looks quite interesting. More info is needed...

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #11 on: September 10, 2014, 11:58:35 am »
@SupSuper, thanks a lot! And I was scared when saw that: https://openxcom.org/bugs/openxcom/issues/819. It is not a bug, not an issue etc.

Nighlies are to be tested, aren't they? :) But for curiosity, I wonder if the same bug can occur with the version 1.0 as well when starting a new mission... I'll check it as well, hopefully I have also a save made just before the mission is generated.

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: [Deadly bug] The game cracks during tactical fight
« Reply #12 on: September 10, 2014, 02:53:27 pm »
Checked, in the newest build all seem to work fine, and there is Alien Habitat (hoorah!), thank you once again :)

(For curious ones: Alien Habitat is available only after changing some game files into patched ones; I prefer to term it a patch, not a mod, because the original game does not have Alien Habitat due to an error in data files: you can obtain those Alien-Habitat-having partched data files from my mod https://www.openxcom.com/account/manage-mod?ModID=371 - copy all the files, overwriting the existing ones, but if you do not want changes in the research tree, just do not switch the mod on.)

Indeed, the stable release 1.0 does not experience such RMP problems, at least during my 10 tests or so (with an Abducter tactic battle generated again and again).