I know in the video I claimed it was released as source and a screensaver , but that step has been delayed and I’m to lazy to re-cut the video.

Soon.

Note that the stuttering apparent in the video is not from the program itself. It was running at 200-300fps with no slowdowns when I made this video. The stuttering either happened during video capture or during the encoding process, which I was obliged to do twice. (Cheapo Windows Movie Maker doesn’t support multiple audio tracks, so to get the typing sound and the music in there together I had to encode the entire movie with just the typing, then re-import that movie and add the music. There were probably better ways to have solved this, but all of them would have taken longer and I’d already spent more time on this than I’d intended.

The story of the cool cam is one many engineers (and by extension, programmers) need to take to heart, that marketing does not always deserve the scorn we give it, and that a little polish in presentation can go a long way to covering up the lack of polish in everything else. I applied that lesson to great effect here. The animated camera does a great job of showing off the cool stuff and hiding the rough edges.

One thing that struck me though, the car lights.. I think they would have looked better as billboards always facing the camera.
That way they wouldn’t be reduced to thin lines when viewed at an angle.
Something to consider if you ever go back to this :)

This is brilliant. You show how much can be done by one guy, working alone. Makes me wonder if you could add a simple physics engine and create a basic game that involved flying through the city without hitting anything.

This is highly awesome, and watching the video has me thinking about the Arthur C. Clark saying. You know, “Any sufficiently advanced tech is indistinguishable from magic”?

I know, because you’ve documented it, that this is the result of many hours of thought, effort, testing, revision, and general hard work, informed by acquired knowledge and ability, but when you show the video without the project documentation, and the creative process is sped up like that, it looks like wizardry.

Looks very good indeed, I might use it as a screensaver. Only a few minor remarks:
-> The lights look a bit weird at ground level.
-> The cars also look a bit weird. Not sure what it is: their constant speeds instead of accelerating? The fact that it’s only lights?

Question: what programming language is the source code in? As Burton Choinski mentioned above in the comments, I’d love to use this screensaver on my Mac. Sadly, a windows .scr file would do me no good to this end, but the source code may (depending on the language you coded in). I’d be willing to invest some time to port it to a Mac screensaver file if possible, it really is stunning work.

Wow! I want it. I want it now. I’ve grown bored as heck with most of my screen savers but it’s such a pain to get new ones because they’re so often a distribution source for malware and I get sick of sifting through. I think I’ll trust you, though, which means I’ll be downloading a copy as soon as you get it ready to distribute.

I mainly lurk here, have for years but had to comment to this great great series. Very educational. I look forward to studying the code. And I think the city turned out great.

Do you think that putting blinking aircraft warning lights on the taller skyscrapers would add to this project? I think it would add some visual detail at the top to balance some of the action going on below with the cars.

Thanks again for doing this. I hope you’ll take on other projects like this in the future.

Note that the stuttering apparent in the video is not from the program itself. It was running at 200-300fps with no slowdowns when I made this video. The stuttering either happened during video capture or during the encoding process, which I was obliged to do twice.

This stuttering is likely because the framerate is way too high. You’re only going to get 30fps in a YouTube video, and MS Moviemaker is going to throttle your video at 60fps, anyways. Dunno how easy it would be to implement, but adding a vsync 60fps cap would probably do worlds to increase the smoothness.

Carra:The cars also look a bit weird. Not sure what it is: their constant speeds instead of accelerating? The fact that it's only lights?

It could be the street crossings. That’s at least what I noticed, the lines of cars just sort of moved through each other. Probably waaay too much work to change,though(I wouldn’t even know where to begin).

Shamus,
I’m also a lurker. I know nothing about programming, but enjoy reading these articles of yours as exercises in problem solving. Seeing the finished product makes the whole thing really jump to life.
I vote yes for screen saver.
While taking laziness into account, a followup project with Godzilla wrecking the place? Yes please!

Quick question: does anyone know if it would be easy to port this project to an OpenGL screensaver for a Linux machine? (and would that make it easier or harder to do a Mac port?)

There’s this awesome screensaver-wrapper program known as XScreenSaver which will take almost any graphics-generating program and run it as a screensaver. But I’ve never tinkered with the setup, so I don’t know.

[…] This is the work of Shamus Young, from Twenty Sided. In just 50 ours, the dude made a procedural city filled with street lights, cars and… oh yeah, buildings. Lots and lots of buildings. And he’s going to release the source code! I can’t wait to get my hands on it, only to realize I’m way over my head. […]

Enough with the feature requests! Shamus has sunk 50 hours into this, and it looks great!
What we need now is for other hobbyist coders to grab the source code when Shamus releases it, and take Pixel City in their own directions. We can follow these coders, and harass them into implementing our every feature wish, no matter how complex or arbitrary. Let Shamus be :P

I’m going to agree with some of the above comments that the “cars” look really fake, all the same speed, always moving, never stopping, never turning. Everything else looks so nice, and it seems like there must be some way to procedurally generate some more realistic traffic patterns.

The only thing that I noticed was the car headlights all moving at the same speed. For some reason seeing the lights all progressing at the same rate as the cars on the streets parallel to them seemed odd to my brain.

Those who read the previous entries should remember that Shamus actually did do more realistic traffic patterns. But they weren’t coming out right, so rather than spend a ton more time over-simulating, he reverted to fake traffic.

And as somebody who is graduating in urban planning in 4 weeks and has a soft spot for urban 3D modeling, I can tell you that some people would kill to be able to do the kind of magic you just created in 50 hours of work … ;)

If there is any possibility, I would really appreciate if you could turn this into a screen saver. Maybe with some options to lower the level of detail, because otherwise I’m not sure my poor Thinkpad will be able to display it properly…

Wow. I haven’t commented in a while, but I have been following fairly closely. I too would like to know the secrets behind the office tower names. It certainly lends some extra realism to the scene. Also, Shamus, during some of the earlier shots where the city can be seen to be drawn, it appears as though the aircraft warning lights (for want of a better name) are drawn before the buildings are. My assumption is that by the time everything is drawn all elements have been calculated and that the lights are simply drawn first.

At any rate, you deserve all the commendations heaped upon you here, as much for revealing your process as for actually doing it. And, for the record, I would like to pass on my congrats for your ever-widening impact on the electronic world.

Not much to add here, other than: congrats! It looks beautiful. Yes, there are a couple of small things that can be improved (mainly street lights IMO), but it’s already quite a stunner. I hope you enjoyed doing it!

It is sooo cool to see someone think of something neat, “I wonder if I can make good looking city scape using simple tricks and procedural generated content”, then think, “hey, why don’t I blog the whole process so other people can watch”.

Wow, this is great.
It’s amazing what a few effects can make our eyes believe it’s real =)

There just came one question to my mind.
You have this moving cam (and if you release it as screensaver, this will surely be part of it). What happens with the cars if your watching the city for a 180Â° turn of the cam?
At the beginning, the red and white car-lights are positioned as we are used to it (drivin on the right side of the street). But if the cam turns 180Â°, will the red lights drive towards the camera on the left side?

Belzi.ET: Cars look at where they are relative to the camera when deciding what color to be. In development (non-screensaver) mode you can aim the camera straight down and see them flip colors as they go by.

Can the stuff be rendered on the fly? Such that if you travel forward you plot out and render buildings before they come into view (and chuck the ones behind after a certain point for memory saving), and this have the “endless city” screen saver? The PoV could have a random walk travel path (straight travel, banks, climbs, dives) and you would always have city.

One Trackback

[…] This is the work of Shamus Young, from Twenty Sided. In just 50 ours, the dude made a procedural city filled with street lights, cars and… oh yeah, buildings. Lots and lots of buildings. And he’s going to release the source code! I can’t wait to get my hands on it, only to realize I’m way over my head. […]