Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate terrain from heightmap image (e.g. png) #2060

Closed
Ryder17z opened this issue Oct 12, 2015 · 18 comments
Closed

Generate terrain from heightmap image (e.g. png) #2060

Ryder17z opened this issue Oct 12, 2015 · 18 comments
Labels
feature Add something new to the game.

Comments

@Ryder17z
Copy link

Self-explanatory idea, but i dunno how this would be implemented...

@vzybilly
Copy link

This is my thought of how to achieve this.

each tile would be 2x2 points (pixels for grey-scale), rct2 map size is heightmap.width/2, heightmap.height/2

Step 0, smooth lightly, since I don't think a tile can be more than 2, maybe 1 height difference between corners.
Step 1 would just have to set the heights for all the tile corners... the tile center, if needed, would be the average of the 4, rounded.

Another way would just be to set the tile height, leaving rough edges to be smoothed, either by the user or by a smoothing algo

@duncanspumpkin duncanspumpkin added the enhancement An improvement to an existing feature (no alteration). label Oct 13, 2015
@IntelOrca
Copy link
Contributor

The random map generator already has code to convert a 2D height map array into RCT2 map element form with appropriate smoothing and terrain applying. So that can be used initially for a basic implementation of this feature. The water level would work in the same way.

However this won't allow you to set cliffs or lakes above the water level which you could add into a height map. If you use greyscale, you only have a precision of 8 bits for height... if you want to more accurately specify cliffs and smooth ground in the height map and water, you will want to make use of all three RGB components using a scale of e.g Blue to Brown to Green to White. Alternatively you use an image format which is 16 or 32 bits per colour component.

@Ryder17z
Copy link
Author

@IntelOrca Another way to set water level could be by using a different/mask file

Also i did not know we had a map generator.

@IntelOrca IntelOrca added feature Add something new to the game. and removed enhancement An improvement to an existing feature (no alteration). labels Oct 24, 2015
@aroidzap
Copy link
Contributor

I would like to do that and also improve whole map generator, but it will take me some time (few months I think), becouse I want it to be perfect and I am new to this project. Could you assign it to me @IntelOrca? Thx in advance :)

@Gymnasiast
Copy link
Member

@aroidzap : We can only assign ourselves unfortunately.

@aroidzap
Copy link
Contributor

ok, so should i work on it? or leave it to someone else?

@AaronVanGeffen
Copy link
Member

You can make a PR for your ongoing work, I guess. Just indicate that it shouldn't be merged yet and it'll be tagged "work in progress".

Mind you, if you think it might take you "a few months" it might be better to split your goal into different subtasks and make PRs for them separately.

@IntelOrca
Copy link
Contributor

I wouldn't have thought something like this would take more than a few hours of actual time working on it. We can't assign issues to any user, only those that have write access to the repository. So your own assignment message should be enough.

@aroidzap
Copy link
Contributor

For experienced programmer it will take few hours... but not for me... I'm just offering my little help. If you don't want it, it's ok and assing it to someone else. I just tought this feature is not so important to be done early.

@Gymnasiast
Copy link
Member

If you want to do it, please do it. I just meant that I can't use Github's assignment feature on other people. Consider this your assignment. :)

@aroidzap
Copy link
Contributor

ok ;)

@Ryder17z
Copy link
Author

Any progress on this?
The current map generator i feel should have 2 sliders on the first two tabs to make it more useful :
Terrain style: Flat - Mountain slider
Land/Water slider

@aroidzap
Copy link
Contributor

Sorry, not actually

@IntelOrca
Copy link
Contributor

@Patrik356b I think @X123M3-256 has been doing some things with map generation.

@X123M3-256
Copy link
Contributor

@IntelOrca Yes, I have code for translating a heightmap into tile positions, but I do not have a way to load the heightmap from disk. Does OpenRCT2 already link SDL_Image or another image loading library? I'd rather not introduce a new dependency for this so if there's already a library I could use that would be ideal. What is used for saving screenshots?

Also, my code is not ideal. When fed nice smooth functions it gives good results, but when given noisy functions more typical of terrain, there's a lot of tiles that could be placed better.

@janisozaur
Copy link
Member

@X123M3-256
Copy link
Contributor

OK, I'll use that to load the heightmap.

@Broxzier Broxzier mentioned this issue Mar 7, 2017
5 tasks
janisozaur added a commit that referenced this issue May 3, 2017
- Feature: [#1730] Keyboard shortcuts for track construction.
- Feature: [#2060, #5282] Heightmap loader
- Feature: [#5110] The tile inspector can now be used in multiplayer.
- Feature: [#5305] Add scenery eye dropper tool.
- Feature: [#5370] Ride operating mode can be set from the console.
- Feature: [#5415] Add mute toolbar button (as seen in RCT1 and Locomotion).
- Improved: [#5254] Scenario option changes are now synchronised over multiplayer.
- Improved: [#3288] Added server description and greeting textboxes to the start server menu.
- Improved: [#3502] Track previews display at higher zoom level for large layouts.
- Improved: [#5055] Implement 'quick demolish' for rides.
- Improved: [#5137] Removing all guests no longer closes the rides and removes the vehicles.
- Improved: [#5163] Minor tile inspector improvements and fixes.
- Improved: [#5222] Add Catalan language.
- Improved: [#5351] Giga Coaster and Steel Twister RC boosters now use the correct sprites.
- Improved: Looping RC and Corkscrew RC now use booster sprites from RCT1's CSG1.DAT if available.
- Improved: Scenario options are now synced in multiplayer.
- Improved: Remove duplicate ride penalty for closed rides.
- Improved: Make shortcut keys window larger and resizable.
- Removed: known_issues.txt no longer used, check issue tracker on GitHub.
- Fix: [#1992] Felicity Anderson Cheat can crash the game, as well as blocking queues.
- Fix: [#4493] Provide tooltip for disabled price field.
- Fix: [#4689] Object selection tabs sometimes flicker.
- Fix: [#4913] Server greeting displaying local setting.
- Fix: [#4972] Map window not updated properly when shrinking map from Map Generation window.
- Fix: [#5004] Peeps in parks imported from RCT1 show abnormalities.
- Fix: [#5014] Research not imported from RCT1 correctly.
- Fix: [#5032] Booster speed is not saved in TD6.
- Fix: [#5140] Headless server should save default users.json.
- Fix: [#5150] --openrct-data-path sets user data path instead of OpenRCT2 data path.
- Fix: [#5169] Parks containing packed objects fail to open.
- Fix: [#5199] "Force a breakdown" debugging tool isn't hidden in multiplayer.
- Fix: [#5188] Clicking on a Magic Carpet doesn't open the ride window.
- Fix: [#5218] Scale RCT1 park value objectives.
- Fix: [#5219] Game crashes when opening 'misc' tab in options.
- Fix: [#5238] RCT1 import: Rides are initially free when placing them.
- Fix: [#5252] Correct typo in Conger Eel Coaster description.
- Fix: [#5265] Queue line TVs not detected properly.
- Fix: [#5271] Keyboard shortcuts window isn't large enough (for some languages).
- Fix: [#5284] Mechanic is called to fix a ride that's outside his patrol area.
- Fix: [#5285] Intro always plays even if play_intro = false.
- Fix: [#5299] Scenario editor crash when placing peep spawn.
- Fix: [#5318] Using the bulldozer tool on under-construction paths results in unlimited free money.
- Fix: [#5325] Game crashes if encountering an invalid ride type during research.
- Fix: [#5345] Correct typos in descriptions for Top Spin and Splash Boats.
- Fix: [#5350] Steel Twister RC and Giga Coaster boosters are underpowered, Junior Roller Coaster boosters overpowered compared to RCTC.
- Fix: [#5357] "Assertion failed!" after guest with name 'Emma Garrell' exits/enters ride.
- Fix: Walls do not import from RCT1 correctly in pause mode.
- Fix: Extraneous window tabs show up on MacOS 10.12.
- Fix: Potential for integer overflow in ride length.
- Fix: Vehicles erroneously removed when removing all guests.
- Technical: INI configuration file now case-insensitive.
- Technical: Remove version build from msbuild & NSIS.
janisozaur added a commit that referenced this issue May 3, 2017
- Feature: [#1730] Keyboard shortcuts for track construction.
- Feature: [#2060, #5282] Heightmap loader
- Feature: [#5110] The tile inspector can now be used in multiplayer.
- Feature: [#5305] Add scenery eye dropper tool.
- Feature: [#5370] Ride operating mode can be set from the console.
- Feature: [#5415] Add mute toolbar button (as seen in RCT1 and Locomotion).
- Improved: [#5254] Scenario option changes are now synchronised over multiplayer.
- Improved: [#3288] Added server description and greeting textboxes to the start server menu.
- Improved: [#3502] Track previews display at higher zoom level for large layouts.
- Improved: [#5055] Implement 'quick demolish' for rides.
- Improved: [#5137] Removing all guests no longer closes the rides and removes the vehicles.
- Improved: [#5163] Minor tile inspector improvements and fixes.
- Improved: [#5222] Add Catalan language.
- Improved: [#5351] Giga Coaster and Steel Twister RC boosters now use the correct sprites.
- Improved: Looping RC and Corkscrew RC now use booster sprites from RCT1's CSG1.DAT if available.
- Improved: Scenario options are now synced in multiplayer.
- Improved: Remove duplicate ride penalty for closed rides.
- Improved: Make shortcut keys window larger and resizable.
- Removed: known_issues.txt no longer used, check issue tracker on GitHub.
- Fix: [#1992] Felicity Anderson Cheat can crash the game, as well as blocking queues.
- Fix: [#4493] Provide tooltip for disabled price field.
- Fix: [#4689] Object selection tabs sometimes flicker.
- Fix: [#4913] Server greeting displaying local setting.
- Fix: [#4972] Map window not updated properly when shrinking map from Map Generation window.
- Fix: [#5004] Peeps in parks imported from RCT1 show abnormalities.
- Fix: [#5014] Research not imported from RCT1 correctly.
- Fix: [#5032] Booster speed is not saved in TD6.
- Fix: [#5140] Headless server should save default users.json.
- Fix: [#5150] --openrct-data-path sets user data path instead of OpenRCT2 data path.
- Fix: [#5169] Parks containing packed objects fail to open.
- Fix: [#5199] "Force a breakdown" debugging tool isn't hidden in multiplayer.
- Fix: [#5188] Clicking on a Magic Carpet doesn't open the ride window.
- Fix: [#5218] Scale RCT1 park value objectives.
- Fix: [#5219] Game crashes when opening 'misc' tab in options.
- Fix: [#5238] RCT1 import: Rides are initially free when placing them.
- Fix: [#5252] Correct typo in Conger Eel Coaster description.
- Fix: [#5265] Queue line TVs not detected properly.
- Fix: [#5271] Keyboard shortcuts window isn't large enough (for some languages).
- Fix: [#5284] Mechanic is called to fix a ride that's outside his patrol area.
- Fix: [#5285] Intro always plays even if play_intro = false.
- Fix: [#5299] Scenario editor crash when placing peep spawn.
- Fix: [#5318] Using the bulldozer tool on under-construction paths results in unlimited free money.
- Fix: [#5325] Game crashes if encountering an invalid ride type during research.
- Fix: [#5345] Correct typos in descriptions for Top Spin and Splash Boats.
- Fix: [#5350] Steel Twister RC and Giga Coaster boosters are underpowered, Junior Roller Coaster boosters overpowered compared to RCTC.
- Fix: [#5357] "Assertion failed!" after guest with name 'Emma Garrell' exits/enters ride.
- Fix: Walls do not import from RCT1 correctly in pause mode.
- Fix: Extraneous window tabs show up on MacOS 10.12.
- Fix: Potential for integer overflow in ride length.
- Fix: Vehicles erroneously removed when removing all guests.
- Technical: INI configuration file now case-insensitive.
- Technical: Remove version build from msbuild & NSIS.
@janisozaur
Copy link
Member

#5282

ZehMatt pushed a commit to ZehMatt/OpenRCT2 that referenced this issue Jul 14, 2017
- Feature: [OpenRCT2#1730] Keyboard shortcuts for track construction.
- Feature: [OpenRCT2#2060, OpenRCT2#5282] Heightmap loader
- Feature: [OpenRCT2#5110] The tile inspector can now be used in multiplayer.
- Feature: [OpenRCT2#5305] Add scenery eye dropper tool.
- Feature: [OpenRCT2#5370] Ride operating mode can be set from the console.
- Feature: [OpenRCT2#5415] Add mute toolbar button (as seen in RCT1 and Locomotion).
- Improved: [OpenRCT2#5254] Scenario option changes are now synchronised over multiplayer.
- Improved: [OpenRCT2#3288] Added server description and greeting textboxes to the start server menu.
- Improved: [OpenRCT2#3502] Track previews display at higher zoom level for large layouts.
- Improved: [OpenRCT2#5055] Implement 'quick demolish' for rides.
- Improved: [OpenRCT2#5137] Removing all guests no longer closes the rides and removes the vehicles.
- Improved: [OpenRCT2#5163] Minor tile inspector improvements and fixes.
- Improved: [OpenRCT2#5222] Add Catalan language.
- Improved: [OpenRCT2#5351] Giga Coaster and Steel Twister RC boosters now use the correct sprites.
- Improved: Looping RC and Corkscrew RC now use booster sprites from RCT1's CSG1.DAT if available.
- Improved: Scenario options are now synced in multiplayer.
- Improved: Remove duplicate ride penalty for closed rides.
- Improved: Make shortcut keys window larger and resizable.
- Removed: known_issues.txt no longer used, check issue tracker on GitHub.
- Fix: [OpenRCT2#1992] Felicity Anderson Cheat can crash the game, as well as blocking queues.
- Fix: [OpenRCT2#4493] Provide tooltip for disabled price field.
- Fix: [OpenRCT2#4689] Object selection tabs sometimes flicker.
- Fix: [OpenRCT2#4913] Server greeting displaying local setting.
- Fix: [OpenRCT2#4972] Map window not updated properly when shrinking map from Map Generation window.
- Fix: [OpenRCT2#5004] Peeps in parks imported from RCT1 show abnormalities.
- Fix: [OpenRCT2#5014] Research not imported from RCT1 correctly.
- Fix: [OpenRCT2#5032] Booster speed is not saved in TD6.
- Fix: [OpenRCT2#5140] Headless server should save default users.json.
- Fix: [OpenRCT2#5150] --openrct-data-path sets user data path instead of OpenRCT2 data path.
- Fix: [OpenRCT2#5169] Parks containing packed objects fail to open.
- Fix: [OpenRCT2#5199] "Force a breakdown" debugging tool isn't hidden in multiplayer.
- Fix: [OpenRCT2#5188] Clicking on a Magic Carpet doesn't open the ride window.
- Fix: [OpenRCT2#5218] Scale RCT1 park value objectives.
- Fix: [OpenRCT2#5219] Game crashes when opening 'misc' tab in options.
- Fix: [OpenRCT2#5238] RCT1 import: Rides are initially free when placing them.
- Fix: [OpenRCT2#5252] Correct typo in Conger Eel Coaster description.
- Fix: [OpenRCT2#5265] Queue line TVs not detected properly.
- Fix: [OpenRCT2#5271] Keyboard shortcuts window isn't large enough (for some languages).
- Fix: [OpenRCT2#5284] Mechanic is called to fix a ride that's outside his patrol area.
- Fix: [OpenRCT2#5285] Intro always plays even if play_intro = false.
- Fix: [OpenRCT2#5299] Scenario editor crash when placing peep spawn.
- Fix: [OpenRCT2#5318] Using the bulldozer tool on under-construction paths results in unlimited free money.
- Fix: [OpenRCT2#5325] Game crashes if encountering an invalid ride type during research.
- Fix: [OpenRCT2#5345] Correct typos in descriptions for Top Spin and Splash Boats.
- Fix: [OpenRCT2#5350] Steel Twister RC and Giga Coaster boosters are underpowered, Junior Roller Coaster boosters overpowered compared to RCTC.
- Fix: [OpenRCT2#5357] "Assertion failed!" after guest with name 'Emma Garrell' exits/enters ride.
- Fix: Walls do not import from RCT1 correctly in pause mode.
- Fix: Extraneous window tabs show up on MacOS 10.12.
- Fix: Potential for integer overflow in ride length.
- Fix: Vehicles erroneously removed when removing all guests.
- Technical: INI configuration file now case-insensitive.
- Technical: Remove version build from msbuild & NSIS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add something new to the game.
Projects
None yet
Development

No branches or pull requests

9 participants