Author Topic: MAPVIEW upgrade  (Read 192575 times)

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: [NEW request] Import from mod rule file
« Reply #465 on: January 26, 2020, 11:19:41 pm »
noted, in my notes ...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10536
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
    • Email
Re: MAPVIEW upgrade
« Reply #466 on: February 09, 2020, 07:30:16 pm »
After some time spent with the new MapView, I must say I am really impressed with it. It runs smoothly, reliably and comfortably. Love all the new functions.

Having said that, I'd like two raise two issues - one which is actually serious and one small annoyance.

The serious one:



This position should be 0,0,0, but the editor shows 1,1,1. I understand it's a conscious decision, but for the life of me I cannot imagine any practical use for this. Map coordinates are coded starting with 0, so any time I want to define something by hand, I need to remember to subtract 0 from all the coords. This is really unwieldy and I can't see why I have to suffer this, since AFAIK there's no use for counting staring with 1.

The mild annoyance:



Most of my terrains exceed 254 tiles by design. Thank you for the warning, but it's really unnecessary, and having to click this popup every time I open a map (which sometimes means several times per minute) is not my favourite thing about MapView. There are ways to check the number of tiles which do not involve annoying popups. Can I turn it off somehow?

These are minor complaints, but I guess every bit of feedback helps. Thank you for this marvellous project!

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #467 on: February 19, 2020, 07:35:22 am »
hey Solar, sry been out of the loop for a bit


This position should be 0,0,0, but the editor shows 1,1,1. I understand it's a conscious decision, but for the life of me I cannot imagine any practical use for this. Map coordinates are coded starting with 0, so any time I want to define something by hand, I need to remember to subtract 0 from all the coords. This is really unwieldy and I can't see why I have to suffer this, since AFAIK there's no use for counting staring with 1.

i hear ya. Another member [you know who you are ;)] requested it, iirc. To me I'm kinda meh either way (programmers tend to think 0-based easier than 1-based). But i can see it as a problem given that you're mixing/matching Mv2 functionality w/ by-hand designs ...

Perhaps i should throw in an Option: 1-based counting (default 0-based)

I hope you can suffer it as is for now since i'm actually recovering from some pseudo-major surgery atm.

Quote
Most of my terrains exceed 254 tiles by design. Thank you for the warning, but it's really unnecessary, and having to click this popup every time I open a map (which sometimes means several times per minute) is not my favourite thing about MapView. There are ways to check the number of tiles which do not involve annoying popups. Can I turn it off somehow?

yes. Open the TilesetEditor for the current Map. near the bottom is a tickbox "bypass RecordsExceeded". Unfortunately it needs to be set for each Map that exceeds the terrain limit -- perhaps another Option is needed here: (global) ignore RecordsExceeded


Quote
These are minor complaints, but I guess every bit of feedback helps. Thank you for this marvellous project!

am glad. I'll put these near the top of my priority TODO list but again, need RnR for now,

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10536
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
    • Email
Re: MAPVIEW upgrade
« Reply #468 on: February 19, 2020, 02:47:45 pm »
hey Solar, sry been out of the loop for a bit

Hi KevL!


i hear ya. Another member [you know who you are ;)] requested it, iirc. To me I'm kinda meh either way (programmers tend to think 0-based easier than 1-based). But i can see it as a problem given that you're mixing/matching Mv2 functionality w/ by-hand designs ...

Perhaps i should throw in an Option: 1-based counting (default 0-based)

I hope you can suffer it as is for now since i'm actually recovering from some pseudo-major surgery atm.

Right, such an option would really help. Just to give you some perspective, these nunbers are used for:
- placing items
- placing unit spawns (well, technically also items)
- placing X-Com soldiers in custom deployments in the craft
- placing X-Com equipment pile in the craft
I probably missed something, but at least the first two points are kind of a big deal, because of how common they are. Whereas counting from 1 is, as I said before, quite useless.

yes. Open the TilesetEditor for the current Map. near the bottom is a tickbox "bypass RecordsExceeded". Unfortunately it needs to be set for each Map that exceeds the terrain limit -- perhaps another Option is needed here: (global) ignore RecordsExceeded

Yeah, I believe it would be necessary, since I don't think having to manually approve hundreds of maps makes sense. Please consider it.

am glad. I'll put these near the top of my priority TODO list but again, need RnR for now,

Sure. These are minor things anyway. Get well soon!

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #469 on: February 19, 2020, 11:15:51 pm »
Right, such an option would really help. Just to give you some perspective, these nunbers are used for:
- placing items
- placing unit spawns (well, technically also items)
- placing X-Com soldiers in custom deployments in the craft
- placing X-Com equipment pile in the craft
I probably missed something, but at least the first two points are kind of a big deal, because of how common they are. Whereas counting from 1 is, as I said before, quite useless.

ok. here's what i'm thinkin' (since the way tiles are counted in the Mapfiles is not obvious /Lul -- that is, x and y are switched and z is counted from the toplevel downward )

default to 0-based, and keep the z-level count using 0 as the groundlevel (eg. the top of a battleship will still be level 3)

Can you pls confirm for me that, when placing items/xcom-craft-deployment-positions/etc, that z-level "0" is in fact the groundlevel ? I don't feel up to poking through oxc/e code to figure this out :\


Then i can define 2 options:
- 1-based count for X/Y-plane
- 1-based count for Z-level

(both would default to a 0-based count)


Quote
Yeah, I believe it would be necessary, since I don't think having to manually approve hundreds of maps makes sense. Please consider it.

yep, was never really happy with it. I just wanted a way to let newbs know that, hey, you can't go adding terrains ad infinitum ...

sidenote: at present that flag is stored in MapTilesets.yml for each tileset ( iff set true ). This is also an opportunity to clear (reset) all those flags per a menuitem ...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10536
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
    • Email
Re: MAPVIEW upgrade
« Reply #470 on: February 19, 2020, 11:45:43 pm »
ok. here's what i'm thinkin' (since the way tiles are counted in the Mapfiles is not obvious /Lul -- that is, x and y are switched and z is counted from the toplevel downward )

I... don't even want to think about this ;)

default to 0-based, and keep the z-level count using 0 as the groundlevel (eg. the top of a battleship will still be level 3)

Can you pls confirm for me that, when placing items/xcom-craft-deployment-positions/etc, that z-level "0" is in fact the groundlevel ? I don't feel up to poking through oxc/e code to figure this out :\

Yes, the ground level is defined as 0.

yep, was never really happy with it. I just wanted a way to let newbs know that, hey, you can't go adding terrains ad infinitum ...

Yes, but the current solution is like Windows handholding, doesn't help the newbies much but is really annoying to everyone else. As I'm sure you realize.
I think it would be good enough to just display the total number of tiles somewhere.

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #471 on: February 20, 2020, 12:34:09 am »
the ground level is defined as 0.

tks.

Quote
Yes, but the current solution is like Windows handholding, doesn't help the newbies much but is really annoying to everyone else. As I'm sure you realize.

i totally agree. But again just for those who don't know, i wanted to give the user a sort of slapintheface as soon as a tileset loads (if you know what I mean)

Eg. transferring a Map + terrains from Mv1 (since Mv1 doesn't mention any limit at all, as far as i recall)

/anyway, onward

Quote
I think it would be good enough to just display the total number of tiles somewhere.

yes in both TileView's statusbar and in the TilesetEditor, the total records value should/will be printed reddish if >254 (no warning, just printed in red)


k, will twiddle away at stuff during the next week or so

Offline hellrazor

  • Commander
  • *****
  • Posts: 1980
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #472 on: February 20, 2020, 02:55:00 am »
Is there a mono Version? Best would be as source so i can compile and optimize it against my cpu :)

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #473 on: February 20, 2020, 03:17:12 am »
Is there a mono Version? Best would be as source so i can compile and optimize it against my cpu :)

my repo should be Mono compatible as is

https://github.com/kevL/OpenXCOM.Tools

notes:
Stoddard has successfully set up an automated build routine against Mono: https://lxnt.wtf/oxem/#/MapView

but osd_daedalus (see pages 29+) had issues with it [probably depends on the flavor of Linux] until he (seems to have) achieved good results by building OpenXCOM.Tools natively, on his own machine.

Note: Once you get a running build, go to MainView|Options and turn on "UseMono" -- which should resolve the quirky non-transparency issue that appears to be inherent in the Mono libraries. Unfortunately this also bypasses several graphical niceties of Mapview2, but ought to correct the black boxes that appear around all sprites (ie, no transparency) otherwise.

... if you identify any issues wrt/ Mono pls let me know since i'd like to maintain compatibility (within reason and feasibility, cause i'm strictly Windoze/.NET here)



/good luck :)
« Last Edit: February 20, 2020, 03:24:46 am by kevL »

Offline hellrazor

  • Commander
  • *****
  • Posts: 1980
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #474 on: February 20, 2020, 03:21:34 am »
my repo should be Mono compatible as is

https://github.com/kevL/OpenXCOM.Tools

notes:
Stoddard has successfully set up an automated build routine against Mono: https://lxnt.wtf/oxem/#/MapView

but osd_daedalus (see pages 29+) had issues with it [probably depends on the flavor of Linux] until he (seems to have) achieved good results by building OpenXCOM.Tools natively, on his own machine.

Note: Once you get a running build, go to MainView|Options and turn on "UseMono" -- which should resolve the quirky non-transparency issue that appears to be inherent in the Mono libraries. Unfortunately this also bypasses several graphical niceties of Mapview2, but ought to correct the black boxes that appear around all sprites (ie, no transparency) otherwise.

... if you identify any issues wrt/ Mono pls let me know since i'd like to maintain compatibility (within reason and feasibility, cause i'm strictly Windoze here)



/good luck :)
Any build / compile instruction ?

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #475 on: February 20, 2020, 03:25:31 am »
Any build / compile instruction ?

nope. you know as much as i do ..........

Offline hellrazor

  • Commander
  • *****
  • Posts: 1980
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #476 on: February 20, 2020, 03:27:28 am »
nope. you know as much as i do ..........

fuck.... boah now i have to research that...
Been ages since i worked with mono...

https://stackoverflow.com/questions/8264323/how-to-compile-a-visual-studio-c-sharp-project-with-mono

Lets try ^^

EDIT: xbuild MapView/MapView.csproj is the key ;) only problem i do not have a gui installed on the respective machine ;D So testing has to wait....
« Last Edit: February 20, 2020, 03:34:53 am by hellrazor »

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #477 on: February 20, 2020, 03:31:40 am »
( this could be interesting )

Offline hellrazor

  • Commander
  • *****
  • Posts: 1980
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #478 on: February 20, 2020, 03:46:30 am »
( this could be interesting )

Well!!! See for yourself:

The Routeview window seems strange, maybe not drawing correctly?

Operating system Ubuntu 14.04 here on my Laptop. Will also work on the Desktop, compilation there worked ;)
And thanks so much for making it look really good and useable. Looking forward to spam MAPS!!
« Last Edit: February 20, 2020, 03:50:49 am by hellrazor »

Offline kevL

  • Colonel
  • ****
  • Posts: 417
  • pitchforks and torches
    • View Profile
Re: MAPVIEW upgrade
« Reply #479 on: February 20, 2020, 04:23:20 am »
holy serious RouteView shenanigans batman!

good job on the build, though. :)


here is the core function that draws the gridlines in RouteView ->

MapView/Forms/Observers/RouteView/RoutePanel.cs
DrawGridLines()

if you want to play with it idk.


note: HalfWidth and HalfHeight are (non-trivially) variables used to translate between cartesian and isometric coordinates ... but offhand i don't have a clue what's going on




EDIT: It might be the PixelOffsetMode on line #138

Code: [Select]
    _graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;

ie, try a different mode ... like none or half ...
« Last Edit: February 20, 2020, 04:46:43 am by kevL »