-
Notifications
You must be signed in to change notification settings - Fork 86
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
More Marvin commands #404
More Marvin commands #404
Conversation
Hi, @thokkat , thanks for PR! Can you please give more detail explanation on each command? Expected vanilla behavior and implemented one(if differs) |
Edited start post. |
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.
I've made a quick only look so far, will do testing, once I'm done with npc swimming code, that I'm currently working on.
game/world/worldobjects.cpp
Outdated
npc.tick(dtPlayer); else | ||
if(npc.isPlayer()) { | ||
if(Gothic::inst().camera() && Gothic::inst().camera()->isMarvinMode(Camera::M_Free)) { | ||
return; |
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.
Bug?
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.
Also why player is not receiving ticks, when in free-cam mode?
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.
Player can't move, doesn't drop if in air, receives no damage if diving bar is empty, aigoto
only starts if free cam
mode is left and current animation is frozen. Player can be damaged by monsters and npc though but death animation behaves like aigoto
. Maybe it's best to just activate godmode
here.
So basically all what's done in player-tick is skipped/ignored.
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.
Tested vanilla today:
In free cam move playable npc doesn't receive animation ticks for skeletal animation, an no physics ticks. It can receive damage and perceptions(magic damage at least).
Also main menu not working in free-camera O-o
Anyway return;
is definitely wrong here.
game/camera.cpp
Outdated
if(m==M_Free) | ||
pl->setAnim(AnimationSolver::NoAnim); | ||
if(m==M_Fixed) { | ||
auto offset = dst.target - pl->cameraBone(); |
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 math odd.
Is it another way to write inverse(pl->cameraBone()) * dst.target
?
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 is supposed to calculate the vector from player to camera position. Is there a better way?
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.
Is there a better way?
Matrix seem to be close-most to vanilla. so you storing offset vector in players coordinate system. And then you project it back to world on camera ticks. This should be shorter and titling will be reproduced naturally.
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.
Isn't it what I'm currently doing? Code below would lead to same offset vector.
Vec3 offset(0,0,1);
Matrix4x4 m;
m.identity();
m.translate(pl->cameraBone(true));
m.inverse();
m.translate(dst.target);
m.project(offset);
cameraOffset = offset;
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.
I mean it make sense to change it, and fetch cameraBone
from npc as matrix, with tilt and rotation.
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.
I use pl->transform()
to fetch matrix, but still normal tilt. Am I forgetting something or is there anything else needed?
Edit: Ok looks like offsetAng
could do the tilt
@ezamelczyk @Try Also didn't manage to get tilt in. Everything i did also changed the rotation axis. I'd like to leave that for a follow pr, except you know right away how to do it. Although i like it how it is, just a change of camera perspective. |
Yup. Seems to be working correctly with updates from main. |
Checkout with github no longer working :( |
This PR implements marvin keys
F4-F7
and the console commandtoggle time
#215.F4 - Reset camera to normal mode.
F5 - Freeze camera. Camera stays in place and can't be moved. Character can move freely.
F6 - Free camera. Allows to fly the camera through the world. Character is frozen.
F7 - Like normal play but camera is shifted to a position reached by F6. Camera moves with the character.
F4-F6 are implemented the same as vanilla. There
F7
aligns the camera to the players head-to-foot axis. I haven't looked into that and kept the usual y-axis, but can try if it's desirable.I encountered some hiccups when the camera changes to a different mode. I opted to not stop marvin cam in those cases for now, there's always
F4
to reset.Comparison F7 PR/vanilla
new.mp4
old.mp4