Home » MODDING HQ 1.13 » v1.13 General Development Talk » ja2MapTool (Initial release)
ja2MapTool[message #350420] Sun, 30 July 2017 20:37 Go to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
I've created a tool for converting JA2 maps between different mods. It works by remapping tiles and items in these maps, so they won't look all crazy when opened in the target mod.

https://i.imgur.com/CYREjCI.jpg

Download link: https://www.dropbox.com/s/kx6qjqg6patn2mt/ja2MapTool.jar?dl=1
Github: https://github.com/starcatter/ja2tools

It may require a fairly recent Java version. Also, it eats up RAM like crazy, so be sure to bring plenty.

Perhaps what's more interesting than the tool itself are the utilities necessary to make it happen - Java classes for reading a bunch of JA2 data files and making sense of them. Hopefully someone will find a way to use these to make a bunch of other useful JA2 tools.

Here's a quick manual: http://imgur.com/a/dOHXx

Note that it's still rather rough around the edges, but since I'm out of time to regularly work on it, I'm releasing it as it is. The core functionality should be solid enough, I'm sure I've tested it at least once...

Also, I'm looking for people to help me finish this tool, so if you're interested in contributing, don't hesitate to let me know! There's plenty to do on this project.

Re: ja2MapTool[message #350421 is a reply to message #350420] Sun, 30 July 2017 21:14 Go to previous messageGo to next message
Flugente

 
Messages:3137
Registered:April 2009
Location: Germany
This seems very useful, good job thumbs up
Are there any limitations on map versions, or does this mean we could upgrade any old map to a new state?



Saren threw his head back and screamed in impotent fury, before falling to his throne, head in his claws, trembling in horrified disbelief.

Then he heard a faint chime as Sovereign subscribed to her ECHO channel.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: ja2MapTool[message #350422 is a reply to message #350421] Sun, 30 July 2017 22:39 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
As far as I've checked, it can read any old map, or at least JA2 Gold and up. There may be some glitches when upgrading items with attachments on very old maps, since I wasn't crazy enough to port all of the item migration code... But it shouldn't produce anything the game won't be able to handle. All maps coming out of the tool are at the latest version, unless there's some recent new version I don't know about. So yeah, the map loader module could be used to automatically upgrade all the maps to the latest version, and it wouldn't take long either, last I've tested it could load all vanilla maps in a couple of minutes.

Two things I forgot to mention in the first post, the tool can open maps from any location, not just the game dir, as long as you give it somewhere to get tiles and items from. Also, if you put the jar in the game directory, or somewhere else that contains VFS configs, it will automatically detect that and you won't have to add that directory at the start.

Re: ja2MapTool[message #350425 is a reply to message #350420] Mon, 31 July 2017 07:21 Go to previous messageGo to next message
pheloncab

 
Messages:269
Registered:August 2004
Location: So. Cal. or texas
While not a modder, as an avid user of mods, THANK YOU Buddies Thank you !!

This should be great for many reasons including those wanting to bring older mods into the new items/exe files.
Re: ja2MapTool[message #350432 is a reply to message #350425] Tue, 01 August 2017 20:16 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
I've added a much needed feature, tileset auto-mapping.

https://i.imgur.com/uZOMZB0.png

Download: https://www.dropbox.com/s/endlo00i950knz1/ja2MapTool-Alpha3.jar?dl=1

Clicking on the auto map button will make the tool do most of the work for you:

  • Tile categories that are in the same file as the source will be marked with a light shade of blue. They should be similar enough.
  • Categories that were in a different file that was found in the target tileset will be mapped to that file and marked light green.
  • All remaining tiles will be compared to tiles in the target tileset and if any sufficiently similar looking tiles are found, a suggestion list will be created. If the best suggestion is good enough, the tile will be automatically mapped. Categories with auto-matched tiles are marked yellow.
  • In case the tool has no idea what to do with a given tile category, it will mark it light red.

So far I've only managed to put together a simple histogram-based image comparison system, so aside from very similar looking tiles the suggestions aren't very good. OTOH, together with file-matching, this seems to get a fair bit of work done, so we're off to very good start anyway.

Re: ja2MapTool[message #350434 is a reply to message #350420] Tue, 01 August 2017 23:47 Go to previous messageGo to next message
Darkling

 
Messages:7
Registered:April 2016
Location: New Zealand
Very nice!

Puts my map item mapping code (in Haskell, no prebuilt execs) to shame. For those interested go to hub.darcs.net/Rohan/ja2-mapper
Thanks to my laziness it supports only the latest map format and does everything with text files and the command line. One possible use is that it can list all items used in a map and warns if any are undefined (NADA)

Perhaps these other two projects will be of more utility (given the same item mapping file as above)

    hub.darcs.net/Rohan/ja2-item-diff will show some differences (currently coolness, scifi, repairable, notBuyable but easily changed in the code) between the mapped items in each mod
    hub.darcs.net/Rohan/ja2-item-mapper can update items in semi arbitrary XML and annotates each with the item name
Documentation is essentially nil but if anyone's interested I'll look to "improve that soon (tm)".
Re: ja2MapTool[message #350435 is a reply to message #350432] Wed, 02 August 2017 01:09 Go to previous messageGo to next message
edmortimer

 
Messages:816
Registered:January 2015
Location: Home Free
I've always wanted to add a bit of Tracona to my AV mod and this utility will make that a lot easier! Much thanks and very appreciated!




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum

Alpha 4: map compositor[message #350474 is a reply to message #350420] Fri, 04 August 2017 20:33 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
I've added a new feature to the map tool, a map compositor.
https://i.imgur.com/dMqIRRi.jpg

Download: https://www.dropbox.com/s/dnhye2ritx3eggr/ja2MapTool-Alpha4.jar?dl=1
Demo and manual: http://imgur.com/a/IDC4W

The map compositor allows you to do some copy-pasting on a map, while specifying which layers you want pasted. It automatically creates new room numbers for pasted buildings. It can also copy map snippets between maps and depends on the map converter to remap tiles on the fly. So far it seems to produce working maps.

Let me know of the bugs you find, and how to reproduce them. I know there's a weird issue with selection cursors getting stuck inside the map converter, I'd love a step-by-step of how to cause that.

Re: Alpha 4: map compositor[message #350478 is a reply to message #350474] Sat, 05 August 2017 01:48 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
Small update, as I was checking how the tool handles maps from various mods I've noticed it didn't work well with VFS configs not based on Vanilla maps, so I fixed that...
https://i.imgur.com/ig6JxXf.jpg
Download: https://www.dropbox.com/s/nmdg0vvoge5rzj1/ja2MapTool-Alpha5.jar?dl=1

I've also improved the map selector, now it shows maps grouped be VFS profile. Selecting same map under different profiles works as expected - you get different map versions. I just hope it's not more confusing this way.

Re: Alpha 4: map compositor[message #350488 is a reply to message #350478] Sun, 06 August 2017 00:39 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
Finally, I fixed the broken palette. Things look much nicer now!
https://i.imgur.com/shOoqo2.png
Download: https://www.dropbox.com/s/8xutnn9h3q0i4mv/ja2MapTool-Alpha6.jar?dl=1
Visual changelog: http://imgur.com/a/p2CWl

I've improved the renderer a bit, I mean beyond the fixed palette. Now we've got proper a placement preview and more accurate cursors. I've changed the way selection works, now only a ctrl-click will erase the selection start marker, meaning you can scroll the screen before placing the selection-end marker. Also the placement preview should properly react to changes in selected snippet and placing things on the map should feel more responsive. If you forgot to remap something before placing a snippet, you can now change the mapping, reselect the mapping/snippet, and hit the Paste button again, it should remember where you placed the last thing and overwrite it.

Oh and I fixed the stuck-selection bug. This version should be more user friendly.

thumbs26.png  Alpha 7: placements and layers[message #350600 is a reply to message #350420] Tue, 15 August 2017 14:03 Go to previous messageGo to next message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
I've expanded the idea of copy-pasting maps and added the option to place multiple snippets before committing them to the map.
https://i.imgur.com/wGXaukM.png

download: https://www.dropbox.com/s/rqvppze6xh59y7i/ja2MapTool-alpha7.jar?dl=1
presentation and usage instructions: http://imgur.com/a/ZVKun

There's quite a bit that has changed! Check the imgur link for details. Being able to move chunks of the map around should make designing map layouts a bit easier. I've added layers because placing snippets on top of each other sucked otherwise.

I've also improved the VFS browser, now it shows map/sti previews as soon as you select the VFS file or its variant, making it quite handy for browsing game assets. The map viewer still uses the old click-to-scroll navigation, the editor windows (converter and compositor) now use cursors/wsad to scroll (shift to scroll faster), space to center map.


Re: Alpha 7: placements and layers[message #350604 is a reply to message #350600] Tue, 15 August 2017 22:30 Go to previous message
The_Bob

 
Messages:353
Registered:May 2009
Location: Behind you.
I've noticed the tool wasn't working as fast as it should, so I fixed a bunch of performance issues.
Here's the fixed version: https://www.dropbox.com/s/b4ga4qv43gcywgv/ja2MapTool-alpha8.jar?dl=1

Previous Topic: Question about JA2 data structures
Next Topic: Mapeditor Command Line Options
Goto Forum:
  


Current Time: Thu Sep 21 02:35:33 EEST 2017

Total time taken to generate the page: 0.01229 seconds