I hope to be part of making cities a more visually pleasing aspect of landing planetside.
It would be a multi-step process but some things can be done in parallell.
A) adding more buildings, variations, ..
B) altering the city generator to create more realistic layouts and taking new metadata into account
C) altering the terrain generator to create suitable landscapes underneath city layouts.
this is the metadata I have come up with so far:
mindensity, # default 0, (0-100?) city edge, small cities, single buildings, ...
maxdensity, # default 100, (0-100?) city core, high density skyscrapers
landscape: flat | sloped | any # default=any
function: industrial | business | residential | ... # default: none
faction: federation | empire | alliance | alien | ... # default: none
age: ruins | old | contemporary | modern | futuristic | ... # default: none
flags:
landmark, # default=false, should only be placed once in a city
city=__name__, # default=undefined, object can only be placed in city named __name__
atmospheric, # default=false, only placed on planets with breathable atmosphere
non-atmos, # default=false, only placed on planets entirely without atmosphere
military, # default=false, only placed in cities with military theme
# not all flags need to be set, flags are independent of eachother
# parser must handle undefined flags (futureproofing models)
# parser must handle models without any flags
example:
#
model=bigben.obj
city=london
landmark
example 2:
#
model=barn.obj
mindensity=0
maxdensity=10
function=industrial
atmospheric=true
example 3:
#
model=missilesilo.obj
military=true
Cities
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Cities
A) Good but this is what we need an artist for. We have city building models but we need more of them, or a way to generate buildings.
There is a word of warning here though and that is that I have optimised the city rendering quite a bit and it now uses instancing. If you add more types of buildings that means there are going to be more unique groups of buildings to render and so the size of each group goes down, reducing the effectiveness of the instanced rendering.
That will eventually reach a point where it heavily affects the rendering.
A-better) Increase the total number of types of building by a small amount, and have a few unique buildings in there too.
Create a way of generating buildings from prefab parts so that all buildings within a city are similarly customised, in the same way that apartment blocks are fairly generic but those from New York are clearly distinct in style from Shanghai.
B) I started on this, I was going to use perlin noise and a placement mask to control the height of the buildings and where they could be placed. The orientation of the buildings could be based on the gradient of the noise sampled which would make buildings face in coordinated directions. There are lots of different ways to do it though.
C) This is the hard part though a possible technique has been implemented before and so might be worth looking at.
There is a word of warning here though and that is that I have optimised the city rendering quite a bit and it now uses instancing. If you add more types of buildings that means there are going to be more unique groups of buildings to render and so the size of each group goes down, reducing the effectiveness of the instanced rendering.
That will eventually reach a point where it heavily affects the rendering.
A-better) Increase the total number of types of building by a small amount, and have a few unique buildings in there too.
Create a way of generating buildings from prefab parts so that all buildings within a city are similarly customised, in the same way that apartment blocks are fairly generic but those from New York are clearly distinct in style from Shanghai.
B) I started on this, I was going to use perlin noise and a placement mask to control the height of the buildings and where they could be placed. The orientation of the buildings could be based on the gradient of the noise sampled which would make buildings face in coordinated directions. There are lots of different ways to do it though.
C) This is the hard part though a possible technique has been implemented before and so might be worth looking at.
Re: Cities
I just realized "ruins" dont have to be time-related, it could be because of war.
Re: Cities
A) I'm all about getting different building sets for different factions. Like, keep the ones we have for one faction, add another set like "New York"-set you (joonicks) showed in IRC for another faction. Then fluffy's optimization stays optimized. Just something I generally have many plans on how to make the player notice they're in a new/different faction.
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Cities
Just archiving here from IRC since it seems relevant.FluffyFreak wrote: <FluffyFreak> Cities need a few things,
<FluffyFreak> 1) blending with the terrain beneath them - either modifying it or replacing it entirely.
<FluffyFreak> 2) better orientation, placement and layout
<FluffyFreak> 3) interconnection, roads, walkways etc.
<FluffyFreak> 4) interconnection between cities
<FluffyFreak> 5) more variations so we can have sets of buildings suitable for different factions and worlds
<FluffyFreak> 1 already has had a PR in the past that could be improved if someone is interested.
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Cities
I'll just ... leave this here.
Re: Cities
I think having at least some larger prefabs and big structures could be a solution to at least some of the problems (both optimization and cosmetic ones, plus it's sci-fi and what's sci-fi without massive arcologies?).
It might also help with landscaping as large prefabs may include platforms extending long way down and compensating for terrain unevenness. Those platforms could involve things like multi-level streets and make cities look more involved and denser. With some creative design allowing certain objects to overlap without looking bad (for example buildings and street decks) and connect at variety of angles (basically by giving meshes sections that could stick into one another without care for exact alignment, plus maybe some helper meshes for masking seams) could also help with more organic and diverse looks, but it would require some good city generating code to use properly.
Large prefabs would also help with rendering issues that currently exist - since cities are currently just collections of comparatively tiny buildings they suddenly vanish when viewed from over 200km away or so, while ideally they should be visible even from high orbit (also can someone point me at the code that decides when to start drawing object as billboard and when to stop drawing something altogether? - me and this code have some talking to do).
It might also help with landscaping as large prefabs may include platforms extending long way down and compensating for terrain unevenness. Those platforms could involve things like multi-level streets and make cities look more involved and denser. With some creative design allowing certain objects to overlap without looking bad (for example buildings and street decks) and connect at variety of angles (basically by giving meshes sections that could stick into one another without care for exact alignment, plus maybe some helper meshes for masking seams) could also help with more organic and diverse looks, but it would require some good city generating code to use properly.
Large prefabs would also help with rendering issues that currently exist - since cities are currently just collections of comparatively tiny buildings they suddenly vanish when viewed from over 200km away or so, while ideally they should be visible even from high orbit (also can someone point me at the code that decides when to start drawing object as billboard and when to stop drawing something altogether? - me and this code have some talking to do).
-
- Posts: 1343
- Joined: Tue Jul 02, 2013 1:49 pm
- Location: Beeston, Nottinghamshire, GB
- Contact:
Re: Cities
Some articles /implementations on generating city layouts etc
http://gamedev.stackexchange.com/a/122084
http://www.tmwhere.com/city_generation.html
https://medium.com/@nickfourtimes/walki ... .uqz4p72sv
http://gamedev.stackexchange.com/a/122084
http://www.tmwhere.com/city_generation.html
https://medium.com/@nickfourtimes/walki ... .uqz4p72sv
Re: Cities
Just found this medieval city generator. Don't know if any source is available, but might be interesting even then.
Re: Cities
Can't find if this one popped up here before, so:
https://josauder.github.io/procedural_city_generation/
https://josauder.github.io/procedural_city_generation/