Tutorial that might help your track perfections.

Discussion in 'Track Modding' started by Frederick Alonso, Dec 5, 2020.

  1. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Hey guys,

    Someone asked me to put more of my knowledge online.

    So I'm happy to share my tutorial on how to use satellite data as reference material to built a track upon. In case you need more perfection or having issues with proportions for example it's very handy to have reference material in your 3D scene. It saved me headages and many research. Over the years I have used many tricks but this one is the fastest way I think to work a track out from scratch.

    I can all copy paste it but I dropped it on my public available patreon blog:
    https://www.patreon.com/posts/44691029

    I wrote it down as simple as possible to follow.
    If you follow the tutorial, you can go from this osm 2D view:
    [​IMG]
    to this 3d view:
    [​IMG]

    If you have more questions, drop them below so I can expand the tutorial for modders loving the stuff like I do :)

    I dropped it here to help other modders going fast forward.
    BTW I once said it here but yes I'm building a fresh Fuji 2021 version in coming months.

    It's public available and it's not my intention to spam here
    [​IMG]
     
    Last edited: Dec 5, 2020
    Corti, Dave^, haunetal1990 and 5 others like this.
  2. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    Thank you for your efforts.
    I noticed the result is flat.The wiki page mentions that elevation calculation is disabled by default, but it doesn't look like these osm files contain it anyway (it just has long and lat coords). The documentation suggests that elevation data can be obtained but the instructions aren't clear.

    How did you obtain elevation data as seen in your screenshot?
     
    Frederick Alonso likes this.
  3. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    I updated the article, thanks. Forgotten to mention it but the trees and locations are very accurate. In terms of 3D height we don't get this with OSM data. So you are right. I see it as a 2D top view guide in a 3D edit viewport. Actually I use Google earth Viewer as reference as well. So I can set my viewports the same and model in another (top view) viewport the parts I want to elevate. It's a bit extra work but once done right it's the nuts!

    In blender I do this in skulpt mode and select the tool that gets the job done. Pinch, round, flat tools are used to manipulate the mesh I made as well. A big plane with good subdivisions and perfect scale was added in the same dimensions I took a top view from in google earth.

    The reason I love OSM is simple, they just add square building cubes. Which is the base I use all the time for a fresh model object. Also it would be no fun to just download and go from there. But it is also a bad idea if we get for example a 3D building with a bunch polygons you cannot even use (copyrights may become a problem).

    But at least after a good week doing edits, I'm sure you will be far ahead compared to someone that builds over a flat pixelated satellite image reference. In the end he also needs to know all this ;)
     
    Last edited: Dec 5, 2020
    Rogger likes this.
  4. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    I've worked out how to read height data. By default the program won't try to set the height. You can tell it to do so with a properties file, but you also have to tell the program to look for the properties file too.
    1. Make a copy of example_config.properties (call it cfg.properties, for example) and open it in notepad (I prefer notepad++ because it has features).
    2. Remove the # and the space from the line "# srtmDir = srtm". That'll tell it to look for height data in a folder called "strm"
    3. Create that folder, but there's nothing to put in it yet. The program will tell you what it needs.
    4. Make a copy of osm2world-windows (example filename: osm2world-height) and open it in notepad (or notepad++)
    5. Change it to this: java -Xmx2G -jar OSM2World.jar --config cfg.properties --gui
    (changes in bold. the first parameter tells it to use the new config file. The second parameter seems daft, but as soon as you have just one parameter the program will try to run in command-line mode only, so adding "--gui" makes the window show up again.
    6. Not sure if this is correct or helpful but putting a # at the start of the "treesPerSquareMeter = 0.001" line will make the trees more dense like with the original batch file.
    7. (optional) change the value of material_TERRAIN_DEFAULT_color to #55FF55 for green terrain. The existing value is white.
    8. Run the file osm2world-height and then open the .osm file
    9. It will show an error message because it's now looking for height data but cannot find any. Fortunately the cmd.exe window (hidden behind the program) will tell you what it's looking for. E.g. warning: missing STRM tile something.hgt (there may be more than one file listed)
    10. The .properties file mentions this website for getting elevation data: https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/
    11. For each .hgt file mentioned in the warnings, download the zip file with the matching name and extract its contents (.hgt file) to the "strm" folder you created.
    13. Quit the program and re-run the batch file.
    14. Selecting the osm should now successfully apply the elevation data.

    Edit:
    for a large area the cmd window may run of of space in which to list the required hgt files.
    This example will give it more lines so you can scroll up to it:
    mode con:cols=140 lines=870
    java -Xmx2G -jar OSM2World.jar --config cfg.properties --gui

    Example batch file for just converting to obj immediately, but you have to change the osm and obj filenames each time:
    java -Xmx2G -jar OSM2World.jar --config cfg.properties --input something.osm --output something.obj
    pause

    Note the 'pause' on the second line - the cmd output is much more compact so any missing .hgt files should be easy to see.

    edit 2:
    With a large area I tested, I got a better obj file using the gui even though it takes longer than the direct command line conversion.
     
    Last edited: Dec 7, 2020
    Rogger likes this.
  5. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Damn that is very interesting if we can even fix this :) Did you tried it out on a piece of map? Crazy it is even possible, It's great to spot heights as they are in real life and just use it as reference to make your own 3D very perfect! Thanks for figuring it all out. I have spend a lot time finding the best way but did not even know height was also possible. Thumbs up for you! I might give this a go and add the new code in the zip file and also update the article with your credits for finding this.
     
  6. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    I also added 14 tracks I like making in the next few months. 3 of these winning votes will be made. Fuji is one of them that I started on but feel free to vote guys. There are some smaller not so popular tracks that are very awesome I think. You can vote by login in with a google or FB account. https://www.patreon.com/posts/44644092
     
  7. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    So I did a run based on your comments and could indeed get data from the height. Crazy and helpfull! Big thanks for the tip, I added a note about this on the patreon tutorial :) I might look for Fuji mountain and the racetrack heights more in depth now and match it with my new 3D. Will look more realistic in the end. Big ups to your efforts.[​IMG]
     
    Last edited: Dec 8, 2020
    Rogger likes this.
  8. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
    I followed your suggestion of taking multiple tiles from the map and putting them together in Blender. I thought it'd be a good idea to try the original layout of Clermond Ferrand. It was not. I think you need "useBillboards = true" in the config file, as the cylinder/cone shaped trees eat up a lot of memory if you load many tiles. I ran out or RAM (8GB) from using 22 tiles.
     
  9. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    I also did some experiments with the trees but in some way I don't need a lot of them. It's more an indication where the trees should be seeded. For me personally the height of terrain and top view is more important. Cylinder shaped trees are not even practical and we also need to remove them afterwards. I also discovered taking too much area is a bad idea. Let's say Le Mans. You should do it in 4 areas (OSM) and then glue them in Blender. It's a bit of work but I don't care, still worth the efforts in some way. If you just have a top view and need to go from there, it's a lot more work and research.

    Yesterday for example I experimented and had good results with small areas zoomed in enough. I took the Vulcan of Fuji and had amazing details from it.
     
    Rogger likes this.
  10. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Last edited: Jan 14, 2021
  11. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Last edited: Jan 22, 2021
  12. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    jayarrbee36 and Hazi like this.
  13. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    For all interested I just uploaded a zip to my Google drive with an example that loads fine in game. The link is at the bottom of my article of (Part 3).

    You can learn how to make this, after that it should be a no brainer to add and build a lot more.
    [​IMG]
     
    svictor likes this.
  14. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    926
    Likes Received:
    6,279
    Good tutorial.

    For the falling car problem (as the initial position of garage in AIW), there is a better and easy solution which doesn't require to alter/move models:

    You can manually set first or any garage spot with NOTEPAD:

    1. Open *.AIW file with notepad (if there is no AIW file, launch game to generate AIW first and save).

    2. Find following section:
    [PITS]
    TeamIndex=0


    Under TeamIndex=0, you can see 3 GarPos values. Each GarPos has 4 values, the first value should be left untouched. The 2nd 3rd 4th value are XZY position, which you just need to copy correct XZY value (the coordinates where you want to place the car) from 3dsimed or other 3d software. And remember to swap Y & Z value when copying XYZ value from 3d software (hence the order in AIW is X Z Y), and also change Z value 0.5 meter higher to make sure car is above ground.

    For example:

    PitPos=(54.803,0.001,-16.313)
    PitOri=(-0.002,1.500,0.003)
    GarPos=(0,58.003,0.004,-19.204)
    GarOri=(0,-0.005,-3.100,0.002)
    GarPos=(1,56.164,0.007,-18.767)
    GarOri=(1,-0.004,-3.121,-0.001)
    GarPos=(2,54.364,0.010,-18.767)
    GarOri=(2,-0.004,-3.121,-0.001)
     
    Last edited: May 15, 2021
    Frederick Alonso likes this.
  15. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Thanks buddy, I will add this info into the tutorial and give you the credits for it :)
     
    svictor likes this.
  16. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    A first impression of the retopology (selfmade clone) mountains, mapped with some random copyright free images and tested in game on special hours. The grass took me 3 days to set tight.
    [​IMG] [​IMG]
     
    FuNK! and Hazi like this.

Share This Page