lot area use problem

03-25-2013 01:05 PM
New Contributor III
I'm not sure how to solve this:

In situations where I have a corner such as the image, I am finding I am getting odd skinny buildings.
I can't have this for a number of game reasons, player getting stuck.
I am trying to find a way to prevent this type of generation and have the lot more appropriately filled with a building.

Any ideas?
0 Kudos
1 Reply
Frequent Contributor II
Hi Robert,

Here, you're hitting the boundary of what's possible using the 'Dynamic City Layouts' system and CGA.

From an artist's POV, I'd recommend to deviate from this system a bit anyway, to make the city layout a bit more interesting.

There's multiple routes to go :

1] MOST realistic, mostly manual shape creation
Use the 'Dynamic City Layouts' only for the streets and manually draw and place building footprints. You may bump into some issues where terrain and buildings meet, but with some cleverness in placement of props and distribution of other things, this may be minimized.
Search OpenStreetMap.org for realworld building footprints and use them.

2] MIX procedural with realworld footprint assets
Use the 'Dynamic City Layout's' shapes 'Lot' and 'LotInner' to scatter realistic building footprint assets inside the shape, instead of using the shapes themselves to produce the footprints with CGA operations. This will improve the richness of your environments, but keep the system procedural.

3] Entirely done in CGA
Here, you will deal with those situation in CGA code, by writing heuristics which try to filter out such problematic situations. Though, since the current array of CGA functions to detect such things are still limited. Mostly I write such heuristics by comparing 'shape area' to 'scope area' [scope.sx * scope.sz], nVertices, nEdges, plus using convexify() and innerRect(). This MAY NOT be giving you satisfying results.

Of course, 1] to 3] depend on your game, story, level design, ..., but you will have to choose something between 1] and 3]. Whether you're creating levels where the character can wander freely or if the person passes thru levels more 'linearly' will have a strong influence on this.
It also depends what type of person creates the environments, whether it's a skilled developer ( such as yourself ) or rather an artists who hates scripting and needs be provided with the corresponding CGA code.

Let me know what you think !

0 Kudos