diff --git a/README.md b/README.md index c7a705430..181857ed3 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Yes, yet another work-in-progress game and graphic engine project :) | Win64 | DX12 | ![Win64_DX12_Debug.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_DX12_Debug.yml/badge.svg) | ![Win64_DX12_Release.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_DX12_Release.yml/badge.svg) | ![Win64_DX12_Final.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_DX12_Final.yml/badge.svg) | Win64 | Vulkan | ![Win64_Vulkan_Debug.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_Vulkan_Debug.yml/badge.svg) | ![Win64_Vulkan_Release.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_Vulkan_Release.yml/badge.svg) | ![Win64_Vulkan_Final.yml](https://github.com/vimontgames/vgframework/actions/workflows/Win64_Vulkan_Final.yml/badge.svg) +![Screenshot](doc/img/0.39.png) + [description](#description)\ [changelog](#changelog)\ [getting started](#getting-started)\ diff --git a/data/Prefabs/Bat.prefab b/data/Prefabs/Bat.prefab index 7c4efde6b..d31fccc94 100644 --- a/data/Prefabs/Bat.prefab +++ b/data/Prefabs/Bat.prefab @@ -81,6 +81,7 @@ + @@ -113,7 +114,7 @@ - + diff --git a/data/Prefabs/Floor/Concrete_3x3.prefab b/data/Prefabs/Floor/Concrete_3x3.prefab index 83b53aa75..2c89b90b6 100644 --- a/data/Prefabs/Floor/Concrete_3x3.prefab +++ b/data/Prefabs/Floor/Concrete_3x3.prefab @@ -30,7 +30,7 @@ - + @@ -66,6 +66,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/data/Prefabs/GJ.prefab b/data/Prefabs/GJ.prefab index bc55df6c2..24da04350 100644 --- a/data/Prefabs/GJ.prefab +++ b/data/Prefabs/GJ.prefab @@ -30,15 +30,15 @@ - + - + @@ -103,9 +103,10 @@ - + + @@ -115,9 +116,10 @@ - + + @@ -127,9 +129,10 @@ - + + @@ -139,9 +142,10 @@ - + + @@ -151,9 +155,10 @@ - + + @@ -163,9 +168,10 @@ - + + @@ -175,9 +181,10 @@ - + + @@ -187,9 +194,10 @@ - + + @@ -209,7 +217,7 @@ - + @@ -220,7 +228,7 @@ - + diff --git a/data/Prefabs/GrosCovid.prefab b/data/Prefabs/GrosCovid.prefab index c50d078cf..145d1f2cf 100644 --- a/data/Prefabs/GrosCovid.prefab +++ b/data/Prefabs/GrosCovid.prefab @@ -34,11 +34,11 @@ - + @@ -151,6 +151,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -191,7 +228,7 @@ - + @@ -207,7 +244,24 @@ - + + + + + + + + + + + + + + + + + + diff --git a/data/Prefabs/Katana.prefab b/data/Prefabs/Katana.prefab index e2cc59c78..c10901336 100644 --- a/data/Prefabs/Katana.prefab +++ b/data/Prefabs/Katana.prefab @@ -81,6 +81,7 @@ + @@ -97,7 +98,7 @@ - + @@ -113,7 +114,7 @@ - + diff --git a/data/Prefabs/KatanaRomeo.prefab b/data/Prefabs/KatanaRomeo.prefab index 5676fbe7f..5e87847bc 100644 --- a/data/Prefabs/KatanaRomeo.prefab +++ b/data/Prefabs/KatanaRomeo.prefab @@ -81,6 +81,7 @@ + @@ -97,7 +98,7 @@ - + @@ -113,7 +114,7 @@ - + diff --git a/data/Prefabs/VGF_Boy.prefab b/data/Prefabs/VGF_Boy.prefab index 8a0fd62cd..2ea31e5c5 100644 --- a/data/Prefabs/VGF_Boy.prefab +++ b/data/Prefabs/VGF_Boy.prefab @@ -24,56 +24,63 @@ - + - - - + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - + - + - - - - - - - - - - + + - - + + - + + + + + + + @@ -89,13 +96,65 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -109,7 +168,7 @@ - + @@ -147,7 +206,47 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/Scenes/Aiguelongue.scene b/data/Scenes/Aiguelongue.scene index e196f6c41..04fddf8ba 100644 --- a/data/Scenes/Aiguelongue.scene +++ b/data/Scenes/Aiguelongue.scene @@ -599,7 +599,7 @@ - + @@ -667,10 +667,10 @@ - + - + @@ -1857,7 +1857,7 @@ - + @@ -2436,7 +2436,7 @@ - + @@ -3682,7 +3682,7 @@ - + @@ -3707,7 +3707,7 @@ - + @@ -3867,7 +3867,7 @@ - + @@ -4110,7 +4110,7 @@ - + @@ -4218,7 +4218,7 @@ - + @@ -4240,7 +4240,7 @@ - + @@ -4255,6 +4255,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/Sounds/Groscovid/die.wav b/data/Sounds/Groscovid/die.wav new file mode 100644 index 000000000..5ef8b14dd Binary files /dev/null and b/data/Sounds/Groscovid/die.wav differ diff --git a/data/Sounds/Groscovid/hurt.wav b/data/Sounds/Groscovid/hurt.wav new file mode 100644 index 000000000..c0db8bcad Binary files /dev/null and b/data/Sounds/Groscovid/hurt.wav differ diff --git a/data/Sounds/Weapons/swoosh_bat.wav b/data/Sounds/Weapons/swoosh_bat.wav index 91606fd5b..536f058a1 100644 Binary files a/data/Sounds/Weapons/swoosh_bat.wav and b/data/Sounds/Weapons/swoosh_bat.wav differ diff --git a/data/Sounds/Weapons/swoosh_sword.wav b/data/Sounds/Weapons/swoosh_sword.wav index 950106fdf..21b085558 100644 Binary files a/data/Sounds/Weapons/swoosh_sword.wav and b/data/Sounds/Weapons/swoosh_sword.wav differ diff --git a/doc/img/0.39.png b/doc/img/0.39.png new file mode 100644 index 000000000..e9037bbf5 Binary files /dev/null and b/doc/img/0.39.png differ diff --git a/projects/game/src/Behaviour/Character/CharacterBehaviour.cpp b/projects/game/src/Behaviour/Character/CharacterBehaviour.cpp index 66636e2bd..3b5ee11ac 100644 --- a/projects/game/src/Behaviour/Character/CharacterBehaviour.cpp +++ b/projects/game/src/Behaviour/Character/CharacterBehaviour.cpp @@ -58,21 +58,24 @@ bool CharacterBehaviour::registerProperties(IClassDesc& _desc) registerProperty(CharacterBehaviour, m_life, "Life"); registerProperty(CharacterBehaviour, m_hp, "HP"); - registerProperty(CharacterBehaviour, m_score, "Score"); registerProperty(CharacterBehaviour, m_walkSpeed, "Walk"); registerProperty(CharacterBehaviour, m_runSpeed, "Run"); - registerProperty(CharacterBehaviour, m_jumpSpeed, "Small Jump"); - registerProperty(CharacterBehaviour, m_runJumpSpeed, "Big Jump"); + registerProperty(CharacterBehaviour, m_jumpSpeed, "Jump (small)"); + registerProperty(CharacterBehaviour, m_runJumpSpeed, "Jump (big)"); - registerPropertyEx(CharacterBehaviour, m_isActive, "Active", vg::core::PropertyFlags::NotSaved); - registerPropertyEx(CharacterBehaviour, m_speedCurrent, "Speed", vg::core::PropertyFlags::NotSaved); - registerPropertyEx(CharacterBehaviour, m_velocityNorm, "Velocity", vg::core::PropertyFlags::NotSaved); - registerPropertyEx(CharacterBehaviour, m_currentRotation, "Rotation", vg::core::PropertyFlags::NotSaved); - - registerPropertyEnumEx(CharacterBehaviour, MoveState, m_moveState, "Move", vg::core::PropertyFlags::NotSaved); - registerPropertyEnumEx(CharacterBehaviour, FightState, m_fightState, "Fight", vg::core::PropertyFlags::NotSaved); - registerPropertyEnumEx(CharacterBehaviour, SoundState, m_soundState, "Sound", vg::core::PropertyFlags::NotSaved); + registerPropertyGroupBegin(CharacterBehaviour, "Character debug"); + { + registerPropertyEx(CharacterBehaviour, m_isActive, "Active", vg::core::PropertyFlags::NotSaved); + registerPropertyEx(CharacterBehaviour, m_score, "Score", vg::core::PropertyFlags::NotSaved); + registerPropertyEnumEx(CharacterBehaviour, MoveState, m_moveState, "Move", vg::core::PropertyFlags::NotSaved); + registerPropertyEnumEx(CharacterBehaviour, FightState, m_fightState, "Fight", vg::core::PropertyFlags::NotSaved); + registerPropertyEnumEx(CharacterBehaviour, SoundState, m_soundState, "Sound", vg::core::PropertyFlags::NotSaved); + registerPropertyEx(CharacterBehaviour, m_speedCurrent, "Speed", vg::core::PropertyFlags::NotSaved); + registerPropertyEx(CharacterBehaviour, m_velocityNorm, "Velocity", vg::core::PropertyFlags::NotSaved); + registerPropertyEx(CharacterBehaviour, m_currentRotation, "Rotation", vg::core::PropertyFlags::NotSaved); + } + registerPropertyGroupEnd(CharacterBehaviour); return true; } @@ -271,12 +274,12 @@ bool CharacterBehaviour::takeHit(CharacterBehaviour * _attacker, ItemBehaviour * if (m_hp > 0) { m_moveState = MoveState::Hurt; - playSound(SoundState::Hit); + playSound(SoundState::Hurt); } else { m_moveState = MoveState::Die; - playSound(SoundState::Hit); + playSound(SoundState::Die); } if (push > 0) diff --git a/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.h b/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.h index 64b0f791a..6fe9db296 100644 --- a/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.h +++ b/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.h @@ -16,6 +16,7 @@ class EnemyBehaviour final : public CharacterBehaviour void Update(const Context & _context) override; private: + float m_detectionRadius = 10.0f; vg::core::float3 m_targetPosNew = vg::core::float3(0, 0, 0); vg::core::float3 m_targetPosSmooth = vg::core::float3(0, 0, 0); bool m_targetAcquired = false; diff --git a/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.hpp b/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.hpp index 222efc880..eee1d5b1a 100644 --- a/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.hpp +++ b/projects/game/src/Behaviour/Character/Enemy/EnemyBehaviour.hpp @@ -24,8 +24,15 @@ bool EnemyBehaviour::registerProperties(IClassDesc & _desc) { super::registerProperties(_desc); - registerPropertyEx(EnemyBehaviour, m_targetPosNew, "TargetPosNew", PropertyFlags::NotSaved); - registerPropertyEx(EnemyBehaviour, m_targetPosSmooth, "TargetPosSmooth", PropertyFlags::NotSaved); + registerProperty(EnemyBehaviour, m_detectionRadius, "Detection radius"); + setPropertyDescription(EnemyBehaviour, m_detectionRadius, "If a player is detected in this radius, it will be detected"); + + registerPropertyGroupBegin(EnemyBehaviour, "Enemy debug"); + { + registerPropertyEx(EnemyBehaviour, m_targetPosNew, "Target position", PropertyFlags::NotSaved); + registerPropertyEx(EnemyBehaviour, m_targetPosSmooth, "Target position (smoothed)", PropertyFlags::NotSaved); + } + registerPropertyGroupEnd(EnemyBehaviour); return true; } @@ -107,7 +114,7 @@ void EnemyBehaviour::FixedUpdate(const Context & _context) closestPlayerInfo = activePlayersInfos[0]; vg::renderer::IDebugDraw * dbgDraw = Game::Engine().GetRenderer()->GetDebugDraw(); - bool isClose = closestPlayerInfo.distance < 4.0f; + const bool isClose = closestPlayerInfo.distance < m_detectionRadius; //dbgDraw->AddLine(world, pos, closestPlayerInfo.position, m_isActive ? 0xFF0000FF : 0xFF00FF00); diff --git a/projects/game/src/Behaviour/Character/Player/PlayerBehaviour.hpp b/projects/game/src/Behaviour/Character/Player/PlayerBehaviour.hpp index c42ef7f2c..8814cf635 100644 --- a/projects/game/src/Behaviour/Character/Player/PlayerBehaviour.hpp +++ b/projects/game/src/Behaviour/Character/Player/PlayerBehaviour.hpp @@ -43,8 +43,12 @@ bool PlayerBehaviour::registerProperties(IClassDesc & _desc) registerProperty(PlayerBehaviour, m_UI, "UI"); setPropertyDescription(PlayerBehaviour, m_UI, "Player UI Prefab instance linked"); - registerPropertyEx(PlayerBehaviour, m_viewIndex, "View", vg::core::PropertyFlags::NotSaved | vg::core::PropertyFlags::ReadOnly); - setPropertyDescription(PlayerBehaviour, m_viewIndex, "Index of the View used by this player"); + registerPropertyGroupBegin(PlayerBehaviour, "Player debug"); + { + registerPropertyEx(PlayerBehaviour, m_viewIndex, "View", vg::core::PropertyFlags::NotSaved | vg::core::PropertyFlags::ReadOnly); + setPropertyDescription(PlayerBehaviour, m_viewIndex, "Index of the View used by this player"); + } + registerPropertyGroupEnd(PlayerBehaviour); return true; } diff --git a/projects/game/src/Game_consts.h b/projects/game/src/Game_consts.h index d51a91e4f..bff992533 100644 --- a/projects/game/src/Game_consts.h +++ b/projects/game/src/Game_consts.h @@ -26,7 +26,7 @@ vg_enum_class(FightState, vg::core::u8, vg_enum_class(SoundState, vg::core::u8, None = 0, - Hit, + Hurt, Die ); diff --git a/src/engine/Component/Physics/Object/Body/PhysicsBodyComponent.hpp b/src/engine/Component/Physics/Object/Body/PhysicsBodyComponent.hpp index 079ac8bce..775ffdf08 100644 --- a/src/engine/Component/Physics/Object/Body/PhysicsBodyComponent.hpp +++ b/src/engine/Component/Physics/Object/Body/PhysicsBodyComponent.hpp @@ -78,30 +78,30 @@ namespace vg::engine _context.m_gameObject->setGlobalMatrix(matrix); } } - } + } + } - const auto * engineOptions = EngineOptions::get(); - if (engineOptions->isAnyBodyVisible()) + const auto * engineOptions = EngineOptions::get(); + if (engineOptions->isAnyBodyVisible()) + { + const auto shapes = GetGameObject()->GetComponentsT(); + if (shapes.size() > 0) { - const auto shapes = GetGameObject()->GetComponentsT(); - if (shapes.size() > 0) + float totalMass = 0.0f; + for (uint i = 0; i < shapes.size(); ++i) { - float totalMass = 0.0f; - for (uint i = 0; i < shapes.size(); ++i) + const auto * shape = shapes[i]; + if (shape && shape->isEnabled()) { - const auto * shape = shapes[i]; - if (shape && shape->isEnabled()) - { - const auto * physicsShape = shape->getPhysicsShape(); - if (physicsShape && engineOptions->isBodyVisible(physicsShape->GetShapeType())) - physicsShape->Draw(_context.m_world, _context.m_gameObject->getGlobalMatrix()); - } + const auto * physicsShape = shape->getPhysicsShape(); + if (physicsShape && engineOptions->isBodyVisible(physicsShape->GetShapeType())) + physicsShape->Draw(_context.m_world, _context.m_gameObject->getGlobalMatrix()); } } - else - { - VG_WARNING("[Physics] PhysicsBodyComponent in GameObject \"%s\" has no physics shape", _context.m_gameObject->GetName().c_str()); - } + } + else + { + VG_WARNING("[Physics] PhysicsBodyComponent in GameObject \"%s\" has no physics shape", _context.m_gameObject->GetName().c_str()); } } diff --git a/src/version.h b/src/version.h index 4328f664d..f571d62ca 100644 --- a/src/version.h +++ b/src/version.h @@ -2,4 +2,4 @@ #define VG_FRAMEWORK_VERSION_MAJOR 0 #define VG_FRAMEWORK_VERSION_MINOR 39 -#define VG_FRAMEWORK_VERSION_PATCH 0 \ No newline at end of file +#define VG_FRAMEWORK_VERSION_PATCH 1 \ No newline at end of file