aliens

Author Topic: Globe Editor  (Read 10674 times)

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Globe Editor
« on: November 21, 2021, 05:11:06 pm »
A tool to edit the Globe rules.

Supports:
  • Polygons
  • Textures
  • Areas
  • MissionZones
  • Countries
  • Borders
  • Loading background image

So far the polygon editing is just barebones, you can create triangles and that's pretty much it.
I have included some simple tools like splitting a triangle and Delaunay optimization to make the process a little less painful, but it's still not great.
I have found that creating the inside with big triangles and then making a triangle strip on the coastline works best. You can then split the inside into smaller triangles and optimize.
Also be aware that editing around the prime meridian is sometimes a little funny.

Controls not documented anywhere in the program:
Arrows, Mouse middle button: Scroll around
Numpad +, Numpad -, Mouse wheel : Zoom

As far as saving and loading the globe file, I strongly recommend creating a file just for the globe data.
All in all:

BACKUP YOUR FILES!

I'm welcoming any suggestions for new features and improvements and also the inevitable bug reports.

The program is in VB.net in the ol' windows forms

Sources: https://github.com/bohemond-of-antioch/OpenXcom-GlobeEditor
Releases: https://github.com/bohemond-of-antioch/OpenXcom-GlobeEditor/releases

I'm releasing this under Creative Commons Zero.
« Last Edit: December 12, 2021, 08:06:25 pm by bohemond »

Offline Buscher

  • Colonel
  • ****
  • Posts: 168
    • View Profile
Re: Globe Editor
« Reply #1 on: November 21, 2021, 07:54:02 pm »
It runs in Wine (wine-6.20 (Staging)) but I keep getting an empty view in the main window. No idea if I am doing something wrong or if it's a Linux issue.
My approach was to load the globe.rul in Openxcom/standard/xcom1.
It does save fine as I got a new file out of it. But maybe you want to save it similar to the vanilla globe.rul. Creating new vertexes and importing background works too. So not sure if it might be an import thing. Loading from a rul file I have created with this tool works fine.
Also it would be nice to save project data (chosen background, etc.)

Spoiler:
vanilla
Code: [Select]
  polylines:
...
    - [351.25, -41.625, 353.875, -41.625, 352.375, -37]
vs
Globe editor
Code: [Select]
  polylines:
...
    - - 351.25
      - -41.625
      - 353.875
      - -41.625
      - 352.375
      - -37
« Last Edit: November 21, 2021, 07:58:33 pm by Buscher »

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: Globe Editor
« Reply #2 on: November 21, 2021, 08:49:27 pm »
The standard globe.rul uses
    data: GEODATA/WORLD.DAT
which is not supported. Only the polygons in yaml work at the moment. I didn't want to get into loading the binary world data, although I could just steal it from OpenXCom source, I guess...

The polylines/borders are not supported either.

I've already thought about storing some metadata to keep the source yaml file more intact upon saving.

Not sure about the project file as there is really not much to save. Just the background for now, but I might do it if there more features are requested.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: Globe Editor
« Reply #3 on: November 22, 2021, 12:03:07 am »
A BLESSING! A BLESSING FROM THE LORD!

Bohemond be praised!

Thank you so much for this! I've been waiting to see this released. I'm still messing around, but finally i can make my alien world with improved accuracy having a background! Got a few suggestions, hope they are doable:

Im a laptop user, i don't have + nor - tabs, could be possible to have zoom by scrolling with the mouse middle button ? It's also a bit more intuitive.

Also, having the option to change the color of the texture polygons and the number would be great, to have more than the starting 12.

I look forward to see further development of your new tool! Specially the countries, borders and cities.
« Last Edit: November 26, 2021, 07:43:37 pm by efrenespartano »

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: Globe Editor
« Reply #4 on: November 23, 2021, 05:46:55 pm »
Ah, I did not think of the textures, so it seems Buscher's idea of saving a project will come sooner than I anticipated.

I keep forgetting about the mouse wheel as well as I don't use it at all. I will add that.

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: Globe Editor
« Reply #5 on: November 27, 2021, 10:25:19 pm »
Sorry, I disappeared for a while due to IRL problems. First, your tool is great and I am going to prefer it among everything we have so far.
If you don't mind, I will post some suggestions here, that could be some improvement to the product:
1/ floating point data for x y w h corrections of background instead of integer for precise adjustment
2/ option to display grid. Your meridian and equator lines are very useful for background adjustment, but grid would allow even more precise control
3/ indexes for textures in toolbox
4/ option to show indexes of texture on map directly for people who define colors poorly.
5/ option to define texture colors. Some textures are identical in color. For me personally, it is hard to recognize all that green colors and stop putting northern forests or swamps in jungles  :-\
6/ I have exception on using areas tool, probably something is bad with my data https://github.com/723Studio/X-Com-From-the-Ashes/blob/master/Ruleset/geosphere.rul
7/ Custom textures. For instance, I have 15 textures, but I can see only 14 in texture tool.
8/ Not sure, but it seems I can't see point-like missionZones
9/ Right click option does not work for rectangles
10/ Support of making rectangles?

Could be nice if we would share different maps that can be used as background here =) For mine you need to apply correction: X -180, Y -91, W 360, H 182
« Last Edit: November 27, 2021, 11:22:10 pm by Finnik »

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: Globe Editor
« Reply #6 on: December 07, 2021, 01:07:29 pm »
I've sucessfully managed to complete my alien world! :D The option of having a background below made this possible.

I got a few requests/suggestions, hope they are doable:

1.- A globe preview: I had a bit of hard time figuring out how was the globe going meanwhile i was modelling it. I managed to get a look at it by loading it directly on the mod, but i have to admit i would prefer to have a sphere preview of it directly in the tool (like the actual game, i mean). Less clicks here, less mess in the mod folders there. Something like you can switch between the "flat" view with the background or the "spherical" view to see if everything is in order.

2.- I support my friend Finnik's 3 and 4 points on the previous post. I messed up the textures more than once and i just noticed it when i loaded the globe on the game.

3.- A more detailed description to the area tool. Is this intended for regions?

3b.- A regions tool. Geez, i'm suffering trying to make custom regions.

Anyway, im building a shrine for your, bohemond!  ;D It took me a while to get used to the basic commands of the tool, but after a couple of tries i felt comfortable. My initial attempt had few polygons, but after i understood how to use the tool, i greatly increased the poly count to get smoother landmases. Your tool is superb. Keep up with the awesome work, your tools ease our lives.  ;D

P.S. Somehow, i managed to load the ruleset generated by your tool on the old globe editor made by Falko. They seem pretty compatible, im using it to make the countries meanwhile you add the option on your project.

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: Globe Editor
« Reply #7 on: December 08, 2021, 04:22:21 pm »
Both of you bring good suggestions, I should have thought of some of these myself.

I have a problem with just a few:
- Rectangles. I suppose you mean polygons with four vertices. I'd like to avoid supporting these as much as possible, it just makes everything so much more complicated. But I agree that at least the split action (right click) should work on them.
- Globe preview. I think I can manage, as long as it stays as a preview (no editing) and you're not too picky about the precision of the rendering.

Regions/Areas/MissionZones
I thought these already worked pretty well (although I found some bugs).
I guess the naming could be better, I modelled it after the yaml content. Basically a Region is defined by its name, areas and missionZones. I didn't intend to include editing of the other properties (cost, regionWeight, etc.), but it's possible of course.
Then you just drag the boxes by the sides, yeah, I think this UI needs to be improved.
I will also add support for point-like missionZones.

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: Globe Editor
« Reply #8 on: December 09, 2021, 04:39:23 pm »
Released a new version: Projects

Adds support for projects: saving globe metadata, background metadata and defining textures.
Background now works with floating-point numbers.
Mousewheel zoom.

I'm releasing the projects feature so you can already comment on it. The rest of the features will take longer I think.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: Globe Editor
« Reply #9 on: December 11, 2021, 10:17:06 pm »
Thanks for the quick update, mate! :D

Also, thank you for taking in consideration our feedback, looking forward for more updates on your godly tool.

Offline bohemond

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: Globe Editor
« Reply #10 on: December 12, 2021, 08:04:45 pm »
Next release is up, with most of the suggested features implemented:

Countries
Borders
Spherical Globe Preview
Texture Indexes
Grid
Point-Like mission zones

Also includes a whole lot of bugfixes.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: Globe Editor
« Reply #11 on: December 19, 2021, 04:55:50 am »
Wonderful update! I appreciate a lot the fact you put hints about the keyboard shortcuts required to do stuff on the different sections of the tool.

And the sphere preview is gorgeous, i was super happy to see the world in there (even when i actually have it done and working in game).

Im still learning how to use the regions and countries tool, but i have the feeling it will be easier to employ once im get used to them.

P.S: big kudos on the small icon of the .exe, i loved it! :D

Offline GumChewer

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: Globe Editor
« Reply #12 on: August 14, 2024, 03:04:12 pm »
First, thanks for writing the tool!

Second, I'd like to request some features. Cause I'd love to ease the editing by them.
I looked at the code, but I have strictly zero experience with Visual Basic and even less with GUIs in Visual Basic. Implementing them myself is a no-go.

Polylines
  • Selecting multiple vertices at once and delete all of them at once on pressing delete (by left-click and drawing a rectangle.?)
  • Scrolling by right mouse button and dragging
  • Selecting two end-vertices of two polylines and joining the two polylines together
  • Load/Save, display and edit a comment for each polyline (this will ease editing if both the editor and direct editing the yaml-file is used)

General
  • Loading world.dat (The code of OXCE is in RuleGlobe.cpp - RuleGlobe::loadDat)
  • Undo feature (even one-step would help a lot)

Offline _Raven_

  • Captain
  • ***
  • Posts: 53
    • View Profile
Re: Globe Editor
« Reply #13 on: August 15, 2024, 04:31:58 pm »
I didn’t plan to tell you how to create programs, because all this is pointless until all of you, people without borders, gathered from all over the world, achieve the end of the war, but since this topic came to life from a long sleep and then they began to offer editor updates, and I’m currently working on creating the perfect globe, in which case I decided to show you the right path.

To make it comfortable to create a globe using this editor, you must add the following functions:
1) <- -> (cancel, apply) (to undo the last few actions if you made a mistake);
2) there must be save buttons (rewrite the open file, save the file as... and at the same time select the file name and the file type in .rul or .dat, as well as auto-save progress within the system, so that you can continue working even if The laptop froze while working);
3) you need a button to open a file (open any file or even several .rul files at once);
4) you need to add the function of self-opening a file or files by dragging the file into the program window, and it is advisable to add all the possibilities for simple editing of complex functions;
5) Never make the program create a .rul file but not open a .dat file (you would have to be either stupid or crazy to prohibit opening globe files in the globe editor);
6) the globe editor should show all the information about the polygons;
7) there must be program settings (data about the textures of the globe must be saved, how many there are and what color they are);
8) Convenient editing tools (in the WorldEditor program the most convenient and best tool is called “knife”, it easily and simply cuts the globe polygons into pieces, in the GlobeEditor program there is no such thing, you didn’t think of doing in the new program what works perfectly in the old one , congratulations, you are slow-witted and cannot create a full-fledged program without my tips);
9) Support for four corners (what a joke, the vanilla globe is created from triangles and rectangles, but there is no support for four corners, only triangles);
10) It is easier to combine WorldEditor and GlobeEditor into one program (one program lacks the functions that the other has, and the other does not have what the first has. This looks like a conspiracy, but let me create my own editor and it will be better than yours, only my editor will not have the functions that yours has, moreover, my editor will load and save completely different files, completely different globes, and your editor will edit the globe in a standard format);
11) Instructions in the box (there should always be complete instructions for using all the functions of the editor, as well as detailed tips on how best to create polygons and what should not be done under any circumstances).


Since you don’t care about what’s happening in the world and the fact that because of this war, many different masters are dying, then at least be masters yourself and finally create at least something normal and complete, otherwise modding will cease to exist after the end of the genocide on Ukraine at the hands of Americans and Europeans.