Author Topic: MAPVIEW upgrade  (Read 53445 times)

Offline luke83

  • Commander
  • *****
  • Posts: 1341
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #360 on: January 03, 2019, 01:49:18 pm »
So was building some maps and when i returned they are all garbled ( see image below), now i am assuming this is because i have too many tilesets used on this mapset, my question for the experts is:
 Is this a limitation that OXC has overcome and its only just Mapview that is not updated OR does OXC have this same restriction ( and just has not been updated)?  In the old days i remember there was a limit but i thought OXC overcome all these pesky issues.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8077
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: MAPVIEW upgrade
« Reply #361 on: January 03, 2019, 02:25:59 pm »
Hi Luke,
The limits on OXC maps are the same as in the original game, because it's the same file format.
Therefore, you are limited to 256 tiles per terrain (doesn't matter if it's in one or multiple tilesets).
There are however several tricks you can use:
1) Destroyed tiles are not saved in a map, so you can go over 256, as long as the excess tiles are limited to destroyed tiles. So try putting destroyed tiles at the end of your last tileset.
2) UFOs and crafts use different tilesets. If your particular map does not include them, you can make a terrain block with different tilesets and spawn it as a UFO/craft.
3) If you're using OXCE (like pretty much any serious modder these days), you can combine terrains by defining another terrain in the mapscript. (This is the most robust option, unless you are only a few tiles over the limit, in which case it's better to just use option 1.)
If I think of anything else, I will also mention it, but for now that is all.

Offline luke83

  • Commander
  • *****
  • Posts: 1341
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #362 on: January 03, 2019, 07:02:50 pm »
Thanks Mate, I am about 50 over the limit which should be fine, i was being Lazy anyway and i just importing Several Custom Tilesets from other maps instead of only what i needed so  i will just bite the bullet and make another Custome Tileset for this map also ;).

Offline kevL

  • Captain
  • ***
  • Posts: 191
    • View Profile
Re: MAPVIEW upgrade
« Reply #363 on: January 03, 2019, 07:10:02 pm »
1) Destroyed tiles are not saved in a map, so you can go over 256, as long as the excess tiles are limited to destroyed tiles. So try putting destroyed tiles at the end of your last tileset.

not sure you mean this, but i'll try to clarify something ...

pretty sure that destroyed parts have to be kept within the Terrain that references them (eg, i don't believe it's valid to have a terrain that consists purely of destroyed parts at the end of a terrainset -- ie. MCD references need to be within their own MCD file)

I mean it doesn't *strictly* make sense to reference part#250 (or #275 ...) in an MCD that contains only 50 records.

(caveat: it may work, but that doesn't mean it strictly makes sense: because it would mean you could have a Map with a terrain that references a part that doesn't exist in the overall set)


note2: in TileView if you select a part, the titlebar ought display its MCD-ID (aka part#) -- first its position in the total terrainset ( MapID ), then its position in its own terrain ( TerrainID ).

@luke you probly know that, it's just a general note

Offline luke83

  • Commander
  • *****
  • Posts: 1341
    • View Profile
    • openxcommods
Re: MAPVIEW upgrade
« Reply #364 on: January 03, 2019, 07:31:24 pm »
note2: in TileView if you select a part, the titlebar ought display its MCD-ID (aka part#) -- first its position in the total terrainset ( MapID ), then its position in its own terrain ( TerrainID ).

@luke you probly know that, it's just a general note

Yep, i noticed it AFTER my maps were corrupted ( good news is its only 3 maps that i did before i noticed  ;))

A suggestion for a future update to help new modders (or old modders like me that forget the rules), add a message box on load that lets the modder know they have gone over the limit with set XYZ. Not desperately needed, but i know how easy messageboxes are to add in code so just thought i would mention it.


On another topic, do we have a guesstimate on when TFTD Bigobbs support will occur for PCKVIEW, i still have a few items i have not been able to steal from other Modders or Export myself. 

Offline kevL

  • Captain
  • ***
  • Posts: 191
    • View Profile
Re: MAPVIEW upgrade
« Reply #365 on: January 03, 2019, 08:07:58 pm »
Yep, i noticed it AFTER my maps were corrupted ( good news is its only 3 maps that i did before i noticed  ;))

A suggestion for a future update to help new modders (or old modders like me that forget the rules), add a message box on load that lets the modder know they have gone over the limit with set XYZ. Not desperately needed, but i know how easy messageboxes are to add in code so just thought i would mention it.

+3½


Quote
On another topic, do we have a guesstimate on when TFTD Bigobbs support will occur for PCKVIEW, i still have a few items i have not been able to steal from other Modders or Export myself.

well i just finished with this : https://github.com/kevL/yata/blob/master/UndoRedo.cs
so i should be able to make some time in the next few days and see how it goes ...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8077
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: MAPVIEW upgrade
« Reply #366 on: January 03, 2019, 08:19:01 pm »
not sure you mean this, but i'll try to clarify something ...

pretty sure that destroyed parts have to be kept within the Terrain that references them (eg, i don't believe it's valid to have a terrain that consists purely of destroyed parts at the end of a terrainset -- ie. MCD references need to be within their own MCD file)

Yes of course, destroyed tiles must be in the same tileset as good tiles. I just didn't mention it since I thought it was kinda obvious.
In practice, the tileset with the most destroyed tiles should ideally be last.

+3½

Agreed :)

Offline kevL

  • Captain
  • ***
  • Posts: 191
    • View Profile
Re: MAPVIEW upgrade
« Reply #367 on: January 05, 2019, 10:42:20 pm »
PckView - bigob support
https://github.com/kevL/OpenXCOM.Tools/blob/master/Distribution/README.md

minimal testing -- I got it to load TFTD/UFO Bigob.Pck and output a spritesheet. Again the background color seems to get set to #255 ... so floodfill to #0 req'd after output.

On the File menu there ought be 2 Open commands: 1st for rego PCKs, 2nd for Bigob PCKs. I noticed, in my meanderings, there are 2 Bigobs (at least there is for UFO, not sure about TFTD) -- there's Bigob.PCK/TAB in the UNITS directory and Bigob.PCKs (individual sprites, no TABs) in the UFOGRAPH directory. i didn't test the latter but feel free to try ... i have no idea if they're different



EDIT:
MapView2 upgrade 2019 jan 7

    add UFO1A (small scout) to the default MapTilesets.YML ... note to those who want access to the small scout but don't want to bork their current MapTilesets config: generate a MapTilesets.TPL via the Configurator and copy type:UFO1A to their working MapTilesets.YML

    issue a warning if the quantity of allocated Terrain MCD-records exceeds 256. The warning, if applicable, is shown when the Map loads by selecting it in the MapTree or when a Map's descriptor is modified causing the Map to reload (eg. terrains have been added or removed)


EDIT2:
upgraded upgrade (see 2nd screenshot)



EDIT3:
debug from 8bbp PNG source:
Width= 32
Height= 40
PixelFormat= Format32bppArgb

debug from 8bbp BMP source:
Width= 32
Height= 40
PixelFormat= Format8bppIndexed

AAAAARGHT why does .net/gdi+ do this to me

Edit3b:
found this workaround and it seems to work
https://stackoverflow.com/questions/44835726/c-sharp-loading-an-indexed-color-image-file-correctly#answer-45100442
Quote
I had this problem too, and it seems that any paletted png image that contains transparency can't be loaded as being paletted by the .Net framework, despite the fact the .Net functions can perfectly write such a file. In contrast, it has no problems with this if the file is in gif format, or if the paletted png has no transparency.
« Last Edit: January 09, 2019, 04:42:56 am by kevL »

Offline kevL

  • Captain
  • ***
  • Posts: 191
    • View Profile
Re: MAPVIEW upgrade
« Reply #368 on: January 12, 2019, 09:32:00 pm »
@note: Currently working w/Stoddard on a Linux build that overcomes the Mono/transparency issue

initial results are promising ...

is based on the original footwork by tkzv.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2153
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #369 on: January 14, 2019, 05:58:24 am »
@note: Currently working w/Stoddard on a Linux build that overcomes the Mono/transparency issue

initial results are promising ...

is based on the original footwork by tkzv.

I am seriously looking forward to a version which can work without the transparency issue.
Fiddling around with this win 7 VM is a maze...

Offline kevL

  • Captain
  • ***
  • Posts: 191
    • View Profile
Re: MAPVIEW upgrade
« Reply #370 on: January 14, 2019, 08:17:49 am »
i believe the transparency issue is completely solved. (at least bypassed, by simply not painting sprite-pixels that're palette-id #0)

at the moment i've punted the ball to Stoddard, who is (if i understand...) trying to get either a decent multi-platform build against Mono, or a decent Windows build that runs as well as possible on Linux with the Mono libraries.


there's still stuff to puzzle through, however. like, is there going to be a different build for Windows vs [other], what .NET version is best, etc .. should the sourcecode be maintained in two different branches/repos .....

other issues are popping up, needless to say, but atm it's up to Stoddard to say whether any show-stoppers happen,


--
in other news, am sitting on a version of PckView that supports PNG in/out and also supports pck-spritesets for UFO/TFTD terrain, units, and bigobs. I want to wait till the Net vs Mono thing gets sorted out a bit better,
« Last Edit: January 14, 2019, 08:22:56 am by kevL »

Offline Stoddard

  • Captain
  • ***
  • Posts: 385
  • in a fey mood
    • View Profile
    • Linux builds & stuff
Re: MAPVIEW upgrade
« Reply #371 on: January 16, 2019, 10:22:53 am »
Yep, transparency done.

Binaries:
windows-built - https://lxnt.wtf/oxem/builds//MapView/MapView2_Net451_190115.7z
linux-built - https://lxnt.wtf/oxem/builds//MapView/MapView-612a2ce-2019-01-16-mono.7z

source the linux-built build is built from - https://github.com/StoddardOXC/OpenXCOM.Tools/tree/net45


I am seriously looking forward to a version which can work without the transparency issue.
Fiddling around with this win 7 VM is a maze...

Please try out the above.
« Last Edit: January 16, 2019, 10:25:03 am by Stoddard »