OpenXcom Forum

Modding => OpenXcom Extended => Topic started by: ohartenstein23 on October 26, 2020, 12:26:44 am

Title: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on October 26, 2020, 12:26:44 am
I'm making available an alpha release of a map editor for OXCE that I've been working on! This tool is intended for helping modders and other interested community members to make small-scale changes on existing MAP/RMP files in a mod from within OXCE - for large scale map creation the MapView tool maintained by kevL (https://github.com/kevL/OpenXCOM.Tools) is a better choice.

Attached to this post are 64-bit Windows and Ubuntu 18.04 builds of OXCE with the map editor included - any other operating systems would need to be compiled from my source code, which can be found on GitHub (https://github.com/ohartenstein23/OpenXcom/tree/battlescape-editor). It is currently built on top of OXCE 6.9.4. Any updates to OXCE or bug fixes for the editor will have to wait until the next feature release of the editor. Installation is done in the same way as for OXCE (https://openxcom.org/forum/index.php/topic,5258.0.html), and I would recommend keeping the installation of the editor separate from the OXCE version you use for regular play/modding.

*** IMPORTANT CAVEAT: This is an incomplete feature and not a part of official OXCE releases. Do NOT bother Meridian with bug reports or requests regarding this map editor. ***

Extensive documentation of the editor and its features is contained in the build downloads below. For the features currently available and the kinds of feedback I'd appreciate on this build, I'm including a bit from the first page of that documentation:

Quote
This is the documentation for an alpha release version (05 February 2021) of the Map Editor for Open X-Com Extended (OXCE). The alpha release versions are intended for demonstration and testing of the basic functionality of an in-game map editor. Feedback on the user interface and functionality are appreciated as are bug reports, but bug fixing support will likely be slow and tied to new feature releases. Please read through the following list of included and planned features before making suggestions for further development. It is also not intended to replace MapView but rather to provide supplementary map editing with minimal setup outside installation of OXCE. The primary features in this release are

  • Editing of maps included in the currently loaded set of mods
  • Creating new maps from the terrains defined in the currently loaded set of mods
  • Editing single tiles at a time by adding, changing, or removing objects within the tile
  • Editing single AI nodes at a time by adding, moving, changing, and removing them and their links
  • Switching between tile and AI node editing modes
  • Undoing and redoing single tile/node edits
  • Saving edited .MAP and .RMP files in the current OXCE user folder
  • Sample ruleset for implementation of the edited .MAP and .RMP files in the openxcom.log file
  • Opening the main Map Editor Menu for creating/selecting a new map to edit directly from the Editor Interface.
  • Editing multiple tiles/nodes at a time by both rectangular selection and paintbrush-style selection tools
  • Copying, cutting, and pasting selections of multiple tiles/nodes at once
  • Find and replace tools for searching and editing tile and node content
  • Searching of text lists in the Map Editor Menu

The following features are planned for future releases:

  • Option to attempt to match MCDs across maps when pasting tiles
  • Creating new maps with custom terrains from a selection of terrain data sets (.MCD files) from the currently loaded set of mods
  • Direct loading of .MAP files from a specified directory using a supplementary file to indicate which terrain data sets to use
  • Find and replace tools for searching and editing tile and node content
  • Resizing maps
  • Improved Map Editor main menu
  • Testing map being edited in the battlescape before saving and importing changes due to tile destruction
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on October 26, 2020, 12:27:26 am
Release changelogs:

01 November 2020 (https://openxcom.org/forum/index.php/topic,8711.msg133538.html#msg133538)
06 November 2020 (https://openxcom.org/forum/index.php/topic,8711.msg133687.html#msg133687)
Title: Re: [Documentation] [Feedback] Map Editor
Post by: kevL on October 26, 2020, 03:21:06 am
wow. good luck o23
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik on October 26, 2020, 03:39:43 am
This is a great thing to have! Please, keep moving with this amazing tool! Here is my first impression:
1) It is much better to have in-game rendering, rather than its simulation with map editor. Working with this I will know for sure that my map would look like the thing I'm currently working on.
2) Having an in-game resolution really helps! It is much easier to detect small mistakes on the map when looking from a game perspective, especially when working on a big map.
3) It runs way more smooth. Currently, I'm working with a huge mapblock (50x70x5) and map editors lags kills me. In your editor it's perfect. Tomorrow I will proceed with your editor, it's way faster and definitely much enjoyable!
4) In-game feel - when working in the map editor I am "working". I love modding and level design in particular, but it still. I was not working for a log time, just tried a few things. But all that feeling that is created by using vanilla-style UI and game rendering makes me feel more like I'm DMing a D&D session and I am in process of set up a dungeon on the table from tiles, and it is a part of a game we are playing with my friends. Hard to explain, but I like your environment much better than working in window forms.
5) Browsing mod's maps. It still not perfect, you know, there could be some more additions to that within terms of UX, but it's already better - you just choose a mod and the map, instead of those additional manipulations with editor settings I always hated.
6) God bless you, Undo button!!!11

It is a great progress for an alpha, I'm sure you have some things in your backlog and I really hope you will continue this amazing project!

UPD:
I can confirm the first impression. Tho mapmaking is not the most critical part of my current project I'm working on, it's still important. So I have to add - handy UI and much faster placing of new tiles in the general workflow for me compensate lack of filling and cut/copy/paste functions. It's obvious, that they would be very welcome, but now this editor is my main mapping tool and after a few days of working there I don't want to return back to MapView 2. All my experience is recorded (tho, it's all in Russian, sorry). The process is much more enjoyable, I guys have to try it, it's like some magic opens when you get the flow of it because in-game rendering feels like playing, especially when the shadow of the upper floor is calculated!

Pls, keep moving with this awesome project!
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on November 01, 2020, 10:44:28 pm
wow. good luck o23

Thanks kevL!

snip

Glad you're enjoying using it Finnik, and thanks for the feedback and bugreports on discord.

I'm releasing an update with the ability to select multiple tiles and nodes at a time for editing, check the first post for new downloads (https://openxcom.org/forum/index.php/topic,8711.msg133353.html#msg133353). There are some new user options too that go along with the selections and based on feedback I've received.

It also includes a fix for UFO doors opening and remaining open when placing them where a tile was previously. This was just a cosmetic bug, the doors would be closed properly if the map was loaded into the battlescape.

Next up on the feature list is copy/cut/paste, probably followed by find/replace buttons. At that point, most of the features for the editor itself will be done and I'll move on to better file management support.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik on November 01, 2020, 11:06:20 pm
And now we are talking! Just tried it fast - feel super cool! I'd suggest posting somewhere a list of changes and new features that update brings - for example, we can now select, and use Shift to add to selection and ctrl to deselect - users can miss it with updates. Also, I can't find what Shift+Ctrl does.

Can we use Esc to clear the selection? Like if there is a selection Esc clears it and if there is no selection - it opens Options?
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on November 02, 2020, 12:06:14 am
Guess I could add a list of changes as I release them in this thread. Here's what the latest release brought:


You can clear the selection by left-clicking outside the map. I'd rather not overload the Esc button too much, but I can add another hotkey to clear the selection, probably default 'X' for now.

Control + Shift together only selects tiles within the area you've already selected. Think opposite of what Control alone does - it won't affect tiles outside the previous selection.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: efrenespartano on November 02, 2020, 01:13:52 am
I don't have as much real feedback as Finnik has (most because I'm still playing around with it and I'm quite happy with the current build, my suggestions are already on the to-do list anyways), but I've been promoting your tool on my dev team and they love it so far. We all are rooting for you and your project! Looking forward to seeing more of it!
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on November 06, 2020, 01:04:00 am
Glad you and your team have been enjoying using it.

Another release is ready, this time cut/copy/paste functions have been added. Again the first post has the files to download (https://openxcom.org/forum/index.php/topic,8711.msg133353.html#msg133353). The new features for this release are:

Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik on November 06, 2020, 10:16:46 pm
So cool!
Code: [Select]
Option to attempt to match MCDs across maps when pasting tiles

Resizing maps

Testing map being edited in the battlescape before saving and importing changes due to tile destruction

Those are the most promising currently, resizing is quite a needed tool, I already had to return to MapView to do it there. I would also welcome shading change directly in the editor to see online how to place lights (and it should respect OXCE lightning model). Also, it would be nice if not editing, but just reading MCD properties.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Ethereal on November 07, 2020, 11:43:26 am
It is a pity that there is only a win64 version. Well, I'll wait for the win32 version.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ValeriusPaipikus on November 10, 2020, 02:09:54 am
Very well...
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 on February 05, 2021, 07:56:20 pm
A new release is ready, the first post has the files to download (https://openxcom.org/forum/index.php/topic,8711.msg133353.html#msg133353). The new features for this release are:


As part of the fix for displaying nodes, you may have to check any maps you've made with the tool where you limited nodes to flying units only or small units only. The bug switched the display of those two values in the code, so you may have to switch them. Fortunately the new find and replace can help fix that!
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik on February 05, 2021, 11:11:51 pm
Woo, cool! Thank you!
Title: Re: [Documentation] [Feedback] Map Editor
Post by: 4ky on July 27, 2021, 04:52:30 pm
TFTD maps cannot be opened. Crash with error: "Sprite Set MapEditorIcons not found". Tried varies version of TFTD - no results.
If this error is resolved, please provide a way to download the latest versions. Or explain what I am doing wrong. Attached a log file to the message.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 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
Title: Re: [Documentation] [Feedback] Map Editor
Post by: 4ky 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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?
Title: Re: [Documentation] [Feedback] Map Editor
Post by: 4ky 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: kevL 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
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: ohartenstein23 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.
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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?
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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?
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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  :'(
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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?
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Yankes on October 24, 2022, 02:23:51 pm
You do not include every file to solution
Title: Re: [Documentation] [Feedback] Map Editor
Post by: Finnik 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