Introduction:
Rather than making an individual stage, I model a large area and procedurally connect random start and finish points to make stages.
The end goal is to have a large library of RBR stages that can be pulled up at random.
E.g. A tournament is using my stage "HEUVELLAND". The members competing have no idea what the actual route will look like, it is chosen at random from the library of various stages made with procedural routes. This lightens the competitive nature of the game and allows for casual and serious players to compete on a slightly more level playing field.
This may be an idea that deserves implementation BEYOND rbr. Perhaps my own game?
I'm not nearly experienced enough as a developer to take on a task like that right now, however. I will continue forward making the RBR arena stage. I need to come up with a better name than that.
Below are some days of testing this idea:
1-6-22: Test 1
- Generate some random terrain (later maybe use LIDAR data)
- Vertex paint the desired population density
- Geometry nodes do the following:
- distribute points according to density map
- connect the points at also according to density map
- fully painted areas are cities, all cities can only be connected by 1 line
- smooth the curves and use array modifier to put roads along the paths
- place houses and other objects along the road according to density map
I think a big part of the memorability of these stages is how well they're made, I will have to keep this in mind as I embark on this project.
1-9-22: Test 2
Today I evaluated the 1m accurate lidar data I got from the Flanders government. Super cool! I've never worked with point clouds this big before and I crashed blender and cloud compare quite a few times.
Ultimately I ended up importing the geotiff into QGIS, filtering out the extra data, saving it as a geotiff, and loading it into blender with the GIS addon. I did have to make sure that I imported it with the proper Belge-Lambert 1972 projection, and covert it to the Web-Geodata projection.
Some progress picture of my work with the "A" region of Heuvelland:
This is the area I've decided to look at, the "road" as shown on the map are 30m wide segments that will eventually become the "near geometry" in a RBR stage.
Before jumping into any serious modelling endeavors I want to explore some procedurally generated routes first. I would like to explore 2 options for route generation:
- A to B - path finding
- Place a point at random (with some exceptions) on a road anywhere on the map.
- This is the start line
- Place a second random point (with some different exceptions) on a road anywhere on the map.
- This is the finish line
- Given parameters "Length" and "curviness" find routes that go from A to B and approximately fit those requirements
- Each junction is given a unique name, as is each road that links junction to junction.
- Each road has characteristics "Length" and "Curviness"
- Each road will also have predefined pacenotes
- Find all paths that connect the two points and meet the parameters given some margin for error
- e.g. length and curviness parameters will have say a +/- 10% margin
- A until B - natural growth
- Place a point at random (with some exceptions) on a road anywhere on the map.
- This is the start line
- Each junction is given a unique name, as is each road that links junction to junction.
- Each road has characteristics "Length" and "Curviness"
- Each road will also have predefined pacenotes
- Given this starting point, find all routes that match the length requirement with no double backing or crossing
- Filter out any routes that don't meet the curviness requirement (+/- 10%)
- If there are multiple routes that meet the requirements, choose one at random
1-16-22: Procedural Stage Generator
- The spreadsheet has 2 pages each with specific information
- Junctions
- list of roads connected to the junction
- junction index
- Roads
- list of junctions at each end of the road
- road's length in km
- road index
- See the program and files here
- Given the route generated from the python script, blender needs to create a Driveline object that
- Each road will have a set of pre-written pacenotes and a collection of "Near Geometry" that will be revealed when the road is added to the stage route
- With this a large number of random stages can be created with relative ease. Much like some of the Czech stages use different routes within a similar arena / collection of roads. Or similar to how stages in the DIRT games take place in the same location and use the same roads. This method however can produce much more variety.
- I can see the ability to generate random stages being useful in two ways:
- Option A: 1 or 2 stages exist for tournament play
- e.g. a "Long" and "Short" version
- When selecting the stage, RBR randomly selects a stage from a list of pre-generated routes.
- A script that executes when the stage is selected assigns the randomly selected stage to the game in the tracksettings.ini (or whichever file allows you to change stage access)
- This introduces a level of randomness and prevents drivers from completely memorizing and treating the stage like a "Hill-Climb"
- Option B: Many normal stages
- This method could also just be an easy way to generate a few interesting routes across the same area
No comments:
Post a Comment