Skip to content

Commit

Permalink
Merge branch 'main' into 340-music
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyTornetta committed Dec 11, 2024
2 parents f41f0e7 + 51b7cc0 commit 56ebf36
Show file tree
Hide file tree
Showing 229 changed files with 5,978 additions and 3,394 deletions.
1,539 changes: 964 additions & 575 deletions Cargo.lock

Large diffs are not rendered by default.

63 changes: 32 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,49 @@ members = ["cosmos_client", "cosmos_core", "cosmos_server"]
resolver = "2"

[workspace.dependencies]
bevy = { version = "0.14.1", default-features = false }
bevy_rapier3d = { git = "https://github.com/AnthonyTornetta/bevy_rapier", version = "0.27.0", branch = "context-component", features = [
bevy = { version = "0.15", default-features = false }
bevy_rapier3d = { git = "https://github.com/AnthonyTornetta/bevy_rapier", version = "0.27.0", branch = "master", features = [
"simd-stable",
"serde-serialize",
] }

bevy_easy_compute = { git = "https://github.com/AnthonyTornetta/bevy_easy_compute", branch = "no-build-worker", version = "0.14.0" }
bevy_easy_compute = { git = "https://github.com/AnthonyTornetta/bevy_easy_compute", branch = "no-build-worker", version = "0.15" }

renet2 = { git = "https://github.com/UkoeHB/renet2", tag = "0.0.5" }
serde = "1.0.203"
serde_json = "1.0.120"
bincode = "1.3.3"
renet2 = { git = "https://github.com/UkoeHB/renet2", branch = "main", version = "0.0.7" }
serde = "1.0"
serde_json = "1.0"
bincode = "1.3"
noise = "0.9.0"
# Check out https://crates.io/crates/tinyrand in future
bevy_renet2 = { git = "https://github.com/UkoeHB/renet2", tag = "0.0.5" }
bevy_renet2 = { git = "https://github.com/UkoeHB/renet2", branch = "main", version = "0.0.7" }
rand = "0.8.5"
rand_chacha = "0.3.1"
# bigdecimal 0.4.6 has a formatting regression that causes a crash
bigdecimal = "0.4.5"
rayon = "1.10.0"
futures-lite = "2.3.0"
local-ip-address = "0.6.1"
image = { version = "0.25.1", default-features = false, features = ["png"] }
bevy-inspector-egui = "0.25.0"
crossterm = { version = "0.27.0", features = ["event-stream"] }
renet2_visualizer = { git = "https://github.com/UkoeHB/renet2", tag = "0.0.5" }
walkdir = "2.5.0"
toml = "0.8.14"
rayon = "1.10"
futures-lite = "2.5"
local-ip-address = "0.6.3"
image = { version = "0.25.5", default-features = false, features = ["png"] }
bevy-inspector-egui = "0.28.0"
crossterm = { version = "0.28.1", features = ["event-stream"] }
renet2_visualizer = { git = "https://github.com/UkoeHB/renet2", branch = "main", version = "0.0.7" }
walkdir = "2.5"
toml = "0.8.19"
lz4_flex = "0.11.3"
thread-priority = "1.1.0"
bevy_kira_audio = "0.20.0"
anyhow = "1.0.86"
thiserror = "1.0.61"
bitflags = "2.6.0"
bevy_mod_debugdump = "0.11.0"
arboard = "3.4.0"
derive_more = "0.99.18"
clap = "4.5.8"
bytemuck = "1.16.1"
bevy_obj = "0.14"
bevy_hanabi = "0.12.1"
iyes_perf_ui = "0.3.0"
bevy_mod_billboard = "0.7.0"
thread-priority = "1.2"
bevy_kira_audio = "0.21.0"
anyhow = "1.0"
thiserror = "2.0"
bitflags = "2.6"
bevy_mod_debugdump = "0.12.0"
arboard = "3.4"
derive_more = "1.0"
clap = "4.5"
bytemuck = "1.20"
bevy_obj = "0.15"
bevy_hanabi = "0.14"
# iyes_perf_ui = "0.3.0"
# bevy_mod_billboard = "0.7.0"

# For any non workspace package
[profile.dev.package."*"]
Expand Down
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,31 @@ Every time you want to view the documentation, navigate to the `docs/` directory

#### System ordering

If you want to view the ordering of the systems, run (on linux) `cargo run --features print-schedule | dot -Tsvg > ./debug.svg` for either the cosmos_client or cosmos_server projects. If the `print-schedule` feature is enabled, these are setup to use bevy_mod_debugdump to create graphs of the `Update` schedule. If you need a different schedule, you'll have to change the `main.rs` file for either project to specify the correct schedule. Note, you'll need [graphviz](https://graphviz.org/download/) for the dot cmomand to work.
If you want to view the ordering of the systems, run (on linux) `cargo run --features print-schedule | dot -Tsvg > ./debug.svg` for either the cosmos_client or cosmos_server projects. If the `print-schedule` feature is enabled, these are setup to use bevy_mod_debugdump to create graphs of the `Update` schedule. If you need a different schedule, you'll have to change the `main.rs` file for either project to specify the correct schedule. Note, you'll need [graphviz](https://graphviz.org/download/) for the dot cmomand to work.

# Cosmos Roadmap

See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the list of current features/bugs in development.

## Release 0.0.7a (In Progress)
- [ ] Wires
- [ ] Electrical

- [ ] Music
- [x] Creative Mode
- [x] Chat
- [x] Galaxy map
- [x] Able to view stars
- [x] Zoom in to view planets
- [x] Set waypoint
- [x] Rotating Planet
- [ ] Biosphere Improvements
- [ ] Ice biosphere glaciers
- [ ] Better Water block
- [ ] Better Lava block
- [ ] Structures
- [ ] Rocks spawning
- [ ] Undergrowth
- [ ] 1 More tree type
- [ ] Groundwork for biomes
- [ ] Planes
- [ ] Redwood forest
- [ ] 1 Additional forest
- [ ] Ocean
- [x] On-planet skybox
- [x] Dropped item entity
- [x] When storage is broken, drop items on ground
- [x] If not enough inventory room when player is mining something, drop item
- [x] Fix missing chunks on planets
- [x] Bevy 0.15

## Release 0.0.6a

- [x] Place rotated blocks
- [x] Add main menu
- [x] Customizable settings
Expand Down Expand Up @@ -136,6 +126,7 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
- [x] Update to bevy 0.14

## Release 0.0.5a

- [x] Add a gravity well block
- [x] Remove snapping to structures on collision
- [x] Camera system
Expand Down Expand Up @@ -262,7 +253,7 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
- [x] Player world moves relative to its player
- [x] Players can be a part of the same world if they are close enough
- [x] Requires rewrite of bevy_rapier to support multiple physics worlds
- [ ] Merge PR https://github.com/dimforge/bevy_rapier/pull/328
- [x] Merge PR https://github.com/dimforge/bevy_rapier/pull/328
- [x] Update to bevy 0.10.0
- [x] Performant ships
- [x] Ability to have 50 small-sized ships loaded with minimal performance impact
Expand Down Expand Up @@ -354,7 +345,7 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
- [x] Sync bodies from server to client
- [x] Ability to break/replace block
- [x] Dynamic meshing
- [x] Dynamic physics bodies
- [x] Dynamic physics bodies
- [x] Block break events sent to server, server sends back block changed event
- [x] Selects nearest structure
- [x] Integrate physics system
Expand All @@ -368,6 +359,7 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
- [x] Support re-sizable window

## Release 0.0.8a

- [ ] More pirate ships
- [ ] More asteroid types
- [ ] Fuel for reactor
Expand All @@ -378,11 +370,27 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
- [ ] Add more randomly generated structures (e.g. stations)

## Everything that will still have to be done after 0.0.7a

- [ ] Shops
- [ ] Peace zone?
- [ ] Prices based on supply + rarity
- [ ] Keep supply relatively equal between nearby shops
- [ ] Each shop has its own supply of money that it cannot go below
- [ ] Biosphere Improvements
- [ ] Ice biosphere glaciers
- [ ] Better Water block
- [ ] Better Lava block
- [ ] Structures
- [ ] Rocks spawning
- [ ] Undergrowth
- [ ] 1 More tree type
- [ ] Groundwork for biomes
- [ ] Planes
- [ ] Redwood forest
- [ ] 1 Additional forest
- [ ] Ocean
- [ ] Wires
- [ ] Electrical

## NPCs

Expand All @@ -391,16 +399,16 @@ See [the issues page](https://github.com/AnthonyTornetta/Cosmos/issues) for the
NPC controlled OR player controlled
NPC controlled factions store reputation of other factions + players
Factions have different attributes
- One may steal your ship blueprints
- To balance this:
- scrap is collected when you mine melting down ships instead of the actual blocks
- Different scrap types
- Substitute expensive blocks for less expensive ones if needed
- If ship is below 50% success rate, don't produce it again
- Dynamic faction expansion
Bounty board
- Take down X ship
- Selling the ship

- One may steal your ship blueprints
- To balance this:
- scrap is collected when you mine melting down ships instead of the actual blocks
- Different scrap types
- Substitute expensive blocks for less expensive ones if needed
- If ship is below 50% success rate, don't produce it again
- Dynamic faction expansion
Bounty board
- Take down X ship
- Selling the ship
- Selling ship designs
- Buying ship designs

9 changes: 5 additions & 4 deletions cosmos_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cosmos_client"
version = "0.0.6"
version = "0.0.7"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down Expand Up @@ -37,10 +37,11 @@ default = [
"bevy/default_font",
"bevy/webgl2",
"bevy/sysinfo_plugin",
"bevy/bevy_window",
]

[dependencies]
cosmos_core = { version = "0.0.6", path = "../cosmos_core", features = [
cosmos_core = { version = "0.0.7", path = "../cosmos_core", features = [
"client",
] }

Expand Down Expand Up @@ -79,5 +80,5 @@ clap = { workspace = true, features = ["derive"] }
bevy_easy_compute = { workspace = true }
bevy_obj = { workspace = true }
bevy_hanabi = { workspace = true }
iyes_perf_ui = { workspace = true }
bevy_mod_billboard = { workspace = true }
# iyes_perf_ui = { workspace = true }
# bevy_mod_billboard = { workspace = true }
24 changes: 24 additions & 0 deletions cosmos_client/assets/cosmos/blocks/basic_fabricator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"texture": {
"Sides": {
"right": {
"Single": "cosmos:basic_fabricator_sides"
},
"left": {
"Single": "cosmos:basic_fabricator_sides"
},
"front": {
"Single": "cosmos:basic_fabricator_sides"
},
"back": {
"Single": "cosmos:basic_fabricator_sides"
},
"top": {
"Single": "cosmos:basic_fabricator_top_bottom"
},
"bottom": {
"Single": "cosmos:basic_fabricator_top_bottom"
}
}
}
}
43 changes: 43 additions & 0 deletions cosmos_client/assets/cosmos/blocks/door_open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"texture": {
"All": {
"Connected": [
"cosmos:door_open_0",
"cosmos:door_open_1",
"cosmos:door_open_2",
"cosmos:door_open_3",
"cosmos:door_open_4",
"cosmos:door_open_5",
"cosmos:door_open_6",
"cosmos:door_open_7",
"cosmos:door_open_8",
"cosmos:door_open_9",
"cosmos:door_open_10",
"cosmos:door_open_11",
"cosmos:door_open_12",
"cosmos:door_open_13",
"cosmos:door_open_14",
"cosmos:door_open_15"
]
}
},
"model": {
"Sides": {
"name": "cosmos:door_open",
"top": "cosmos:base_top",
"bottom": "cosmos:base_bottom",
"left": "cosmos:base_left",
"right": "cosmos:base_right",
"front": "cosmos:base_front",
"back": "cosmos:base_back",
"connected": {
"top": "none",
"bottom": "none",
"left": "none",
"right": "none",
"front": "none",
"back": "none"
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cosmos_client/assets/cosmos/images/blocks/door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion cosmos_client/assets/cosmos/lang/blocks/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ cosmos:water=Water
cosmos:sand=Sand
cosmos:cactus=Cactus
cosmos:build_block=Build Block
cosmos:door=Door
cosmos:door_open=Door
cosmos:basic_fabricator=Basic Fabricator
cosmos:iron_ore=Iron Ore

cosmos:ship_hull_grey=Grey Ship Hull
cosmos:ship_hull_black=Black Ship Hull
Expand Down Expand Up @@ -105,4 +109,4 @@ cosmos:logic_wire_red=Red Logic Wire
cosmos:logic_wire_dark_red=Dark Red Logic Wire
cosmos:logic_wire_yellow=Yellow Logic Wire
cosmos:logic_wire_dark_yellow=Dark Yellow Logic Wire
cosmos:logic_wire_mint=Mint Logic Wire
cosmos:logic_wire_mint=Mint Logic Wire
3 changes: 2 additions & 1 deletion cosmos_client/assets/cosmos/lang/items/en_us.lang
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cosmos:test_crystal=Test Crystal
cosmos:test_crystal=Test Crystal
cosmos:iron_bar=Iron Bar
2 changes: 1 addition & 1 deletion cosmos_client/src/asset/asset_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn load_assets<T: Asset, K: Send + Sync + 'static>(
loading_assets.loading_handles.retain_mut(|handle| {
let load_state = asset_server.get_load_state(handle.id()).expect("Id has to exist here");

if load_state == LoadState::Loaded || matches!(load_state, LoadState::Failed(_)) {
if matches!(load_state, LoadState::Failed(_) | LoadState::Loaded) {
done_loading.loaded_handles.push((std::mem::take(handle), load_state));
false
} else {
Expand Down
4 changes: 2 additions & 2 deletions cosmos_client/src/asset/asset_loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ fn check_assets_ready(
for folder_handle in loading.iter().map(|h| &h.folder_handle) {
for handle in folder_handle {
let load_state = server.get_load_state(handle);
if load_state == Some(LoadState::Loaded) || matches!(load_state, Some(LoadState::Failed(_))) {
if matches!(load_state, Some(LoadState::Failed(_) | LoadState::Loaded)) {
match server.get_recursive_dependency_load_state(handle) {
Some(RecursiveDependencyLoadState::Loaded) => {}
Some(RecursiveDependencyLoadState::Failed) => {
Some(RecursiveDependencyLoadState::Failed(_)) => {
panic!("Failed to load asset!!");
}
_ => {
Expand Down
Loading

0 comments on commit 56ebf36

Please sign in to comment.