mardi 12 février 2013

Coming back to Road Map

I've been asked many times to diffuse the source code or to distribute a licence of my engine. In one hand, I feel very proud with it but in the other hand, it's clear that the engine is not ready to be diffused in it's current state.

As you may have noticed, I dodge bugs instead of resolving them. Every exception is detected by the engine and is flagged as "not working", then abandonned or used for other thing. For instance, a Lot on wich the offset opperator generate a bug is isolated, and the engine try no more to use the offset operator on it. Instead of a building, you'll have a beautiful Parc :)

So I've worked on the engine to resolve the most ennoying bugs. And the more sensible part is the road map generation. There were coincident or collapsed segments, short angle or length that generate, many layer later, tons of bugs.

I've enhanced these exception detection and managed the cases where theses bugs appears. I also worked on the highway pattern, changed somes rules with minor and major, and change the graphics for a more "google maps" one.

This road map of 20 000 lots (a fifth of inner Paris) is generated without any bug, in two or three seconds.




mardi 22 janvier 2013

Shapes optimisation, Episode II

One of my main difficulty now is to "group" shapes in the scenegraph, because there are to many objects to manage. I can't group an entire building when modeled because of two reasons :


 - My scenegraph JMonkey Engine can't group objects with different textures.
 - As I said before, all shapes are manipulated by the scenegraph and can't be grouped before the rendering.

So I made an algorithm in my modeler, that looks for shapes with identical attributes and post-process like same textures, same rotation axes, same altitudes... and group them in real time during modelisation.

This method is very light and save a huge amont of memory, especialy with big buildings. But the code is not that simple and requires some more work to be implemented.

Here are some visuals of the grouping system in action.


 

The Highways

Here is some news of the road network generation with the implementation of a new pattern : the Highways.

This pattern is quite specific because you can't grow a highway randomly like the other roads, considering only the population density. So I've updated my population density management with an interpolated randomly generated map. It works exactly like a basic landscape generator.

When the population is in place, the engine "casts" a highway in direction of the future city, but when the highway touches high population area, it choose between passing through, or turning around. Algorithms are still to be enhanced but the result is interesting.