Skip to content

Commit

Permalink
improvements on AI, HA renderer, Overworld and related modules
Browse files Browse the repository at this point in the history
  • Loading branch information
PsichiX committed Dec 6, 2021
1 parent e089cc8 commit c60cdd9
Show file tree
Hide file tree
Showing 120 changed files with 4,033 additions and 2,969 deletions.
4 changes: 2 additions & 2 deletions demos/procedural-world-simulation/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "oxygengine-pws"
version = "0.22.0"
version = "0.24.0"
authors = ["Patryk 'PsichiX' Budzynski <psichix@gmail.com>"]
edition = "2021"
description = "Oxygengine procedural world simulation"
Expand All @@ -14,6 +14,6 @@ minifb = "0.19"
rand = "0.8"

[dependencies.oxygengine-procedural]
version = "0.22"
version = "0.24"
path = "../../engine/procedural"
features = ["parallel"]
2 changes: 1 addition & 1 deletion demos/wip/pokemon/Cargo.toml
Expand Up @@ -21,6 +21,6 @@ rand = "0.8"
getrandom = { version = "0.2", features = ["js"] }

[dependencies.oxygengine]
version = "0.22"
version = "0.24"
features = ["web-composite-game"]
path = "../../engine/_"
2 changes: 1 addition & 1 deletion demos/wip/soulhunter/Cargo.toml
Expand Up @@ -19,6 +19,6 @@ console_error_panic_hook = { version = "0.1", optional = true }
serde = { version = "1", features = ["derive"] }

[dependencies.oxygengine]
version = "0.22"
version = "0.24"
features = ["web-composite-game"]
path = "../../engine/_"
2 changes: 1 addition & 1 deletion demos/wip/spinbots/Cargo.toml
Expand Up @@ -21,6 +21,6 @@ serde_yaml = "0.8"
vek = "0.15"

[dependencies.oxygengine]
version = "0.22"
version = "0.24"
features = ["web-composite-game"]
path = "../../engine/_"
60 changes: 30 additions & 30 deletions engine/_/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "oxygengine"
version = "0.22.0"
version = "0.24.0"
authors = ["Patryk 'PsichiX' Budzynski <psichix@gmail.com>"]
edition = "2021"
description = "Oxygengine"
Expand Down Expand Up @@ -81,140 +81,140 @@ desktop-native-headless-game = [
]

[dependencies]
oxygengine-core = { version = "0.22", path = "../core" }
oxygengine-utils = { version = "0.22", path = "../utils" }
oxygengine-core = { version = "0.24", path = "../core" }
oxygengine-utils = { version = "0.24", path = "../utils" }

[dependencies.oxygengine-backend-web]
version = "0.22"
version = "0.24"
path = "../backend-web"
optional = true

[dependencies.oxygengine-input]
version = "0.22"
version = "0.24"
path = "../input"
optional = true

[dependencies.oxygengine-input-device-web]
version = "0.22"
version = "0.24"
path = "../input-device-web"
optional = true

[dependencies.oxygengine-composite-renderer]
version = "0.22"
version = "0.24"
path = "../composite-renderer"
optional = true

[dependencies.oxygengine-composite-renderer-backend-web]
version = "0.22"
version = "0.24"
path = "../composite-renderer-backend-web"
optional = true

[dependencies.oxygengine-network]
version = "0.22"
version = "0.24"
path = "../network"
optional = true

[dependencies.oxygengine-network-backend-web]
version = "0.22"
version = "0.24"
path = "../network-backend-web"
optional = true

[dependencies.oxygengine-network-backend-desktop]
version = "0.22"
version = "0.24"
path = "../network-backend-desktop"
optional = true

[dependencies.oxygengine-network-backend-native]
version = "0.22"
version = "0.24"
path = "../network-backend-native"
optional = true

[dependencies.oxygengine-procedural]
version = "0.22"
version = "0.24"
path = "../procedural"
optional = true

[dependencies.oxygengine-navigation]
version = "0.22"
version = "0.24"
path = "../navigation"
optional = true

[dependencies.oxygengine-audio]
version = "0.22"
version = "0.24"
path = "../audio"
optional = true

[dependencies.oxygengine-audio-backend-web]
version = "0.22"
version = "0.24"
path = "../audio-backend-web"
optional = true

[dependencies.oxygengine-physics-2d]
version = "0.22"
version = "0.24"
path = "../physics-2d"
optional = true

[dependencies.oxygengine-integration-ow-ha]
version = "0.22"
version = "0.24"
path = "../integration-ow-ha"
optional = true

[dependencies.oxygengine-integration-p2d-cr]
version = "0.22"
version = "0.24"
path = "../integration-p2d-cr"
optional = true

[dependencies.oxygengine-integration-ui-cr]
version = "0.22"
version = "0.24"
path = "../integration-ui-cr"
optional = true

[dependencies.oxygengine-integration-ui-ha]
version = "0.22"
version = "0.24"
path = "../integration-ui-ha"
optional = true

[dependencies.oxygengine-integration-vn-ui]
version = "0.22"
version = "0.24"
path = "../integration-vn-ui"
optional = true

[dependencies.oxygengine-script-flow]
version = "0.22"
version = "0.24"
path = "../script-flow"
optional = true

[dependencies.oxygengine-visual-novel]
version = "0.22"
version = "0.24"
path = "../visual-novel"
optional = true

[dependencies.oxygengine-ai]
version = "0.22"
version = "0.24"
path = "../ai"
optional = true

[dependencies.oxygengine-animation]
version = "0.22"
version = "0.24"
path = "../animation"
optional = true

[dependencies.oxygengine-user-interface]
version = "0.22"
version = "0.24"
path = "../user-interface"
optional = true

[dependencies.oxygengine-editor-tools]
version = "0.22"
version = "0.24"
path = "../editor-tools"
optional = true

[dependencies.oxygengine-ha-renderer]
version = "0.22"
version = "0.24"
path = "../ha-renderer"
optional = true

[dependencies.oxygengine-overworld]
version = "0.22"
version = "0.24"
path = "../overworld"
optional = true
2 changes: 1 addition & 1 deletion engine/_/src/lib.rs
Expand Up @@ -102,7 +102,7 @@ pub mod editor_tools {

pub mod prelude {
#[cfg(feature = "oxygengine-ai")]
pub use oxygengine_ai::*;
pub use oxygengine_ai::prelude::*;
#[cfg(feature = "oxygengine-animation")]
pub use oxygengine_animation::prelude::*;
#[cfg(feature = "oxygengine-audio")]
Expand Down
5 changes: 3 additions & 2 deletions engine/ai/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "oxygengine-ai"
version = "0.22.0"
version = "0.24.0"
authors = ["Patryk 'PsichiX' Budzynski <psichix@gmail.com>"]
edition = "2021"
description = "AI module for Oxygengine"
Expand All @@ -16,5 +16,6 @@ parallel = ["oxygengine-core/parallel"]
scalar64 = ["oxygengine-core/scalar64", "emergent/scalar64"]

[dependencies]
oxygengine-core = { version = "0.22", path = "../core" }
oxygengine-core = { version = "0.24", path = "../core" }
emergent = "1.5"
serde = { version = "1", features = ["derive"] }
42 changes: 42 additions & 0 deletions engine/ai/src/components.rs
@@ -0,0 +1,42 @@
use crate::resources::AiBehaviorMemory;
use emergent::prelude::*;
use oxygengine_core::{
ecs::Component,
prefab::{Prefab, PrefabComponent},
Ignite, Scalar,
};
use serde::{Deserialize, Serialize};

#[derive(Ignite, Default, Serialize, Deserialize)]
pub struct AiInstance<C>
where
C: Component,
{
pub template: String,
#[serde(default)]
pub decide_delay: Scalar,
#[serde(skip)]
#[ignite(ignore)]
pub(crate) decide_phase: Scalar,
#[serde(skip)]
#[ignite(ignore)]
pub(crate) decision_maker: Option<Box<dyn DecisionMakingTask<AiBehaviorMemory<C>>>>,
}

impl<C> AiInstance<C>
where
C: Component,
{
pub fn new(template: impl ToString, decide_delay: Scalar) -> Self {
Self {
template: template.to_string(),
decide_delay,
decide_phase: 0.0,
decision_maker: None,
}
}
}

impl<C> Prefab for AiInstance<C> where C: Component + Default {}

impl<C> PrefabComponent for AiInstance<C> where C: Component + Default {}

0 comments on commit c60cdd9

Please sign in to comment.