Author Topic: [Question-ANSWERED] Strange bug when changing difficulty rul  (Read 8356 times)

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
[Question-ANSWERED] Strange bug when changing difficulty rul
« 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?
« Last Edit: April 30, 2016, 12:14:39 pm by new_civilian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8626
    • View Profile
Re: [Question] Strange bug when changing difficulty
« Reply #1 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.
« Last Edit: April 29, 2016, 12:00:17 pm by Meridian »

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty
« Reply #2 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.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2011
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: [Question] Strange bug when changing difficulty
« Reply #3 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.

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty
« Reply #4 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.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8626
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #5 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?

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #6 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.  :)

Offline R1dO

  • Colonel
  • ****
  • Posts: 437
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #7 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.

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #8 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.  :)
« Last Edit: April 29, 2016, 04:29:11 pm by new_civilian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8626
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #9 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.
« Last Edit: April 29, 2016, 11:03:08 pm by Meridian »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #10 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".
« Last Edit: April 29, 2016, 11:42:31 pm by SupSuper »

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #11 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?
« Last Edit: April 30, 2016, 11:46:49 am by new_civilian »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #12 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

Offline new_civilian

  • Commander
  • *****
  • Posts: 725
    • View Profile
Re: [Question] Strange bug when changing difficulty rul
« Reply #13 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.  :)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11460
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Question-ANSWERED] Strange bug when changing difficulty rul
« Reply #14 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.