Egregoria: 3D City Builder without a grid
github.com
github.com
I did not expect to end up on hackernews that early. While I've been working on this project on and off for 3 years it is still in its infancy. I have so many things I want to rewrite, so many features missing even for the most basic game loop. So many 3D models I have to make.
And so little time! Working on this as a side project with a full time job has been hard at times. I do not recommend making city builders :D
I wish I anticipated the attention so I would have given the README bit more love.
Anyway, I will try to answer any questions in the comments.
How can it be any less obvious what Spectra is. Haha.
Seems it's built mainly for spatial.io which has WebXR support but also native apps for iOS, Android and Quest.
(I say this because the performance is probably better on the native apps)
It would be cool to have more bike/pedestrian/train/mass transit transportation options available, instead of cars and trucks being the default option. Also tooltips would be really helpful.
I feel like there's almost enough here that you could do steam/itchio.
I love tooltips! Thank you for the suggestion, I have opened an issue.
>I feel like there's almost enough here that you could do steam/itchio.
I think it's way too early for this. As people say the last 20% takes 80% of the time. There's a lot of systems I've neglected for an actual release. It probably needs a few years more work before any kind of "real" release for players instead of developers.
All the blocks are there and the language is really well suited to games.
On top of my head:
The pros:
- The crate ecosystem and the package manager makes it really easy to integrate any useful component such as pathfinding, spatial partitioning, graphics backend, audio system.. Most crates take a lot of effort to be cross-platform so I can develop on linux and not spend too much time debugging windows releases.
- The strong typing and algebraic data types makes expressing the game state very pleasant. I also found I was able to develop a very big game without too many bugs even though I don't write many tests.
- Ahead of time compilation + LLVM guarantees you won't have to optimise for weird things around a virtual machine. Rust gives you more control to optimise hot loops as you can go low-level.
- I find wgpu to be the perfect balance between ergonomics and power compared to Vulkan. OpenGL support through wgpu is also a nice addition for lower end devices.
- The Rust community is very helpful, you can often talk directly to crate maintainers
The cons:
- Compilation times, when compared to JITed languages such as C# can be very painful. It can be alleviated by buying a 3950X but I still often get 10-30s iteration times.
- The static nature of Rust means you often need a dynamism layer above to tweak stuff that can be awkward to manage. I made inline_tweak for this purpose but it's really far from how easy Unity makes it. https://github.com/Uriopass/inline_tweak
- Since Rust feels very ergonomic, you are tempted to write almost all game logic within it, so mod support feels very backwards to implement as you cannot really tweak "everything" like in Unity games. Thankfully "Systems" game like Factorio or Egregoria can be theoretically split into the "simulation" and the "entities" so mod can still have a great impact. Factorio is built in C++ so has the same problematic. Their Lua API surface is quite insane to be able to hook into everything. https://lua-api.factorio.com/latest/
Now, I have to talk about Bevy: https://bevyengine.org/. It did not exist when I started but it is a revolution in the Rust gamedev space. It is a very powerful 100% Rust game engine that makes you write game code in Rust too. It has incredible energy behind it and I feel like if I'd used Bevy from the start I wouldn't have had to develop many core engine systems. Its modular design is also incredibly pleasant as you can just replace any part you don't like with your own.
A lot like watching little ants going around doing their business. This idea is also explored in one of the books of the Ants trilogy from Bernard Werber (I think?) where a society simulation is used to try out advertising campaigns.
- 3D assets
- Audio assets
- UI/UX design
- Low-level graphics shenanigans (platform support, debugging tools, dos-and-donts, optimizations)
- Simulation depth (logistic chain, economics, city services..)
- Mod support
Any help with these would be greatly appreciated
For me, it sounds like city models such as cars and buildings will be one of the easiest models to generate (from what I have seen in papers).
As an indie dev myself I'm counting on that I will be able to buy most 3D content for a fraction of time/cost in a couple of years. And I plan my development around this and ignore art assets for now.
In practice however I didn't see any real good generated 3D asset for now. The problem is probably much harder as there are far more 2D assets than 3D, especially with PBR support.
License looks open. Very demanding hardware requirements (8 A100s).
That is 2D though.
Im working on a game in the same vein: Metropolis 1998, a city builder with real time traffic and interior building views, which you can design yourself if you want. Aesthetically, it's a beautiful throwback to the games I grew up playing as a kid.
Keep up the good work on Metropolis 1998! I have followed your work and the dev community you built around it and it is very inspiring.
However yes the pressure is different than full time job
But yes, I'm really not ready for that kind of pressure and marketing efforts. I feel - and even more so since Cities:Skylines 2 announcement - that there isn't enough I can do alone to turn this into a full-time job.
That game was way ahead of its time. I just want a 2023 version, but just couldn't seem to find it. Every successor game and other games seem to either focus on details/individuals or 3D effects with far less scale.
We have far more capable hardware to run large cities and more growable lots and better traffic pattern. But a better Simcity 4 is never made beyond the 20 years old base game code and addons... Or am I oblivious?
However I do think that Simcity 4 being grid-based, and the pre-rendered graphics it allows add to how beautiful the game still is, 20 years later. Cities: Skylines looks good, but I suspect it will age much faster.
There's nothing wrong with that, since software does last far longer than hardware does. But the limitation shows (i.e. limited to 1080p, limited calculation logic to support hardware spec of the time).
I wonder if there's any scale first city building games that picks up that niche since.
To build an apartment building, you need prefab panels. To get panels, you need to build a panel factory, which needs gravel. To get gravel, you need a quarry. And then you need vehicles to haul the gravel to the panel factory. And then the panels to the construction site. And buses to bring workers from another housing block to the construction site. And you need to import or produce fuel, and electricity, to run all of it. (Or you can just spend some currency you've earned from exports to build it or import it instantly. Necessary at the start to get your nucleus of industry going.)
It's almost ready for official 1.0 release later this year, and has excellent mod support for custom buildings/industries.
[1] https://store.steampowered.com/app/784150/Workers__Resources...
This 1996 talk by Will Wright to Terry Winograd's user interface class at Stanford takes a deep dive into SimCity 2000's design, what made it so successful, and how it compared to other less successful Maxis games. It includes a retrospective of SimEarth, SimAnt, and SimCity 2000, and a preview of The Sims (called Dollhouse at the time).
I attended the talk and took notes, which I had Will review, and years later (after working with Will at Maxis and EA on The Sims) updated it with more details and retrospective learned by developing The Sims.
Just this year I discovered that the Stanford Library had finally published the video of that talk and many others, so I made a transcript and updated the article with lots more quotes and screen snapshots and analysis.
Egregoria looks really cool and impressive, and I'm glad to see it carry on the tradition, benefit from the inspiration, and learn from the successes and shortcomings of the SimCity and City: Skylines franchises, and other great simulation games like Factorio.
Will Wright on Designing User Interfaces to Simulation Games (1996) (2023 Video Update):
https://donhopkins.medium.com/designing-user-interfaces-to-s...
>A summary of Will Wright’s talk to Terry Winograd’s User Interface Class at Stanford, written in 1996 by Don Hopkins, before they worked together on The Sims at Maxis. Now including a video and snapshots of the original talk!
Will Wright - Maxis - Interfacing to Microworlds - 1996-4-26:
https://www.youtube.com/watch?v=nsxoZXaYJSk
>Video of Will Wright's talk about "Interfacing to Microworlds" presented to Terry Winograd's user interface class at Stanford University, April 26, 1996.
>He demonstrates and gives postmortems for SimEarth, SimAnt, and SimCity 2000, then previews an extremely early pre-release prototype version of Dollhouse (which eventually became The Sims), describing how the AI models personalities and behavior, and is distributed throughout extensible plug-in programmable objects in the environment, and he thoughtfully answers many interesting questions from the audience.
>This is the lecture described in "Will Wright on Designing User Interfaces to Simulation Games (1996)": A summary of Will Wright’s talk to Terry Winograd’s User Interface Class at Stanford, written in 1996 by Don Hopkins, before they worked together on The Sims at Maxis.
https://donhopkins.medium.com/designing-user-interfaces-to-s...
>Use and reproduction:
>The materials are open for research use and may be used freely for non-commercial purposes with an attribution. For commercial permission requests, please contact the Stanford University Archives (universityarchives@stanford.edu).
There is a budget, but after the first 30 minutes you'll always be running an enormous surplus without trying.
Citizen commute to work, but if they can't get there, the workplaces will continue to work, with some trivial penalty to efficiency.
There is traffic simulation, but if a jam forms, vehicles will start vanishing to unblock the road.
You can build public transport, but it doesn't matter if it's efficient, because the city's entire population can be standing at bus stops waiting forever with seemingly no ill effect.
Citizens will use parking spots if they're available, but if they aren't, they'll just disappear their car and reappear it later.
Zoned buildings get built and upgraded autonomously, but what gets built doesn't depend on economic factors, just on how many upgrade points are accrued from nearby services and attractions.
There is a large number of special buildings of various types that can be unlocked and built, but they all count as a tourist attraction and don't perform their actual function, they're effectively statues.
Cities Skylines is a bizarre un-game that has all the UX and presentation of a city simulator without any actual simulation.
Wanting traffic to visually flow in real-time speeds without having a 24-hour (real-time) day cycle.
If you want 1 day to be 60 minutes, and someone's commute takes 10 minutes, that means their car will be on the road for 33% of the game time, when in reality, a 10 minute commute would be 1.375% of a day's time. The result is the overall, there's FAR more traffic on the roads in C:S than is realistic.
Industrial especially just spawns far too much traffic, far more than is realistic. If you think 1 factory produces 5 semi-trucks worth of goods per day, but they spawn all those trucks in a 1-hour period and have them drive at real-time speeds, you end up producing 24x as many trucks as you should.
But as I said above, I don't think the problem is solvable and still make a fun game. You either have to make an in-game day take 24 hours, or make the cars animate faster.
The most recent example is KSP2 - they unironically have degraded the physics engine on purpose because the lead designer thought that wobbly rockets were fun. I think that person has never played KSP1, KSP2 is simply another soulless game with small injections of carefully controlled-dosage "fun".
The question that is hard to balance in sims like this is how do you make something like this a fun game. it's a pretty tricky balance.
Roads and cars still form a core part of the game, it doesn't support pedestrian-only streets or bikes, but density is so much easier to achieve. That + the grid means cities don't end up looking "suburban" and "car-centric".
With cars, anyone can go anywhere without thinking much, although it is a bit of an overstatement considering the time I have spent fighting gridlocks.
It's like 10 years old, but kind of scratches that simple old lifestyle itch without any war or fighting elements
I am still in the mid-early learning phase of Rust, but it's where I'm putting my learning juices in... and at this point I can consider myself a professional architectural 3D modeller (https://www.myminifactory.com/users/TheLazyForger).
Would be happy to contribute (in fact I opened a couple of issues right now), is there a Discord or equivalent? I couldn't seem to find it on the github readme.
The discord badge in the readme is not very big, here's the discord link:
EDIT: very impressive portfolio!
Joined the discord.
Oo this is cool. What simulated elements are present/planned so far? Is there like a mini economy and things like actor preferences implemented? I checked out the devblog and although aspects like 3D rendering are interesting, I'm more interested in the simulation details and mechanics.
For example, all of them have hunger state, have jobs assigned to them, a house etc.
So a single citizen will always go back where it lives everyday instead of a random house, it will try to go near its home to buy groceries. I've decided that they don't have money as I found it too hard to calibrate, but there is still "real" items like bread being exchanged.
It would be fun to see the kinds of emergent behavior that arises. Maybe even hook an LLM up and let it drive some narratives.
I like to think too that with sufficient fidelity a simulation of this sort may be useful in real world city planning/economic modeling/geopolitics.
Will be keeping a close eye on this :)
>I like to think too that with sufficient fidelity a simulation of this sort may be useful in real world city planning/economic modeling/geopolitics.
This was one of the early vision I had for this project: Simulating different economies to see which ones fared better. However I have kind of abandoned this as the realy world is just far too complex! Making a "normal" but different city builder seems a bit more achievable.
Every so often, citizens and companies (I call the abstraction a "Soul") look through everything they can do and pick the on with the highest utility score.
If they're hungry, they'll get food. If it's the time of day where they should work, they'll go to work, except if they're too hungry!
Or, specifically, for lack of a better term, a city(s) where all transportation is done through a ride sharing system, including autonomous vehicles and mass transit.
I’m guessing it’s a combination traffic and economic sim (to deal with issues like surge pricing).
But maybe it could examine questions like:
* do autonomous vehicles reduce the overall number of vehicles.
* lower necessary street capacity.
* can parking be moved outside the city center (for example overnight parking when demand is lowest and cars are idle/charging).
* how do pedestrian patterns change.
Etc.> After the success of SimCity, Maxis received numerous requests from various companies to develop simulations for their industries. After rejecting many requests from other companies, the team eventually agreed to make a prototype of SimRefinery for Chevron:
[SimRefinery was] a simulation of their refinery operation, for orienting people in the company as to how a refinery works. It wasn't so much for the engineers as it was for the accountants and managers who walked through this refinery every day and didn't know what these pipes were carrying. — Will Wright
I read about it many years ago, sadly forgot its name and a bit of searching didn't make it show up. So leaving this here in hope someone knows what I am talking about and drops a link. I'd like to read up on what happened to the project as well.
https://citymonitor.ai/community/2002-warsaws-mayoral-candid...
https://www.tracc.anl.gov/joomla/index.php/transims-visualiz...
> An Egregor is an autonomous psychic entity made up of, and influencing, the thoughts of a group of people. It represents emergence at its purest form, where individuals come together to become a collective force.
[ 2176412 ERROR C:\Users\user\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.16.0\src\backend\direct.rs:1174] Shader translation error for stage ShaderStages(NONE | FRAGMENT): FXC D3DCompile error (0x80004005): C:\Users\user\git\Egregoria\called `Result::unwrap()` on an `Err` value(432,18-24): error X3005: 'ddx': identifier represents a variable, not a function
(Windows 10)
> Unable to open libEGL
No idea where to get that.
And,
> thread 'main' panicked at 'texture not found at path: assets/sprites/blue_noise_512.png
> in Rust
> Egregoria is an indie city builder, mostly inspired by Cities:Skylines.
I tried to find out what techbuilt with and it seems like it's Unity and C# which surprised me a bit, but it's cool to hear.
- Egregoria is written in Rust directly using wgpu as a graphics backend and a custom "engine" which is not really an engine as it is built with only one game in mind
- Cities:Skylines is built in C# using Unity as the game engine
>This looks really good, congrats.
Thanks :)
Is 3d camera an important factor in a modern, complex city building game?
From the player perspective, 3D is the norm these days. It looks better, it's usually more intuitive and 2D is usually a bunch of tricks to fake 3D anyway.
From a developer perspective, 3D fits my brain better as I can translate real concepts better. To me, it feels easier modelling in blender and apply physically based rendering rather than learning lots of 2D techniques to have a consistent good looking art style.
One interesting change (but it's a big one, at least aesthetically) would be to force a certain angle of view, rather than allow a complete pan-tilt. Something in a "total war" fashion, so to speak. Or - at least - allowing such camera to be used in the options.
I remember when voice to text was expensive, now we have on-device neural networks working.