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

feat: Darkflame Cinema #1294

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft

feat: Darkflame Cinema #1294

wants to merge 31 commits into from

Conversation

Wincent01
Copy link
Member

Darkflame Cinema is a way to create interactive — acted — experiences in Darkflame Universe. It aims to provide a complement to the ordinary mission structure with static NPCs and mission texts to convey story. Insperation is drawn from games likes of World of Warcraft, where NPCs frequently act out scenes, alone and in combination with both the player and other NPCs.

See the README for documentation.

The tool can be used without modded objects, but will have limited utility. With precedence of tools like VanityNPC this can fit in the main repository — introducing only optional functionality.

* Recorder to recall player actions.
* Server precondtions to manage entity visiblity.
Conflicts:
	dGame/dGameMessages/GameMessages.cpp
Includes documentation of how to create acts, prefabs and scenes.
* Updated logging
* Added an image to the README
* Visiblity and effect records
* Recorder will catch effects from behaviors
* Documentation for setting up a scene to play automatically.
* Documentation for server-side preconditions.
* Added the ability to specify a change to play
* Added the ability to specify if a scene can play multiple times to the same player
+ Can now specify a cordinate to path find to
+ Can now enable/disable the combat AI
@Wincent01 Wincent01 added enhancement New feature or request A-game Related to dGame labels Nov 14, 2023
@Wincent01 Wincent01 marked this pull request as draft November 14, 2023 13:04
dGame/Player.cpp Outdated
Comment on lines 35 to 37
m_ObservedEntitiesLength = 256;
m_ObservedEntitiesUsed = 0;
m_ObservedEntities.resize(m_ObservedEntitiesLength);
Copy link
Member Author

Choose a reason for hiding this comment

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

This had no right being a vector instead of a set

Copy link
Collaborator

Choose a reason for hiding this comment

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

This change should be moved to a separate PR since it is quite isolated and a good improvement.

Copy link
Collaborator

@EmosewaMC EmosewaMC left a comment

Choose a reason for hiding this comment

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

First pass of review feedback, will do a second pass later

CMakeVariables.txt Outdated Show resolved Hide resolved
Comment on lines 37 to 43
static std::string emptyString{};

const auto& it = this->m_ConfigValues.find(key);

if (it == this->m_ConfigValues.end()) return emptyString;

return it->second;
Copy link
Collaborator

Choose a reason for hiding this comment

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

any particular reason you moved away from operator subscripting here? The memory usage here is in the bytes, so I dont see why we'd basically inline the subscripting

Copy link
Member Author

Choose a reason for hiding this comment

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

When we were troubleshooting the SQL stuff this was where a crash was occuring.

dGame/EntityManager.cpp Outdated Show resolved Hide resolved
dGame/Player.cpp Outdated
Comment on lines 35 to 37
m_ObservedEntitiesLength = 256;
m_ObservedEntitiesUsed = 0;
m_ObservedEntities.resize(m_ObservedEntitiesLength);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change should be moved to a separate PR since it is quite isolated and a good improvement.

dGame/dCinema/Play.cpp Show resolved Hide resolved
Comment on lines +81 to +88
public:
NiPoint3 position;
NiQuaternion rotation;
NiPoint3 velocity;
NiPoint3 angularVelocity;
bool onGround;
bool dirtyVelocity;
bool dirtyAngularVelocity;
Copy link
Collaborator

Choose a reason for hiding this comment

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

member variables should be moved to private if possible

Comment on lines +97 to +99
std::vector<std::pair<LOT, std::pair<NiPoint3, NiQuaternion>>> m_Objects;
std::vector<std::pair<Prefab, NiPoint3>> m_Prefabs;
std::vector<std::pair<LOT, std::pair<Recording::Recorder*, std::string>>> m_NPCs;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The first and third objects here can be replaced with std::multimap if I am understanding the use case here correctly

Copy link
Member Author

@Wincent01 Wincent01 Nov 20, 2023

Choose a reason for hiding this comment

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

Yeah. Could do either way, isn't going to have a noticable effect on speed/mem. This is a list of LOTs which should be spawned at a specified location/rotation.

float m_ChanceToPlay = 1.0f;
bool m_Repeatable = true;

std::vector<std::pair<PreconditionExpression, bool>> m_Preconditions;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be replaced with a std::set (std::set is just std::map<T, bool> effectively)

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so? The boolean here specifies weather or not the precondition should be negated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case it could just br replaced with a map instead for lookup

dGame/dUtilities/ServerPreconditions.hpp Outdated Show resolved Hide resolved
dGame/dUtilities/SlashCommandHandler.cpp Outdated Show resolved Hide resolved
Conflicts:
	dGame/EntityManager.cpp
	dGame/Player.h
	dGame/dComponents/RenderComponent.cpp
Conflicts:
	CMakeLists.txt
	dGame/CMakeLists.txt
	dGame/Entity.cpp
	dGame/dBehaviors/AttackDelayBehavior.cpp
	dGame/dBehaviors/PlayEffectBehavior.cpp
m_Delay = element->DoubleAttribute("t");

if (element->Attribute("cleanUp")) {
cleanUp = element->BoolAttribute("clean-up");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cleanUp = element->BoolAttribute("clean-up");
cleanUp = element->BoolAttribute("cleanUp");

Copy link
Collaborator

@EmosewaMC EmosewaMC Sep 10, 2024

Choose a reason for hiding this comment

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

nit: also as a note, bool attribute (really any of the Attribute calls) already does bounds checks for you, the second argument allows you to choose a default value should one not exist in the xml doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-game Related to dGame enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants