aliens

Author Topic: MAPVIEW upgrade  (Read 315946 times)

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #405 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=3.1.2.0" but Error.txt says "XCom, Version=3.0.0.0" ... so i suppose you tried an earlier version. These are the (correct/compatible/should-all-work-together) versions for 2019 june 24:

MapView.exe - 3.1.3.0
XCom.dll - 3.1.2.0
DSShared.dll - 3.0.0.1
YamlDotNet.dll - 0.0.0.0

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

Offline Roxis231

  • Colonel
  • ****
  • Posts: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: MAPVIEW upgrade
« Reply #406 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: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #407 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: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: MAPVIEW upgrade
« Reply #408 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: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #409 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
https://drive.google.com/file/d/17qXON7f_4i1r65HdfhgV2GJzyJnO6h_I/view?usp=sharing
« Last Edit: August 26, 2019, 12:43:46 pm by kevL »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #410 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: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #411 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 ->

MainView
- 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)

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

TopView
- 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.

RouteView
- 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

TopRouteView
- prevent tab flicker

TilesetEditor
- 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)

ScanG
- 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

MapInfo
- 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

Configurator
- 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

General
- 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.

McdView
- 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)

PckView
- 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

SpriteEditor
- 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.

ConfigConverter
- properly dispose the openfile dialog

RulesetConverter
- 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:
3.3.0.0
- MapView.exe
- McdView.exe
- PckView.exe
- XCom.dll
- DSShared.dll
2.1.0.0
- ConfigConverter.exe
1.0.0.0
- RulesetConverter.exe

YamlDotNet.dll by Antoine Aubry et al. retains ver 0.0.1.0

https://github.com/kevL/OpenXCOM.Tools/blob/master/Distribution/README.md


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


Offline osd_daedalus

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Re: MAPVIEW upgrade
« Reply #412 on: September 29, 2019, 12:46:53 pm »
Hello!
Thank you for your efforts in MapView.
I managed (with lots of efforts) to run it on Linux (Linux Mint 19.2, Mono 6.6.0 Preview).

I wish to warn you, though, that the Mono-ready builds won't work on me, for a strange reason: my output is:
on terminal
Quote
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319

followed by a "oop exception"
Quote
System.ArgumentNullException: Value cannot be null.
Parameter name: path
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00014] in <9535effa99f042c5a94ca386690497e6>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <9535effa99f042c5a94ca386690497e6>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.File.Open (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <9535effa99f042c5a94ca386690497e6>:0
  at XCom.LogFile.WriteLine (System.String line) [0x00001] in <7d46fe1e90db48a1b282fb30c553e539>:0
  at MapView.XCMainWindow..ctor () [0x00036] in <2b76cbc6c63f42d294898d08a5ee383e>:0
  at (wrapper remoting-invoke-with-check) MapView.XCMainWindow..ctor()
  at MapView.Startup.RunProgram () [0x0001e] in <2b76cbc6c63f42d294898d08a5ee383e>:0

But, if I compile my build from sources, with .NET 4.5.1 as target framework, it works well. Can't figure why...

Well, time to discover it and to enter in the world of xcom modders. Thanks again!

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #413 on: September 29, 2019, 09:20:27 pm »
thanks for the report,

the Mono builds are Stoddard's baby but unfortunately I haven't seen him post for a couple months. It looks like a problem with creating/opening the "debug.log" file, which is enabled by preprocessor directive "DEBUG" in DSShared/LogFile.cs ... which, uh, should not be happening ... Ah, on the last release i moved LogFile from XCom to DSShared (for increased visibility); there might be some lingering, persistent reference to the old namespace somehow.

will keep my eyes open and good luck with the app,

Offline osd_daedalus

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Re: MAPVIEW upgrade
« Reply #414 on: September 30, 2019, 10:25:30 pm »
Hi, thank you for your answer.
In the end I switched the entire OpenXcom modding environment in a Windows 7 virtual machine, due to a ton of sudden crashes, the sudden death of Monodevelop (something about the number of generic arguments provided doesn't equal the arity of the generic type definition, but this even on new projects), and VS Code for Linux supporting only .NET Core 3.0

(I wonder, is it really necessary to build this tool on so high .NET framework SDKs?)

Anyway, I wish to flag you this:
even if my TFTD folder is correct, looks like it still searches in the UFO directory for the TFTD resources, can you check about?
Thank you!

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #415 on: October 01, 2019, 12:57:52 am »
heya,

In the end I switched the entire OpenXcom modding environment in a Windows 7 virtual machine, due to a ton of sudden crashes, the sudden death of Monodevelop (something about the number of generic arguments provided doesn't equal the arity of the generic type definition, but this even on new projects), and VS Code for Linux supporting only .NET Core 3.0

that's too bad ... this project needs a dedicated Linux/Mono developer ... unfortunately it's not something I'm interested in or have the time for at present

Quote
(I wonder, is it really necessary to build this tool on so high .NET framework SDKs?)

I was happy w/ 3.5 but was informed that Monodevelop (or similar?) wanted something around 4.5+ ... I had/have 4.5.1 installed and just went with it.

Quote
even if my TFTD folder is correct, looks like it still searches in the UFO directory for the TFTD resources, can you check about?

Can you give specific details? Eg, steps to reproduce, what specific resource borks up ... resource paths are cached by the constructor and at that point it looks okay. Also, have a glance at your settings/MapResources.yml file, it should look similar to this:

Code: [Select]
ufo: C:\basepath_of_UFO
tftd: C:\basepath_of_TFTD

Offline osd_daedalus

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Re: MAPVIEW upgrade
« Reply #416 on: October 01, 2019, 07:26:58 pm »

Can you give specific details? Eg, steps to reproduce, what specific resource borks up ... resource paths are cached by the constructor and at that point it looks okay. Also, have a glance at your settings/MapResources.yml file, it should look similar to this:

Code: [Select]
ufo: C:\basepath_of_UFO
tftd: C:\basepath_of_TFTD

Without seeing yet the code (I am installing VS Community hoping it will work...)...

Even if paths are corrected, looks like TFTD resources are still searched in UFO directory, and not in TFTD.
UFO resources instead appear corrected.

Later (in this period I have to run everywhere!) I'm going to have a look to try to see what could be the issue...

ADD: was forgetting... my output of MapResources.yml appears to be correct:
Code: [Select]
ufo: C:\Users\vbox\Downloads\OpenXcom\bin\UFO
tftd: C:\Users\vbox\Downloads\OpenXcom\bin\TFTD
« Last Edit: October 01, 2019, 07:30:20 pm by osd_daedalus »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #417 on: October 01, 2019, 08:30:04 pm »
yep. Looking ...

note I don't have TFTD so i'll set up a mock Tftd installation for debugging. While that should be enough to figure out what's going on, if you want to pursue this on your end also (barring RL ofc) that could well be a good thing.


[note that the logfile works in Debug only, and ought write itself to the executable's dir]

Offline osd_daedalus

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Re: MAPVIEW upgrade
« Reply #418 on: October 01, 2019, 09:10:34 pm »
Well, maybe I discovered something.
Using Debug in VS Community and breaking the execution, I see this:

descriptor.cs, line 94
Code: [Select]
if (path == GlobalsXC.BASEPATH) // use this Tileset's basepath
return Path.Combine(Basepath, GlobalsXC.TerrainDir);

Looks like this is never true, so the path variable is always set to UFO\... rather than TFTD\

So, either the issue is there or something related, OR it is about that basepath missing from MapTilesets.yml (and yes, I tried to rebuild them).
The issue is I have still to learn how these files work. My C# skill is very little (tbh, all of coding skills), but I will write if I find something.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #419 on: October 01, 2019, 09:22:21 pm »
MapTilesets does not store a basepath if the basepath of a tileset is the same as the basepath set by the Configurator.

ie, if a tileset does not have a basepath in the YAML file, it is (or should be) using the basepath that was set by the Configurator,


ps. am about to look into descriptor line 94