Author Topic: MAPVIEW upgrade  (Read 315896 times)

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
Re: MAPVIEW upgrade
« Reply #375 on: February 11, 2019, 08:56:20 am »
(resolution: upgrade Mono)
Most likely for me. 16.04 has frozen the version.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #376 on: February 11, 2019, 11:49:38 am »
Hey KevL, do these errors mean anything to you?

I get this on mapset Grunge1, if i make ANY changes to that mapset ( even just changeing the shade of 1 pixel in the set), when i try to load it back into Mapview it gives the below errors. At first i thought it was MCDEDIT corrupting the file but it loads perfectly in Openxcom ( and displays correctly) its only mapview that crashes out.

Any thoughts?
« Last Edit: February 11, 2019, 11:54:43 am by luke83 »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: MAPVIEW upgrade
« Reply #377 on: February 11, 2019, 12:05:54 pm »
Kevl, 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.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #378 on: February 11, 2019, 03:56:33 pm »
@luke83
loading ...

EDIT:
GRUNGE1_L83.PCK/TAB looks borked. It won't open in PckView (correctly) either. suggest recreating if poss.



@Solarius Scorch
in the .7z package (windows build) there's a subdir /ConfigConverter

it's a standalone app that requires MapEdit.dat, Images.dat, AND Paths.pth (input)

and outputs MapTilesets.yml

There's a ReadMe.txt ...


It's only been tested with what I have here, and a couple other dats that unfortunately strike me as a bit buggy, or at least quirky from the git go ...

am curious what results you could get from it. Pls pay attention to any dialogs that pop, the output (MapTilesets) could well need tweaking,

but i'd be happy to work on it with ya if it comes to that,
« Last Edit: February 11, 2019, 05:20:06 pm by kevL »

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #379 on: February 11, 2019, 06:27:00 pm »
Borked? It looks fine on my end, what are you seeing?

Yes i can recreate it, problem is, as soon as i change anything at all, it "breaks" again...its loading into OXC ok but i would like to have a working file, i might try changing the images through PCK view then and see if that avoids what ever is going on.

Thanks again mate :)
« Last Edit: February 11, 2019, 06:30:04 pm by luke83 »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #380 on: February 11, 2019, 07:51:07 pm »
i did a bit of debugging ...

for some reason there's a mismatch between the quantity of sprites in the PCK and the quantity of sprites expected by the TAB.

Code: [Select]
SpriteCollection..cTor
. fsTab.Length= 106
. tabOffsetLength= 2
. tabSprites= 53
pckSprites= 56 tabSprites= 53


looking at the PCK and TAB files in a hexeditor shows that the last few blank sprites have somehow caused a mismatch between the PCK and TAB data. (i fixed it with the hexeditor to make it work, but the point is that something went distinctly screwy somewhere along the production line)

OXC and MCDEdit can let things go through okay -- no harm done perhaps. But PckView/MapView do error-checking to ensure the quantity of sprites match the quantity expected by the TAB file. If they don't the spriteset goes null,

that's just the way it is, Luke


(but i'll put a note in my TODO, to issue an error... hrm, it's problematic due to the UFO vs TFTD taboffsets... bleh)

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #381 on: February 12, 2019, 08:03:34 am »
Used your awesome PCKview to change the graphics over without any issues, i dont know what caused the issue but its great to be able to work around them :)

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #382 on: February 12, 2019, 09:33:21 am »
sweet :)

but all i've been doing is riff off what Ben did,

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #383 on: February 13, 2019, 07:46:42 am »
Still, your doing great work, keep it up, the community appreciated you keeping the tools alive.

I wish Apoc had someone working on the modding tools, i just found a image extractor that is dos based, still looking for any newer programs. I am looking into the idea of doing my Foxy ( Fantasy Open Xcom) in APoc instead of OXC so am now looking at tools.
« Last Edit: February 13, 2019, 07:49:20 am by luke83 »

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
Re: MAPVIEW upgrade
« Reply #384 on: February 15, 2019, 12:02:56 pm »
MapView with Mono has troubles saving GIF images. The background is filled with garbage.


And a few questions to avoid creating an extra post:

Is there any easier way to add custom maps to the tree, other than modifying MapTilesets.yml and restarting?

Is there an undo?

Are there keyboard shortcuts for map editing (move cursor, change level, cut/copy/paste...)?
« Last Edit: February 15, 2019, 12:07:13 pm by tkzv »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #385 on: February 15, 2019, 04:19:01 pm »
MapView with Mono has troubles saving GIF images. The background is filled with garbage.

I'd like to output screenshots in PNG (eventually), i glanced at the SaveGif() function when implementing PNG input/output for PckView ... hoped it was working ok, guess not :\


answers to these questions are in the CHM-help file. if there's a viewer for CHM on non-windows ...

Quote
Is there any easier way to add custom maps to the tree, other than modifying MapTilesets.yml and restarting?

right click on the Maptree and, depending on what node is selected, options should pop up in a menu

Quote
Is there an undo?

no. Implementing Undo/Redo in a nontrivial codebase that wasn't written with it in mind is (very) nontrivial.

Quote
Are there keyboard shortcuts for map editing (move cursor, change level, cut/copy/paste...)?

cut = Ctrl+x
copy = Ctrl+c
paste = Ctrl+v
delete = Delete

(but not sure about non-windows systems)

move cursor - nope, am thinking about it at some point tho.
change level - nope.

because of the way MapView was originally coded, implementing shortcuts is a fair bit more complicated than normal,

Offline Stoddard

  • Colonel
  • ****
  • Posts: 485
  • in a fey mood
    • View Profile
    • Linux builds & stuff
Re: MAPVIEW upgrade
« Reply #386 on: February 15, 2019, 04:44:52 pm »
I'd like to output screenshots in PNG (eventually), i glanced at the SaveGif() function when implementing PNG input/output for PckView ... hoped it was working ok, guess not :\

This very much looks like uninitialized memory, like, dest image not cleared before drawing. Maybe windows does it automatically while mono does not.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #387 on: February 16, 2019, 01:05:23 am »
hey Stoddard,
unfortunately the first call in SaveGifFile() is CreateTransparent() which SEEMS to create the bitmap-area and fill all pixels w/ paletteId #0

but there are several other drawing and cropping calls going on after that, I don't understand them atm ... this'll wait for a better day,


EDIT:
I just pushed a commit to master : output MainView screenshot as PNG

Stoddard's auto-mono build should pick it up soon ... (but is not in windows build yet)
« Last Edit: February 17, 2019, 02:44:50 am by kevL »

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
Re: MAPVIEW upgrade
« Reply #388 on: February 19, 2019, 07:57:56 am »
Saving as GIF is no longer available. Saving as PNG works, but fills black with garbage too. (Staircases in the air and missing walls and roof are correct.)

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #389 on: February 19, 2019, 11:42:20 am »
huh, ok

unfortunately i'm not setup to build or debug Mono ... I'd just be chasing cats up trees.

maybe someone who is can give it a go,


EDIT: back on the ranch ... implemented an overhead ScanG viewer.
https://github.com/kevL/OpenXCOM.Tools/blob/master/Distribution/README.md

File->ScanG view
- mousewheel does levelup/down
- doubleclick toggles between multilevel view and single-level view
- requires ScanG.Dat in the GEODATA folder of the Configurator's basepath

EDIT: 2019 feb 21
- added check to ensure that a tilepart's ScanG reference doesn't exceed those available in the .Dat file

EDIT: screenshot3
- rigging PckView to view/edit ScanG.Dat (not done)
« Last Edit: February 22, 2019, 08:27:01 pm by kevL »