OpenXcom Forum

Modding => Work In Progress => Topic started by: SophiaThe3rd on April 07, 2018, 03:42:35 am

Title: Improving World.DAT discussion
Post by: SophiaThe3rd on April 07, 2018, 03:42:35 am
Players spend a significant amount of time in this game in Geoscape. Earth should look better and more accurately reflect our real world (circa. 1999) Searching the forums has led to:
Volutar's World Editor
Bladum's World.DAT
Hobbes's Area51/Terrain pack 4.X
Am I missing any?(yes i was! there is also)
https://falkooxc2.pythonanywhere.com/worldeditor

These resources make some of the changes I'm looking to see, but do little to satisfy my main concerns with the current globe, being:
Firstly, I feel the coastlines of Earth look terrible. Laughable. Land in vast areas where none exists, missing landmass and islands, and oversimplified edges.
Second, all but the very largest bodies of inland water are ignored. Earth looks very dry, and earth has MANY lakes large enough to lose a UFO and drown its entire crew.
I have therefore started using World Editor to experiment with "improving" things. That was over a year and many man-hours ago. Progress is pictured below. The Question is : "Should this be finished?" Getting this far has taken dedication, there is still more to go, especially in Canada and Greenland, where high latitudes are a pain. Then would still come the terrain distribution improvements by Bladum followed by integrating all of the terrain type improvements by Hobbes. Whew. Poly count is already pushing 6000. I welcome any and all opinions or insight. I dont think I'll finish this unless other people think it's possible AND practical. I think it looks beautiful so far, but if it breaks the game, makes it run too slow, or too drastically changes the "look" of the game then I'll shift my efforts back to other parts of the game i've had my eye on...
Title: Re: Improving World.DAT discussion
Post by: Yankes on April 07, 2018, 03:15:12 pm
Better would be showing results in game itself. Another thing is performances, current drawing globe code excepted classic number of polygon and could have problems if you bump up number of them.
Title: Re: Improving World.DAT discussion
Post by: ohartenstein23 on April 07, 2018, 03:44:06 pm
The original WORLD.DAT has ~600-700 polygons, and with some tests from my random world generator, it seems like up to ~5000 performs okay, though I don't remember the exact counts I used.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on April 08, 2018, 09:08:02 am
I have therefore started using World Editor to experiment with "improving" things. That was over a year and many man-hours ago. Progress is pictured below. The Question is : "Should this be finished?" Getting this far has taken dedication, there is still more to go, especially in Canada and Greenland, where high latitudes are a pain.

A lot of dedication, excellent work!

Quote
Then would still come the terrain distribution improvements by Bladum followed by integrating all of the terrain type improvements by Hobbes.


I made a new terrain distribution for the Terrain Pack/A51 as well

Quote
Whew. Poly count is already pushing 6000. I welcome any and all opinions or insight. I dont think I'll finish this unless other people think it's possible AND practical. I think it looks beautiful so far, but if it breaks the game, makes it run too slow, or too drastically changes the "look" of the game then I'll shift my efforts back to other parts of the game i've had my eye on...

I'd definitely be interested in an upgraded Geoscape for Terminator: Tech-Com total conversion. I'm curious to see how your work actually looks ingame.

One minor issue with the smaller bodies of water is that they'll involve missionZone redesign so that alien bases aren't generated on lakes.

I'd like to see how it actually looks ingame.

EDIT: something else I realized meanwhile about the high polygon count (6000) - it will be required to assign textures to all those polygons, so there might be an issue because of all the work involved.
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on April 13, 2018, 05:39:51 pm
Trying to capture an in game shot as requested, game crashes on startup. Last successful in game check was back when Africa and Australia plus Eastern Asia were completed, some thousands of polys ago. Simply replacing old world.dat with new one is all that's needed to change the earth, correct?
Attached are crash log and World.dat in current state.

Quote
EDIT: something else I realized meanwhile about the high polygon count (6000) - it will be required to assign textures to all those polygons, so there might be an issue because of all the work involved.

-too true, but thats just a simple matter of click, arrow key, click, arrow key.. also, nearly all work so far is strictly inland water or coastline. All these new polys will just copy the main neighboring poly's texture.

not sure where the hold up is, any ideas/fixes very welcome.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on April 14, 2018, 02:23:37 am
(https://i.imgur.com/1FDbujR.png)

It appears Canada is trying to impale Africa or something...  ;D

I couldn't get it to work on vanilla since it doesn't have the additional textures (segmentation error), but when I used your file on my Area 51 mod it worked flawlessly (well... there are still parts of the globe that require more luv)

My bet is that your crash is related to the ruleset since the game loads your WORLD.DAT file without any problems

This illustrates my mention of the high polygon count - it's point and click, but unless there's another way, that means 6000 point and clicks...

--- posts merged ---

Had a better look and the detail looks quite nice, that must have taken quite an effort :)

(https://i.imgur.com/7qRcd6A.png)

And this was taken using it on Tech-Comm mod:

(https://i.imgur.com/FHfmTHz.png)

Very nice work. I would be definitely be interested on this for Tech-Comm, since textures aren't used as much on the mod
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on April 14, 2018, 03:55:59 pm
Super! I was afraid some limitation was the problem, but it appears that's not the case. The impaling poly is a simple issue of not enough vertices. A single or two point "poly" (missing the third coordinate) kinda of "draws anyway" with missing points assumed at the center of the earth or some such. Earliest versions were tested in game to ascertain the smallest features (coast/lakes) the game will draw at max zoom. Smallest of the small might not appear at lowest zoom after terrain textures bring colors to the table, but zoom in and they do show up.
If I understand correctly Hobbes, I just need to drop the number of types of terrain back to original, and it should load vanilla with improved globe, right? (for future testing/screenshots)
How to edit country border lines? Will need doing after everything else gets polish too i suppose.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on April 14, 2018, 08:15:49 pm
If I understand correctly Hobbes, I just need to drop the number of types of terrain back to original, and it should load vanilla with improved globe, right? (for future testing/screenshots)

That *should* do the trick, assuming there are no bugs with the ruleset.

I assume you used the globe from either the Terrain Pack or Area 51 as a starting point since i haven't seen any other globe with so many textures assigned. And when vanilla loads your WORLD.DAT it can't find the extra textures referenced on the file, thus it crashes. At least that's what must have happened when I tried it with vanilla.

Quote
How to edit country border lines? Will need doing after everything else gets polish too i suppose.

Quote
globe:
  polylines:
    - [293.125, -44.5, 291.375, -47.25, 288.375, -45, 285, -45, 278.8, -46.125]
    - [242.875, -32.625, 253.625, -31.75, 256.75, -28.875, 258.625, -29.75, 261, -26.375, 263, -26.125]
    - [235, -48.875, 255, -48.875, 265, -49, 270.375, -48]

You should also adjust the missionZones on regions.rul to avoid alien bases being placed on water, if you want your globe to be a stand-alone mod.

Any ETA on when will you have all the polys done?
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on April 21, 2018, 12:03:47 am
Quote
Any ETA on when will you have all the polys done?

Ballpark estimate on my coastlines is around 40-ish man-hours remaining. I don't sit down to it as often as I would like lately, but I'm shooting for around June. If your new mod is better suited with a "blank slate" earth (few/only one texture) it could be made available in shorter order than my vision for this project i suspect. Bladum's geographic distribution is much improved in my opinion, and I would want that integrated already as well, even if earth was a snowball/cinder. I still don't know how I'm going to deal with the poles themselves.
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on July 31, 2018, 01:31:22 am
Major slowdowns ensued after my tower PC burnt up, but i was able to salvage everything and transfer to a laptop powerful enough to deal with YAML rulesets over 20K... ;)
Coastlines progress, all that remains are tiny RANDOM islands, Canada's high altitude, and the poles.

OPINION QUESTION?: The poles WERE low res/low difference breaks in terrain type in the VANILLA game. They worked alright because the game wasn't very specific. It's an easy search to annual median sea ice levels on google. But, Super high (80°+) latitudes are hard to coastline... SHOULD there be A strip of #SINKABLE ocean between high pole and high Canada as in vanilla or would  earth  be more natural with  broken sea ice snugged right up to high lat polys?
TLDR: should sea ice butt-up to places that WOULD be frozen or should players be given a chance to sink a UFO they don't want to deal with?

also:
I am a little confused about rulesets as pertains to World.DAT. Options (in rulesets) like countries, regioins, etc. allow for (override/delete/replace) of  lat/lon. coordinates, but I am not sure about how to make this into a MOD instead of an Upgrade to OXC. I would love to release as many versions as necessary to accommodate vanilla players as necessary.

Still unpacking/studying Terrain Pack 4.0 to gauge available terrains vs. desired #EARTHACCURATE
Title: Re: Improving World.DAT discussion
Post by: Hobbes on July 31, 2018, 02:55:16 am
SHOULD there be A strip of #SINKABLE ocean between high pole and high Canada as in vanilla or would  earth  be more natural with  broken sea ice snugged right up to high lat polys?

TLDR: should sea ice butt-up to places that WOULD be frozen or should players be given a chance to sink a UFO they don't want to deal with

Vanilla. Oceans already cover more than 70% of the planet. And if modders want to reduce/increase the number of UFO interceptions over land/water they can do it through the ruleset by adjusting the UFO flight patterns.

Quote
also:
I am a little confused about rulesets as pertains to World.DAT. Options (in rulesets) like countries, regioins, etc. allow for (override/delete/replace) of  lat/lon. coordinates, but I am not sure about how to make this into a MOD instead of an Upgrade to OXC. I would love to release as many versions as necessary to accommodate vanilla players as necessary.

Still unpacking/studying Terrain Pack 4.0 to gauge available terrains vs. desired #EARTHACCURATE

First version should only use the vanilla terrains rather than the whole Terrain Pack.

Afterwards, it's really up to the modder's skills and needs. In Tech-Comm for instance I'm planning to use less world textures than vanilla.
Title: Re: Improving World.DAT discussion
Post by: coolguy on July 31, 2018, 05:24:22 am
I'm so excited, this new globe will surely give the game a more modern look. So much detail, wow.
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on August 25, 2018, 07:50:44 pm
Work progresses on this Jovian project. I feel satisfied with the coastlines and inland water of the entire globe. Once product hits the shelves feedback is welcome and missed spots could be persuaded, but things look great with my only gripes being that Australia has weird terrain that i'm not sure is land or lake or lagoon and Canada has WAY too many lakes, most of which are frozen(?) most of the time.
That being said next comes elevation layering. As laughable as the coastlines were, the representation of flat/hilly/mountainous terrain was quite a bit shite as well. Entire mountain regions missing and such. Good or bad this means slicing up the interiors into polys small enough to mold around earths' terrains. Coastline additions pushed the count up to 7500, so this process will likely push 10k. Process is not AS slow as finessing the waterlines, but its a bit of scissors work. About 75% through the N/S Americas. This puts things at about version 0.33
Still to come will be the actual terrain type assignments coupled with texture work to smooth appearances, as well as polyline work for country borders and mission zone adjustments for zones 3 and 4 for sure; zones 1 and 2 need checking but appear to be mostly within adjusted landmasses. (will UFOs land in the water if its within the zone?,or do they find a textured poly within the zone?)
There was a recent corrupted data scare recently, so i'm backing up this progress online as well. Of course anyone is welcome to do anything with it.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on August 26, 2018, 01:34:43 am
Great work so far. Here are a couple of images taken with the new world using Tech-Comm

(https://i.imgur.com/VaZw9Hx.png)

If not for the lines shown below I'd start integrating this globe with Tech-Comm

(https://i.imgur.com/WZHb8ZV.png?2)

That being said next comes elevation layering. As laughable as the coastlines were, the representation of flat/hilly/mountainous terrain was quite a bit shite as well. Entire mountain regions missing and such. Good or bad this means slicing up the interiors into polys small enough to mold around earths' terrains. Coastline additions pushed the count up to 7500, so this process will likely push 10k. Process is not AS slow as finessing the waterlines, but its a bit of scissors work. About 75% through the N/S Americas. This puts things at about version 0.33
Still to come will be the actual terrain type assignments coupled with texture work to smooth appearances, as well as polyline work for country borders and mission zone adjustments for zones 3 and 4 for sure; zones 1 and 2 need checking but appear to be mostly within adjusted landmasses. (will UFOs land in the water if its within the zone?,or do they find a textured poly within the zone?)
There was a recent corrupted data scare recently, so i'm backing up this progress online as well. Of course anyone is welcome to do anything with it.

For Tech-Comm my requirements regarding textures and hilly/mountain/etc. terrain will be quite simple, since I'm only planning to use 3-4 different biomes (one for polar, another for forest, another for desert) and then there will be 3 variations of each biome (plain, hilly, and swamp). The biomes will be assigned to textures, but the variations will be determined randomly for each texture. So, I'll just need all the coastlines defined, the extra layering for elevation will be welcome to other mods that use this with the original game.
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on August 26, 2018, 04:21:24 am
Found the three bad polys, thanks for the spot. Only the three, correct? If it's what you want, its yours
Title: Re: Improving World.DAT discussion
Post by: Hobbes on August 30, 2018, 09:57:35 pm
Found the three bad polys, thanks for the spot. Only the three, correct? If it's what you want, its yours

Thank you very much!

However, I've found more bad polys once I installed it, check attached image
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on August 30, 2018, 11:12:16 pm
Found those three as well, then actually booted up current progress to confirm BEFOREHAND that there weren't any more.
I THINK  ;) this version is error free, attached below.

Couple days of good pushing and the western hemisphere is roughed out, onto Europe and Africa!

Title: Re: Improving World.DAT discussion
Post by: Hobbes on August 31, 2018, 12:58:04 am
Found those three as well, then actually booted up current progress to confirm BEFOREHAND that there weren't any more.
I THINK  ;) this version is error free, attached below.

Couple days of good pushing and the western hemisphere is roughed out, onto Europe and Africa!

It is error free, just checked ;)

This is excellent, still a lot of work involved but the old Geoscape is finally gonna get replaced
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on March 06, 2019, 12:07:30 am
Work had slowed some these last few month while i sorted things out, but nevertheless I have hit what I consider to be another milestone. The entirety of the globe is rendered with coastlines, lakes, flatlands, hilly/mountainous areas, steep mountain, ice flows and polar caps. A LARGE number of fixes and adjustments have been made to combat the significant amount of overlaping polygons in previous versions. Not completely eliminated, but much more under control. Next is deciding exactly how to apply the textures to the terrains in a fashion that makes sense, is easy to modify, and produces a pleasing look to the globe. Also still to do is cleaning up some of the country polylines where coastlines have been altered. All that said, it occurs to me that this current build might be useful to someone in the future as a sort of "proto-earth" or post apocalyptic base build ready to scorch. ;)
Title: Re: Improving World.DAT discussion
Post by: Stoddard on March 06, 2019, 12:21:43 am
This is a great accomplishment and I salute you.

My only hope is that you saved most of the intermediate data and that you're going to post it too.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on March 06, 2019, 01:22:06 am
Just had a look at it using Tech-Comm and it looks amazing. Good work!
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on March 06, 2019, 02:04:00 am
intermediate data? something specific? there isnt much in the way of incremental versions i'm afraid.. so far anyway. Most of whats done thus far is a massive upshot of polys and their placements. I didnt think that a version with the Americas done but Africa and EurAsia not,per se, would be terribly useful to anyone.
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on March 06, 2019, 02:05:33 am
screen cap of Asia
Title: Re: Improving World.DAT discussion
Post by: Stoddard on March 06, 2019, 02:17:49 am
intermediate data? something specific? there isnt much in the way of incremental versions i'm afraid.. so far anyway. Most of whats done thus far is a massive upshot of polys and their placements. I didnt think that a version with the Americas done but Africa and EurAsia not,per se, would be terribly useful to anyone.

Please share how did you accomplish this.

Was it all done by hand-drawing polygons?
Title: Re: Improving World.DAT discussion
Post by: Hobbes on March 06, 2019, 04:28:18 am
North America using the latest version

(https://i.imgur.com/X8uVdoF.png)
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on March 06, 2019, 06:15:22 am
Fear not, I do intend to sit down and write out a documentation of the entire process and revelations ive had along the way. In the mean time, huge thank you to all the devs and community that make things like this possible in the first place. If only system shock saw this kind of love...
Title: Re: Improving World.DAT discussion
Post by: Hobbes on March 08, 2019, 05:18:40 am
Just had a look using world.dat editor and the level of detail is impressive. About assigning textures to the polygons I think you're in the right track by starting to differentiate between low/high altitude areas, with different Geoscape sprites to each.
Title: Re: Improving World.DAT discussion
Post by: Hobbes on March 09, 2019, 05:03:18 pm
OK, after some thinking here are a couple of pointers that might help with the development:

The polar regions are lacking the detailed coastline polygons, which I think should be added because the visual difference is striking. I'm wondering if you didn't add them because they're ice and thus constantly change over the years.

The next step I'd take after polygon design would be to start choosing visual textures for textures.png and try them out to see how they look, and how they look together. The main issue here is that the Geoscape palette is quite limited, plus the day/night cycle uses different gradation coloring, so there aren't many choices available there regarding colors.

The lack of color variety will have effects on the realism, if you check an orbital picture of Earth the colors will be too bright and the polygons will stand out, but this can be mitigated by choosing different visual patterns for each texture. And the lack of realism is also due to other factors that are impossible to control, like seasonal changes (winter in the northern hemisphere and summer in the southern one), plus elevation differences are not always visible from space. But here I think that realism needs to take a step back to aesthetics because if the globe doesn't look good visually that is going to be an eye sore for the player.

Once the visual patterns are chosen and assigned to polygons.png, then it will be a matter of assigning those textures to the individual polygons, and you're probably cringing right now because there are thousands of them. One way to reduce the workload is to assign to texture #0 the most used visual pattern, and then manually edit the other textures.

But here you'll also have to take a design decision: either only use the original textures, which will allow your mod to be used easily by anyone by simply replacing the world.dat file; or add new textures, either from the Terrain Pack or whichever you like, giving you more flexibility but making the modders have to adapt to your system.

This decision also applies to the terrains being used: you either stick to the vanilla ones, or you add additional ones from the Terrain Pack or elsewhere to represent the new biomes, etc. However, since the terrains are assigned through the rulesets, modders can easily choose which ones they want to assign to each texture. The important thing to remember here is that the two systems (visual Geoscape textures and terrains used) are used together, but are independent from one another regarding design: one is edited through world.dat, the other through the ruleset. So if world.dat is finished, then someone else can take it and adapt it to their needs regarding terrain assignment.

There are a couple of issues that modders will also have to fix, and I'd advise leaving those fixes to them, because they involve changes in regions.rul: city placements and missionZone definitions (so that UFOs don't land on the ocean/lakes)

Finally, about the terrains used, with the Terrain Pack I've designed it like this:
* There are several biomes: Farm, Forest, Desert, Jungle, Mountain, Polar, Tundra, Taiga, Grassland, Steppe and Savanna
* Each biome can have different terrain versions assigned. This is done by reusing existing sets of mapblocks and giving them a different visual look by assiging different MCD sets
* The existing generic sets of mapblocks are: DESERT.MAP, FOREST.MAP, DESERTMOUNTAIN.MAP, FORESTMOUNTAIN.MAP and FORESTPOLAR.MAP. By using different MCD sets to them, I can create 5 subterrains to most biomes, each using different mapblocks.
* There are a number of unique sets of mapblocks for terrains where I couldn't do the previous trick: the temple versions of Jungle and Desert, the Jungle Mountain mapset, the different version of Farm, etc.
* These terrains are then assigned to each texture,  according to their distribution in real Earth, but also trying to keep their appearance balanced
Title: Re: Improving World.DAT discussion
Post by: SophiaThe3rd on March 25, 2019, 06:24:16 am
Awesome post. Insightful and informative.

The polar regions are indeed unfinished. Currently they sit at a confirmed "stable" configuration while experimenting with my approach to polar ice flows. I have period accurate reference photos of polar ice min/max states for 1999. An issue is that at such high latitudes polys become less malleable in world editor. It's a pain, and on backburner until I hammer out the structure of my textures and terrains.

For textures.png I still haven't come down on a side of the fence for OG/TP4, but either way realism was always meant to be in the play and not on the visual. I also expect that either way the elevations so plainly visible now will be almost swept away visually by the end, but still there when it comes to crash sites.

By the time I am confidant in my framework, I think texture painting will be fairly smooth, and progress will be rewarding immediately.

I think the complexity of the interplay between the systems involved (textures.png, rulesets, world.dat, mission zones, etc..) limit the usefulness of using a world.dat replacement alone. Not advised but certainly not forbidden.

I have always meant for the final version to be properly boxed up, and able to be flipped like a light switch in the mod menu, unaffected by all other (non-geoscape) mods. To achieve this I don't see how I COULDN'T address the missionZones, polylines for borders, and city placements.

Your final blurb is forum gold. VERY useful explanation.

some observations:
the original structure is a mess when it comes to the terrains and textures. all four textures for forests share with jungles, but farms have four textures all to themselves. even polar and desert get two apiece. this jamming together is confusing at best and at worst should probably be undone, maybe by a tiny mod of its own merit.

while they share colors on the globe, forests can only occur in the north and jungles only in the south. this is just wrong and the system used to do it is of questionable usefulness at all.

Forest/Jungle texture 11 is totally unused, and is probably something that was cut for production times but more interesting is Forest/Jungle texture 6. This texture is only used twelve times in the original globe. I speculate (based on their placements) this might have been a different unfinished terrain that was cut entirely, perhaps swamps.

The MCDs for desert, forest and mountain all already have elevated terrain for battlescape use. Amending these onto farm and polar MCDs and adding some ground surface art for each gives all OG biomes both flat and hilly capabilities. A few extra mapBlocks will need to be assembled to accommodate the behavior change. Maybe a mapScript as well. For mountainous biomes I can just copy the other 5 terrains ground surface .pck art onto duplicated copies of mountain itself. Bring along a few trees, stumps, or grasses from each and BAM. Existing mapBlocks and mapScripts should transition perfectly. I suspect that much of this is already done in TP4.0, I haven't dug in that deeply yet.

When all is said and done, this mod should be easy to modify and easy to add to. It will be nearly impossible to rearrange or reorganize. Because the original structure is a mess and because I have future modders (myself and others) in mind, extra EXTRA care is being given to layout. Original programmers were much more tidy with organization on systems such as alienDeployments itemLists or the research tree. As such these various other systems were MUCH easier for me to understand and imagine improvements for. It will greatly reduce future headaches if this thing is easy to read.

Any all-new textures will require art that not only looks the part, but also wraps around on itself on all four sides. I don't know if I can do that. I believe there is ample art already available in TP4, and the texture decisions all boil down to the "look" of the globe. OG or TP4. Again, I still haven't decided. It MAY be possible to upgrade a finished OG version into a TP version(visually speaking) but only if I get the layout right the first time, as the visual elevation references i have in prep for painting will be gone after said painting.