Author Topic: MAPVIEW upgrade  (Read 75638 times)

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #420 on: April 12, 2019, 11:14:10 am »
Hey, just checked out MCDEDIT, looks very nice, not sure if you plan on doing the art edit side of things or not to replicate VOutars version?

i have no plans for it at present... my sentiment is that pixel-editing is best suited to a dedicated pixel-editor (a real image editing program). Granted, i'm not an artist so it doesn't occupy much of my thoughts...

some time ago I adapted PckView with the ability to touch-up sprites that have rogue pixels, which is sorta common in the stock resources. So, if i need a project in future, am leaning toward handling sprite-editing in PckView. idk

I do have a feature request for it though,I am always merging MCDs from different sets to create my own, what would be good would be if open a separate view window on the side of the main window,  Select another MCD set and copy over the  MCDdata and MCDimage from the secondary MCD into the main one.

this sounds more interesting. Like a new command: File|Open copy panel...

- shows an overview of a secondary MCDset and allows multiple records to be copied to McdView's internal copy-buffer

( have gotta get keyboard navigation sorted first tho )

EDIT: whackloads of keyboard-shortcuts incoming ...


2019 April 22
- keyboard shortcuts: see keyboard_cheatsheet.txt or the CHM Helpfile
- several UI changes, insubstantial (mechanically) but noticeable
- the Maptree gets double-buffered to stop flicker (non-Mono build only)

Reminder to backup yer stuff.

next... the Copypanel (see screenshot)

2019 April 27
- add CopyPanel to McdView + tweaks. The CopyPanel is a subsidiary window that can open an MCDset, from which records may be copied for insertion into McdView proper.

screenshot#2 - InsertAfterLast (alpha, not in master branch yet) - an operation that inserts tileparts from the CopyPanel along with their sprites and sub-parts to Main. (note: a regular copy/insert from the CopyPanel transfers MCD-data only, that is sprites and sub-parts usually need to be tweaked up after insertion).

2019 May 10
McdView's CopyPanel gets InsertAfterLast: optionally inserts sprites as well as death/alternate parts to the terrainset.

screenshot #4 -- calculate on-the-fly TabOffsets in PckView (not in master branch yet)

2019 May 12 - PckView upgrade.
- arrow-keys navigate sprites
- [Delete] selects next sprite (allowing quick deletion of a range of sprites)
- shortcuts have been re-assigned
- update CHM helpfile
- confirmation on save if spriteset has changed
- and the selected sprite's TabOffset is printed to the statusbar along with the offset of the 'next' sprite.
« Last Edit: May 13, 2019, 07:09:46 am by kevL »

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #421 on: June 24, 2019, 10:41:23 pm »
(new post to hit the new post flag)

2019 June 24

- possible fix for intermittent exception related to MCD Info, caused by discrepancy between the way MCD records load in MapView and (external) McdView (after being invoked via TileView).

reported by Kato /thks

Offline Roxis231

  • Colonel
  • ****
  • Posts: 479
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: MAPVIEW upgrade
« Reply #422 on: July 03, 2019, 09:36:30 am »
Hi KevL

I've downloaded the latest copy - but when I try to run it I get this error.

Any Ideas? Error file Included.

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #423 on: July 03, 2019, 07:54:24 pm »
The error is simply saying that MapView.exe can't find XCom.dll (or one of its dependent .dlls -- DSShared.dll, YamlDotNet.dll)

I get errors like that when i try to run the .exe either
a) without the .dll(s) in the same directory
b) when it's still inside the archive

possible fixes:
a) keep the program's .exe and .dll files in the same directory together
b) unzip the archive ...

Or i guess it could be a funky new security feature MS came out with, in which case i rly din't have a clue,

(other than to /not/ install to the "Program Files" folder)

ps. I notice that the pic says "XCom, Version=" but Error.txt says "XCom, Version=" ... so i suppose you tried an earlier version. These are the (correct/compatible/should-all-work-together) versions for 2019 june 24:

MapView.exe -
XCom.dll -
DSShared.dll -
YamlDotNet.dll -

McdView.exe -
PckView.exe -
« Last Edit: July 03, 2019, 08:16:42 pm by kevL »

Offline Roxis231

  • Colonel
  • ****
  • Posts: 479
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: MAPVIEW upgrade
« Reply #424 on: July 04, 2019, 05:07:12 am »
Downloaded the June 9th version - got that working

June 24th seems to be missing DLLs

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #425 on: July 04, 2019, 07:52:08 am »
MapView2_190624.7z looks okay t'me and seems to run fine,

I can think of two people who (i hope) would have mentioned it ...

Offline Roxis231

  • Colonel
  • ****
  • Posts: 479
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: MAPVIEW upgrade
« Reply #426 on: July 04, 2019, 08:55:28 am »
Just re-downloaded it to check.

Seems the first time I got a copy without DLLs - not sure how, but they are there now.

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #427 on: July 04, 2019, 09:58:43 am »
good :)

i think it's a good version.

( tho i'm working on a new, anti-pasta version at present <g> )

EDIT: wip ->

Feature request: some kind of report or indicator for unused mcd entries. I've got some overly large terrain sets right now, and that would help me edit them down a bit without having to click on the tiles to try and figue it out by eyeballing it.

four yrs late ... (see screenshot1). I'm working on a subsystem that opens via File|MapInfo. Sort of a "show detail" dialog.

// TODO:
// - MapDetail      (Terrains in the Tileset: label + count)
// - RouteDetail    (routenodes, spawnnodes + ranks, attacknodes in the Tileset or Category)
// - CategoryDetail (Tilesets in the Category)
// - GroupDetail    (Categories + Tilesets in the Group)
// - TerrainDetail  (all Tilesets that use a Terrain or all Terrains used in the Maptree)

but those are just thoughts about it ... the underlying code isn't really set up for this (the MCD records aren't actually stored as independent collections; at present, the Tileset only grabs what it needs and disregards the rest)

EDIT2: SpawnInfo (screenshot#2)

EDIT3: 2019 aug 26
this might amuse someone ... not for the faint of heart

RulesetConverter demo
« Last Edit: August 26, 2019, 12:43:46 pm by kevL »

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #428 on: August 30, 2019, 03:43:55 am »
Saving as GIF is no longer available. Saving as PNG works, but fills black with garbage too.

next release has a MainView option to output screenshots to PNG or GIF (that might help, no guarantees tho). It also has an option to bypass the cropping algorithm (maybe that's where the glitches were creeping in but i don't think so, am suspecting that it's an issue w/ Mono's PNG handling although that's merely a guess atm)

is there any method of converting the old mapedit.dat/images.dat information to your format?
I would like to give your work a try, but I have hundreds of custom terrains and mapblocks, and there's just no way I'm going to do this manually.

next release has RulesetConverter. It'd be best to figure out the basics of how MvII's "basepath" system works first, however, or figure it out on the fly. Basically there are
1. Configurator basepath (set on first run, or under the Edit menu): the parent directory of MAPS,ROUTES,TERRAIN, + UFOGRAPH (for the cursor sprite), and GEODATA (if you want ScanG and LoFT for use in McdView).
2. Tileset basepath: overrides the configurator's basepath of MAPS and ROUTES for a particular Map, if set (see the TilesetEditor).
3. Terrain basepath: can be one of three settings - use the Configurator basepath for terrains, use the Tileset's basepath for terrains, or specify a custom basepath to any other TERRAIN folder. (also see the TilesetEditor)

(note that ConfigConverter2 will still be shipped in a subdirectory of MapView2 - and (a) if it works for ya, and (b) you're looking for a "MapTilesets.yml" from scratch - ie are willing to set Mapview's Configurator basepath to wherever the ConfigConverter wants - it could be more useful than the RulesetConverter.)

eta for ver.3.3 is ... close, and it will be beta or "release candidate" or NOT THOROUGHLY TESTED if ya'll get my drift

Offline kevL

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: MAPVIEW upgrade
« Reply #429 on: August 31, 2019, 10:20:59 am »
Time to release this upon the suspecting ... treat as Beta software.

This is a very large update.

IMPORTANT: The MapOptions.Cfg file in your /settings folder will be changed. So back that file up if you like your current MapViewII customizations and want to transfer them to a/the new MapOptions config (i would strongly suggest using the Options dialogs instead of dicking about with the textfiles).

IMPORTANT: The so-called backup mechanic for MapView, McdView, and PckView has also changed. This is not a comprehensive backup mechanic and was never intended to be that. It's intended only to give the user (including yours truly) that ONE (1) chance on a misclick to go "oh sh*t i shouldn't have done that" and have a chance of recovering the file you just overwrote*. The problem was that the routines were inconsistent; sometimes you got a .bak file, sometimes it wrote to an "MV_Backup" subdirectory, sometimes you got nothing at all, etc -- so I've implemented a plan: any and every time a file on the hardrive** is changed by MapView, McdView, or PckView, it is first copied to an "MV_Backup" subdirectory of its original location, with its original filename.

* note: This should also handle more hazardous failures like a power outage during file-write but let's not go there. Get yourself a UPS. (seriously.)

** note: Does not include image-output; exporting images does *not* perform backups. But saving MAP, RMP, MCD, PCK, and TAB files as well as configuration files should/will get their instant backups.

changelog ->

- RMB-drag scrolls the Map when scrollbars are visible
- Ctrl+F1..F4 toggles parttype visibility as per TopView F1..F4
- F1 opens the CHM Helpfile (was start animations)
- F2 toggles animations (was stop animations only)
- always draw targeter-cursor during keyboard navigation
- fixed multi-tile select by keyboard
- fixed exception on [Esc] and/or MouseWheel when no Mapfile is loaded
- moved ModifyMapSize from File menu to Edit menu
- reworked statusbar aesthetic
- allow keyboard navigation through the Maptree without loading any Maps until [Enter] is pressed
- expand/collapse parent nodes on the Maptree w/ [Enter]
- changed the hotkey for opening the Maptree's context menu from [Enter] to [Space]
- refactored the MenuManager (handles viewer-open/close from the Viewers menu)
- fixed CTD when taking full-level screenshots.
- tightened up Maptree handling (loading/writing the Maptree; allow a blank MapTree; don't write group or category padding-text to "MapTilesets.yml" if there are no tilesets in the group/category anyway).
- faster loading of Tilesets (much faster if you have many toplevel groups)
- added to Options: screenshot background color (default Transparent) and crop background (default false) and choice of PNG or GIF output (default PNG)
- added to Options: color toners for SelectedTiles (none,grayscale,redscale,greenscale,bluescale - default grayscale)
- rewrote the CollapsibleSplitter (the divider between the Maptree and the main panel)

- changed the null-sprite aka. eraser-sprite
- added mnemonics to menus
- reworked statusbar aesthetic
- prevent tab flicker

- tweaked the parttype null-sprites
- double-leftclick on a tile selects the tilepart of the currently selected quadrant (also [t])
- rightclick and double-rightclick (also [Enter] and [Shift+Del]) operate on either a tile or the quadrant-panel.
- display the currently selected tilepart's sprite in the quadrant-panel; click (also [q]) selects its proper quadrant-slot
- ignore the spaces between quadrant-types when clicking to select a type
- reset the quadrant-panel's sprites after loading or resizing a Map
- fixed multi-tile select by keyboard
- added mnemonics to menus
- added Test->Test parts in tileslots to check the types of all parts (floor, westwall, northwall, content) that are currently assigned to tiles against the type of tileslot they occupy. The result is shown in a dialog.

- Tally button displays current spawn info for the tileset and its category
- clear previously selected tile's coordinate info after resizing a Map
- print mouseovered node's baseattack-weight in the overlay, iff non-zero
- add a Save button to the data area (doubles as a "routes changed" indicator)
- fixed: set MapLocation on LMB-dragnode so that keyboard-dragnode doesn't go dysfunctional.
- added mnemonics to menus and arranged menuitems

- prevent tab flicker

- fixed up Tab-order (ie. keyboard navigation around the dialog)
- try to keep listboxes focused with a reasonable item selected when allocating/deallocating terrains
- disable the ACCEPT button until a Descriptor is valid.
- fixed the global descriptor changer (if a tileset with the same basepath exists in 2+ categories, both get their metadata changed)
- handle terrain-not-found errors less annoyingly
- added a checkbox to suppress the MCD RecordsExceeded warning (saved in MapTilesets.yml w/ each tileset)

- fixed: don't draw the SE quadrant of large units (sic)
- added viewer to the zOrder list
- register its screen position on MainView quit
- moved item from File to Viewers menu
- switch icons and palette between UFO/TFTD resources when a Mapfile loads.
- enable/disable the ScanG menuitem depending on tileset and available resources

- moved item from File to Help menu
- added a Detail button that shows what MCD records are used/unused in the currently displayed Map's terrainset

- use custom messagebox to display info/errors that need to print paths (prevents wrapping long paths)
- don't close the configurator when simply generating a MapTilesets template

- reworked load/save Options (MapOptions.cfg) incl/ fixes to Content-type blob updates
- rewrote Options interaction in toto (tighter integration w/ viewers' shortcuts, improved code refactorability, etc.)
- reworked load/save viewer locations and sizes (MapViewers.yml)
- try to maintain z-order on (1) open/close McdView or PckView (2) MinimizeAll/RestoreAll (3) option "AllowBringToFront" when MainView takes focus.
- changes to spriteset loading (determine tabword-length based on the tab-file data instead of failure to instantiate a 2-byte wordlength spriteset) [idea lifted from OXC code]
- rewrote tile-loading and the default-tileset creation routines
- reworked double-buffering calls to what I believe are the most simple/efficient yet effective
- re-select the current treenode on the Maptree if the Configurator forces a restart; plus use what seems to be a more stable restart routine.
- rewrote the Infobox (a dialog that replaces .net's stock MessageBox here and there)
- restrict keyboard shortcuts to exact key or key-combinations (eg. [Shift+Enter] no longer invokes an operation that's intended for [Enter] only)
- tighter file handling, IO exception handling, one-time safety backup handling, to-load-or-not-to-load handling, file corruption handling, file IO error message handling, handling handling and file-fondling in general.

- ensure that the CopyPanel is closed on exit, else it can stick open when invoked via TileView
- RMB-click on the IsoLoft panel reverts slider to show all layers
- fixed: write the ScanG ushort as little-endian regardless of computer architecture.
- allow loading of filetype via Explorer's file-associations
- properly dispose temporary LoFT and ScanG bitmaps
- allow the IsoLoft viewer to track all the way down to 0 layers and use 3-step shading (instead of 2-step) while tracking layers.

ScanG chooser
- fixed: handle iconsets that have less than 35 icons (the first 35 icons are for units not terrains)

- fixed saving sprites that do not have a fully transparent top row(!)
- fixed File|Export Sprites ...
- reworked statusbar aesthetic
- minimize/restore the Sprite and Palette windows when the main window's state minimizes/restores
- bring Sprite and Palette windows to front when the main window takes focus
- apply MapView's gamma adjustment to sprites and swatches (can be toggled from the Palette menu, default is On)
- resolved conflict between contextmenu shortcut [p] (export sprite) and mnemonic [Alt+p] (open Palette menu)
- allow loading of filetype via Explorer's file-associations

- flag Changed if pixels changed
- reworked statusbar aesthetic
- added mnemonics to menus

Palette viewer
- properly dispose created brushes
- reworked statusbar aesthetic

Updated CHM helpfile and keyboard_cheatsheet.

- properly dispose the openfile dialog

- add.

IMPORTANT: This is a good time to backup your irreplaceable MAP, RMP, MCD, PCK, and TAB files(!)

Backing up your \settings folder is a good idea also. Especially MapTilesets.yml (... the other configuration files are easy to replace or regenerate) and, for the reasons given above, MapOptions.Cfg.

That is, this update has vast tracts of code refactoring, duplicated code removal, standardization of various routines, generally increased readability/maintainability/documentation even ...

But backup yer stuff,

( welcome to the QualityAssurance dep't -- ie, treat this release as BETA )

in fact, if i were you I'd simply rename my current MapView2 installation ( eg. MapView2_ ) and install this version alongside it. Run it once to create the /settings directory, quit and *copy* in your MapTilesets.yml ... Then take it from there,

Assembly Versions:
- MapView.exe
- McdView.exe
- PckView.exe
- XCom.dll
- DSShared.dll
- ConfigConverter.exe
- RulesetConverter.exe

YamlDotNet.dll by Antoine Aubry et al. retains ver

ps. woohoo got  through Stoddard's auto-builder for Mono (this was by no means certain...)