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

This branch contains multiple bugfixes and improvements. #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nino-Bock
Copy link

There are comments in the code which explain the changes made but needs to be removed when merging into main

Bugfixes:

  1. _leave did not reset the character position after the animation finished. _enter on the other side needs the sprite to start from its original position. I fixed that by resetting the sprite when the tween finishes.

  2. Pressing ui_accept causes animations to be skipped. As the same action is required to advance text, every animation except the first one was skipped. I removed that animation skip functionality, as it's required in my opinion and solves that issue.

Improvements:

  1. There can now be 4 characters on screen instead of 2. The added ones are named left_center and right_center

  2. Now only the talking character gets focus and is displayed in color. All the others are grey.

  3. Characters can leave the screen now and talk from the off without becoming visible again. I added a new animation called -hidden- for that cause.

Askarus added 2 commits November 11, 2021 11:04
…mments in the code which explain the changes made but needs to be removed when merging into main

Bugfixes:
1. _leave did not reset the character position after the animation finished. _enter on the other side needs the sprite to start from its original position. I fixt that by resetting the sprite when the tween finishes.
2. Pressing ui_accept causes animations to be skipped. As the same action is required to advance text, every animation except the first one was skipped. I removed that animation skip functionality, as it's required in my opinion and solves that issue.
------
Improvements:
1. There can now be 4 characters on screen instead of 2. The added ones are named left_center and right_center
2. Now only the talking character gets focus and is displayed in color. All the others are grey.
3. Characters can leave the screen now and talk from the off without becoming visible again. I added a new animation called -hidden- for that cause.
…n other one gets focus.

MAde the game to quit and not end in a black screen when the last scene gets played
@Nino-Bock Nino-Bock closed this Nov 15, 2021
@Nino-Bock Nino-Bock reopened this Nov 15, 2021
Copy link
Contributor

@NathanLovato NathanLovato left a comment

Choose a reason for hiding this comment

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

I see a couple of issues with those changes. For one, darkening the characters like that isn't necessarily an improvement. It at least feels incomplete. For instance, it probably shouldn't be instant.

I refactored the code on my end. A few things you do make it a bit more complicated than necessary - the system probably needs more of a rewrite too if you're to handle more than two characters and layer new animations. I've got to do more testing and think about it.

I left some general comments but there's nothing for you to directly change right now

Comment on lines +34 to +39
# NOTE:
# This code does not make sense
# As soon as you press ui_accept the animation is skipped
# That always happens when the player presses Enter/Space to advance the text
# That way animations will never play except for the first animation or when animations play automatically
#
Copy link
Contributor

@NathanLovato NathanLovato Nov 26, 2021

Choose a reason for hiding this comment

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

This is intentional. This is so when advancing text to the end you also skip the animations. Suppose you have longer animations: you don't want to just let them run without limits past the end of the text. Now, tweens can be a bit finicky so there's a need for some bug fixing there.

Copy link
Author

Choose a reason for hiding this comment

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

The problem here is that an animation will NEVER play as the player always presses ui_accept whenever they want to advance conversation.
What is needed is some mechanism which only lets you skip the animation if ui_accept is held for XX amount of time.
Maybe there is a function for that and I don't need to add a timer for it, which would make it all much easier.

Comment on lines +42 to +43
# if event.is_action_pressed("ui_accept") and _tween.is_active():
# _tween.seek(INF)
Copy link
Contributor

Choose a reason for hiding this comment

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

In a PR, you shouldn't leave dead code. But in this case, this code shouldn't be removed, if it doesn't work well, it should be fixed instead.

else:
_displayed[side] = character


_determine_focus(character.id, side, sprite)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to split the code to a new function that's only being used once. It only creates an indirection when reading the code (you have to jump to another place, then come back)

Copy link
Author

Choose a reason for hiding this comment

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

I disagree with that.
An indirection is not always bad for the reader.
In my opinion it is much better to make a function like that, than to put everything in one big function and add comments.
Someone who wants to understand my code can skit "_determine_focus" if them is not interested in that piece of code.
If everything was in one function, it's much harder to get a hold of the big picture.

@NathanLovato
Copy link
Contributor

NathanLovato commented Dec 4, 2021

I'm unable to work on this right now. I did some refactoring on my side last time, but I would implement the features differently, starting back from the requirements.

When coding this for the course, I intentionally made the system limited and specific. So some of the code is highly specific.

To expand it, there's a need to rethink in particular how characters work within the system. It'd also affect the course as this project's directly linked to it, so that's why it's quite a bit of work and I'm unable to tackle now.

The first bugfix regarding the leave animation would still be welcome. The other isn't a bug, or maybe there's a bug, but skipping animations along with the corresponding text is intentional, as commented in the PR review. If it doesn't skip all animations, then that bit isn't intended.

Now, I'm not a big player of visual novels, so if in most VN games they still play animations when skipping text and that's what players of those games expect, then the change would be welcome. Do you know more about that perhaps?

@NathanLovato
Copy link
Contributor

And once again, thanks for taking the time to contribute. I hope you understand reviewing and adapting code + the course takes time I don't have right now, and that it's not rejecting your work in itself.

@Nino-Bock
Copy link
Author

I'm unable to work on this right now. I did some refactoring on my side last time, but I would implement the features differently, starting back from the requirements.

When coding this for the course, I intentionally made the system limited and specific. So some of the code is highly specific.

To expand it, there's a need to rethink in particular how characters work within the system. It'd also affect the course as this project's directly linked to it, so that's why it's quite a bit of work and I'm unable to tackle now.

I expanded that system just for my personal needs.
I wanted to mimic the behavior o "Fire Emblem Path of Radiance" which had a nice dialog system in my opinion.
It was not my intention to rewrite the whole thing, but to quickly add functionality I needed for a very short fun conversation I sent someone.

The first bugfix regarding the leave animation would still be welcome. The other isn't a bug, or maybe there's a bug, but skipping animations along with the corresponding text is intentional, as commented in the PR review. If it doesn't skip all animations, then that bit isn't intended.

As mentioned above, your code does skip every animation as there is no check for how long the ui_accept button is held.
Animations get skipped whenever the button gets pressed, which is each time the player advances conversation.

Now, I'm not a big player of visual novels, so if in most VN games they still play animations when skipping text and that's what players of those games expect, then the change would be welcome. Do you know more about that perhaps?

I too am not a big player of visual novels.
As mentioned above I just wanted to get familiar with the engine and send someone a short and fun piece of conversation.
After finishing your course I noticed I was missing some features I wanted to use.

What some games (not VN but Fire Emblem like games) do is to not skip all the text and character animation instantly, but play them at a much higher speed.
I'm not sure if I remember that one correctly however.

@Nino-Bock
Copy link
Author

And once again, thanks for taking the time to contribute. I hope you understand reviewing and adapting code + the course takes time I don't have right now, and that it's not rejecting your work in itself.

Don't worry, I understand.
You have to have the course AND the code in mind.

I will make a PR then only containing the bugfixes.
Thanks for your time :)

@Jeremi360
Copy link

@Nino-Bock if you still looking for something like this check out my Rakugo Dialogue System:
https://rakugoteam.github.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants