-
Notifications
You must be signed in to change notification settings - Fork 173
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
base: main
Are you sure you want to change the base?
feat: Darkflame Cinema #1294
Conversation
* 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
dGame/Player.cpp
Outdated
m_ObservedEntitiesLength = 256; | ||
m_ObservedEntitiesUsed = 0; | ||
m_ObservedEntities.resize(m_ObservedEntitiesLength); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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
dCommon/dConfig.cpp
Outdated
static std::string emptyString{}; | ||
|
||
const auto& it = this->m_ConfigValues.find(key); | ||
|
||
if (it == this->m_ConfigValues.end()) return emptyString; | ||
|
||
return it->second; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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/Player.cpp
Outdated
m_ObservedEntitiesLength = 256; | ||
m_ObservedEntitiesUsed = 0; | ||
m_ObservedEntities.resize(m_ObservedEntitiesLength); |
There was a problem hiding this comment.
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.
public: | ||
NiPoint3 position; | ||
NiQuaternion rotation; | ||
NiPoint3 velocity; | ||
NiPoint3 angularVelocity; | ||
bool onGround; | ||
bool dirtyVelocity; | ||
bool dirtyAngularVelocity; |
There was a problem hiding this comment.
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
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanUp = element->BoolAttribute("clean-up"); | |
cleanUp = element->BoolAttribute("cleanUp"); |
There was a problem hiding this comment.
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.
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.