Author Topic: [SOLVED] Base Defense, Quick Battle.. what base?  (Read 5913 times)

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
[SOLVED] Base Defense, Quick Battle.. what base?
« on: April 25, 2015, 11:55:17 pm »
I wanted to test some changes I did to the base. My new terrain uses only a portion of the map files of the vanilla XBASE terrain (13 out of 20); I changed the map script/ruleset accordingly.
But when I try to do a quick battle (Base Defense mode obviously) it errors: "Map failed to fully generate". My new maps are still messy-wip (routes all over the place), but it shouldn't do that.
So I wonder, what base does it reference to build the battlescape map? Does it take the "startingBase" as defined in the ruleset? Or is it somewhere else? Or hardcoded (and so calling maps files that have been removed from my custom list)?

Thanks.
« Last Edit: April 26, 2015, 11:30:27 am by robin »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #1 on: April 26, 2015, 01:21:20 am »
I wanted to test some changes I did to the base. My new terrain uses only a portion of the map files of the vanilla XBASE terrain (13 out of 20); I changed the map script/ruleset accordingly.
But when I try to do a quick battle (Base Defense mode obviously) it errors: "Map failed to fully generate". My new maps are still messy-wip (routes all over the place), but it shouldn't do that.
So I wonder, what base does it reference to build the battlescape map? Does it take the "startingBase" as defined in the ruleset? Or is it somewhere else? Or hardcoded (and so calling maps files that have been removed from my custom list)?

Thanks.

New Battle seems to use the starting base from what I've just tested.

Usually that message appears when it tries to place maps but it is unable to do so, or for several other reasons. The issue should be with the map script. Can you post the relevant parts of the ruleset (terrain + mapScript)?

I've also got a debug version for terrains that Warboy gave me that might help.

Also, did you change the facilities section accordingly (just checking)?
« Last Edit: April 26, 2015, 01:25:02 am by Hobbes »

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #2 on: April 26, 2015, 01:57:56 am »
terrains:
  - name: XBASEN
    mapDataSets:
      - BLANKS
      - XBASEN1
      - XBASEN2
      - DOORSSEC
      - LIFTER
    civilianTypes:
      - STR_CIV_SCIENTIST_M
      - STR_CIV_SCIENTIST_F
    script: XBASEN
    mapBlocks:
      - name: XBASE_00
        width: 10
        length: 10
      - name: XBASE_01
        width: 10
        length: 10
      - name: XBASE_02
        width: 10
        length: 10
      - name: XBASE_03
        width: 10
        length: 10
      - name: XBASE_07
        width: 10
        length: 10
      - name: XBASE_08
        width: 10
        length: 10
      - name: XBASE_13
        width: 10
        length: 10
      - name: XBASE_14
        width: 10
        length: 10
      - name: XBASE_16
        width: 10
        length: 10
      - name: XBASE_17
        width: 10
        length: 10
      - name: XBASE_18
        width: 10
        length: 10
      - name: XBASE_19
        width: 10
        length: 10
      - name: XBASE_20
        width: 10
        length: 10
mapScripts:
  - type: XBASEN
    commands:
    - type: digTunnel
      direction: both
      tunnelData:
        level: 1
        MCDReplacements:
          - type: westWall
            set: 1
            entry: 15
          - type: northWall
            set: 1
            entry: 14
          - type: floor
            set: 1
            entry: 7
    - type: fillArea
      blocks: 13

facilities should be all right; I'm also using a quite old OXC version 02-02-2015 21:00.
Too tired to think more :P

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #3 on: April 26, 2015, 02:16:00 am »
Hm, you've given the command to fill the empty areas of the base with XBASE13 (Mind Shield). That might be causing issues.

Here's the debug build that Warboy gave me for map generation. I've only included the executable, so you'll need to add the /data folder and its subfolders. It will display on the log file which maps failed to be placed. https://dl.dropboxusercontent.com/u/18824603/OXC%20DEBUG.zip

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #4 on: April 26, 2015, 02:42:36 am »
battle.cfg contains _most_ of a save, including a base, the base comes from there. you can copy/paste a base layout from any save you want and paste it in there. when you hit "randomize" it regenerates this save based on the current starting base in the ruleset.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #5 on: April 26, 2015, 09:51:54 am »
Hm, you've given the command to fill the empty areas of the base with XBASE13 (Mind Shield). That might be causing issues.
Well no, in my case "blocks: 13" should point to XBASE_20. Also I hijacked XBASE_13 to be used by a new facility I made, which is a hyperwave-radar:

  - type: STR_GLOBAL_RADAR_SYSTEM
    hyper: true
    spriteShape: 2
    spriteFacility: 32
    buildCost: 1000000
    buildTime: 32
    monthlyCost: 200000
    radarRange: 10850
    radarChance: 10
    mapName: XBASE_13

(thanks for the link).

battle.cfg contains _most_ of a save, including a base, the base comes from there. you can copy/paste a base layout from any save you want and paste it in there. when you hit "randomize" it regenerates this save based on the current starting base in the ruleset.
I noticed that file and the base in it.
But check the lines starting from the 3rd STR_HANGAR, the order is like "messed":

  facilities:
    - x: 2
      type: STR_ACCESS_LIFT
      y: 2
    - y: 0
      type: STR_HANGAR
      x: 2
    - y: 4
      type: STR_HANGAR
      x: 0
    - type: STR_HANGAR
      y: 4
      x: 4
    - y: 2
      x: 3
      type: STR_LIVING_QUARTERS
    - y: 3
      x: 2
      type: STR_GENERAL_STORES
    - y: 3
      x: 3
      type: STR_LABORATORY
    - y: 3
      x: 4
      type: STR_WORKSHOP

I fixed the file manually, to see if that was the problem but the game  (my ooold build that is) messes-up the lines again every time it opens it. Also the Base Defense worked (at least it did in the campaign) before I put my custom stuff in.
« Last Edit: April 26, 2015, 09:58:42 am by robin »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #6 on: April 26, 2015, 10:58:58 am »
yeah the order in the save doesn't matter.

blocks: 13 means the 13th block, not the block named XXXXX13. you only have 12 blocks defined, of which, BASE13 is number 7
« Last Edit: April 26, 2015, 11:02:45 am by Warboy1982 »

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Base Defense, Quick Battle.. what base?
« Reply #7 on: April 26, 2015, 11:21:08 am »
not 6 (start counting from 0)?

Tough you're right about the 12 total, in fact, changing "blocks: 13" to "blocks: 12" fixed the issue.
« Last Edit: April 26, 2015, 11:29:58 am by robin »