Author Topic: MAPVIEW upgrade  (Read 259617 times)

Offline Alex_D

  • Colonel
  • ****
  • Posts: 482
    • View Profile
Re: MAPVIEW upgrade
« Reply #495 on: October 06, 2021, 09:59:02 pm »
Thank you kevL

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: MAPVIEW upgrade
« Reply #496 on: October 16, 2021, 11:31:12 am »
Hi. Noticed that vanilla tftd map of alien base level 1 can not be opened via MapView. Something looks wrong, maybe with map height.

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: MAPVIEW upgrade
« Reply #497 on: October 16, 2021, 12:08:40 pm »
I get this when I try to copy-paste an area of tiles from a map to another.
Happens both if if I try to paste on the same level or on a different level from source map.
The maps use the same MCD libraries.

The MCDs count for these maps exceeds the 255 limit, but all the MCDs in the copy-pasted area are not among the ones beyond that limit.

Let me know if you need more info.
« Last Edit: October 16, 2021, 12:11:08 pm by robin »

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: MAPVIEW upgrade
« Reply #498 on: October 16, 2021, 12:09:32 pm »
double post sry.

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #499 on: October 16, 2021, 10:05:23 pm »
@robin I think i got it ... gimme a day or so to look it over.

@Nord I don't have TftD myself and so can't check the Maps... is there an error? or is it silent... what happens?

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: MAPVIEW upgrade
« Reply #500 on: October 17, 2021, 06:07:54 pm »
@Nord I don't have TftD myself and so can't check the Maps... is there an error? or is it silent... what happens?
Here is error message:
Spoiler:
System.OverflowException: Array dimensions exceeded supported range.
   at XCom.SpriteCollection..ctor(String label, Palette pal, Int32 tabwordLength, Byte[] bytesPck, Byte[] bytesTab)
   at XCom.SpritesetsManager.LoadSpriteset(String label, String dir, Int32 tabwordLength, Palette pal, Boolean preserveStaticSpritesets)
   at XCom.Descriptor.CreateTerrain(Int32 id)
   at XCom.MapFileService.LoadDescriptor(Descriptor descriptor, Boolean& treechanged, Boolean browseMapfile, Boolean ignoreRecordsExceeded, RouteNodeCollection routes)
   at MapView.MainViewF.LoadSelectedDescriptor(Boolean browseMapfile, Boolean keepRoutes)
   at MapView.MainViewF.OnMapTreeAfterSelect(Object sender, TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #501 on: October 18, 2021, 04:56:14 am »
Here is error message:
Spoiler:
System.OverflowException: Array dimensions exceeded supported range.
   at XCom.SpriteCollection..ctor(String label, Palette pal, Int32 tabwordLength, Byte[] bytesPck, Byte[] bytesTab)
   at XCom.SpritesetsManager.LoadSpriteset(String label, String dir, Int32 tabwordLength, Palette pal, Boolean preserveStaticSpritesets)
   at XCom.Descriptor.CreateTerrain(Int32 id)
   at XCom.MapFileService.LoadDescriptor(Descriptor descriptor, Boolean& treechanged, Boolean browseMapfile, Boolean ignoreRecordsExceeded, RouteNodeCollection routes)
   at MapView.MainViewF.LoadSelectedDescriptor(Boolean browseMapfile, Boolean keepRoutes)
   at MapView.MainViewF.OnMapTreeAfterSelect(Object sender, TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@Nord you seem to be using an old version of MapView2. The functs in the stacktrace no longer exist in that form ...pls upgrade and try it again -- let me know if it still borks out,

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: MAPVIEW upgrade
« Reply #502 on: October 18, 2021, 09:39:28 am »
@Nord you seem to be using an old version of MapView2. The functs in the stacktrace no longer exist in that form ...pls upgrade and try it again -- let me know if it still borks out,
Downloaded version fro 4 october. Still got this:
Spoiler:
System.OverflowException: Array dimensions exceeded supported range.
   at XCom.Spriteset..ctor(String label, Palette pal, Byte[] bytesPck, Byte[] bytesTab, Int32 spritewidth, Int32 spriteheight, Int32 tabwordLength, Boolean createToned)
   at XCom.SpritesetManager.CreateSpriteset(String label, String dir, Palette pal, Boolean createToned, Int32 spritewidth, Int32 spriteheight)
   at XCom.Descriptor.CreateTerrain(Int32 terid)
   at XCom.MapFileService.LoadDescriptor(Descriptor descriptor, Boolean& browseMapfile, Boolean ignoreRecordsExceeded, RouteNodes routes, TreeNode selected)
   at MapView.MainViewF.LoadSelectedDescriptor(Boolean browseMapfile, Boolean keepRoutes)
   at MapView.MainViewF.OnMapTreeAfterSelect(Object sender, TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #503 on: October 18, 2021, 08:10:28 pm »
vanilla tftd map of alien base level 1

hi Nord, could you link me to a MAP and the terrain files req'd to load

#----- Alien Base Level 1 -----------------------------------------------------#
  - type: ENTRY00
    terrains:
      - SAND
      - UEXT2
      - UEXT3
      - ORGANIC1
      - ENTRY

?

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #504 on: October 19, 2021, 06:16:20 am »
The release build of Mapview2 was well behaved on my machine, when loading Maps in the tftdSeascapes|Alien Base Level 1 category. I get this error:

Quote
In the MCD file ENTRY part #6 has an invalid death part (id #47 of 12 records).

in the debug build, however, this also gets thrown:

System.ArgumentNullException: Value cannot be null.
Parameter name: image
   at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
   at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
   at MapView.Forms.MainView.MainViewOverlay.DrawSprite(Image sprite, Rectangle rect) in c:\GIT\OpenXCOM.Tools\MapView\Forms\MainView\MainViewPanel\MainViewOverlay.cs:line 2031
   at MapView.Forms.MainView.MainViewOverlay.DrawTile(MapTile tile, Int32 x, Int32 y, Boolean toned) in c:\GIT\OpenXCOM.Tools\MapView\Forms\MainView\MainViewPanel\MainViewOverlay.cs:line 1975
   at MapView.Forms.MainView.MainViewOverlay.DrawRembrandt() in c:\GIT\OpenXCOM.Tools\MapView\Forms\MainView\MainViewPanel\MainViewOverlay.cs:line 1440
   at MapView.Forms.MainView.MainViewOverlay.OnPaint(PaintEventArgs e) in c:\GIT\OpenXCOM.Tools\MapView\Forms\MainView\MainViewPanel\MainViewOverlay.cs:line 1321
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

investigating further, found that Alien Base Level 2 does the same thing with the ORGANIC2 terrain, which is almost identical to the ENTRY terrain (but has 2 less tileparts).

Quote
In the MCD file ORGANIC2 part #6 has an invalid death part (id #47 of 10 records).

potential fix :
Open ENTRY.MCD in McdView (or MCDEdit) and change the deathtile of id #6 from 47 to 7. save ...
Open ORGANIC2.MCD in McdView (or MCDEdit) and change the deathtile of id #6 from 47 to 7. save ...

try it ...,
« Last Edit: October 19, 2021, 06:50:33 am by kevL »

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: MAPVIEW upgrade
« Reply #505 on: October 19, 2021, 11:42:20 am »
I have open MCD's. And no, they are valid.
MCD part 6 have deathId 7 in ENTRY. ORGANIC2 is fine too.

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #506 on: October 19, 2021, 04:04:41 pm »
I have open MCD's. And no, they are valid.
MCD part 6 have deathId 7 in ENTRY. ORGANIC2 is fine too.

then pls send me the Map and terrain files for the tileset you are trying to load. The ones you sent me are different ... (and they load, btw).

@robin sry this is taking longer than expected

[edit]
@Nord

Quote
System.OverflowException: Array dimensions exceeded supported range.

at first i thought the error was the usual "index exceeds bounds of the array" but then looked into it ... it looks like, for whatever whacky reason, one or more of the terrains you're trying to load is causing c# to attempt to create an array with indices for > 65000 sprites
« Last Edit: October 20, 2021, 09:12:34 am by kevL »

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #507 on: October 20, 2021, 09:06:06 am »
2021 October 20
MapView2_211020.7z
https://drive.google.com/file/d/1CLaCLZu_Y_YMfmWaeSMYrfKsUCyeJTMx/view?usp=sharing

fix Copy/Paste tiles from one Map to another.
rework About boxes
+ assorted tweaks

Offline Nord

  • Commander
  • *****
  • Posts: 1625
  • The Gate is open.
    • View Profile
Re: MAPVIEW upgrade
« Reply #508 on: October 20, 2021, 09:30:36 am »
Ok, i have tryed an full-clean install. And it is working. Sorry, looks like problems are on my side. Too many modding, confused with all these maps and terrains.
Once again, sorry.
 :-[

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #509 on: October 20, 2021, 10:04:57 am »
kk

nothin wrong with pushing the limits..