Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Demo Port #611

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Game Demo Port #611

wants to merge 17 commits into from

Conversation

PiggottDev
Copy link
Contributor

Very rough first draft of the game demo port - needs few iterations of tidying before merging.

@PiggottDev PiggottDev added the demo label Apr 4, 2024
@PiggottDev PiggottDev self-assigned this Apr 4, 2024
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 13.93443% with 525 lines in your changes missing coverage. Please review.

Project coverage is 50.26%. Comparing base (b06cb54) to head (d4748e8).

Files with missing lines Patch % Lines
example_apps/game/src/main.rs 0.00% 96 Missing ⚠️
example_apps/game/src/agents/model/stats.rs 0.00% 83 Missing ⚠️
example_apps/game/src/ui.rs 0.00% 73 Missing ⚠️
example_apps/game/src/agents/model/leaderboard.rs 0.00% 48 Missing ⚠️
example_apps/game/src/agents/leaderboard.rs 0.00% 45 Missing ⚠️
example_apps/game/src/agents/game.rs 0.00% 41 Missing ⚠️
example_apps/game/src/agents/player.rs 0.00% 39 Missing ⚠️
example_apps/game/src/agents/battle.rs 0.00% 35 Missing ⚠️
example_apps/game/src/generator/universe.rs 0.00% 22 Missing ⚠️
example_apps/game/src/agents/team.rs 0.00% 16 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #611      +/-   ##
==========================================
- Coverage   50.98%   50.26%   -0.72%     
==========================================
  Files         378      391      +13     
  Lines       32517    33136     +619     
==========================================
+ Hits        16578    16657      +79     
- Misses      15939    16479     +540     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@horned-sphere horned-sphere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive for a first attempt!

example_apps/game/game-model/src/model/config.rs Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/game.rs Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/gamertag.rs Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/player.rs Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/round.rs Outdated Show resolved Hide resolved
example_apps/game/src/agents/model/leaderboard.rs Outdated Show resolved Hide resolved
Comment on lines +32 to +50
pub fn ui_server_router(port: u16) -> Router {
Router::new()
.route("/index.html", get(index_html))
.route("/lib/game.min.js", get(game_min_js))
.route("/lib/game.min.js.map", get(game_min_js_map))
.route("/lib/swim-core.min.js", get(swim_core_min_js))
.route("/lib/swim-core.min.js.map", get(swim_core_min_js_map))
.route("/lib/swim-host.min.js", get(swim_host_min_js))
.route("/lib/swim-host.min.js.map", get(swim_host_min_js_map))
.route("/lib/swim-ui.min.js", get(swim_ui_min_js))
.route("/lib/swim-ui.min.js.map", get(swim_ui_min_js_map))
.route("/lib/swim-ux.min.js", get(swim_ux_min_js))
.route("/lib/swim-ux.min.js.map", get(swim_ux_min_js_map))
.route("/lib/swim-vis.min.js", get(swim_vis_min_js))
.route("/lib/swim-vis.min.js.map", get(swim_vis_min_js_map))
.route("/assets/favicon.ico", get(favicon))
.route("/assets/swim-logo.png", get(swim_logo))
.with_state(UiConfig { port })
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize that this is copied from the example app I did but it's definitely hacky. We shoul probably make somethiung more general if we're going to have a lot of these.

Copy link
Member

@SirCipher SirCipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really great for a first pass! My comments are just nits really. Before this gets merged It could do with a sprinkle of documentation

example_apps/game/README.md Outdated Show resolved Hide resolved
example_apps/game/game-model/Cargo.toml Outdated Show resolved Hide resolved
example_apps/game/game-model/Cargo.toml Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/battle.rs Outdated Show resolved Hide resolved
example_apps/game/game-model/src/model/battle.rs Outdated Show resolved Hide resolved
Comment on lines +154 to +155
// pub total_duration: u64,
// pub last_online: u64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rogue comment

example_apps/game/src/agents/model/stats.rs Show resolved Hide resolved
Comment on lines +178 to +179
// self.total_duration += match_summary.duration;
// self.last_online = match_summary.end_time;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rogue comment

}

fn configure_logging() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let filter = example_filter()?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just be able to depend on the example_util crate rather than copying this here. You could maybe add a new function there that accepts a slice of additional directives to add

example_apps/game/src/main.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants