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

Implement Dialogue tools Actor mechanics - closes 6461 #6469

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

blurymind
Copy link
Contributor

@blurymind blurymind commented Mar 20, 2024

This expands the current dialogue tools runtime with a set of Actions, conditions and expressions to enable setting actors and opening the door to implement a story based game with much less repetition for changing of avatars, text color, actor stats and so on

Todo:

I can confirm that this does not change of the existing functionality unless you set up an actor that is detected in a dialogue line in yarn.

I have also made some minor changes to simplify some of the existing code a bit

Assiciated ticket that this closes #6461 and #6420 since the actor stuff relies on it

New features that greatly simplify setting up complex dialogue:

  • Ability to create dialog actors and detect when they are the currently talking actor in yarn text lines
//in yarn
I am a normal line and I will work just the same as before
s: Hello, how are you? I am an actor line. If an actor with the id of "s" has been created, I will be treated differently
m: I am another actor line. The beginning "m:" will be stripped out of the text and DialogueTools will detect when I'm active
s smile: that is true! You can also pass arguments such as "smile" and dialog tools will tell the game when I am talking.
m: This makes it super easy to  dynamically change text color, avatars and so on when the active actor changes
s: what is useful is that the actor state is saved in yarn's state, that makes game saves and dynamic changes supper easy
// to change an actor's info, the pattern is as follows $a.[id].[variable]=newValue. Creating an actor simply sets those up
// this lets you easily change them during dialog or via the event sheet. A simple command is added to make this easier
<<set $a.s.color="123;12;123">>
// you can even attach your own values to an actor and use them to drive gdevelop events that update the avatars for example
<<set $a.s.face="smile">>
  • Ability to easily set up an actor's name, emotes, color, and any other parameters and dynamically change those
  • ability to get command parameter values via key like so (demonstrated use in the demo)
    <<command oldParameter keyedParameter=123 anotherKeyedParameter=true>>
  • ability to get tag values via key like so (demonstrated use in the demo)
    tag anotherTag keyedTag:123 anotherKeyedTag:true
  • basic ability to "fake" object variables in yarn, check if their keys exist, how many keys so we can iterate, delete object variables and so on. This is necessary for more complex games such as visual novels where we want to have better ability for yarn text to drive UI. The actor system is built on top of it

@blurymind blurymind requested a review from 4ian as a code owner March 20, 2024 18:05
@blurymind
Copy link
Contributor Author

Sorry this is taking awhile for the demo. I want to make sure it stress tests the new features well while demonstrating in a simple way how to set it up and use it

@blurymind
Copy link
Contributor Author

@4ian and anyone interested in trying this new actor system, please feel free to give my little demo a try
https://github.com/blurymind/Gdevelop-dialoguetools-actor-system-demo

@blurymind
Copy link
Contributor Author

blurymind commented Mar 30, 2024

The demo presents a basic avatar mechanic where you have a left and a right avatar as well as layering (face is another layer from outfit) - all setup w the event sheet.

I am wondering whether to expand my actor system to also keep track of actor's avatar position and face to make it even easier to setup and use (fewer event sheet lines needed that way) - but it would make the system more opinionated about how its used in some ways. For now decided not to go further with adding more to it

@4ian
Copy link
Owner

4ian commented Apr 2, 2024

I've lost a bit track of the status of this, is this something ready to review/tested? :)

@blurymind
Copy link
Contributor Author

yes it is :) thanks in advance

@blurymind
Copy link
Contributor Author

If you feel like I need to expand the demo to present more of these features I can do that too? Let me know if you need anything for the pr or have feedback :)

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