uriopass / egregoria Goto Github PK
View Code? Open in Web Editor NEW3D City Builder without a grid
Home Page: http://douady.paris/blog/
License: GNU General Public License v3.0
3D City Builder without a grid
Home Page: http://douady.paris/blog/
License: GNU General Public License v3.0
Either using scancodes instead of virtual key codes or adding input remapping support would fix this.
Either way, I think that it's important that this works out of the box for everyone.
Having to change basic controls at the start would not be a good first impression.
Neither moving the mouse to the screen edges nor arrow keys worked. Restarting the game solved the issue. One thing I noticed was that the screen pivot point was located at 0,0.
Buildings need to have an interior with different rooms and furnitures. The pedestrians need to be able to move in it.
Some kind of introduction guide that helps a new player to create a small city like in the youtube demo.
Can be hosted on github's wiki and linked somewhere at the start.
Currently, cars can get stuck in a 3-way (or more) gridlock since the priority system only looks at couples.
So if cars A, B and C each want to let another car go in cycle, a gridlock happens.
This is a very hard problem though, since some global authority (intersection based ? Cluster based ?) Need to be put in place (or maybe not, see comment).
Hi, I was toying with the idea of making a traffic simulator in Rust, and I was trawling the web trying to figure out which graphics library or game engine to use (Amethyst, ggez, gfx, wgpu, vulkano, glium, gd, the list goes on and on), or whether I should be using 2D or 3D, and I found Egregoria, which seems to have things in common with what I wanted to make.
I'm wondering how best to talk to you or other people working on this about what's going on?
Water is currently represented by just blue terrain, nice water can give a cool vibe.
At the moment, pedestrian entities and car entities are very different, and a pedestrian cannot "hop into" a parked car.
Parked car just randomly unpark and start to drive around.
Ideally, there would be some way of seeing the interior of a car but maybe not for now.
Inspect different informations about a building.
Steps:
egui
panel for the buildings (such as information from the BuildingInfos
resource), their recipe for a GoodsCompany
...Buildings roofs are a bit weird right now being all gray. Maybe keep the gray roofs for the supermarkets/companies (with an outline) but make actual "3D" roofs for the buildings.
I've tried coding the straight skeleton algorithm in Rust but I gave up. Might try again some day.
Bevy did it, there's probably a way to do it too, could speed up iterative compile time quite a bit. Would be cool to dynamic link winit there too.
So that when modifying the game logic, the rendering doesn't get recompiled.
Currently blocked by: Color/LinearColor in egregoria::rendering and
KeyCode/KeyboardInfo/MouseButton/MouseInfo
Sounds and music greatly improve immersion. There needs to be a sound layer someday.
Rodio is good and compatible with winit now. There's also 2 musics ready for release in resources/music{1,2}.ogg
Just calling cargo run
using the latest stable rust compiler crashes on macOS / M1 MacBook.
Environment:
macOS Monterey 12.4
rustc 1.61.0 (fe5b13d68 2022-05-18)
MacBookPro18,2 / Apple M1 Max
Stacktrace:
❯ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/native_app`
[ 76790 INFO instance ] Adapter Metal AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: DiscreteGpu, backend: Metal }
[ 76991 ERROR /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:828] Error in Adapter::request_device: unsupported features were requested: SPIRV_SHADER_PASSTHROUGH
thread 'main' panicked at 'could not find device, have you installed necessary vulkan libraries?: RequestDeviceError': /Users/sirpalee/projects/Egregoria/wgpu_engine/src/gfx.rs:163
0: backtrace::backtrace::libunwind::trace
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/libunwind.rs:93:5
backtrace::backtrace::trace_unsynchronized
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:66:5
backtrace::backtrace::trace
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/backtrace/mod.rs:53:14
backtrace::capture::Backtrace::create
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:176:9
1: backtrace::capture::Backtrace::new
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.65/src/capture.rs:140:22
2: log_panics::init::{{closure}}
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/log-panics-2.0.0/src/lib.rs:52:25
3: std::panicking::rust_panic_with_hook
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
4: std::panicking::begin_panic_handler::{{closure}}
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:588:13
5: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:138:18
6: rust_begin_unwind
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
7: core::panicking::panic_fmt
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
8: core::result::unwrap_failed
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/result.rs:1785:5
9: core::result::Result<T,E>::expect
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/result.rs:1035:23
10: wgpu_engine::gfx::GfxContext::new::{{closure}}
at wgpu_engine/src/gfx.rs:152:31
11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/future/mod.rs:91:19
12: futures_executor::local_pool::block_on::{{closure}}
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.21/src/local_pool.rs:315:23
13: futures_executor::local_pool::run_executor::{{closure}}
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.21/src/local_pool.rs:90:37
14: std::thread::local::LocalKey<T>::try_with
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/thread/local.rs:442:16
15: std::thread::local::LocalKey<T>::with
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/thread/local.rs:418:9
16: futures_executor::local_pool::run_executor
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.21/src/local_pool.rs:86:5
17: futures_executor::local_pool::block_on
at /Users/sirpalee/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.21/src/local_pool.rs:315:5
18: native_app::context::Context::new
at native_app/src/context.rs:58:19
19: native_app::main
at native_app/src/main.rs:27:19
20: core::ops::function::FnOnce::call_once
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227:5
21: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:122:18
22: std::rt::lang_start::{{closure}}
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:145:18
23: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:259:13
std::panicking::try::do_call
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
std::panicking::try
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
std::panic::catch_unwind
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
std::rt::lang_start_internal::{{closure}}
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:128:48
std::panicking::try::do_call
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
std::panicking::try
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
std::panic::catch_unwind
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
std::rt::lang_start_internal
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:128:20
24: std::rt::lang_start
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:144:17
25: _main
@Uriopass Hi, I started using Rust a few months ago and I'm looking for an interesting project like yours to work on.
I'm really interested in human society simulations so if you need help with anything right now, I would be pleased to help.
There should exist a social network between people, which fluctuates over time. The relations between people should be taken into account when planning activities together.
Allow people to entertain themselves through external activities such as cinema, sport, parks, etc.
Freight/passenger trains are undoubtedly cool looking and fun to play with. Although it might take a bit of time to implement, my experience with the road system should make it easier to build, at least for the tracks.
Also, subway make a city faster and could solve some traffic issues.
When 100k cars are in, heap exceded errors are thrown.
Currently, instances are matrix fours, whereas they should hold in vec4 (position + rotation)
Shouldn't be that complicated, but still needs to be done. Current single shadow map is just a bit sad.
Legion looks like it has all the features I want and a very nice API:
I haven't see integrated event management like in bevy (Deleted, Modified)
but I've seen something like maybe_changed. Need to dig deeper.
At the moment, when a car is unparking they just do so without checking if there's anything in the way.
Since they just follow a predefined trajectory, they end up colliding.
One could use the collision world to check that no car is nearby before unparking.
Add workplaces, which means a building generator and some sort of company model.
From Wikipedia:
An economy is an area of the production, distribution and trade, as well as consumption of goods and services by different agents.
For the first try at economy in this project, I plan to center it about food.
I'll have as economic agents:
The food will magically appears in supermarkets, though it would be better if it came from somewhere like farms.
It will be distributed in supermarkets, and consumed by people. Money would be a good way to monitor what interactions happen and what needs balance.
People will earn money by working in companies, though those companies won't do anything interesting yet.
Might update this issue when I develop this idea further (feel free to comment with your thoughts if you're reading this though).
On a 4k monitor it's almost unreadable. On a FHD monitor it's still uncomfortably small.
Ideally a setting for UI scale would be nice, but a larger hardcoded/default value would already help a lot.
Making buildings is cool, but where do we put them ?
There are many approaches to partition space for construction terrain.
Partition like Cities:Skylines, where the side of the roads are cut into rectangular pieces which are then used by predefined homes that occupies a certain amount of rectangles.
Partition the way buildings are made in Paris, where faces from the road graph are detected and extruded to form little quads or triangles which represents the buildings. No pathway needed since they are all directly on the road.
Just place houses randomly and check if they don't intersect anything, which is the current approach but is not very satisfying.
A mix of 1 and 2
1 for suburbs and 2 for city center
5?) ??
I probably want to go with option 1 for Egregoria 0.2 since I got a reference (Cities Skylines) and the region where buildings are placed are rectangular which is easier to manage for buildin+pathway generation than an arbitrary convex polygon
To check out: some discussions on zoning
https://forum.paradoxplaza.com/forum/threads/my-proposal-for-a-better-zoning-system-less-gaps-bigger-plot-sizes-intuitive-usage.883848/
Rain, drought, seasons, all that. Could make some interesting economic patterns.
Probably the source of the "couldn't decode shader" bug
Time is important, and one of the easy way to show time passing is having a day/night cycle.
What I'm thinking for a basic one is to have a post-processing shader taking a list of light sprites to multiply with the actual screen color.
Would look something like this.
I also need to upgrade the TimeInfo struct (rename it to GameTime probably) and add useful helpers like time-of-day, date, seconds_until etc.
Introduce a bicycle shop and allow people to cycle to work or anywhere. I'm not entirely sure where they would park their bike though, maybe bike parkings could be alongside most roads ?
Once the house generator is done, and cars are unified, there needs to be some central place to associate civilian with the things it own, such as his house, cars, money .. ?
Enable faster spatial queries such as: check for collision for a point on the map without looping over all roads.
Should be easily fixed after
Uriopass/flat_spatial#2
Birds, cows, dolphins, whatever. Should make things more alive.
Trees would give a lot more depth to the world but it is surprisingly complicated to make trees pretty from above.
Here's some failed attempts and references to try and think about it:
If you have an idea and want to talk about it, join the discord !
Pave a way for people to go inside buildings
When trying to enhance the car AI, I wish there was some sort of automated "car scenarios" test where I could check if
a) No collisions happened
b) No gridlocks happened
c) How fast they went to their objective
For example, two cars in front of each other wanting to go forward, this is tough and cannot be resolved at the moment but maybe someday they could both chose to go right to avoid each other.
Another example is two cars going perpendicular to each other, where one must stop to let the other pass, this works at the moment but if I had an automated test to prove it it would be great.
The current black/grid background is getting a bit old, maybe adding some green background with trees and lakes would make everything more coherent.
Make basic house generator with a few templates and without interiors.
Depends on #21
There were some breaking API changes. Need to check where it crashes or doesn't compile and fix it.
Eventually, I want to have an Egregoria client running on wasm, however this is currently blocked on:
Instead of an island, the world should be situated on a beach or something open so that the city can engage with exterior trading.
That way, a small city can still get access to goods they can't have without a lot of work like electronics, cars or petrol.
Like in cities skylines, I can imagine a sort of highway coming from infinity that has allows connection to the global market.
This has to be done in three steps
Add a first-person camera selectable in the settings.
Should not allow collision with the ground and have a speed dependent on the height of the camera.
Currently, drawing the map is incredibly expensive, recalcuating the noise function for every pixel every frame. On mid-tier hardware this is a lot of wasted power.
Some lazy chunk based texture generation with lod would be much better.
The economy UI could probably be a bit more interesting. Currently only showing offer/demand is a bit shallow. Even some ideas about this would be cool.
People have an education level and might go to school, college, universities or others to educate themselves.
Current house generation based on skeleton algorithm is incredibly flaky, probably something better could be done. Rather self-contained, good first issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.