Connect with us

Tech

Citybound – city building game using actor-based distributed simulation

Published

on

Citybound – city building game using actor-based distributed simulation

A city building game that uses microscopic models to vividly simulate the organism of a city arising from the interactions of millions of individuals.

People on the move, businesses in trade, neighbourhoods changing. Each inhabitant struggling, adapting, making life choices. The city evolves, the city grows. The city is us.

See and inspect all aspects of city life, across many scales of time and space.

Shape your city by sketching detailed project plans for infrastructure and zones.

Implement projects, decide on budgets and make government decisions.

Citybound has an ambitious vision and is developed as a largely one-man open-source effort. Follow my creation process on the DevBlog and the Citybound community on Reddit. If you are brave, try out the experimental live builds. Citybound is proudly community-funded.

Micro-Economy Simulation

In Citybound, every single household (a family or a business) is individually simulated. Each household has a home, and the daily activities of its family members or employees are driven by the resources the household needs and offers. Each household maintains a precise real-time inventory of its resources, which not only include tangible goods like groceries, raw materials, or money, but also intangible concepts like sleep, health, recreation, work-force, touristic interests or business services.

Economic patterns arise directly from household interactions. To fulfil its human or business needs, each household tries to find attractive “trade-partners” for each resource, factoring in price and quality differences, but also local reachability based on transport conditions. Households re-prioritise their needs throughout the day, leading to natural patterns of commute, shopping or logistical transport trips.

Future work: Pre-simulating local trade conditions to determine attractiveness of real estate, thus influencing immigration, development and city growth. Scaling the system to high-density buildings and large populations in the millions.

Details & Inspiration ▾

  • The original inspiration for simulating cities at the level of individuals and their interactions (and starting Citybound in the first place) came from SimCity (2013), which, however, only implemented a very superficial version of that (modelling people more like fluids with sources and drains)

Papers:

  • Kim, D. (2012). Modelling Urban Growth : Towards an Agent Based Microeconomic Approach to Urban Dynamics and Spatial Policy Simulation
  • Koomen, E., Diogo, V., Dekkers, J., & Rietveld, P. (2015). A utility-based suitability framework for integrated local-scale land-use modelling.
  • Waddell, P., Borning, A., Noth, M., Freier, N., Becke, M., & Ulfarsson, G. F. (2003). Microsimulation of Urban Development and Location Choices: Design and Implementation of UrbanSim.
  • Park, I. K., & von Rabenau, B. (2011). Disentangling agglomeration economies: Agents, sources, and spatial dependence.
  • Tiglao, N. C. C. (2005). Modeling Households and Location Choices in Metro Manila.
  • Weidner, T., Moeckel, R., & Brinckerhoff, P. (2011). SILO: A Land-­Use Model For Integrated Modeling.
  • Beckmann, K. J., Brüggemann, U., Gräfe, J., Huber, F., Meiners, H., Mieth, P., … Wegener, M. (2007). ILUMASS Integrated Land-Use Modelling and Transportation System Simulation.

Microscopic transport Simulation

The efficient flow of traffic through transport infrastructure is vital for a city’s health. Traffic is spontaneously determined by the micro-economic goals of its participants – and chaotic events are at the heart of traffic. That’s why in Citybound every single trip of every person is simulated microscopically. Hundreds of thousands of cars physically move along roads and have to break, accelerate and change lanes in traffic to safely get to their destination.

Future work: Other modes of transport (pedestrians, light & heavy rail, airports, etc.). Multi-modal pathfinding (combining walking, public transport, taxis and driving to reach destinations).

Details & Inspiration ▾

  • Microscopic traffic simulation was the first part of Citybound that I implemented – my strategy was to show of that I could make this very computation-intensive part of city simulation scale to city sizes of millions of inhabitants. With already early prototypes being able to simulate up to 400,000 cars in real-time, this would suffice for cities of population ~4 million.
  • Because the road network is subject to frequent change in Citybound, many static pathfinding methods that require long pre-computation but offer fast run-time lookup are unsuitable. Pathfinding information in Citybound is stored in the road network itself and is dynamically updated and propagated through the network, similar to internet routing tables.

Papers:

  • Blatnig, S. (2008). Microscopic Traffic Simulation with Intelligent Agents.
  • Liberti, L. (2014). 14th Workshop on Algorithmic Approaches for Transportation Modelling, Optimization, and Systems.
  • Sturtevant, N., & Buro, M. (2004). Partial Pathfinding Using Map Abstraction and Refinement.

haptic collaborative

planning

The core principle of interacting with the game world in Citybound is through planning. This gives you the ability to preview effects of even large-scale projects in your city, to undo and redo and to combine different ideas. Smart paint-gestures become beautifully curved roads and perfectly shaped zones, offering the power and expressiveness of professional CAD tools while being much more intuitive and fun to use.

Precise management of plan updates not only enables smooth interactive editing of even huge cities, but also makes collaborative multiplayer planning possible, where several people can play in and work on the same city together in real time.

Future work: Planning with 3D features like bridges and tunnels. Preview of financial and political impact of planned projects.

Actor-Based distributed simulation

To realise Citybound’s vision of simulating large-scale cities and streaming them to browsers for interaction, I had to invent and implement quite an unusual computation architecture. Actors and message passing are the key concept in Kay, my actor-system framework that elevates Citybound’s simulation logic from its transparently networked and easily scalable underpinnings. Implemented in Rust, it allows type-safe and high-performance actor updates and inter-actor communication, with low-level optimisations for cache-locality while offering high-level features like distributed dynamic dispatch and broadcast messages.

Details & Inspiration ▾

  • The main inspiration for my approach was my experience with the Erlang programming language for distributed systems.
  • Kay has relatively few features and abstractions in comparison, but that allows a focus on high-performance, with minimal actor and message footprints in memory.
  • The consolidated layout of actor state in memory and the mechanisms for handling broadcast messages that are received by up to millions of actors are heavily inspired by Data Oriented Game Engine Design, the core ingredient in the highly successful pattern of Entity-Component Systems.

RUSt-WASM-JS Bridge

Compiling Kay to WebAssembly allows running a fully fledged actor system node in the browser, which can communicate with the simulation backend through type-safe high-performance messages and do computation-intensive preparation work for rendering, before efficiently serialising and passing rendering-relevant information as JavaScript objects to a React app that implements the rest of the UI. The React app can call Rust hooks that were exported to JavaScript, to send Kay messages back to the simulation backend for influencing the game world based on player input.

Reactive 2D+3D UI framework

Defining a combined 2D and 3D UI to interact with Citybound’s quite complex planning and simulation objects is a difficult task. Reactive, component-based frameworks with clear information flow heavily simplified 2D UI development in recent years. I extend React with my Monet library, applying React’s principle (wrapping stateful updates in a declarative, functional API) to WebGL rendering and GPU resource management. In addition, I define a new kind of React component representing an interactive shape in a 3D world. Taken together, this allows me to fully define the 2D and 3D appearance and interactivity of a game object in a single React component.

Robust high-performance geometry kernel

Almost every object in the Citybound world can be arbitrarily shaped, be it roads, zones or building lots – and their exact shape typically results from complex geometric operations between other objects. My Descartes library provides everything from simple path operations to vast polygon-overlay tasks, with a focus on performance and topological robustness despite approximation and inaccuracies.

Incremental computation framework

To provide real-time interactive editing of large city plans and to minimise bandwidth usage between UI and server while streaming plan result previews, it is vital to have a precise formalisation of how changes in plan input affect plan results, and then communicating only the differences. Currently implemented ad-hoc in a monolithical planning manager, this approach will be generalised and translated into a distributed framework to allow plans to scale beyond one backend server.

Details & Inspiration ▾

Papers:

  • Matthew A. Hammer, Joshua Dunfield, Kyle Headley, Nicholas Labich, Jeffrey S. Foster, Michael W. Hicks, David Van Horn. Incremental computation with names – also see adapton.org

Procedural geometry pipeline

The fact that almost all geometry in Citybound is procedural is both an opportunity and a challenge. Early work has begun in my Michelangelo library that will provide expressive shape-grammars to describe architecture styles or natural shapes based on extrusions, which can then be evaluated on demand to generate optimally-batched meshes and instance-arrays with dynamic level of detail and animated components.

Details & Inspiration ▾

Papers:

  • Kelly, T., & Wonka, P. (2011). Interactive architectural modeling with procedural extrusions.
  • Kelly, T. (2013). Unwritten Procedural Modeling with Skeletons.

The city is us. © Anselm Eickhoff

Read More

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published.

Tech

Nothing announces official launch date for new Ear (stick) AirPods alternatives

Published

on

By

Nothing announces official launch date for new Ear (stick) AirPods alternatives
Nothing Ear (stick) held by a model on white background



(Image credit: Nothing )

True to form, Nothing has just announced the full reveal date for its upcoming audio product, Ear (stick). 

So, an announcement about an announcement. You’ve got to hand it to Carl Pei’s marketing department, they never miss a trick.

What we’re saying is that although we still have ‘nothing’ conclusive about the features, pricing or release date for the Ear (stick) except an image of another model holding them (and we’ve seen plenty of those traipsing down the catwalk recently), we do have a date – the day when we’ll be granted official access to this information. 

That day is October 26. Nothing assures us that on this day we’ll be able to find out everything, including pricing and product specifications, during the online Ear (stick) Reveal, at 3PM BST (which is 10AM ET, or 1AM on Wednesday if you’re in Sydney, Australia) on nothing.tech (opens in new tab)

Any further information? A little. Nothing calls the Ear (stick), which is now the product’s official name, “the next generation of Nothing sound technology”, and its “most advanced audio product yet”. 

But that’s not all! Apparently, Ear (stick) are “half in-ear true wireless earbuds that balance supreme comfort with exceptional sound, made not to be felt when in use. They’re feather-light with an ergonomic design that’s moulded to your ears. Delivered in a unique charging case, inspired by classic cosmetic silhouettes, and compactly formed to simply glide into pockets.” 

Opinion: I need more than a lipstick-style case

Nothing Ear (stick) – official leaked renders pic.twitter.com/FrhKmRttmiOctober 1, 2022

See more

It’s no secret that I want Nothing’s earbuds to succeed in world dominated by AirPods; who doesn’t love a plucky, eccentric underdog? 

But in order to become some of the best true wireless earbuds on the market, there is room for improvement over the Nothing Ear 1, the company’s inaugural earbuds. 

Aside from this official ‘news’ from Nothing, leaked images and videos of the Ear (stick) have been springing up all over the internet (thank you, developer Kuba Wojciechowski) and they depict earbuds that look largely unchanged, which is a shame. 

For me, the focus needs to shift from gimmicks such as a cylindrical case with a red section at the end which twists up like a lipstick. Don’t get me wrong, I love a bit of theater, but only if the sound coming from the earbuds themselves is top dog. 

As the natural companions for the Nothing Phone 1, it makes sense for the Ear (stick) to take a place similar to that of Apple’s AirPods 3, where the flagship Ear (1) sit alongside the AirPods Pro 2 as a flagship offering. 

See, that lipstick case shape likely will not support wireless charging. That and the rumored lack of ANC means the Ear (stick) is probably arriving as the more affordable option in Nothing’s ouevre. 

For now, we sit tight until October 26. 

Becky is a senior staff writer at TechRadar (which she has been assured refers to expertise rather than age) focusing on all things audio. Before joining the team, she spent three years at What Hi-Fi? testing and reviewing everything from wallet-friendly wireless earbuds to huge high-end sound systems. Prior to gaining her MA in Journalism in 2018, Becky freelanced as an arts critic alongside a 22-year career as a professional dancer and aerialist – any love of dance starts with a love of music. Becky has previously contributed to Stuff, FourFourTwo and The Stage. When not writing, she can still be found throwing shapes in a dance studio, these days with varying degrees of success.  

Read More

Continue Reading

Tech

YouTube could make 4K videos exclusive to Premium subscribers

Published

on

By

YouTube could make 4K videos exclusive to Premium subscribers
Woman watching YouTube on mobile phone screen



(Image credit: Shutterstock / Kicking Studio)

You might soon have to buy YouTube Premium to watch 4K YouTube videos, a new user test suggests.

According to a Reddit thread (opens in new tab) highlighted on Twitter by leaker Alvin (opens in new tab), several non-Premium YouTube users have reported seeing 4K resolution (and higher) video options limited to YouTube Premium subscribers on their iOS devices. For these individuals, videos are currently only available to stream in up to 1440p (QHD) resolution.

The apparent experiment only seems to be affecting a handful of YouTube users for now, but it suggests owner Google is toying with the idea of implementing a site-wide paywall for access to high-quality video in the future.

So, after testing up to 12 ads on YouTube for non-Premium users, now some users reported that they also have to get a Premium account just to watch videos in 4K. pic.twitter.com/jJodoAxeDpOctober 1, 2022

See more

It’s no secret that Google has been searching for new ways to monetize its YouTube platform in recent months. In September, the company introduced five unskippable ads for some YouTube users as part of a separate test – an unexpected development that, naturally, didn’t go down well with much of the YouTube community. 

A resolution paywall seems a more palatable approach from Google. While annoying, the change isn’t likely to provoke the same level of ire from non-paying YouTube users as excessive ads, given that many smartphones still max out at QHD resolution anyway. 

Of course, if it encourages those who do care about high-resolution viewing to invest in the platform’s Premium subscription package, it may also be more lucrative for Google. After all, YouTube Premium, which offers ad-free viewing, background playback and the ability to download videos for offline use, currently costs $11.99 / £11.99 / AU$14.99 per month.

Suffice to say, the subscription service hasn’t taken off in quite the way Google would’ve hoped since its launch in 2014. Only around 50 million users are currently signed up to YouTube Premium, while something close to 2 billion people actively use YouTube on a monthly basis. 

Might the addition of 4K video into Premium’s perk package bump up that number? Only time will tell. We’ll be keeping an eye on our own YouTube account to see whether this resolution paywall becomes permanent in the coming months.

Axel is a London-based staff writer at TechRadar, reporting on everything from the newest movies to latest Apple developments as part of the site’s daily news output. Having previously written for publications including Esquire and FourFourTwo, Axel is well-versed in the applications of technology beyond the desktop, and his coverage extends from general reporting and analysis to in-depth interviews and opinion. 

Axel studied for a degree in English Literature at the University of Warwick before joining TechRadar in 2020, where he then earned a gold standard NCTJ qualification as part of the company’s inaugural digital training scheme. 

Read More

Continue Reading

Tech

Europe sets deadline for USB-C charging for (almost) all laptops

Published

on

By

Europe sets deadline for USB-C charging for (almost) all laptops

USB-C als Ladestandard in der EU

Mundissima / Shutterstock


Author: Michael Crider
, Staff Writer

Michael is a former graphic designer who’s been building and tweaking desktop computers for longer than he cares to admit. His interests include folk music, football, science fiction, and salsa verde, in no particular order.

Read More

Continue Reading

Trending

Copyright © 2022 Xanatan