Author Topic: Generating maps based off PNG heightmaps?  (Read 6864 times)

0 Members and 1 Guest are viewing this topic.

Offline Flygon

Generating maps based off PNG heightmaps?
« on: September 18, 2012, 04:47:36 PM »
Oh hey! I just noticed this forum existed... so much for posting at CGN! Anyway, I'll just quote the thread I made on CGN below, since it's 1:45AM and I can't be stuffed rewriting the post to make sense for this forum.

Quote
Oh hey, a sudden absolutely random post from Flygon! Anyway, I'd like to inquire about a question. Specifically, the ability to generate 'random' maps based off greyscale heightmaps. If this sounds at all familiar, it's because I am ripping the idea completely from OpenTTD, and as it turns out, SMAC/X and OpenTTD generate their maps using the exact same method. :p Except, of course, SMAC/X can generate much smoother heightmaps with actual 3D tiles.

Of course, the major impediment to this whole idea, is, of course... there no tools for converting PNG files into a heightmap-only SMAC/X scenario file. So, I'd like to ask... is there actually any tools for achieving this? And if not... where is scient and when can I beg him to help make the suitable tools? :cool:

It cannot be all that difficult, given it's a 2D heightmap... right... right?

Edit: Going by my calculations, it should be possible to generate maps based off PNG heightmaps to just every 1.5ish 10 meter segments being off by 10 meter. Given how absolutely minimal this is... well, it's pretty darn good. And it's extremely easy and simple to generate greyscale heightmaps based off real-world locations anyway.


I know this is a bit of a whacky first post, and I'm aware an external program isn't exactly a mod... but given the overall context of things, this seems the right place and way to do things.

Nice spambot protection, by the way! ;3
« Last Edit: September 18, 2012, 05:03:25 PM by Flygon »

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #1 on: September 18, 2012, 08:58:52 PM »
The bots don't give us any trouble, to the extent that my partner doesn't want me going to the trouble to hammer them.

This is interesting research; I'm a creative guy, not a technical one, so I have little to say, but will pass it along to scient and be following this with great interest.

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #2 on: September 19, 2012, 02:33:15 AM »
Excellent! It has been too long since I've spoken to scient... finding this community has been a godsend!

Only real huge concern I have with the heightmaps are that PNG's are based on a horizontal-vertical grid... Alpha Centauri has a grid-type that'd only find a diamond-shape of that PNG useful (it's hard to explain) unless the grid was rotated on a 45 degree angle first... but given how the heightmap system in Alpha Centauri should work anyway, and how easy it is to get high-resolution heightmaps that can be rotated and scaled-down accurately anyway without any issues... sorry, rambling on a bit here. I'll need to get off my ass and find the IRC channel. :P

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #3 on: September 19, 2012, 03:29:29 AM »
Check the top of the page - third item.  I hear you have to hang around a while to get a conversation going on IRC.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #4 on: September 19, 2012, 05:13:49 AM »
Good to see you again Flygon. :)

Yeah IRC seems to be a bit of a stakeout operation at times to get anybody. Still, good luck doing it. :)

If the SMAC map format has been posted somewhere, it shouldn't be too hard to convert an image to it though (I could do that if I had specifications to look at)

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #5 on: September 19, 2012, 05:57:52 AM »
Good to see you again Flygon. :)
Hey there! I must say, when I heard you talk with Charem, I was quite surprised! :o
Quote
If the SMAC map format has been posted somewhere, it shouldn't be too hard to convert an image to it though (I could do that if I had specifications to look at)
Time for the hex editor! Gotta poke those bytes til we got something working! ;D

This heightmap thing has been absolutely jammed in my mind, I keep thinking of how to get more precision out of the heightmaps now! But I've also realized one serious problem.

There is no way to get the depth of the oceans working with greyscale heightmaps. I'll need to look into methods of obtaining ocean depth... might be necessary to draw that up manually, though.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #6 on: September 19, 2012, 06:17:13 AM »
Charem? Haha well he has disappeared again--he's pleasant when he's around but yeah... haha

How about having a set depth for water, at like 127/255?

And yeah, I'd want a format if I was going to write a converter from raw or whatever.

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #7 on: September 19, 2012, 06:34:22 AM »
The main issue is, is that all the tools I have for generating real-world heightmaps, they don't actually seem to retain oceanographic data, outside of rivers. Admittedly, the tools I'm using, I've only been taught to use in context of OpenTTD (which has no ocean heightmap levels, and uses the raw PNG's as heightmaps). What ends up defined as water/ocean is when the height level is set to 0 (and 1-15 also, for the context of OpenTTD, but Alpha Centauri has far more than 16 levels of precision).

If we were to make the heightmap tool work off a greyscale PNG, it would be best to warn the user that they still have a lot of manual work to do on the ocean anyway. Particularly since it's still the responsibility of the map-editor to set every single other element (eg. Fungus, Rainforest, Rockiness, Moisture (?)) anyway. It would be very useful to feed the tool raw real-world map data, though (as much as that would also eat up astronomical amounts of RAM... I end up running out of RAM attempting to generate the greyscale PNG's alone...).

We can discuss the whole Charem thing privately, but I should be able to get you into easy contact with him, if necessary.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #8 on: September 19, 2012, 06:59:16 AM »
Perhaps one method of doing the heightmap is to make a coloured PNG, so red = % of rockiness, green = elevation, blue = rainfall? Probably a bit harder for a program to generate out of the box, but still could work? :)

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #9 on: September 19, 2012, 09:17:34 AM »
I think, for now, we should just focus on elevation. I'm probably not the best geologist to poke about this. I'd be more concerned about oceanic depth than the rockiness and rainfall, regardless.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #10 on: September 19, 2012, 09:25:35 AM »
Okay sure. :) Do we know of any map format spec for us to look at?

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #11 on: September 19, 2012, 09:44:12 AM »
Probably best to look at the OpenTTD greyscale heightmap format. We should probably bring this to an instant messenger, it's easier to explain that there. As much as it deprives me of my forum based energy credits. I don't want to stink up the place with me struggling to explain the greyscale lightmap format.

I should stress that any heightmap fed to the tool should be exceptionally larger than the map itself being generated (for example, a 2048*2048 heightmap of Australia would be used to generate a 256*256 or 512*512 SMACX map), for the sake of very smooth altitude transitions. For how the intensity of the 'pixel' of  the heightmap should be converted to altitude... I say make it user settable. Nothing wrong with having unrealistically high altitudes on a large map, it adds to the potential fun, afterall. ;)

My personal default, though? FF high on the greyscale map becomes 3990m on SMACX.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #12 on: September 19, 2012, 10:00:16 AM »
Yeah I'd agree, wouldn't want to break the game with crazy height levels.

I have MSN and Skype, which would you prefer? PM me your details and we can chat. :D

Offline sisko

  • Emissary AND Founder
  • Administrator
  • *
  • Posts: 2973
  • €1733
  • View Inventory
  • Send /Gift
  • Try to steal credits from another member!  Try to steal credits from another member!  Try to steal credits from another member!  Try to steal credits from another member!  
  • This place is yours, not mine.
  • Scenario Creator Downloads Contributor
    • View Profile
    • Alpha Centauri 2
    • Awards
Re: Generating maps based off PNG heightmaps?
« Reply #13 on: October 23, 2012, 07:12:41 AM »
Anyone else feels like it's time to fix the faction graphics bug?

Offline Flygon

Re: Generating maps based off PNG heightmaps?
« Reply #14 on: October 26, 2012, 03:26:30 AM »

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

My gift to industry is the genetically engineered worker, or Genejack. Specially designed for labor, the Genejack's muscles and nerves are ideal for his task, and the cerebral cortex has been atrophied so that he can desire nothing except to perform his duties. Tyranny, you say? How can you tyrannize someone who cannot feel pain?
~Chairman Sheng-ji Yang 'Essays on Mind and Matter'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 39.

[Show Queries]