Board index FlightGear Development Google Summer of Code

[Proposal] Autogen Cities using PixelCity

Project proposals, student applications and all related discussions.

[Proposal] Autogen Cities using PixelCity

Postby Hooray » Sun Jul 11, 2010 1:16 pm

This is taken from the Feature Poll thread:

simbabeat wrote:The flightgear scenery is seriously underpopulated. In my humble opinion I think everyone who develops for Flightgear feels like like every building in the FlightGear scenery has to be placed with a .stg and a .xml. We have a bit of an auto-generation feature than automatically puts random buildings in places and random this and that in places. Maybe we need a btter or more complete autogen feature that does more than just puts a random model here and there.
Stuff like this is stuff that could be generated. We could use Scighera's model in that topic as a generic model that could be automatically generated in places where antennas would be if he sees fit. A better autogen feature would not take away the need for continued development of scenery however. So anyway....

stuart wrote:Improving the random object generation is on my to-do list, and CVS already has improved urban areas, using shaders to generate buildings. In the mean time, adding objects for their local area is something that everyone should be doing. If you are not prepared to add buildings to your local area, don't expect anyone else to.


I just recently found out that there is already an open source project called "PixelCity" which creates cities completely procedurally.

Check out this video:


The developer's main goal was to develop all this in under 50 hours, he has written about the whole project in his blog: http://www.shamusyoung.com/twentysidedtale

The blog is really extremely interesting, I can truly recommend reading the whole column!

The developer is looking for a project to put his work to good use, and explicitly asks his blog readers to spread the word:
Please do consider spreading the word on this project on your blogs or wherever you tell people about cool stuff.


This is because at the moment PixelCity is just released as a fancy screen saver demo: http://www.shamusyoung.com/twentysidedtale/?p=3237

It uses pure OpenGL and originally built only on Windows, but has now also been ported to Mac OSX: http://www.youtube.com/watch?v=0JVzhsznDms

It is licensed under the GNU GPL and the code is available here: http://code.google.com/p/pixelcity/

The Mac OSX port is hosted at github: http://github.com/skeeto/pixelcity


So if anybody is really interested in improving FlightGear's autogen support, it would surely be a good idea to look into that code, because it satisfies all important FlightGear requirements (GPL licensing, portable OpenGL, tiny footprint, C++ code).
Also, someone else posted already a suggestion to add this to FlightGear a while ago: http://www.fractalforums.com/index.php? ... pic=3223.0
Last edited by Hooray on Tue Jul 13, 2010 5:11 pm, edited 1 time in total.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: [PixelCity] Autogen Cities

Postby Torsten » Sun Jul 11, 2010 6:19 pm

Thanks for pointing this one out, it definitely looks interesting.
I just fetched the source and built and ran it. It really looks cool from the distance and close up.
Implementing it into FlightGear requires porting the OpenGL calls to be OpenSceneGraph compatible, probably by implementing osgDrawable.
The current implementation only shows night-time views, so this has to be tweaked, too.
Another issue to take care of is interaction with existing scenery models, so the generated buildings do not interfere with our scenery models. The same is true for our landcover, roads and elevation data.
Definitely worth some thinking. Probably as a google summer of code http://wiki.flightgear.org/index.php/GSoC project?
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: [PixelCity] Autogen Cities

Postby Jak_o_Shadows » Mon Jul 12, 2010 10:29 am

Perhaps something using blended cities? It's a script for blender that builds the meshes of cities. Quite configurable. Last time i used it, you could input a street map and it would only build buildings in the lots, not on the roads. Now, maybe combine that with open street map or something? Also, you could then just load it fairly normally into flightgear. Instead of downloading the building, it could be an option to download the files needed to make it and do it yourself.
Jak_o_Shadows
 
Posts: 26
Joined: Mon Apr 26, 2010 5:25 am
Callsign: Jak_o_Flight

Re: [PixelCity] Autogen Cities

Postby Hooray » Mon Jul 12, 2010 7:12 pm

Hi, I have taken your ideas and added them to a new wiki page: http://wiki.flightgear.org/index.php/Au ... FlightGear to provide a place for collecting everything that is related to autogen scenery.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: [PixelCity] Autogen Cities

Postby Toanphuc » Tue Jul 13, 2010 1:53 pm

A good flight sim is not to make people feel fly easier but to make them feel fly is as real as it get.
Other Free Flight Sims viewtopic.php?f=3&t=8847
Toanphuc
 
Posts: 180
Joined: Sun Jun 20, 2010 6:26 am

Re: [PixelCity] Autogen Cities

Postby Avionyx » Tue Jul 13, 2010 2:07 pm

Toanphuc wrote:How about this ? http://arnaud.ile.nc/sce/index.php

Interesting but it seems entirely geared towards blender and is very processor intensive. Rendering times on just one detailed city can be huge. Great project though!
Avionyx
 
Posts: 531
Joined: Mon Jan 11, 2010 4:07 pm
Location: EGMD
Callsign: G-AVYX
Version: 2020.4
OS: Manjaro

Re: [Proposal] Autogen Cities using PixelCity

Postby Hooray » Thu Dec 01, 2011 2:58 pm

Update: Some core developers are currently discussing plans to improve random trees and random building support in FlightGear: http://www.mail-archive.com/flightgear- ... 35035.html
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: [Proposal] Autogen Cities using PixelCity

Postby D-PH » Wed Jan 11, 2012 10:47 pm

Those moving car lights on the roads would be actually quite helpful in night flights, as it would help to recognize roads.
D-PH
 
Posts: 60
Joined: Wed Oct 05, 2011 8:07 pm
Callsign: D-PH
Version: 120105
OS: win 7 & linux

Re: [Proposal] Autogen Cities using PixelCity

Postby Bjoern » Fri Jan 13, 2012 7:37 pm

I've mentioned another approach to placing and handling autogen objects here.
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: [Proposal] Autogen Cities using PixelCity

Postby Hooray » Fri Jan 13, 2012 7:57 pm

D-PH wrote in Wed Jan 11, 2012 10:47 pm:Those moving car lights on the roads would be actually quite helpful in night flights, as it would help to recognize roads.


Agreed, a while a ago there was a related discussion here: viewtopic.php?f=23&t=9553

Bjoern wrote in Fri Jan 13, 2012 7:37 pm:I've mentioned another approach to placing and handling autogen objects here.


Yes, thanks for adding this info here - like we mentioned already, most of this should be fine from Nasal space, and it would certainly be possible to leverage/reuse some of the local weather system code, which is doing a conceptually similar thing already. After initial prototyping, we could still look into moving some stuff into C++ space.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: [Proposal] Autogen Cities using PixelCity

Postby Bjoern » Mon Jan 16, 2012 1:28 am

I suppose that C++ can be processed faster than Nasal (hence the move to C++ after the prototyping phase), right?

I've just skimmed through the e-mail exchange that this thread linked to again and I've seen mention of MSFS's way of placing autogen. From FS2002 on, the game engine used so-called .agn files to define building and tree locations on a specific texture file.
Say you have a medium density urban texture called 1.bmp. If you want to see any autogen on it, you'd have to create a texture called 1.agn with the "Autogen Annotator" tool from the SDK. It is a graphical tool, in which you can manually place the building and tree footprints on the ground texture. The general way is doing it building by building, but filler operations (say on larger wooden areas) are also possible. When you're done, you export the .agn file and you can start MSFS and marvel at your new urban texture.
This process is nice if you just want to change a few textures, but if you want to add autogen to tons of custom (e.g. photoreal) ground textures (e.g. for a specific region), it becomes very, very tedious to do.

The Pixel City approach is just great, as it would essentially eliminate the manual placement of buildings within cities. But I'm not sure how much of a burden it would place on the rendering engine when done in real time for a large area.
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: [Proposal] Autogen Cities using PixelCity

Postby Johan G » Mon Jan 16, 2012 7:18 am

Something like this was worked on by Intel-Qube about a year ago. I don't know why it stopped. :|

Here's a link to one of the last posts in that topic: Re: [FIRST RELEASE] Instant City, just add water.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: [Proposal] Autogen Cities using PixelCity

Postby Hooray » Tue Jan 17, 2012 4:05 am

Johan G wrote in Mon Jan 16, 2012 7:18 am:Something like this was worked on by Intel-Qube about a year ago. I don't know why it stopped. :|
Here's a link to one of the last posts in that topic: Re: [FIRST RELEASE] Instant City, just add water.


Like already mentioned by Thorsten in the other thread, this is a different approach: viewtopic.php?f=5&t=14806&start=60#p146274

Bjoern wrote:I suppose that C++ can be processed faster than Nasal (hence the move to C++ after the prototyping phase), right?


Yes, C++ code is compiled to machine code and is by default faster than scripted code, which is dynamically interpreted at run time using a so called "virtual machine". However, it isn't always speed that's the most important factor here, some things are simply not yet possible from scripting space, so one would need to move some stuff into C++ instead or at least enrich the Nasal/C++ interface so that more C++ features can be leveraged from scripting space. This is exactly what's been happening for the local weather system for quite a while now.

Bjoern wrote:The Pixel City approach is just great, as it would essentially eliminate the manual placement of buildings within cities. But I'm not sure how much of a burden it would place on the rendering engine when done in real time for a large area.


Did you see the demo? Did you compile the code? It's pretty efficiently done obviously, I can start several instances of PixelCity here without their performance getting affected at all. The major bottleneck is likely to be within the FG/SG code - at the moment, enabling/disabling terrain rendering (i.e. switching to wire frame mode) shows you easily how much of an impact terrain rendering really has on FG.
The approach is certainly feasible, it is already being done like this in other simulators - just check out the AutoGen support in other simulators, like X-Plane. The major problem is going to be integrating this with FG/SG and OSG in particular. Ideally, PixelCity would be implemented as an OSG plugin so that they could maintain it and ensure that its working with other important plugins.
The terrain system in FlightGear may need quite some thinking in order to come up with working LOD schemes, so that the whole thing makes any sense at all. But this is something that's better by discussed by folks like papillon81 or psadro_gm.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: [Proposal] Autogen Cities using PixelCity

Postby Bjoern » Tue Jan 17, 2012 4:20 pm

Hooray wrote in Tue Jan 17, 2012 4:05 am:Did you see the demo? Did you compile the code? It's pretty efficiently done obviously, I can start several instances of PixelCity here without their performance getting affected at all. The major bottleneck is likely to be within the FG/SG code - at the moment, enabling/disabling terrain rendering (i.e. switching to wire frame mode) shows you easily how much of an impact terrain rendering really has on FG.


Yes, I've seen the demo, but I didn't compile anything (too lazy).
And yes, the terrain rendering part of the engine is going to be a major bottleneck without any optimization. But this is nothing specific to FlightGear, as MSFS also uses most of its assigned resources for terrain rendering as well.

The approach is certainly feasible, it is already being done like this in other simulators - just check out the AutoGen support in other simulators, like X-Plane.


I kind of lost track of X-Plane. Do they use procedural autogen as well?
From what I've seen, the cities in version 10 look really nice. I'm not sure about the performance though.

The major problem is going to be integrating this with FG/SG and OSG in particular. Ideally, PixelCity would be implemented as an OSG plugin so that they could maintain it and ensure that its working with other important plugins.
The terrain system in FlightGear may need quite some thinking in order to come up with working LOD schemes, so that the whole thing makes any sense at all. But this is something that's better by discussed by folks like papillon81 or psadro_gm.


Yes and yes.
I think that implementing a LOD system would be a prerequisite before implementing PixelCity-style autogen. Then again, it *might*(!) be easier to apply to procedurally generated content instead of "fixed" models.
Something like simplified algorithms that e.g. only display simple boxes instead of detailed houses far away in the distance.
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: [Proposal] Autogen Cities using PixelCity

Postby planetacancun » Mon Mar 19, 2012 10:23 pm

Wow! O.O Man, you guys make me drool...
Callsign:Fallen-
Videos: http://youtube.com/planetacancun2
planetacancun
 
Posts: 322
Joined: Thu Jul 30, 2009 5:52 pm
Callsign: Fallen-
IRC name: Fallen-
Version: GIT
OS: Ubuntu

Next

Return to Google Summer of Code

Who is online

Users browsing this forum: No registered users and 3 guests