Giter Site home page Giter Site logo

jdno / auto-traffic-control Goto Github PK

View Code? Open in Web Editor NEW
133.0 133.0 9.0 5.39 MB

A video game for programmers about safely routing planes to an airport ๐Ÿ›ฌ

Home Page: https://auto-traffic-control.com

License: Apache License 2.0

Rust 91.87% Shell 1.89% TypeScript 0.53% C# 1.21% Ruby 2.08% Python 2.41%
bevy game grpc programming

auto-traffic-control's People

Contributors

dependabot[bot] avatar jdno avatar nzen avatar skinner927 avatar tobbentm 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

auto-traffic-control's Issues

Generating Ruby Code From Proto Files

I'll admit that using proto files and gRPC is a new concept to me, so I might be doing something wrong here. But here's what I've been able to do...

protoc --proto_path=atc --ruby_out=lib atc/v1/atc.proto outputs an lib/v1/atc_pb.rb file successfully.

However, when I run

protoc --proto_path=atc --ruby_out=lib atc/v1/atc.proto atc/v1/airplane.proto I get...

atc/v1/map.proto: File not found.
atc/v1/tag.proto: File not found.
v1/airplane.proto:5:1: Import "atc/v1/map.proto" was not found or had errors.
v1/airplane.proto:6:1: Import "atc/v1/tag.proto" was not found or had errors.
v1/airplane.proto:10:3: "Point" is not defined.
v1/airplane.proto:11:12: "Node" is not defined.
v1/airplane.proto:12:3: "Tag" is not defined.
v1/airplane.proto:25:12: "Node" is not defined.

And I have confirmed that the map.proto and tag.proto file is there. So that file not found error doesn't really make sense. Do you have any idea what might be going on?

request : java sdk

This game looks pretty interesting. However, I'm familiar with neither rust nor javascript. It seems there are libraries to generate java source for an ATC client. It would be convenient if ATC offered either a build script to generate these, so potential players needn't learn enough about protoc to compile their own. It would be wonderful if ATC uploaded a jar to a public repository, like maven central, that java proficient players could depend on directly.

I recognize that the current ATC team might not have resources to focus on providing a java sdk and example. So, I've offered a pull request #173 that should provide both. I apologize that I didn't add an issue first, I do know better.

Initial stage of the game should be easy and then get harder

The current game requires pretty good solution to even get a single landed plane. Even though the user might correctly implement Dijkstra algorithm, two planes might collide.

The game could go through multiple scenarios (and becoming harder with each stage):

  1. generate single plane that can go straight to the airport (not having to deal with the restricted zone around the airport)
  2. Only once the first airplane lands, generate another airplane that needs to take into account the restricted zone around the airport to land)
  3. Once the second airplane lands, start generating multiple airplanes (the current situation)

There could be few more complications (later stages):

  • Modifying the map by adding / removing restricted zones
  • High priority planes (airplane would have limited amount of fuel)

Make the game easier to debug

I love the idea of the game and having fun implementing my solution.

However, my current solution has a bug in it as two planes crashed into each other:

Screenshot 2022-08-21 at 10 27 45

How does one go about debugging this? It is impossible to know what were the plane ids or what wast their flight plan. I would have to go over the logs of my solution and try to painfully reconstruct the state in order to find where my solution made an error. It is feasible for somebody who has a lot of experience doing that but it is no fun ๐Ÿ˜ž

At the moment UI window just shows the current state. It could be extended to show information like:

  • ID of the plane
  • flight path of the plane / flight paths of all planes

The information could be displayed always or only on hovering over the plane. Few mockups:

Screenshot 2022-08-21 at 10 51 58

Screenshot 2022-08-21 at 10 54 14

When the game stops, it would be useful to play with the game and debug it: Be able to rewind the game and see how the planes were moving around. You could inspect planes (their ids and the flight plan at the given time) and see when the flight plan changes were issued.

These changes would make it much easier to debug. The player can focus more time into writing algorithms rather than debugging / building their own debugging tools.

Starting a running game killed it

The Game service documentations suggests that sending a start game request while the game is already running, 'nothing will happen'. Doing so ended the simulation. It created a panic with the following message:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: AlreadyInState', game\src\systems\change_app_state.rs:15:47

It looks like the offending line sets the state without checking whether it matches. I would think that a mutable variable could handle being set to the same state, but that does not seem to be the case.

I intend to change the logic such that my client does not try to start the game while it is running. But, it is still appropriate to either change the documentation or resolving the command robustly.

Run game in headless mode

Overview

The next version of the game implements a new architecture for the game, which makes it possible to run the simulation in a headless mode without rendering a user interface. Besides being a requested feature, this functionality also enables us to test the new architecture before building the user interface.

Design

We will add a command-line tool to the project that players can use to launch the game.

cargo run -p cli

In version 0.4, the CLI will only run the simulation. Later versions might add more features, at which point we will redesign the commands and arguments of the CLI.

Features

  • Create a new crate for the command-line tool
  • Launch the simulation and run its game loop
  • Package the CLI as a Docker image

Provide way to specify game seeds

Sometimes I want to play the same game few times over. I might have a bug in my solution and want to debug it. This is much harder if the game keeps changing every single time and it is hard to trigger the weird state.

The user could provide a seed (e.g. uint64) during the start of the game and then the game would use the seed for random number generation. If the user doesn't provide seed, a random one is picked.

MapService NodeToPoint response is ambiguous

When a client sends a NodeToPointRequest to the MapService for some Node, it receives a NodeToPointResponse with only a Point. If a client requests this synchronously, it is clear that the response Point y corresponds to Node x that this client just requested. However, it is not clear how to match requests with responses when sending several asynchronously.

I assume this is a queue, rather than a stack, but I can't tell, as nothing seems to call Map.node_to_point(). I will verify this soon, when my client starts getting node points and estimating where nodes are, so it can approximate airplane moved events to the closest node.

I submit that a response with the point and the node that it goes with constitutes a better message, as it makes the context explicit, rather than implicit. I understand that would be a breaking change to the api.

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.