OpenXcom Forum

Modding => Work In Progress => Topic started by: moriarty on August 08, 2012, 01:39:34 pm

Title: Globe variants
Post by: moriarty on August 08, 2012, 01:39:34 pm
with the excellent work done by Volutar (see here (https://openxcom.org/forum/index.php/topic,530.0.html), I guess it's time for a "modded earth" thread.

I'll go first with a "bugfixed" earth: This is your vanilla earth, but three errors have been fixed that were found in the abovementioned thread:

- the mis-aligned edge in France is now aligned
- the mis-aligned edge in the UK is now aligned
- the hole in Sulawesi Island has been closed (using the duplicate surface that already existed :) )



now's your turn! keep in mind, though, that as of now we can't change country borders or city locations. so I guess we have to stick to feasible stuff, which might include:
- a post-global warming "wasteland" earth, with a whole lot more "desert" and way less arable land
- an ice-age earth with lots of snow and perhaps even more arctic ice/water terrain (did I hear "Winter is coming"?)
Title: Re: Globe variants
Post by: Zharik1999 on August 08, 2012, 07:19:30 pm
I may come with one suggestion, can we somehow realise the change of seasons? For example, in winter most of the locations will be covered with snow and the stuff like that. I guess we will need to recolor some sprites and do other things like that but is the main concept possible?
Title: Re: Globe variants
Post by: moriarty on August 09, 2012, 12:58:57 am
Theoretically, it should be possible, but only with a lot of extra code. Luke83 was asking for something similar (although he was aiming for catastrophic events which change the globe landscape) - changing the globe in-game is possible, but it would mean that the current globe must also be included in the savegame.

Also, this would only make sense if somebody were to make battlescape terrains with snow-covered landscapes... if you simply change the geoscape terrain, you might end up fighting in arctic landscapes after shooting down a UFO in Kansas, which would be a little bit weird, I guess.
Title: Re: Globe variants
Post by: Zharik1999 on August 09, 2012, 08:47:45 am
So, is anybody else interested in this? About changing graphics we can try do two variations of each sprite (winter and summer) like in Warcraft 2 for example.
Title: Re: Globe variants
Post by: moriarty on August 09, 2012, 09:14:20 am
I'd say if anybody really wants to do it, by all means do it! :)

(I don't really want to, though :P there's a whole lot of sprites, and that's a whole lot of work... also, if we really do it, I'd like it to have a real impact on gameplay: fires not spreading, footprints in the snow, reptilian aliens moving slower, maybe helmeted soldiers suffering from visor fog when entering a UFO or building... :) that's even more work. I'd love to see all that, but I guess it's V1.5+)

Title: Re: Globe variants
Post by: Volutar on August 09, 2012, 09:41:47 am
Footprints in the snow? gosh... before trying to think of that - jsut think of footprints on a dirt!
Really it's crazy idea if we think of openxcom. Though very nice strategic idea for something bigger than xcom. Not 1.5+ - I think it's farther than 3.0 :)
Title: Re: Globe variants
Post by: Yankes on August 09, 2012, 09:28:17 pm
Theoretically, it should be possible, but only with a lot of extra code. Luke83 was asking for something similar (although he was aiming for catastrophic events which change the globe landscape) - changing the globe in-game is possible, but it would mean that the current globe must also be included in the savegame.

Also, this would only make sense if somebody were to make battlescape terrains with snow-covered landscapes... if you simply change the geoscape terrain, you might end up fighting in arctic landscapes after shooting down a UFO in Kansas, which would be a little bit weird, I guess.
I made some test. I used code from my radar range test, I didnt change lot of code :) (even position is same as on my last radar screen shot :D)
I have only question, did it look good enough as snow?
Title: Re: Globe variants
Post by: Zharik1999 on August 10, 2012, 08:56:45 am
Really similar, Yankes. Except the last one, I think it's too much.
Title: Re: Globe variants
Post by: Volutar on August 10, 2012, 09:11:04 am
Hrmm... it's possible to make such "snow" areas growing from north pole and south pole in particular seasons. But it will require alternative maps and tilesets for each terrain.
Gameplay alternation I think is unnecessary, considering there are no special things for "polar" terrain..
Title: Re: Globe variants
Post by: luke83 on August 10, 2012, 10:15:47 am
I like the concept of seasonal terrain so i hope you start working on some new maps Zharik1999 to go with any possible Mods.
Title: Re: Globe variants
Post by: Volutar on August 10, 2012, 10:20:18 am
luke83, not maps, mcds. Maps actually should be the same.
Title: Re: Globe variants
Post by: luke83 on August 10, 2012, 12:39:57 pm
luke83, not maps, mcds. Maps actually should be the same.

You know i meant MCD sets ;)
Title: Re: Globe variants
Post by: Volutar on August 10, 2012, 01:12:19 pm
I can imagine - jungle in the snow :)
BTW... Why did they chosen that northern hemisphere always have a forest maps/tilesets, and southern hemisphere - jungle?...
Title: Re: Globe variants
Post by: luke83 on August 10, 2012, 02:02:33 pm
I can imagine - jungle in the snow :)
BTW... Why did they chosen that northern hemisphere always have a forest maps/tilesets, and southern hemisphere - jungle?...

I was thinking more of Forrest in the snow and terror site in the snow , farmland in the snow ,Mountains with snow, from my understanding jungles done get much snow :o
Title: Re: Globe variants
Post by: Zharik1999 on August 10, 2012, 02:17:18 pm
Sorry for lame question but what is MCD set?
Title: Re: Globe variants
Post by: luke83 on August 10, 2012, 02:22:59 pm
General mapmaking outline  https://openxcommods.weebly.com/general-map-creation.html
Title: Re: Globe variants
Post by: Volutar on August 13, 2012, 06:37:52 pm
832 polygons.

more detailed europe, eurasian seas/lakes, americas, oceania, japan, eurasia.

P.S. Country borders become slightly wrong :)
P.P.S. Due to wrong OROGINAL xcom Hawaii placement, and corrected HERE, trajectory data also should be corrected (In original xcom Hawaii islands are placed 5 degrees to the east from real position).
Title: Re: Globe variants
Post by: moriarty on August 20, 2012, 12:56:59 pm
876 polys

I took Volutar's globe and added some African big lakes, changed a bit of coastline and terrain types for Africa, Greenland and Iceland.

Maybe someone wants to add some detail to Australia and NZ? :)
Title: Re: Globe variants
Post by: luke83 on August 20, 2012, 01:36:57 pm
Is there any limits in the amount of new Terrain Types that can be added into Openxcom? New map details is a great step , but is there a way to say , you are now a SWAMP area, you Geoscape graphic colour should look "browny blue" and  your battle scape Map Codes are stored under "Swamp1"
Title: Re: Globe variants
Post by: Volutar on August 20, 2012, 02:14:40 pm
I think there's no obvious limit of terrain types. The thing is - openxcom code should handle them somehow :) If it will handle swamp area (which I find nice idea) - so there should be some "yaml" parameters, like TerrainID->TextureID + Map type. So there should be function to create specific terrain map, and map block files of course.
Title: Re: Globe variants
Post by: moriarty on August 20, 2012, 02:29:54 pm
currently there's 12 terrain types, and adding new ones should be easy. of course, world.dat files with the new terrains are never backwards-compatible after that, but who cares :)

in world.dat it's simply a matter of changing a byte to another value (should be easy as soon as Volutar includes that in his editor). Then we need a new texture for the geoscape, which should be easy, too. then somebody needs to make new tilesets for that kind of terrain... :)

I'm completely in favor of doing this, which is why I started this thread (https://openxcom.org/forum/index.php/topic,551.0.html) some days ago. perhaps you should mention the "swamp" terrain idea there :) (actually, the easiest new terrain to make should probably be "tundra/permafrost". there's a whole lot of it in Russia as well as Canada, and I think a lot of the "mountain" tileset could be re-used - basically everything except the mountains themselves.)
Title: Re: Globe variants
Post by: Daiky on August 20, 2012, 05:11:30 pm
Isn't adding lakes a bit dangerous, because it's going to happen that you shoot down a UFO by accident above a lake and then loose the UFO...
Title: Re: Globe variants
Post by: moriarty on August 20, 2012, 05:24:25 pm
yes. it is. it means you have to take care where you shoot the UFO, just like before :P

I don't know about you, but I sometimes shoot UFOs down over the sea intentionally, because I don't want to fight yet another battlescape mission... :)

and I tried to only add lakes that are big enough to be seen on the lowest zoom level. BIG lakes. I'm not going to add puddles. :)
Title: Re: Globe variants
Post by: Daiky on August 20, 2012, 05:35:07 pm
It's maybe because the interception is not yet zooming in automatically, but while testing in openxcom it happens to me a lot.
A little switch to automatically hold fire when above water or something would help a lot in my case.
Title: Re: Globe variants
Post by: moriarty on August 20, 2012, 05:58:27 pm
hmmm, interesting, perhaps even a little display in the interception screen that shows the terrain you are currently over? of course it would only really work well once we have a working "minimize"-button :)
Title: Re: Globe variants
Post by: Volutar on August 20, 2012, 07:11:07 pm
Why dangerous? sometimes I wish to shot UFO down above water, just to avoid some side-effects on economy.
Title: Re: Globe variants
Post by: MKSheppard on August 21, 2012, 04:49:28 am
You know, you could use a custom ruleset with a custom globe to create an unique game -- imagine a world in which the aliens decide to open the Alien War I (AWI) by smacking an asteroid into earth, and the resultant super-winter from all the asteroidal dust into the air has reduced the world to either arctic or desert tiles, and world population is much much lower; with fewer countries around to fund you...
Title: Re: Globe variants
Post by: moriarty on August 21, 2012, 08:22:11 am
You know, you could use a custom ruleset with a custom globe to create an unique game -- imagine a world in which the aliens decide to open the Alien War I (AWI) by smacking an asteroid into earth, and the resultant super-winter from all the asteroidal dust into the air has reduced the world to either arctic or desert tiles, and world population is much much lower; with fewer countries around to fund you...

Absolutely :)

right now we are a bit limited by the country borders and cities, which are not part of world.dat, but I guess you could already do this if you find a suitable location for your asteroid crater :)
I keep thinking that somebody should make "winter" tilesets for the existing ones... for seasonal effects as well as "ice-age"/"nuclear winter" scenarios :)
Title: Re: Globe variants
Post by: Volutar on August 21, 2012, 08:32:22 am
moriarty, I've looked into your globe. And this is what I've noticed:
1. Some new African Sea? (at western part).
2. Weirdly, but every lake has been shifted about 7 game units to the North. Why?
Title: Re: Globe variants
Post by: moriarty on August 21, 2012, 11:01:58 am
I should probably use a different map image  ;D the western "lake" looked like water on the image I used (I was always bad at geography, so I never noticed that there shouldn't be one), and the north shift is probably because my image isn't perfectly centered for some reason.

I used a global vegetation color-coded image, which explains the new "lake". as for the north shift, I don't know. maybe I accidentally introduced that while resizing the image? I'll look into it.
Title: Re: Globe variants
Post by: moriarty on August 24, 2012, 08:58:56 pm
okay, I re-edited. this is more accurate, free of false lakes as far as I can see, and features larger Alps, added Pyrenees as well as a greener Egypt.

while searching for good image files, I stumbled upon NASA's NEO project (https://neo.sci.gsfc.nasa.gov/Search.html?datasetId=MOD13A2_M_NDVI) which has a lot of interesting image data, including bathymetric imaging of the world oceans, in high enough resolution, for free... the perfect source for geoscape editing :)
Title: Re: Globe variants
Post by: Volutar on October 06, 2012, 02:20:31 pm
Recently found this funny image. It reminded me xcom2 :) How they decided to make inverted earth and change its colors, while missing one issue - submarines shouldn't be able to move over land :) Though they often do that in game.
Title: Re: Globe variants
Post by: Leflair on October 06, 2012, 07:38:00 pm
But Land-Subs are the best subs! They got tracks and everything  :P
Title: Re: Globe variants
Post by: Yankes on October 26, 2012, 10:22:52 pm
I made small experiment with globe graphics, now you can have longitude & latitude lines on it :)
Title: Re: Globe variants
Post by: Volutar on October 26, 2012, 10:34:51 pm
Yeah, but this realization suffers from scale issue. lat&lon lines better to have 1px width, while these are zoom and latitude dependant (near to pole -> narower longitude lines, less zoom - more holes, more zoom - too thick).
Title: Re: Globe variants
Post by: Francois424 on October 26, 2012, 10:49:17 pm
Personally I prefer my globe to be without the bars.  Just feels better that way.  That being said, if it's toggettable, who am I to say  ;D


PS: As long as you guys don't mess with my Antarctica, you're safe  8)
Title: Re: Globe variants
Post by: Yankes on October 27, 2012, 12:11:39 am
Yeah, but this realization suffers from scale issue. lat&lon lines better to have 1px width, while these are zoom and latitude dependant (near to pole -> narower longitude lines, less zoom - more holes, more zoom - too thick).
I can easy fix zoom dependency by simply drawing thinner lines when camera i zoomed.
Latitude is probably unfixable without any ugly hacks.
But this have one great property, it will work in any globe projection :)
I made some test with this.
N and S are north and south poles. Globe surface is heavy deformed but lat&lon lines and shading is still working.
Title: Re: Globe variants
Post by: Yankes on November 02, 2012, 10:37:03 pm
Next experiments.
This time texturing :D

I created big bitmap (to have good quality at max zoom it have 2k x 2k size) in memory and I draw some random shapes on it.
After that I projected it on globe surface.
Funny thing its run with similar speed to polygon implementation. Only drawback is that it need lot of memory (around 8MiB this is around 1/5 of current usage of OX).
Right now its print colors directly, but I think adding second pass to apply correct texturing from today globe. 
Title: Re: Globe variants
Post by: SupSuper on November 03, 2012, 12:58:10 am
Are you reinventing 3D-accelerated rendering? :P
Title: Re: Globe variants
Post by: Yankes on November 03, 2012, 01:05:15 am
Yes, why I should learn OpenGL if I can write my own render? :D
Title: Re: Globe variants
Post by: luke83 on November 03, 2012, 03:29:42 am
I have know idea what your doing but as long as your happy , i am happy :P
Title: Re: Globe variants
Post by: Yankes on November 16, 2012, 10:46:38 pm
Next stage of my fun with globe texturing :)
Now I used standard texture cords. On second and third screen shot you can see random pixels of bitmap that is projected on globe. This bitmap have 1k x 1k size. 2 last screen shots show different globe projection (4th screen look very similar to original bitmap).

Downside of this is I need made 2 calls to `acos()` per pixel, this isnt cheap. But now I can easy modify globe surface, sink continents or creating craters that will be permanent.

Only thing left to do is apply standard xcom textures on my globe version, I cant use it directly on bitmap because different zoom lvl and nonlinear projection will make it ugly. Solution is store in bitmap only texture offset that will be used to determine what color will be on final pixel.
Title: Re: Globe variants
Post by: Yankes on December 02, 2012, 05:15:57 am
I can now draw any surface I want on globe :)
Creating Vegetation map (https://"https://openxcom.org/forum/index.php/topic,530.0.html") will be only problem of converting this graphic to format that is loadable by OpenXcom.
Title: Re: Globe variants
Post by: luke83 on December 02, 2012, 05:33:58 am
Thats awesome  :P
Title: Re: Globe variants
Post by: Volutar on December 02, 2012, 08:01:14 am
the problem not in vegitation map, but in openxcom. it uses 8bit graphics and 320x200 mode, and any of these "image spheric mapping" are useless excercises. you're reinventing a bike, yankes.
Title: Re: Globe variants
Post by: Yankes on December 02, 2012, 03:58:51 pm
the problem not in vegitation map, but in openxcom. it uses 8bit graphics and 320x200 mode, and any of these "image spheric mapping" are useless excercises. you're reinventing a bike, yankes.
8bit isnt problem its only limitation. I cant do any color blending or color interpolation but at least I can made that my globe look exactly like current one but without limitation of polygons, my solution allow removing polygons form game complicity, even testing crash site type can be made by my bitmap.
One thing that is easy in that approach is add city arenas on map on that ufo can crash (after you shutdown terror ufo in last moment) and at night will be more bright than surrounding arena.
Title: Re: Globe variants
Post by: moriarty on December 02, 2012, 04:20:24 pm
hmmm, I can see where your approach will have some applications, but the current model also uses the polygons to determine the terrain type for the crash sites... how do you want to implement that if your globe is a single texture?

now if you for example use two bitmaps, one "visible" image for display and one "invisible" image that color-codes the terrain types, that would be something... larger urban areas could be implemented, urban sprawl anyone? that would also enable us to change the terrain in-game by "re-painting" areas... of course the images would have to be included in the saved games.
Title: Re: Globe variants
Post by: Yankes on December 02, 2012, 05:49:56 pm
yes, but I will stick only one with terrain type. This is because I would need couple of texture for every zoom level if I want use image directly.
It will be 2 stage coloring, first define what terrain type this pixel have and next determine what color it should have.
Another problem that Volutar pointed out "image spheric mapping" can have problems on spheres poles, its hard to made good looking textures, especially when Im limited to 8bit and cant filter it out, but again I will use terrain type that is very uniform near poles and I dont need use any filtering because I will always get same results (at least in standard globes).

And about modifying and saving globe, yes its one of goals why I do it.

Title: Re: Globe variants
Post by: Volutar on December 05, 2012, 12:59:42 pm
So the goal is more like terraforming (i prefer to treat it as "painting". I'd suggest to wait until very post 1.0 (or 2.0), when opengl engine will be used (IF it will be used). Globe texturing and "painting" with opengl is rather easy task, and can be multilayered without colour flaw (overlays in 8bit are almost impossible).
Yes it is possible to make it within 8bit paletted, in 320x200, with software render, but it really don't worth it. It will look pretty ugly and will become much slower, if you try to get higher resolution.
Title: Re: Globe variants
Post by: Yankes on January 05, 2013, 08:12:31 pm
Im now near finishing it. Right now only problem is poles because when I draw triangle on flat surface and then project it on globe all lines are curved.
But this isnt unfixable, I need only find new way of drawing this triangles (not 2D -> 3D but something like 3D -> 2D -> 3D).
Title: Re: Globe variants
Post by: Hobbes on April 27, 2015, 05:06:52 am
I made some test. I used code from my radar range test, I didnt change lot of code :) (even position is same as on my last radar screen shot :D)
I have only question, did it look good enough as snow?

Yankes, have you done anymore work on adding seasons? Sometime ago there was an idea discussed on irc with Warboy of using the current system to place items on maps to be able to also place fire/smoke on chosen maps, which could be used to add fog, and it would be possible to add rain or other weather elements as terrain to the battlescape. Then rain could be set to reduce mobility for units or visibility for all units, etc.

And while looking at the images of the globe with the 'snow' textures (I created similar ones for the Taiga/Tundra northern regions) I remembered that seasons are caused by Earth's tilt of its axis, which would be something really nice to add since it would mean summer missions in the Arctic/Antarctic would always be on daylight, etc. But, then you'd need some sort of weather system.
Title: Re: Globe variants
Post by: Yankes on April 27, 2015, 09:24:24 am
No, but because I now have OXCE I could recycle some ideas from that.

And if I add this to my branch, it would be hard to add whether effect to work like fire/smoke because it would break compatibility with OXC. Its because map data is save as binary and any new data would made impossible to read back. Only way I see possible to add this as "global" parameter. This could work without using any hacks.
Title: Re: Globe variants
Post by: Dioxine on April 27, 2015, 09:29:41 am
Poisonous gases on a volcanic/postnuclear terrain... vacuum on Mars... fire & lightning & incoming off-map shells randomly killing things... yeah, we definitely need weather effects! :)
Title: Re: Globe variants
Post by: beng on August 07, 2023, 11:42:17 pm
okay, I re-edited. this is more accurate, free of false lakes as far as I can see, and features larger Alps, added Pyrenees as well as a greener Egypt.

while searching for good image files, I stumbled upon NASA's NEO project (https://neo.sci.gsfc.nasa.gov/Search.html?datasetId=MOD13A2_M_NDVI) which has a lot of interesting image data, including bathymetric imaging of the world oceans, in high enough resolution, for free... the perfect source for geoscape editing :)

Great work @volutar and @moriarty !  A suggestion for further updates: add more islands to the large open sea areas so UFOs have more places to land in the oceans and players have more places to put bases for better radar coverage. For example:

Title: Re: Globe variants
Post by: beng on August 08, 2023, 05:52:46 am
Here, I have used volutar's world.dat editor to add more islands to the seas. Also tweaked some textures to increase terrain variety.
Update: Tweaked the world dat to add a couple more islands and change some textures.  More places for radar bases in large ocean areas.
Update: Newer version in mod form in the next post below.
Title: Re: Globe variants
Post by: beng on August 09, 2023, 02:57:29 am
I have made some more changes, added islands like Wake Island, Soccotra, Canary Islands, added more cities in most regions of the world so Aliens might terror attack more places (not sure if they will use them in game, like how do they decide where to terror mission?), and packaged it as a mod: Globe Islands. 

Works in OpenXcom 1.0 dev nightly and OpenXcom Extended 7.9.8 [2023-07-03] running in Linux Mint.

Note: To try this mod, start a new game. If you load saved games that were started without this mod the aliens may be using some of the old regions and waypoints.

Version Notes:

Version 0.2b: Changed country areas (used for UFO / XCOM activity calculation) to be slightly more accurate. Added alien mission areas for new Pacific islands.

Update 12 Aug 2023: Ver 0.3b - fixed region rules so UFOs should spawn missions in the new ocean areas and land on the new islands. Added a few more cities. Also adjusted country rectangles to include British, French, and US overseas territories like Guam, Hawaii, Falklands, French Guyana etc.