Page 1 of 1

Elevation Grid Generator

Posted: Wed Nov 05, 2014 4:59 am
by Grigor
This program generates ELEVATION GRIDS for YS Flight Scenery Files from GREYSCALE bitmaps.

1) Run the program from wherever you like - no installation necessary.
2) A file menu will ask for a bitmap filename.
3) Enter the grid size - number of segments is generated automatically from the bitmap file.
4) Enter the height amplification, if desired.
5) Enter a filename, if desired.
6) Press the "Do it!" button and a file will be generated containing the elevation grid.

From there you can use the Scenery Editor to apply finishing touches.

- I recommend using landscape rather than portrait format, or better still plain square.
- Colour images will work, though not as accurately.
- Also included is the AutoHotkey Script, if you would like to tinker with the code.

Enjoy the scenery!

Grigor.
Elevation Grid Generator0.1.zip
(409.47 KiB) Downloaded 140 times
(Added gradient colour selection and fixed output filename error... Also fixed the default sky and ground colours.)

Re: Elevation Grid Generator

Posted: Wed Nov 05, 2014 5:17 am
by Gunny
Now this could be revolutionary in a manner of speaking;}}}} Thanks Grigor

Re: Elevation Grid Generator

Posted: Wed Nov 05, 2014 11:26 am
by Dragon029
This is great; how well does it run as the image sizes get larger; or rather, what's the largest bitmap you've tried it with?

Re: Elevation Grid Generator

Posted: Wed Nov 05, 2014 7:02 pm
by Grigor
I've just tried out a 320 x 250, and it works OK... I guess the only limit would be how much graphics data your machine can handle.

Even Testmap_1.bmp at 60x60 pixels, with a grid size of 400 x 330 makes for spectacular scenery and fun flying.

I've always been a little nonplussed at the flatness of most YS landscapes... even just a small variation of low rolling hills makes a difference. Of course, I do most of my flying at treetop level, so...

Re: Elevation Grid Generator

Posted: Wed Nov 05, 2014 8:09 pm
by Gunny
It works great but I would suggest that you keep the grids small.Since it is for the purpose of scenery editor just a big collection of polygons.I tried a 1000x1000x300 and holy cow the visuals where great but the lag was unacceptable for my old xp machine and the crap for graphics intell processor.Those of you with REAL graphics processors I am sure will get much better results.And if you where thinking of large expanses of rolling hills I would not suggest it.But still it will make the elevation grid process just that much easier to deal with as long as you use it frugally.Thanks again Grigor.

Re: Elevation Grid Generator

Posted: Thu Nov 06, 2014 1:52 am
by Grigor
I tried out a 256 x 256 bitmap and even that was too much for my old XP machine... 120 squared works. Take a look at Testmap_3.bmp in the updated download.

Re: Elevation Grid Generator

Posted: Thu Nov 06, 2014 3:27 am
by Dragon029
Yeah, the reason I asked originally was because I got curious after seeing the 60x60 bitmaps and so I tried a bitmap with 500x500; I let it run for about 3-5 minutes and then decided it was either going to take a very long time or it might maybe have become frozen (memory usage was only climbing maybe 2kb every ~10 seconds; which is probably reasonable considering the file sizes we're working with). I guess my two recommendations if you get the time would be to add a % complete bar (I'm not sure what metric you would use though; maybe % of pixels processed?) and second, (if possible) I'd recommend having the bitmap not stay on your screen while processing, that way larger bitmaps can still be used, with the program just running in the background.

Re: Elevation Grid Generator

Posted: Thu Nov 06, 2014 10:44 am
by Grigor
Yeah... the bitmap needs to be on screen - I could move it to the top left - but that's the clunky way the program reads the value of each pixel. As for a progress bar, I'm not sure whether that would just slow it down further. Perhaps we'll just recommend not using anything bigger than say 150x150 pixels... that only takes a second to scan.

Elevation Grid Generator

Posted: Wed Apr 01, 2015 9:34 am
by Freki79
Did you try any bigger resolution?
Things like this are nice! :P (just experiments)
I should only be able to obtain ocean elevation faces to zero elevation, or zero slope at least, anf then hide them. I hate to see grids disappear when i fly high on them, is there a way to fix the distance to which ys flight draw the grids?

Elevation Grid Generator

Posted: Wed Apr 01, 2015 9:45 am
by Freki79
This is better, sorry. Those pikes should have been rolling hills in my intention though, and water more spreaded.

Elevation Grid Generator

Posted: Wed Apr 01, 2015 4:25 pm
by Stingx
Yasss. I wish we could have things like this and fractal scenery put in maps. I hope Soji's figured that gen thing.

Elevation Grid Generator

Posted: Wed Apr 01, 2015 4:54 pm
by Freki79
If i need a precise measure grid, for example 20 km in the scenery editor, how can i do?

Elevation Grid Generator

Posted: Sun Apr 26, 2015 10:29 am
by Flake
Bump. How do I change the size of the imported grid in Scenery Editor? It's way too small!

Elevation Grid Generator

Posted: Sun Apr 26, 2015 7:42 pm
by waspe414
I can't recall any option in Scenedit to scale things, nor did I find one in a quick search.
You can do it by editing the .ter file, though the vertical scaling is a little involved.
TerrMesh
NBL 2 2
TMS 85.31 70.99
BLO 0.00 L 1 0 0 255 1 0 0 255
BLO 0.00 R 1 0 0 255 1 0 0 255
BLO 0.00
BLO 0.00 R 1 0 0 255 1 0 0 255
BLO 33.57 L 1 0 0 255 1 0 0 255
BLO 0.00
BLO 0.00
BLO 0.00
BLO 0.00
END
NBL specifies subdivisions on both axes, which affects the number of BLO sections. Unspecified BLO sections will be hidden zero elevation faces.
TMS defines the length and width in meters.
I wrote down exactly what the BLO lines meant somewhere else, but the first number, before the L or R, is that point's height.

Changing the horizontal scaling is easy. Changing the vertical scaling requires modifying each BLO line input.

Elevation Grid Generator

Posted: Mon Apr 27, 2015 1:52 am
by Flake
Cheers bruv. Manual edit appears the go.

Elevation Grid Generator

Posted: Mon Apr 27, 2015 7:34 am
by Welshy
Did I just hear Flake talking like a chav?

Elevation Grid Generator

Posted: Mon Apr 27, 2015 8:31 am
by Flake

Elevation Grid Generator

Posted: Mon Apr 27, 2015 4:25 pm
by decaff_42
I could probably whip up an excel tool to do this task. Gimmie a week or so. I remember that I built an excel tool to create elevation grids. I'm not sure if I released it. If I haven't I will tack on this feature and give it a whirl...that is if I can find it on my HD

Elevation Grid Generator

Posted: Tue Apr 28, 2015 4:59 pm
by decaff_42
Okay, I think I have the code working properly now. It can only handle 30x50 node elevation grids, but it should work alright.
If someone is willing to test it on a windows machine, that would be helpful! :D I'll PM you a link.
Screen shot 2015-04-28 at 12.56.42 PM.png
Here is my test elevation grid imported into Scenery Editor.

I cannot handle colors very well, but that is pretty much the easiest step to do in Scenery Editor. Making the node elevations is the harder part.

You can now import and scale an elevation grid in the x,y, and z directions. :D

Elevation Grid Generator

Posted: Tue May 05, 2015 12:31 pm
by Flake
Okie doke, quick tut from me:
Also notes:

Develop a terrain map bmp file - you can photoshop one or whatever you are happy with.

0,0,0 Black is NO elevation at all. 255,255,255 is maximum elevation.

Whatever size you save the bmp as is the size of the grid in subdivisions - so 50*50 pixels is a good size but 200+px is overkill.

Now, if you are me and use win 7: Set the compatability for the program to: Run Win XP SP3, Disable visual themes, Disable desktop composition, Run as admin.

Launch the program and choose the height amplification and terrain size - Size of grid is distance X/Y in meters. Height amplification is the 255m * amplification for each pixel - so if a pixel is perfect white and amplification is 1, it should be 255m above ground, the generated node.

Generate the grid and it should create a new field.

In Scenery Editor (latest test I use...)

File,Import,Scenery... Load the field.

I like to move the grid out of the child scenery and into the root so... Alt+SC, select the grid, Alt+ETR (grid goes to root), Alt+SS (To select the scenery) Select the scenery, ALT+EDS (Delete the scenery). Now you can alt+SC the grid again, then ALT+OVHZ to hide zero elvation faces, then just move and place to suit (ALT+EVI / ALT+ERI) then finally set the gradation color.

Save the field, load and test in YSF - should be all good.

EDIT: Bump.