aliens

Author Topic: [Documentation] [Feedback] Map Editor  (Read 16302 times)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #15 on: July 27, 2021, 09:19:59 pm »
Don't need the log to tell you what's not working - I only drew sprites for the Map Editor UI for UFO.

If you want to use this in TFTD, then you'll need to add the UI sprites either through a mod or by adding it to the "standard" folder in your installation. This means:

1. Making a copy of the image file located at standard/xcom1/Resources/Extended/UI/mapeditor_icons.png, editing it to the TFTD palette, and placing it either in the standard/xcom2 folder or your own mod.

2. Referencing this new image file in a ruleset file, either in standard/xcom2/extraSprites.rul if you put the image in the standard folder or somewhere in your own mod, containing the following lines:

Code: [Select]
extraSprites: # must be somewhere under the extraSprites header
  - type: MapEditorIcons
    width: 320
    height: 240
    subX: 32
    subY: 40
    files:
      0: Resources/Extended/UI/mapeditor_icons.png #this is for putting it in the standard folder, change it to wherever you put the image

Offline 4ky

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #16 on: July 27, 2021, 10:26:32 pm »
Thank you so much. The obvious is incredible. It never occurred to me, that they actually didn’t exist.  :o
It works. If not difficult, please include these changes in next stable release.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #17 on: July 28, 2021, 02:20:25 am »
I wasn't planning on drawing TFTD sprites until I had a full release candidate. However, if you have a standalone mod that gets it working, I'll update the first post with a link to it.

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #18 on: July 29, 2021, 09:22:29 am »
You told that there is an issue with drawing light sources and shade like the game does it (including advanced light path algorithms). What is the actual problem, if it still persist?

Offline 4ky

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #19 on: July 31, 2021, 08:16:08 pm »
One of TFTD map results in an crash by unexpected error. Apparently this is a rout-mistake of the developers of the game itself. Is there anything you can do to handle errors like this correctly? Or is it a special case, that does not require intervention? In any case, this is not a problem, as long as there are other map editors that can be used to fix the .RPM file. Just in case, I am attaching files, although in theory this error can be reproduced on any standard ones.

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #20 on: July 31, 2021, 10:37:26 pm »
@ohartenstein23

looks like 4ky's issue (above^) is an out-of-bounds node(s). But i just want to note (in case you're unaware of this) that several TFTD route-files have noderanks that are set to an invalid value ... ie. 9 when the limit is 0..8

/iirc

not sure how ( or if ) you want to handle those

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #21 on: August 01, 2021, 04:25:09 pm »
You told that there is an issue with drawing light sources and shade like the game does it (including advanced light path algorithms). What is the actual problem, if it still persist?

The problem was that updating lighting for the entire map is computationally expensive, and the editor can call for lighting updates rather quickly. To prevent slowdown from that, I believe I only call for updates in the (x, y) column of tiles when a tile is added or removed. Also, I haven't added any way to check the map with different global shade values.

One of TFTD map results in an crash by unexpected error. Apparently this is a rout-mistake of the developers of the game itself. Is there anything you can do to handle errors like this correctly? Or is it a special case, that does not require intervention? In any case, this is not a problem, as long as there are other map editors that can be used to fix the .RPM file. Just in case, I am attaching files, although in theory this error can be reproduced on any standard ones.

@ohartenstein23

looks like 4ky's issue (above^) is an out-of-bounds node(s). But i just want to note (in case you're unaware of this) that several TFTD route-files have noderanks that are set to an invalid value ... ie. 9 when the limit is 0..8

/iirc

not sure how ( or if ) you want to handle those

As kevL said, some RMP files in TFTD have invalid node values and positions. The editor doesn't have any extra validation yet, so you'll have to use another tool like MapView or a hex editor to correct those before my code will be able to handle that map. I'll add it to my list to for for my next update.
« Last Edit: August 01, 2021, 07:51:46 pm by ohartenstein23 »

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #22 on: August 03, 2021, 03:31:14 pm »
The problem was that updating lighting for the entire map is computationally expensive, and the editor can call for lighting updates rather quickly. To prevent slowdown from that, I believe I only call for updates in the (x, y) column of tiles when a tile is added or removed. Also, I haven't added any way to check the map with different global shade values.

Well, to me would be good any kind of solution - when changing tile, or even with hitting some button to calculate shades, and in that mode you can't edit the map, just observe it. Could be a new mode together with tile/nodes. Any solution would better than saving map, moving it from save to mod, closing and reopening the game and launching battlescape.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #23 on: August 03, 2021, 04:50:16 pm »
Well, to me would be good any kind of solution - when changing tile, or even with hitting some button to calculate shades, and in that mode you can't edit the map, just observe it. Could be a new mode together with tile/nodes. Any solution would better than saving map, moving it from save to mod, closing and reopening the game and launching battlescape.

Updating whole map lighting on changing a tile is a slowdown that I don't want to introduce into the editor. I will have an option to better preview the map in the future without needing to load it into a mod.

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #24 on: August 03, 2021, 10:28:07 pm »
Updating whole map lighting on changing a tile is a slowdown that I don't want to introduce into the editor. I will have an option to better preview the map in the future without needing to load it into a mod.

Ok, I see you reason. What about my idea to make a 3ed mode (together with tiles and nodes) with preview of lightning, where i can choose shading, but i will not be able to edit tiles, so no recalculation but lightning on changing this mode setting from its menu?

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #25 on: February 16, 2022, 11:22:02 pm »
Looks like Map Editor with it's current release is not compatible to recent OXCE version. For instance, it fails to load the mod with recently changed `aggroSound: []` property, that was changed to an array.
Any chance Map Editor would be updated to handle that?

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #26 on: March 14, 2022, 03:14:11 am »
Any chance to have an update? Released version does not support changed `aggroSound: []` property and fails to load mod... I tried to build your current branch myself (looking to update it), but it fails to build with multiple errors in map editor part  :'(

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #27 on: October 23, 2022, 01:17:01 pm »
I am attempting to compile it myself, but I face some compilation errors, that I can't handle. Maybe you guys can provide me a tip?
Source: https://github.com/ohartenstein23/OpenXcom/tree/battlescape-editor
Visual Studio 2019
It looks like many (if not all) new map editor's stuff is not linked, how can I fix those?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #28 on: October 24, 2022, 02:23:51 pm »
You do not include every file to solution

Offline Finnik

  • Colonel
  • ****
  • Posts: 490
  • Finnik#0257
    • View Profile
Re: [Documentation] [Feedback] Map Editor
« Reply #29 on: October 24, 2022, 08:43:05 pm »
You do not include every file to solution

Thanks, that helped! =) apparently, it looked like @ohartenstein23 does not use VS code, so .sln file misses important definitions.
https://github.com/Finnik723/OpenXcom/tree/battlescape-editor
« Last Edit: October 24, 2022, 08:47:59 pm by Finnik »