Jump to content


Photo

Folding a Course and other ways to waste time...


  • Please log in to reply
7 replies to this topic

#1 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 01 June 2016 - 05:57 AM

For those trying to replicate real courses within Unity/CF, there will likely come a time when your course data does not neatly fit into a squarish grid in the world. As luck would have it, the course I have chosen to begin my journey into Unity/CF is such a course. Kiawah Island Ocean Course stretches along the South Carolina coast in a linear fashion where holes run 2 by 2 along the terrain. The lidar tile for this area is a very long rectangle which will not play well with Unity.

NBhYpZE.jpg

I thought if I could just overlay the satellite imagery on the heightmap within photoshop (or similar), then I could crop out each hole individually with the same marquee for the satellite and heightmap data.

89DjRw5.jpg

Satellite Data over my heightmap (generated in ArcGIS)

So, my Photoshop base layer was my Heightmap, above that was the full length course Satellite Image. These layers should not be changed throughout the process. They are simply layers to copy from and paste. I then selectively outlined each hole with the sticky lasso and copied and pasted from the heightmap and satellite image layers. This created 2 layers for each hole - I labeled them hole"x"img and hole"x"hm just to stay organized. I then linked the layers so each hole could be moved and rotated with the satellite and heightmap cutouts together. I then rearranged the holes to be more condensed. (only showing back 9)

satfRvZ.jpg

Underneath this was the heightmap data. So, I saved the file with the satellite images visible as a .jpg to act as my terrain map texture and the heightmap data as a .raw (grayscale) for import into Unity.

wrM1pt0.jpg

Now, before import into Unity, I want to take a brief moment to point out the greatest Windows tool ever, the Snipping Tool! If you have never used this tool, head to your computer and type Snipping Tool in the search bar. Then, pin it to your taskbar. (you can thank me later) Somehow, I only managed to discover this tool several months ago. This tool is everything that "PrtScn" desired to be. The Snipping Tool is a click-expand rectangle that you drag across the screen and it will clipboard the contents of the rectangle. You then have the option of saving that file or heading into photoshop and just choosing paste and it will drop in from the clipboard. The reason I mention this tool is that my next step involved copying images from the Kiawah online yardage book that is conveniently drawn to scale and available from their main website. So, I created a second terrain texture overlay that included those images.

4sjfHRI.jpg

Snipping Tool in action

After some time Snipping and adjusting the yardage book images over my satellite overlay, I am almost ready for import into Unity. One step I forgot to mention is flipping the heightmap 180 (vertically) and resaving. For reasons unknown to me, importing the heightmap and satellite overlay do not carry the same north-south information. So this is my workaround. (Current versions of Unity that I had been using have an Invert option that manages this)

n7MFqVS.jpg

And there we have it, earth folding! Tomorrow, folding the front nine, figuring out the proper dimensions and then let's start this puppy!


  • Fairwayman and Kablammo11 like this

#2 Kablammo11

Kablammo11

    Obscure Person

  • Members
  • PipPipPip
  • 3,953 posts

Posted 01 June 2016 - 09:31 AM

Folding reality... It's a great, because simple and smart idea, I'll give you that. Outside the box, lateral thinking. Amazing!

 

Some reality-disciples around here might complain, though. The sights in the distance will be all wrong, the holes will feel right, but the coastline and the visual identity of the place will become corrupted. And in principle, if you are recreating a real course, then shapes and actual geography are part and parcel of the deal. That is taking creative license a bit too far, imo, and if I were to ever recreate a real one, honestly, I would not want to do that...

Courses like Kiawah and St. Andrews just need squares that are huge enough to host their longest stretch, simple as that & just can't be helped. Yes, that will bring a bit of a resolution penalty, but the CF meshes with their own resolutions should help compensate for that. For what it's worth, I would suggest to abort this terrain folding strategy and seek other ways to waste time more productively...

 

Btw, since North is not mandatory in CF, you can rotate the entire Kiawah course by 45% and align it diagonally on the Unity terrain square, thus keeping its sides shorter than you would think. Around 30 percent shorter, if my math is correct. (Diagonal of a square is root of 2 is 1.41. 100 divided by 1.4 is roughly 70 - too lazy to launch my calculator...)

 

 

The reason why you need to flip the height map vertically is because the texture overlay is projected downwards from the top onto the terrain, whereas the height map information pushes the terrain from the bottom up. Opposite vectors.

If you run Unity 5.2.3 or later, there will be a box in the import menu offering you the option to flip the height map vertically, so that you do not need to do it previously. Once CF comes out (and for you this can't be too soon), it will be for Unity 5.2.3 (or higher) anyway.


  • Fairwayman likes this

>>>>>>> Ka-Boom!





• Mulligan Municipal • Willow Heath • Pommeroy • Karen • Five Sisters • Xaxnax Borealis • Aroha • Prison Puttˆ

• The Upchuck   The Shogun  • Black Swan (•)

 

<<<<<


#3 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 01 June 2016 - 11:49 AM

Oh K11, I love how you start a post with 2-3 complimentary sentences and an exclamatory remark followed by 3-5 paragraphs of why my idea won't work. I agree that the ultra reality freaks will have their panties in a bunch on this one. Since I'm just "based" on here, I'm probably good with my folded reality and my goal is to maintain the oceanside holes as oceanside. Additionally, I intend to have the lateral aspects of the holes be similar in appearance. Which will suffice except for an F5 junkie. I was worried that the course runs 4km and with your math, I believe that might be placed diagonally in a 2850 square or so. Probably 3000 depending how the course fits in the corners. Wouldn't I then need to run heightmap resolution at 4097 to have decent pixel per meter resolution? (or is it a different terrain parameter?) Just didn't know which is better for construction. I also could run 9 holes down the middle and break off the other in 2 chunks and make some false greens and fairways in the distance to keep it close to reality. I will follow whatever you think may be best as I don't want to spend hours in one direction only to redo everything. And too soon is here. Woop!

#4 Kablammo11

Kablammo11

    Obscure Person

  • Members
  • PipPipPip
  • 3,953 posts

Posted 01 June 2016 - 02:24 PM

It is the correct parameter. You could set heightmap to 4097 - this might be asking a bit much from older and semi-old PC's however, performance might become an issue for them.

Our resident but absentee Designer In Chief, Mr. Mike Jones, might be a bit more helpful with that question. Of course he won't, so let's just find mean solace in the thought that once CF is being released to the world he will be utterly swamped 24-7 with panicked requests for help, guidance and specifications, most of them a lot more parochial than your proposed reality-folding idea...

 

The CF meshes come with their own gridpoint resolutions, just to reiterate, with greens and bunkers set to 1 gridpoint per meter, fairways to 1.5 etc - no matter what the underlying terrain resolution is. And you can change these default settings in CF, btw, and make them tighter if you wish. The matter of 2049 or 4097 height maps would only impact the surrounding Unity terrain anyway. And what with Kiawah being a rather flat plot with soft contours, 2049 should work out alright. 

 

I can only give you recommendations. You display a healthy dose of self-assuredness, which will serve you well, so whatever you do, you are the guy in charge and screw-ups will be on your head only. Feel free to ignore me and follow your own instincts. 


>>>>>>> Ka-Boom!





• Mulligan Municipal • Willow Heath • Pommeroy • Karen • Five Sisters • Xaxnax Borealis • Aroha • Prison Puttˆ

• The Upchuck   The Shogun  • Black Swan (•)

 

<<<<<


#5 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 01 June 2016 - 08:53 PM

K11, thank you for the recommendations. As usual, the simplest plan is often the best. I enjoyed folding the course but the following may prove to be better. I am hoping I can have enough "breathing room" between the nines to fog out across my ocean and allow the look to be accurate. Additionally, I will need to invest in transport vehicles between holes 3 and 4 and back from 7 to 8. It will be quite the hike. I know Xaxnax probably has such inventions that would suffice but not sure it is in our budget at this stage. 

NwrTAZ4.jpg

Now, my only task remaining is to figure out what size I need to import this at for my course yardages to be correct. My current file is 3624px by 3624px. Using the bing map legend when cropping images, the 50m length on the map in my image measures 106px. I am assuming Kablammo Corp has an engineer that has worked this out before. I can probably measure a hole or across the course and keep scaling until I get the length I need but my guess is that there is a simple way to do this and my "tired" brain cannot see it at the moment.



#6 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 02 June 2016 - 01:37 AM

Brain reboot and partially answered my own question. I was wrong with statement of 106px/50m above. It is either 101px or 103px, making the grid .495m/px or .485m/px. I will just run calculations for both and see how the course measures when loaded into CF. I can always resize it. Basically, measured a few areas in google map and compared to my map. A known point was 2840px, multiply by previous to get 1405.8m or 1377.4m. That same distance in google was 1.43km. Simple algebra tells me google map is 1.017 or 1.038 larger than my map. So, I will scale the overlay and heightmap together at 101.7% and 103.8% and see what things measure around the course on import. I will return for advice if I have somehow complicated this all and muxed it up.

My problem with the Bing legend is whether to go from the outside of the white line or the blue line for measuring. It is a difference of 2 pixels but over my distance of 2840 px, it creates a 28m difference. Kind of humorous when you try and show your math thoughts online.

aR6byen.jpg



#7 Kablammo11

Kablammo11

    Obscure Person

  • Members
  • PipPipPip
  • 3,953 posts

Posted 02 June 2016 - 08:26 AM

Well, I did encourage you to follow your instincts...

 

My instincts tell me is that you are overthinking this a bit too much. And that the driving force behind your strategy, the fear of going large and loosing resolution, is irrational in certain places and unfounded in others.

Then again, your proposed process strikes me as refreshingly experimental, and by all means, why not go there? Trial and error being the best teacher anyway, go for a trial run without fear of errors. Perhaps this can work out, despite my misgivings?

 

My instincts, just for the record, is that this is the way to go:

 

fk6OjiU.jpg

 

Now keep following yours.


>>>>>>> Ka-Boom!





• Mulligan Municipal • Willow Heath • Pommeroy • Karen • Five Sisters • Xaxnax Borealis • Aroha • Prison Puttˆ

• The Upchuck   The Shogun  • Black Swan (•)

 

<<<<<


#8 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 02 June 2016 - 03:39 PM

Well, I did encourage you to follow your instincts...

 

My instincts tell me is that you are overthinking this a bit too much.

I tend to do that. Born that way for better or worse. I see it as an advantage. As if I complicate it, I learn more information (some useful, some not so useful) about a process and can eventually simplify it. I will shut up now and come back in a few weeks when I've made some progress. Going to watch some real golf at the Memorial. I saw Andrew had a post stating he is there. Kinda funny. Thanks again.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users