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

Add new version of modor and modor_derive #283

Merged
merged 11 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
branches:
- main
- '*'
schedule:
- cron: 0 2 * * SAT
workflow_dispatch: { }
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/scripts/remove_dev_dependencies.sh

This file was deleted.

13 changes: 6 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

### Added

- Entity, component and system definition
- Sequential and parallel system execution
- Physics module to handle transforms, dynamic properties and colliders
- Graphics module to draw models (rectangles, ellipses) with material (color, texture) in one or multiple render targets
(window or texture)
- Text module to draw texts
- Input module to access keyboard, mouse, touch and gamepad states
- Object definition
- Ordering with roles
- Physics module
- Graphics module for 2D rendering
- Text module
- Input module with support of keyboard, mouse, touch and gamepads
- Resources module to easily load and access resources like textures, font, sounds, ...
- Asynchronous job utilities
- Support for Windows, Linux, macOS, Android and WebAssembly
44 changes: 8 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,38 @@ edition = "2021"
version = "0.1.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/modor-engine/modor"
rust-version = "1.74.0"
rust-version = "1.75.0"

[workspace.dependencies]
ab_glyph = "0.2"
approx = "0.5"
android-activity = "0.5"
android-activity = { version = "0.5", features = ["native-activity"] }
android_logger = "0.13"
async-std = { version = "1.12", features = ["tokio1"] }
bytemuck = { version = "1.8", features = ["derive"] }
cargo-run-wasm = "0.3"
compiletest_rs = "0.10"
console_error_panic_hook = "0.1"
console_log = "1.0"
criterion = { version = "0.4", default-features = false, features = [
"plotters",
"cargo_bench_support",
] }
darling = "0.20"
derivative = "2.2"
doc-comment = "0.3"
fs_extra = "1.2"
futures = "0.3"
fxhash = "0.2"
getrandom = { version = "*", features = ["js"] } # To fix this issue: https://github.com/rust-random/getrandom/issues/208
gilrs = "0.10"
image = "0.24"
instant = "0.1"
itertools = "0.12"
log = "0.4"
petgraph = "0.6"
pico-args = "0.5"
pretty_env_logger = "0.5"
proc-macro-crate = "2.0"
proc-macro-crate = "3.0"
proc-macro-error = "1.0"
proc-macro2 = "1.0"
quote = "1.0"
rand = "0.8"
rapier2d = "0.17"
regex = "1.10"
reqwest = "0.11"
scoped_threadpool = "0.1"
spin_sleep = "1.1"
static_assertions = "1.1"
syn = { version = "2.0", features = ["full", "extra-traits"] }
typed-index-collections = "3.0"
wasm-bindgen-futures = "0.4"
rayon = "1.8"
syn = { version = "2.0", features = ["full"] }
thiserror = "1.0"
wasm-bindgen-test = "0.3"
web-sys = { version = "0.3", features = ["Location"] }
wgpu = "0.18"
winit = "0.29"

modor = { version = "0.1.0", path = "crates/modor" }
modor_derive = { version = "0.1.0", path = "crates/modor_derive" }
modor_graphics = { version = "0.1.0", path = "crates/modor_graphics" }
modor_input = { version = "0.1.0", path = "crates/modor_input" }
modor_internal = { version = "0.1.0", path = "crates/modor_internal" }
modor_jobs = { version = "0.1.0", path = "crates/modor_jobs" }
modor_math = { version = "0.1.0", path = "crates/modor_math" }
modor_physics = { version = "0.1.0", path = "crates/modor_physics" }
modor_resources = { version = "0.1.0", path = "crates/modor_resources" }
modor_text = { version = "0.1.0", path = "crates/modor_text" }
modor_derive = { version = "0.1.0", path = "crates/modor_derive" }

[workspace.lints.rust]
anonymous_parameters = "warn"
Expand Down
7 changes: 0 additions & 7 deletions PUBLISHED-CRATES
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
modor_derive
modor_internal
modor
modor_jobs
modor_resources
modor_math
modor_physics
modor_input
modor_graphics
modor_text
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@
[![Coverage with grcov](https://img.shields.io/codecov/c/gh/modor-engine/modor)](https://app.codecov.io/gh/modor-engine/modor)
[![Lines of code](https://tokei.rs/b1/github/modor-engine/modor?category=code)](https://github.com/modor-engine/modor)

Modor is a *mo*dular and *d*ata-*or*iented game engine, based on the following principles:

- *Modularity*: the [entity component system](https://en.wikipedia.org/wiki/Entity_component_system) pattern makes it
very easy to:
- Extend functionalities of the engine in reusable modules.
- Split a project into multiple independent crates.
- Reduce coupling between parts of an application.
- *Simplicity*:
- Everything is stored in an entity, even resources, settings or loaded modules.
- Systems are always linked to component types to facilitate system import and limit their side effects.
- The ability to define a component as system dependency makes system ordering easy and maintainable.
- *Compile-time checking*: compile-time checks are used extensively to avoid as many errors as possible
during runtime:
- System parameters are checked to avoid mutability issues at runtime, e.g. if the same component type is mutably
queried twice by the same system.
- System execution order is checked to avoid dependency cycles.
- The API is designed to avoid runtime panics as much as possible.
Modor is a *mod*ular and *o*bject-o*r*iented game engine.

It has been designed with the following principles in mind:

- *Simplicity*: everything in the engine is an "object" accessible by any other object.
- *Modularity*: the engine makes it easy to:
- Extend functionalities of the engine with reusable modules.
- Split big projects into multiple independent crates.
- Reduce coupling between parts of a crate.
- *Performance*: the engine can take advantage of CPU caching and parallelization for the most
demanding operations.

## ⚠️ Warning ⚠️

Before considering to use this game engine, please keep in mind that:

- It is developed by a single person in his spare time.
- As this engine can already be used to develop 2D games, some important features might still be
missing.
- This engine is code-oriented, so no editor is included.

## Supported platforms

Expand All @@ -45,13 +48,6 @@ dependencies in your `Cargo.toml` file:

```toml
modor = "0.1"
modor_graphics = "0.1"
modor_input = "0.1"
modor_jobs = "0.1"
modor_math = "0.1"
modor_physics = "0.1"
modor_resources = "0.1"
modor_text = "0.1"
```

## Examples
Expand All @@ -65,21 +61,27 @@ You can use one of the following commands to run an example:

For example: `cargo run --example rendering_2d --release`

## Main libraries behind the scene
## Behind the scene

Here are the main libaries used behind the modules of modor:

- Graphics module is backed by [winit](https://github.com/rust-windowing/winit) and [wgpu](https://wgpu.rs/).
- Graphics module is backed by [winit](https://github.com/rust-windowing/winit)
and [wgpu](https://wgpu.rs/).
- Physics module is backed by [rapier](https://rapier.rs/).

## License

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)
or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as
defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the
work by you, as
defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or
conditions.
41 changes: 6 additions & 35 deletions crates/modor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,29 @@ repository.workspace = true
rust-version.workspace = true

[dependencies]
derivative.workspace = true
fxhash.workspace = true
log.workspace = true
typed-index-collections.workspace = true
petgraph.workspace = true
rayon.workspace = true
thiserror.workspace = true
modor_derive.workspace = true
modor_internal.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
scoped_threadpool.workspace = true
pretty_env_logger.workspace = true


[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook.workspace = true
console_log.workspace = true
wasm-bindgen-test.workspace = true

[target.'cfg(target_os = "android")'.dependencies]
android-activity.workspace = true
android_logger.workspace = true

[dev-dependencies]
approx.workspace = true
doc-comment.workspace = true
spin_sleep.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
compiletest_rs.workspace = true
criterion = { workspace = true, features = ["rayon"] }
instant.workspace = true

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
criterion.workspace = true
instant = { workspace = true, features = ["wasm-bindgen"] }
wasm-bindgen-test.workspace = true

[lints]
workspace = true

[[bench]]
name = "entity_creation"
harness = false

[[bench]]
name = "simple_system_iteration"
harness = false

[[bench]]
name = "one_system_fragmented_iteration"
harness = false

[[bench]]
name = "multiple_systems_fragmented_iteration"
harness = false

[[bench]]
name = "parallel_system_iteration"
harness = false
55 changes: 0 additions & 55 deletions crates/modor/benches/entity_creation.rs

This file was deleted.

52 changes: 0 additions & 52 deletions crates/modor/benches/multiple_systems_fragmented_iteration.rs

This file was deleted.

Loading
Loading