Giter Site home page Giter Site logo

citybound / citybound Goto Github PK

View Code? Open in Web Editor NEW
7.6K 214.0 320.0 6.04 MB

A work-in-progress, open-source, multi-player city simulation game.

Home Page: http://cityboundsim.com

License: GNU Affero General Public License v3.0

Rust 84.00% HTML 0.44% JavaScript 7.41% TypeScript 6.94% Less 1.21%
city simulation game rust actor-model

citybound's Introduction

Citybound

Citybound is a city building game with a focus on realism, collaborative planning and simulation of microscopic details. It is independently developed, open source and funded through Patreon.

citybound's People

Contributors

aeplay avatar beefsack avatar bkircher avatar bogdad avatar chances avatar chdudek avatar dependabot[bot] avatar herbstein avatar idonoghue avatar kingoflolz avatar manuel3108 avatar martinrlilja avatar neilw avatar o01eg avatar shanehandley avatar simplynaoh avatar sseemayer avatar tsteinholz avatar wopian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

citybound's Issues

Basic Road Decorations

  • Draw lane decoration based on overlaps
  • Draw traffic lights based on intersection state
  • Display removed lanes in plans in red
  • Draw lane decorations as decals

Game Crashing when Constructing Roads

Game crashed when building this roadstructure (pressing return)
Running on Win10 Anniversary
cityboundcrash

Edit: It crashes whenever two roads cross, one or two roads that do not cross work fine

Try waffle.io

Since you seem to be using GitHub Issues for task-tracking, I think you'd like waffle.io.

It presents a customizable set of your Issues tags as columns in a Trello-like view.

Here's what this repo looks like with the defaults they use for projects with no associated accounts:
https://waffle.io/citybound/citybound

Click the issue number in the top-left corner of a card to see more.

(Yes, you can use it to create/edit/delete things instead of the normal GitHub Issues UI when you're logged in. They also offer a badge you can embed into your README to show the number of tasks currently sitting in a column of your choice.)

They also recently added progress metrics, to help you keep track of yourself:
https://waffle.io/citybound/citybound/metrics-cta

Lane / Path representation

  • figure out how paths can be represented and how lanes build on top of that
  • implement all necessary geometry functions

Traffic Optimization

Debug Build (bound to be slow)

Setup 3x3 grid, spacing: 200

Old intersection implementation
672 lanes, 352416 connect replies

  • 4000 cars at 30ms

4549198 New intersection implementation
132 lanes, 17292 connect replies

  • 12000 cars at 30ms

Setup 6x6 grid, spacing: 200

480 lanes, 229920 connect replies

  • 12,000 cars at 30ms
  • 14,000 cars at 30ms 3b42cc0
  • 15,000 cars at 30ms 5c10950
  • 45,000 cars at 30ms e0e416a
  • 60,000 cars at 30ms a9ddee9
  • 85,000 cars at 30ms b253254
  • 110,000 cars at 30ms 4ba8980

Release Build

Setup 6x6 grid, spacing: 200

  • 400,000 cars at 5ms with some long frames a5de452

Basic Microscopic Car Behaviour

  • Cars have velocity, acceleration and max_velocity
  • Cars break for the car in front of them on the same lane
  • Cars break for the car on the next lane
  • Cars break for cars on parallel overlaps
  • Cars break for cars on conflicting/oncoming overlaps
  • Cars can switch lanes using transfer lanes
  • Cars on transfer lanes interact correctly with cars on left/right lanes
  • Intersections and other overlap interactions
  • Enforce correct car order
  • Find solution for rarer traffic logic updates with overlaps
  • Cars have a concept of next destination and can do all lane transitions correctly
  • Fix behaviour on overlaps
  • More reasonable cars on transfer lanes
  • Forward obstacles between two transfer lanes that go to the same lane
  • Fix glitches
  • Map segments of curved paths to each other accurately on Parallel | Transfer overlaps

Doesn't create windows in xmonad

Hey, looking forward to watching this develop!

I downloaded and launched the Linux binary. I use Ubuntu 14.04 64-bit. It starts up fine when using the Unity desktop environment but I normally use xmonad. In xmonad it doesn't create the game window at all.

Probably a low priority but I thought I would report anyway.

Basic Road Laying UI

  • Road Rendering #2
  • Basic UI #13
  • Draw and adapt a single road stroke
  • Add several road strokes
  • Create "cut" road strokes and intersection areas
  • Create connecting road strokes on intersections
  • Basic Plan realisation
  • Interaction with existing roads & more complete Plan realisation
  • Moving existing roads
  • Curved strokes and node direction
  • Dual-side roads
  • Multilane strokes
  • Correct overlaps on intersections
  • Transfer lanes & overlaps on parallel lanes
  • Make multilane roads look better #12
  • Fix non-straight intersections
  • Fix realization of transfer lanes
  • Fix intersection overlaps
  • Fix disconnected continued transfer lanes
  • T-Intersections
  • Allow deletion of roads #20
  • UI for modifying multilane strokes #20
  • Intersection traffic light timing
  • Live preview of plan changes #20
  • Reimplement continuation of roads
  • Implement adding of lanes #20
  • Implement connection of roads
  • Cancel/Undo/Redo
  • Self-connection of roads
  • Quickly set number of lanes with number keys
  • Self-intersection of strokes
  • Smarter connection of roads with proper biarc connectors

Add a CONTRIBUTING.md

Given that you want to be able to offer licensing other than the AGPL to people, you'll need to make sure any contributors understand the terms under which they must contribute.

The simplest way to do that is to add a CONTRIBUTING.md file, which will result in a hyperlinked "Please review the guidelines for contributing to this repository" banner above the "New ..." forms.

It's explained, including with a screenshot, in this GitHub Blog post.

Planning & Building Optimization

Release Build

Setup 12x12 grid, spacing: 200

Focusing on plan creation:

Focusing on plan realisation:

  • Realize plan 1:40m -> Crash
  • Realize plan 35s -> Crash 9803bea
  • Realize plan 15s -> Works 0a7f714

Interactive-Rate Planning & Implementation

  • Make traffic light timing for complicated intersections faster
  • 15s planning 18x18, 5lanes/side grid
  • Make simple use of a grid as an acceleration structure in planning
  • -> 0.65s planning 18x18, 5lanes/side grid
  • Make simple use of a grid as an acceleration structure in implementation (later)

strange behavior while building roads that cross themselves

this is the road I was trying to build (in three steps)
http://i.minidigger.me/2016/12/citybound-windows_25_16-16-21.png

sometimes it crashes like this:
http://i.minidigger.me/2016/12/Hyper_25_16-15-39.png
sometimes it doesn't build the circle:
http://i.minidigger.me/2016/12/citybound-windows_25_16-17-19.png
the roads are still there, they just don't get build:
http://i.minidigger.me/2016/12/citybound-windows_25_16-20-42.png
when you click the "ghost roads", you get this exception:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:323
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Simulation Panic!
"called `Option::unwrap()` on a `None` value"
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:323```

Basic Lane Subsection UI

  • (Preparation) Rename RoadStrokes -> LaneStrokes
  • (Preparation) Disable existing Debug UI Elements representing lanes
  • (Preparation) Remove all existing code related to lane editing
  • Select and display a subsection of one lane
  • Move a subsection of one lane
  • Allow the same with existing lanes
  • Delete a subsection of a lane
  • Select and delete several lane subsections
  • Move several parallel lane subsections
  • Move unrelated lanes (of two different roads)
  • Keep selection alive after moving
  • Provide live preview
  • Ability to select whole lane
  • Ability to add new lanes parallel to selection
  • Automatically Select parallel lane subsections
  • Switch parallel modes based on zoom
  • Snap selection to start/end points of lanes
  • Snap selection to other points

Create Options Menu

So the problem is the game's control options are stuck, and they should be assignable in an options menu.

I've included some options that you may want to put in. I picked the most important bits from other games. I can add them or you can edit this post if needed, I'll add more as I think of them.

How comprehensive do you want this list to be, do you want me to include all the settings already in the prototype?

  • Create Options Menu

Language

  • Text Language
  • Audio Language
  • Profanity Filter (if chat is used)

User Interface

  • In-Game Clock
  • Show All Road Names

Camera

  • Rotation Speed
  • Scroll Speed
  • Zoom Speed
  • Field of View
  • Invert Camera Y-Axis
  • Auto Zoom if Object between Target and Camera

Graphics

  • Resolution
  • Refresh Rate
  • Frame Limiter
  • Text Size

[Settings (None, Low, Med, High, All) for relevant options]

  • Settings Preset
  • Anti-aliasing
  • Environment
  • LOD Distance
  • Postprocessing
  • Reflections
  • Render Sampling
  • Shadows
  • Textures

[Boolean]

  • Ambient Occlusion
  • Depth Blur
  • Vertical Sync

Audio Options

  • Master Volume
  • Construction Volume
  • Environment Volume
  • Music Volume
  • Traffic Volume
  • User Interface Volume
  • Audio Device
  • Mute CB when Game is in Background

Assignment Options

  • Movement
  • User Interface
  • Camera
  • Screenshot
  • Map

Error when trying to spawn cars

Whenever I press c to spawn cars, as it says on the wiki, I get an error in the top left corner.

SIMULATION PANIC:
attempt to calculate the remainder with a divisor of zero

The console output:

thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', lib\kay\src\slot_map.rs:73
note: Run with 'RUST_BACKTRACE=1' for a backtrace.
Simulation Panic!
"attempt to calculate the remainder with a divisor of zero"

I've tried some different basic road combinations (tried with and without selecting roads) but all of them resulted in the same error. See attached screenshots.

Version: 0.1.0
Platform: Windows 7 x64

citybound-spawn-1
citybound-spawn-2
citybound-spawn-3
citybound-spawn-4

Clicking/Dragging mouse on a built street crashes the game

When building a road, after it has finished, if you click/drag on a road the game crashes.

Error message:
thread 'main' panicked at 'called Option::unwrap() on a `None` value', ../src/libcore\option.rs:323
note: Run with RUST_BACKTRACE=1 for a backtrace.
Simulation Panic!
"called Option::unwrap() on a None value"
thread 'main' panicked at 'called Option::unwrap() on a None value', ../src/libcore\option.rs:323

Set up Continuous Integration

Now that this repo is public, you might as well take advantage of the services which are offered for free to all open-source projects.

First, you'll want Dependency CI to warn you of insecure, abandoned, or incompatibly licensed dependencies.

Second, even if you don't have a test suite for cargo test to run, you can at least hook cargo build up to continuous integration to catch accidental introduction of compile-time errors on platforms (or Rust versions) other than the one you develop on.

Travis CI will do open-source projects for free with Linux and OSX build environments. AppVeyor will do Windows for free.

If, for some reasons, Travis CI doesn't meet your needs, drone.io, CircleCI, and Semaphore all provide "free for open-source" plans.

The Rust Everywhere project also provides a way to hook everything up so that, whenever you push a new tag to GitHub, Travis and AppVeyor will...

  1. Run any automated tests you've defined
  2. If they pass, release binaries will be compiled for Windows, Linux, and MacOS
  3. Bundle the release binaries up into zip/tarball/etc. packages
  4. Upload the release bundles to GitHub's release hosting system for download.

If you do have something for cargo test to run, then you'll also want to add Coveralls.io or Codecov to track test coverage. Setting up to gather code coverage data for Rust is detailed in this blog post.

If you don't have something for cargo test to run on, might I suggest looking into QuickCheck and The Big List of Naughty Strings?

Other tools you may want to run in a CI environment include:

  • rustfmt (When run in diff mode, can be used to make the CI server treat code style violations as a test failure.)
  • cargo-deadlinks (Run after cargo doc to check API documentation for broken internal links)

Also, while the hosted service had problems with your code (probably because you're tying yourself to a specific nightly version), I'd strongly recommend tracking down the version of clippy which corresponds to the nightly you're using. That'll give you code linting over and above what the compiler does.

Get rid of lock-stepping

Easy:

  • Make simulation actors (lanes, etc) deal with slight out-of-date-ness of neighbours
  • Implement graphics that can deal with slight out-of-date-ness

Hard:

  • Find a clean way to do state transitions on a global scale (implementing a plan) involving different actors, with steps that wait for actors to do something

Implement Actor System Basics

  • Find solution for mix of memory sources (persisted, local heap, global heap) a6c836a
  • Implement Actor update cycle with resizing a89a925 d456dc7
  • Implement Actor creation
  • Implement Actor management system
  • Implement message passing
  • Implement external actors
  • Integrate/Rewrite existing State stuff and Simulation
  • Implement advanced messaging patterns
  • Implement actor lifecycle

Self intersecting roads are not build

If you build a road, which intersects with itself, it will not get build properly, but the 'blueprints' are still there. If another road blueprint intersects original road segment, the loop will show up, but with missing lanes (see screenshots).
citybound_selfintersection1
citybound_selfintersection2
citybound_selfintersection3
citybound_selfintersection4
citybound_selfintersection5

Basic Pathfinding

  • come up with concept for lane connectivity
  • implement simple global pathfinding algorithm & datastructure
  • create test UI for single car
  • come up with concept for hierarchical pathfinding -> landmarks
  • make use of landmarks for propagation
  • deal with Lane deletion and changes
  • validate connectivity/routing with ui debug tool (later)

Panic after attempting to begin road placement

Clicked to place a road at the end of an existing, built segment, caused simulation panic and app crash.

OS X El Captan 10.11.6

Console output:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:323
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Simulation Panic!
"called `Option::unwrap()` on a `None` value"
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore/option.rs:323

More Camera controls

  • Move with Space + mouse XY
  • Zoom/Rotation with Shift + Space + mouse XY
  • Zoom/Rotation with multitouch (later)

Cannot re-launch on Mac 10.12.1

Created a Panic by overlapping too many roads (gotta test those intersections!).

CMD+Q to quit the game, however double clicking the .app to restart it launches the app without any new windows appearing. Only option is to force quit the .app.

Basic UI

  • basic scrolling
  • calculate cursor 3d position (per scene)
  • invent system for UI handles with "callback messages"

Basic Lane / Road / Intersection Composition

  • How is one side of a road with lanes that can be merged between represented?
  • How are intersections represented?
    • groups of close/interacting lane overlaps
  • How are the two sides of a road connected? A: for traffic, not at all, only in planning.

Project Managment

It would be really helpful if the projects tab was used to make an Agile style project board. The categories could be Backlog, In-Progress, Testing, and Done. Then each card could link to an issue which could have an assignee or something. That would make development on this project easier for new developers.

Wrapping road on itself causes application to hang

Platform: macOS Sierra 10.12.2
What was I doing: Just messing around, I made one road segment, then tried attaching the continuation back to the end of the first segment. The application froze and I was getting the macOS pinwheel. I force closed the application. Now, when I open the application, no window shows up.

I can't get the application window to show up at all anymore. Even after restarting.

Let me know if there are logs I can copy somewhere and paste them here.

By the way, I'm really excited to follow your progress on this game and possibly make some contributions of my own. Great decision to make it open source!

Mod architecture

Mod support has been discussed many times before, and it's something that can really increase the longevity of a game. See Warcraft 3 or Cities: Skylines. Therefore I'm creating this issue here for a discussion about an actual implementation of mods in Citybound.

Why mods and not X?

Any implementation of mods will make the experience much more customisable from a player perspective, by letting the player enable and disable any mod. It will also enable people to create very experimental mods that are too unstable or not popular enough to be included in the main game.

Forks? Would make it difficult to combine modifications, and essentially impossible for the end user. Forks are better for bigger mods.

Pull requests? All pull requests has to go through some kind of vetting process for quality before they are included. Something which will take resources from the development of the game.

Possible Solutions

All of the alternatives requires some sort of interface to create hooks into the game routines. I can't say anything about any details, so Anselm or someone else might have to fill in here.

Scripting

Scripting would probably be the most obvious solution to this. It would require us to chose a language, probably something like Lua (which has good Rust bindings already). Here we need to figure out a good way to efficiently send objects back and forth between the game and the scripting engine. This is the most difficult part, also because if something is left out (like building parameters) it will make certain mods impossible.

Pros

  • Easy to make a basic implementation.
  • Can be made safe (disabling file access, etc).
  • Cross platform by default.

Cons

  • There will be a performance penalty.
  • Code from mods and the game engine will not be compatible.
  • Existing interfaces needs to have additional scripting interfaces added.

Dynamic libraries

These would written in Rust, and be compiled directly from source with Cargo and rustc. I'm thinking that the same version of rustc that was used to compile the game would be included in the game package. Cargo already exists as a library, so we should be able to use it to compile mods at run time. The mods would be compiled into dylib's, so that they could be dynamically loaded and called from the game at run time.

The game engine should be included as a library and contain ways to hook into the game world.

Pros

  • Native performance.
  • Existing interfaces should be possible to re-use.
  • Mod and mainline code will be compatible.
  • Should make odd things, possible. (Running web servers, hooking up python scripts, etc.)

Cons

  • Not safe (same access to the system as the game has).
  • Relatively easy to mess up cross platform support. (Depends on what you are doing.)
  • Rust can be a bit tricky to use.

Hosting

Mods should contain a package specification, with information about what it is (a mod, a model, etc) and it's dependencies. I'm thinking mods should be pullable from a central repository, something like the Steam Workshop. This should preferably be backed by a REST API with a publicly available specification so that it's possible to get packages from unofficial repos, etc. Getting packages directly from git repos would be a great addition to this, and of course from the local file system.

Summary

Personally I think that the second option of using dynamic libraries would be the best option because it would give us the most freedom to create whatever we want. For example, it would be possible to create a mod which enables Lua scripting.

I'd be willing to build the basis for packages, and if others like the second idea for mods (dynamic libs), I could try to implement that too.

Obviously something like this requires native support in the game engine, that's why I'm bringing it up this early in the process.

Suggestions and general feedback is the reason I made this, so feel free to comment below.

Fails to launch on OS X El Capitan 10.11.6 via application package

The app fails to launch via the .app package on OS X El Capitan 10.11.6 claiming:

You have OS X 10.11.6. The application requires OS X 10.12 or later.

However, I can launch Citybound by manually running the executable within the application package. Probably a simple issue with the package metadata.

Binary not running (anymore) on macOS

I downloaded the app bundle and started it once without problems.
Now I can't open it anymore, I just get a process running at almost 100%. Starting the binary inside the package using the terminal gives no output.

Running from source works fine, self compiled binary works fine as well!

OS: macOS Sierra 10.12.2

Crash trying to plan road from built ring

D:\Games\Citybound\Tech demo 1>citybound-windows.exe
thread 'main' panicked at 'called Option::unwrap() on a None value', ../src/libcore\option.rs:323
stack backtrace:
0: 0x6f54e4 -
1: 0x6f1d59 -
2: 0x6f248a -
3: 0x6f2326 -
4: 0x6f2249 -
5: 0x6f21cb -
6: 0x70b0a5 -
7: 0x70afed -
8: 0x4b3266 -
9: 0x4bc74b -
10: 0x4ff999 -
11: 0x42f206 -
12: 0x6fdb38 -
13: 0x461554 -
14: 0x6f2108 -
15: 0x6fdb38 -
16: 0x6f1503 -
17: 0x4013b4 -
18: 0x4014e7 -
19: 0x7ffba7c38363 -
Simulation Panic!
"called Option::unwrap() on a None value"
thread 'main' panicked at 'called Option::unwrap() on a None value', ../src/libcore\option.rs:323
stack backtrace:
0: 0x6f54e4 -
1: 0x6f1d59 -
2: 0x6f248a -
3: 0x6f2326 -
4: 0x6f2249 -
5: 0x6f21cb -
6: 0x70b0a5 -
7: 0x70afed -
8: 0x4a2805 -
9: 0x4b05a9 -
10: 0x4bc74b -
11: 0x4ff999 -
12: 0x461446 -
13: 0x6f2108 -
14: 0x6fdb38 -
15: 0x6f1503 -
16: 0x4013b4 -
17: 0x4014e7 -
18: 0x7ffba7c38363 -

Reproduction:

  1. Plan a road ring (i.e. a single road starting and ending at the same point)
  2. Implement the plan
  3. The constructed roads will have a destination point in the middle (red dots above lanes) away from the start/end point
  4. Attempt to plan a new road starting at the middle destination point
  5. Above crash happens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.