Author Topic: MAPVIEW upgrade  (Read 313899 times)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #120 on: February 23, 2015, 08:40:12 pm »
I'd also very much prefer to have them separated from vanilla stuff, mainly for ease of modding. Hopefully it'll happen some day.

I am just trying to take a look into some of the expanded ubase maps, to see which is what and write a working mapscript.

But how can i integrate/show those maps in Mapview? Because Mapview only knows UFO Path and ONLY! lists the default maps.
This is Bullshit! Just read the complete fucking directories...
MAPS, ROUTES and TERRAIN. So that all maps can pop up.

Sry... just rageing about mapview.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: MAPVIEW upgrade
« Reply #121 on: February 24, 2015, 01:31:29 am »
I remember it being a pain to edit non-vanilla maps the one time I tried to use it. Have you seen this page? https://openxcommods.weebly.com/mapview.html

With that info, I ended up managing to get the map opened and poke around a bit.

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: MAPVIEW upgrade
« Reply #122 on: February 24, 2015, 03:35:36 am »
Because Mapview only knows UFO Path and ONLY! lists the default maps.
This is Bullshit! Just read the complete fucking directories...
MAPS, ROUTES and TERRAIN. So that all maps can pop up.

Hey, take it easy there, this is one good tool and we are making it a great tool, but it takes time and patience.

Also remember that there is a huge weird mapping of the files, that is stored separated from the actual files,
but the good news is that I'm sure we can tackle all those issues somewhere in the near future.
:D

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: MAPVIEW upgrade
« Reply #123 on: February 24, 2015, 03:40:36 am »
Have you seen this page? https://openxcommods.weebly.com/mapview.html

I hope to be able to replace the GUI of the 3rd and next images, with a more wizard like window.
But I'll probably will keep the old option windows for backward compatibility.

We'll see

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #124 on: February 24, 2015, 11:32:38 am »
Hey, take it easy there, this is one good tool and we are making it a great tool, but it takes time and patience.

Also remember that there is a huge weird mapping of the files, that is stored separated from the actual files,
but the good news is that I'm sure we can tackle all those issues somewhere in the near future.
:D

Ey nevermind your doing a great job, i am just wondering how should one edit custom maps. Replace maps from the original dataset?

Or is there another way.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: MAPVIEW upgrade
« Reply #125 on: February 25, 2015, 08:58:12 pm »
I am just trying to take a look into some of the expanded ubase maps, to see which is what and write a working mapscript.

But how can i integrate/show those maps in Mapview? Because Mapview only knows UFO Path and ONLY! lists the default maps.

It's pretty easy to add existing modded maps to MapView by either editing the Paths and Image.dat files or using the tool's function. 

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #126 on: February 25, 2015, 09:52:37 pm »
It's pretty easy to add existing modded maps to MapView by either editing the Paths and Image.dat files or using the tool's function.

Uhh ok. I will give it a try even thou i have no clue how, but i will try. Btw the way any news from luke83?

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: MAPVIEW upgrade
« Reply #127 on: February 25, 2015, 11:02:02 pm »
I am not sure what i am doing wrong but maps do not want load any more...
I get the following Error Msg

Code: [Select]
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei MapView.RmpViewForm.RmpView.set_Map(IMap_Base value)
   bei MapView.Forms.MainWindow.MainWindowsManager.SetMap(IMap_Base newMap, IMap_Observer observer)
   bei MapView.Forms.MainWindow.MainWindowsManager.SetMap(IMap_Base map)
   bei MapView.MainWindow.LoadSelectedNodeMap()
   bei MapView.MainWindow.mapList_AfterSelect(Object sender, TreeViewEventArgs e)
   bei System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   bei System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   bei System.Windows.Forms.TreeView.WmNotify(Message& m)
   bei System.Windows.Forms.TreeView.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

When trying to load a custom map.

Got the Map to load, but maybe you can improve the code anyway:)
« Last Edit: February 25, 2015, 11:30:34 pm by hellrazor »

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: MAPVIEW upgrade
« Reply #128 on: March 11, 2015, 06:54:08 am »
Hi people, I haven't had time to continue working here, but hopefully I'll have some time in the weekend.

Some minor improvements, including better topview corners and capacity to set routes to dif height in UFO, to eliminate a problem with basement UFO levels
Be sure to download the latest version on the end of the page 8
https://openxcom.org/forum/index.php?action=dlattach;topic=1321.0;attach=13340

Something like the attached maybe?
'https://openxcom.org/forum/index.php?action=dlattach;topic=1321.0;attach=12954;image' from jackStraw
Last time I was coding the infrastructure, changing it to be able to make this mockup

Maybe I'll have time to finish that and review what else is in here, I also was adding the capacity to zoom in and out of the preview window (that looked kool, but I have to remember to be able to zoom in with the scrollbar!).

I wish i could find something to fix my problem with custom maps and the textures.
You can send me a PM if you need something, maybe I can help.

I also added a small bar in the routeView to be able to see how likely a alien is to spawn, move or rank (not really sure what it does, I changed its name to "Importance")

I'll give you guys a teaser
« Last Edit: March 11, 2015, 06:56:01 am by TheBigSot »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: MAPVIEW upgrade
« Reply #129 on: March 11, 2015, 06:05:10 pm »
I also added a small bar in the routeView to be able to see how likely a alien is to spawn, move or rank (not really sure what it does, I changed its name to "Importance")

Flag = probability that the alien will move to that node when patrolling
Zero = unconfirmed, the leading hypothesis for the original game is that it determines probability that the alien will attack the object on that node since it is mainly found in nodes on XCom Base maps and the Skyranger map. I don't think this is actually implemented on OXC though.
Spawn = probability that an alien will spawn on that node

Also, I think there must be a bug since when I select the Lightning using the vanilla files I get an error message saying that there are routes located outside the vertical limits of this map. This has also happened to Dioxine with his Ventura craft (which is a modded version of the Lightning) and can cause crashes.
« Last Edit: March 11, 2015, 06:09:26 pm by Hobbes »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: MAPVIEW upgrade
« Reply #130 on: March 16, 2015, 07:45:35 am »
A little bit more feedback on the latest version. :)

First, with the .map editing functions, everything is working great to me and has been a much welcomed improvement in years I've used this program. With the .rmp editing I'm also very satisfied, specially with how autoconnect nodes work. However, there is still some small glitches where repeated links are added to nodes, which I think are related with autoconnect trying to to link nodes in different levels. If this is the issue, my suggestion would be for autoconnect to never link nodes in different levels because I always prefer to do it manually to ensure they're working.

Thanks for all your work :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: MAPVIEW upgrade
« Reply #131 on: March 16, 2015, 10:17:34 am »
Zero = unconfirmed, the leading hypothesis for the original game is that it determines probability that the alien will attack the object on that node since it is mainly found in nodes on XCom Base maps and the Skyranger map. I don't think this is actually implemented on OXC though.

can confirm, and it is.
basically if an alien patrols to one of these nodes, it will then, as part of the patrol routine, start targeting base facility modules whose MCD has the "baseModule" flag.
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L494
« Last Edit: March 16, 2015, 10:52:38 am by Warboy1982 »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: MAPVIEW upgrade
« Reply #132 on: March 16, 2015, 06:03:59 pm »
can confirm, and it is.
basically if an alien patrols to one of these nodes, it will then, as part of the patrol routine, start targeting base facility modules whose MCD has the "baseModule" flag.
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L494

Thank you. It would be nice then if it was possible for MapView to allow editing these 'Zero' values.

Warboy1982, one further question about the AI. When Tactical initializes during a UFO mission and it is placing the alien units, any alien with a 'scout' or 'start outside UFO' flag is only placed on routes with 0 rank, right? If there are routes with other ranks (Soldier, Navigator, etc.) those are simply ignored, and the aliens are placed randomly on rank 0 nodes, despite of their actual rank.
« Last Edit: March 16, 2015, 06:08:14 pm by Hobbes »

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: MAPVIEW upgrade
« Reply #133 on: March 20, 2015, 02:48:55 am »
can confirm, and it is.
basically if an alien patrols to one of these nodes, it will then, as part of the patrol routine, start targeting base facility modules whose MCD has the "baseModule" flag.
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L494

Good, I will update MapView to include this.

But in other note, I noticed that the code to shoot to base module is HardCoded to always look in the second floor, and not in the floor of the current unit.

https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L510
https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L514

...Position(i, j, 1)...

Thank you for your time

« Last Edit: March 20, 2015, 05:43:19 am by TheBigSot »

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: MAPVIEW upgrade
« Reply #134 on: March 20, 2015, 03:10:33 am »
any alien with a 'scout' or 'start outside UFO' flag is only placed on routes with 0 rank, right? If there are routes with other ranks (Soldier, Navigator, etc.) those are simply ignored, and the aliens are placed randomly on rank 0 nodes, despite of their actual rank.

This is so good to know, if found this codes:
      if (outside)
         node = _save->getSpawnNode(0, unit); https:// when alien is instructed to spawn outside, we only look for node 0 spawnpoints
      else
         node = _save->getSpawnNode(Node::nodeRank[alienRank], unit);

On https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/BattlescapeGenerator.cpp#L931L934

Which basically confirms what you are saying, I may then add a button tool to set all nodes to 0 alienRank, so all nodes can spawn (if other parameters are correct)