OpenXcom Forum

Modding => Work In Progress => Topic started by: NeoWorm on June 26, 2017, 01:08:34 am

Title: Outdoor maps height question
Post by: NeoWorm on June 26, 2017, 01:08:34 am
Just a quick question I hope. I would like to make all outdoor maps higher than in vanilla. Preferably 10 tiles high like in Pirates to give flying units little more space. Can it be done from rulesets or just by modifying maps? If the latter how to do that most effectively?
Title: Re: Outdoor maps height question
Post by: Hobbes on June 26, 2017, 01:25:39 am
Just a quick question I hope. I would like to make all outdoor maps higher than in vanilla. Preferably 10 tiles high like in Pirates to give flying units little more space. Can it be done from rulesets or just by modifying maps? If the latter how to do that most effectively?

It needs to be done through rulesets, on the alienDeployment entries for each type of mission. The height listed there is the one used by the game when building the Battlescape. If the maps are lower than that value it simply adds empty space on top. But if the map files have heights superior than the ones listed on alienDeployment then OpenXcom will crash.
Title: Re: Outdoor maps height question
Post by: NeoWorm on June 26, 2017, 01:35:10 am
It needs to be done through rulesets, on the alienDeployment entries for each type of mission. The height listed there is the one used by the game when building the Battlescape. If the maps are lower than that value it simply adds empty space on top. But if the map files have heights superior than the ones listed on alienDeployment then OpenXcom will crash.
That sounds leagues simplier than I hoped. I am going to just add height, so it should be fine. Thanks
Title: Re: Outdoor -AND INDOOR- maps height question
Post by: robin on March 31, 2018, 12:18:03 pm
necromancy!

What to do when i have terrains with different map heights assigned to the same alienDeployment and I don't want empty layers added?
I have a terrain with height 4, and another terrain with height 1: they're interior terrains so I don't want empty layers added on top. The obvious solution would be to "pad" the shorter terrain with layers full of "concrete" block so it become as high as the higher.. is it the only option?
Title: Re: Outdoor -AND INDOOR- maps height question
Post by: Solarius Scorch on March 31, 2018, 12:49:44 pm
necromancy!

What to do when i have terrains with different map heights assigned to the same alienDeployment and I don't want empty layers added?
I have a terrain with height 4, and another terrain with height 1: they're interior terrains so I don't want empty layers added on top. The obvious solution would be to "pad" the shorter terrain with layers full of "concrete" block so it become as high as the higher.. is it the only option?

Unfortunately I don't think there is another solution. Unless Ohartenstein23 comes up with a script to add solid block fillers where needed, but I don't know if it's possible.
Title: Re: Outdoor maps height question
Post by: Meridian on March 31, 2018, 02:01:51 pm
That sounds leagues simplier than I hoped. I am going to just add height, so it should be fine. Thanks

Don't add too many... otherwise you might get into performance issues.
Title: Re: Outdoor maps height question
Post by: 7Saturn on March 31, 2018, 02:12:43 pm
Out of curiosity: Is there also some sort of line of sight distance in height? Something like 10 levels, not more can be seen for a unit? So in essence, making it possible to fly behind enemy lines unseen?
Title: Re: Outdoor -AND INDOOR- maps height question
Post by: robin on March 31, 2018, 02:45:06 pm
Unfortunately I don't think there is another solution. Unless Ohartenstein23 comes up with a script to add solid block fillers where needed, but I don't know if it's possible.
Thanks. It's not really a bad solution, extremely easy to implement for the mapper.
Title: Re: Outdoor -AND INDOOR- maps height question
Post by: ohartenstein23 on March 31, 2018, 03:33:53 pm
Unfortunately I don't think there is another solution. Unless Ohartenstein23 comes up with a script to add solid block fillers where needed, but I don't know if it's possible.

The script option already exists in verticalLevels - if you make a 10x10x1 "concrete fill" map, then you can have that pad the short maps out:
Code: [Select]
mapScripts:
  - type: INDOOR_MAP
    commands:
    #...
    - type: addBlock
      size: [1, 1, 4] # if map height is 4
      verticalLevels:
      - type: ground
        # whatever blocks or groups you want, but make sure the heights are defined in terrains as well as the widths/lenghts
      - type: middle
        size: [1, 1, 1]
        # the blocks or groups that correspond to the 10x10x1 filler map block
      #...

This should fill out any short 10x10 blocks.
Title: Re: Outdoor maps height question
Post by: Hobbes on March 31, 2018, 05:25:49 pm
Out of curiosity: Is there also some sort of line of sight distance in height? Something like 10 levels, not more can be seen for a unit? So in essence, making it possible to fly behind enemy lines unseen?

According to UFOPaedia.org (https://www.ufopaedia.org/index.php/Line_of_sight) in the original game height had no effect on a unit's visual range, so a unit will see 21 tiles on every direction regardless of the height of the tiles
Title: Re: Outdoor maps height question
Post by: Meridian on March 31, 2018, 05:42:11 pm
According to UFOPaedia.org (https://www.ufopaedia.org/index.php/Line_of_sight) in the original game height had no effect on a unit's visual range, so a unit will see 21 tiles on every direction regardless of the height of the tiles

I can confirm this is still true in OpenXcom.
LOS-related distance calculations ignore Z-levels.
Title: Re: Outdoor maps height question
Post by: Hobbes on March 31, 2018, 06:36:24 pm
LOS-related distance calculations ignore Z-levels.

This would mean that in a map with 1000 height, a unit on level 0 would be able to see only 20 tiles on the x/y-axis and 999 levels on the z-axis

Another fine piece of XCom physics: light has unlimited speed in the z-axis

Title: Re: Outdoor maps height question
Post by: 7Saturn on March 31, 2018, 07:53:07 pm
OK, then I imagined that right. Was just curious, if there had been any change on Openxcom.