OpenXcom Forum

Modding => Work In Progress => Topic started by: new_civilian on April 29, 2016, 11:33:56 am

Title: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: new_civilian on April 29, 2016, 11:33:56 am
I made this difficulty-rule-file for my own personal use:

Code: [Select]
difficultyCoefficient: [0, 1, 2, 4, 6]
aimAndArmorMultipliers: [0.5, 0.8, 1.0, 1.1, 1.2]
statGrowthMultipliers:
  tu: 8
  stamina: 8
  health: 0
  bravery: 0
  reactions: 6
  firing: 6
  throwing: 0
  strength: 4
  psiStrength: 3
  psiSkill: 3
  melee: 8
turnAIUseGrenade: 0
turnAIUseBlaster: 0
constants:
  - damageRange: 100
  - explosiveDamageRange: 50
  - fireDamageRange: [10, 20]

As you can see I did nothing dramatic, I increased the flame damage, made the AI more aggressive etc, that all works fine. No problem. I checked and double checked.

HOWEVER:

Every time the AI now tries to use grenades the game CTD's. I also changed some unit-rul-file stats (increased them basically) so I guess the strength somehow goes bananas and causes a CTD because of strange flightpathes due to super-powered aliens.

Right?  :-\

As soon as I remove the stats changes the game works fine. (Have to restart tac missions of course).

So, what EXACTLY causes the CTD? Is it the strength?
Title: Re: [Question] Strange bug when changing difficulty
Post by: Meridian on April 29, 2016, 11:56:50 am
My guess:

Code: [Select]
turnAIUseGrenade: 1
turnAIUseBlaster: 1

There is no turn 0.

If you have a save, I can have a look.
Title: Re: [Question] Strange bug when changing difficulty
Post by: new_civilian on April 29, 2016, 12:16:08 pm
I changed that during my testing to 3 and then the game crashed at turn three so that is not the problem.

here the save, take a look at Muton unit nr. 1000009, in the (trace-AI eneabled) logfile he was always the last one to appear before the crash. Once I deleted him the crash appeared after Muton nr. 10000017.
Title: Re: [Question] Strange bug when changing difficulty
Post by: hellrazor on April 29, 2016, 02:06:24 pm
My guess:

Code: [Select]
turnAIUseGrenade: 1
turnAIUseBlaster: 1

There is no turn 0.

If you have a save, I can have a look.

Setting this to 0 shouldn't be the issue, it just means that aliens can fire for example Small Launchers in your first directly, setting it 1 would made this weapon only avaible from their first turn.

You should check the maximum values of these growstat modifiers.
Title: Re: [Question] Strange bug when changing difficulty
Post by: new_civilian on April 29, 2016, 02:12:14 pm
For the moment I deleted the file as it caused CTDs no matter what. I even removed the growstat modifiers completely from my file and still got CTDs.
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: Meridian on April 29, 2016, 02:14:31 pm
I can't load the save without your mod at all (CTD at load).
Mind posting that?
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: new_civilian on April 29, 2016, 02:21:51 pm
The file is too big to be attached. But don't worry anymore, Meridian, I simply don't mod that fiile anymore, it's not a big thing.  :)
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: R1dO on April 29, 2016, 03:04:57 pm
The file is too big to be attached. But don't worry anymore, Meridian, I simply don't mod that fiile anymore, it's not a big thing.  :)

Please do provide them (if needed by a dropbox kind of service) .. even when you are not interested in it anymore.
It might be indicative of some error that can popup later, or for other players.
By providing the save and mod you will give the devs a chance to fix the error before it bites someone else.
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: new_civilian on April 29, 2016, 04:17:14 pm
ok will do. give some minutes


Ok this hopefully works, never used that host before.

https://s000.tinyupload.com/index.php?file_id=24292313911263939981

The zip does however no longer include the difficulty.rul file, just copy-n-paste the one from above^

And remember this is a personal mod not meant for release, so I was not concerned with copyright issues.  :)
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: Meridian on April 29, 2016, 08:19:17 pm
Well, good news, it's not caused by the difficulty.rul

I just used one part of it (so that they can throw)
Code: [Select]
turnAIUseGrenade: 1
turnAIUseBlaster: 1

Bad news, it crashes... on targeting check... some tile is passed as null... I don't know what it means, maybe someone else can comment... maybe a map problem? See attached.
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: SupSuper on April 29, 2016, 11:38:32 pm
The crashes are being caused by out-of-bounds route nodes in these positions:
{x=8, y=8, z=-2}
{x=8, y=3, z=-2}
{x=48, y=8, z=-2}
{x=48, y=3, z=-2}
You need to correct the respective map block file.
It's too late for the save, as the map has already been generated, although you can edit it with a text editor and change every node with position "-2" to "0".
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: new_civilian on April 30, 2016, 11:39:15 am
The crashes are being caused by out-of-bounds route nodes in these positions:
{x=8, y=8, z=-2}
{x=8, y=3, z=-2}
{x=48, y=8, z=-2}
{x=48, y=3, z=-2}
You need to correct the respective map block file.
It's too late for the save, as the map has already been generated, although you can edit it with a text editor and change every node with position "-2" to "0".

I have to tell that Hobbes right away,  it's his terrain.

BUT wait a minute, why does the game not crash when i remove the difficulty-rul file then?

hmmmm maybe my editing now (with better Muton stats) allows the muton to target that node that he couldn't target before?
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: Warboy1982 on April 30, 2016, 11:53:52 am
because the numbers you're playing around with affect AI behaviour, and it chose to do something else
Title: Re: [Question] Strange bug when changing difficulty rul
Post by: new_civilian on April 30, 2016, 12:14:22 pm
Ok, thanks for the info and help everyone! I will add an "answered" to the topic title right away.  :)
Title: Re: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: Solarius Scorch on April 30, 2016, 12:52:54 pm
Sorry, which map block is it? I can see it's Dawn City, but I can't identify which one it is.
Title: Re: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: Hobbes on April 30, 2016, 04:19:47 pm
Sorry, which map block is it? I can see it's Dawn City, but I can't identify which one it is.

DAWNURBAN01. Bug already reported (https://openxcom.org/forum/index.php/topic,2358.msg54670.html#msg54670) to me and fixed in November last year

Which mods are you running? It's likely that they don't have the updated file

But what I'm curious is that I thought the Battlescape generator had been updated on a nightly around November that sanitized those kind of bad nodes so that they wouldn't be used and prevent this type of situations. Or maybe I'm mistaken?
Title: Re: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: Meridian on April 30, 2016, 04:23:34 pm
DAWNURBAN01. I've already fixed that map though back in November, IIRC

But what I'm curious is that I thought the Battlescape generator had been updated on a nightly around November that sanitized those kind of bad nodes so that they wouldn't be used and prevent this type of situations. Or maybe I'm mistaken?

Partially. The rest was added yesterday.
Title: Re: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: SupSuper on May 01, 2016, 09:51:29 pm
But what I'm curious is that I thought the Battlescape generator had been updated on a nightly around November that sanitized those kind of bad nodes so that they wouldn't be used and prevent this type of situations. Or maybe I'm mistaken?
We didn't expect editors to allow negative values. (https://github.com/SupSuper/OpenXcom/commit/3e64d7ddc6cc38a103f18e8659036a1ae8625431) :P
Title: Re: [Question-ANSWERED] Strange bug when changing difficulty rul
Post by: new_civilian on May 02, 2016, 02:48:17 pm
Fwiw: I updated my mod to the newest versions of Hobbes' terrains and maps, so hopefully this is no longer a problem. I think in the future I will just use his mod as a starting point for my own personal mod, that way it's easier to keep the maps up-to-date  8)