Finished: Obstacle 3D Generation


This update finishes the obstacle generation. Now you can draw freely any kind of map you like and the algorithm will convert it into a complete 3D-model. Additionally, there are some important quality of life updates.

Obstacle Generation (Part 3):
In the last update I added the painted-area-analysis. This algorithm produced the borderlines for each obstacle. The first step in this update is to take those lines and convert them into the walls of the 3D-model. That includes an analysis for each wall, if it is an inner or outer wall, so the visible side is generated towards the right direction. Additionally, I am adding the option to set the obstacle height.
The next step is to generate the roof for each obstacle. A simple solution would have been to connect each border point with a middle point. But that would have excluded all complex forms, where for example a free area was inside the obstacle. So the second version of the roof generation takes each small square and triangle from the painted points. Those are combined to bigger areas using an analysing algorithm. The important part here is to reduce the vertex and triangle count to a reasonable amount so the performance of the simulation could be secured.

Obstacle Painting:
The brush system was also added in the last update and is finished in this one. The brush is now visualized with rings, that lie around the painted points. Whether I update those rings into another form, depends on the usability. Another addition is that you can keep the already painted obstacles, when you change the size of the arena. Lastly I changed the top-down camera mode into an official edit mode, so you can now only edit the obstacles in this mode. Press <3> to enter this mode.

Fluent Gameplay and Performance:
Just like the reduction of the vertex-count there are other updates, that secure a fluent gameplay. First I am updating the drawing and saving system for the drawn obstacle points. The points were saved in an unsorted list before. But now I sort them into an array. That eliminates the frame drop while drawing with many points and optimizes the calculation speed for the 3D obstacle generation. Regarding the obstacle generation, I put the whole process inside a coroutine that runs in the background so the player still can move freely on the map. The generation is extended over time, so it does not come to lags or frame breaks.

Other Updates:
- The Lines that were used as a replacement for the 3D- models so far, are now used to underline the obstacle-borders in edit mode
- There is a play-mode and an edit-mode. The play-mode shows the 3D-model and the edit-mode shows the painted points.

Bugfix:
- Drawing over the borders of the arena while painting the obstacle points, won't create points in the down left corner anymore.


(01.10-10.10)

Files

Flocking and Obstacle Avoidance - Tech Test.zip 22 MB
Oct 10, 2020

Get Advanced Flocking Simulation

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.