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
New extension: Curved Movement #535
Conversation
Here is the updated example game. This time I think I did it correctly And here is the video. That I also hope I did correctly Version1.mp4 |
Really nice extension! I have some suggestions: Good practices
FeaturesSeparate the path definition from the movementWhat do you think about separating the path definition from the movement? I mean an action to append a path element and another one to start moving on the next path element with a given duration and easing. It could allow to loop on the path either by repeating it or go backward. It could also allow to:
Simplify path buildingI guess that users only need to append a path element or clear the path completely to define another one. Actions to modify points one by one can probably be removed. It will be easier to understand for users. |
Thank you.
Gdevelop orders all actions, conditions, and expressions alphabetically. If I don't use these letters, their order will be all over the place, which looks ugly and unreadable.
That looks a bit less intuitive than having a pause action, but alright. I will remove it.
ok.
These are both expressions which return the X or the Y position of a made up curve. I can't have a single expression returning both numbers. I may be missing something, but I don't see a way to merge them into one.
Sorry. I don't really understand what you mean by this... I read it multiple times but I don't understand.
I could move them into an "Advanced" group so they don't get in the way, but I do think this is quite useful. One of the biggest missing features of tween for me was not being able to change it midway. |
Function names must be chosen once an for all because it would break extension user events to change them. So, it needs to be carefully chosen from the beginning. The UI is not perfect but it will improve and, just a random example, it could be decided that the fullname should be used to sort them which would make the workaround useless.
Let's say we want to create an action to put an object at the middle of 2 points. The formula is: We could create an expression for x
I'm suggesting to split this action:
into:
and:
"Rotate object" and "Angle offset" should be properties. It could feel cumbersome to have 2 actions, but I guess that users will want to define a path at the beginning and move serval times along it. In the future, there could be an actions to move the whole path in one go or loop on it...
If a user change the path during the movement, the object will jump. They will call it a bug. You can keep them for now. It will be easy to remove them later on if we need to, but it's more work for you. |
Okay. I guess I have to remove them then. I just really really really don't like how it looks when my functions are all over the place.
I'm most likely being a smoothbrain right now but I still don't get it.
I see what you mean. I like the idea but it kind of feels the same just with an extra step to me. Maybe I'm just too used to what I created.
Its kind of like a mixture of your suggestion, and how timers work.
Yey! I can finally add something visible into the properties! Good idea btw, thank you.
I included a warning in the description of every action that could possibly make an object jump. I thought that was enough to not make people think its a bug. Either way, those descriptions could definitely be a bit more clear. They kind of suck right now, and I'm not very good at wording.
|
What I mean is that using only one expression will work because the formula is the same for x or y. You could name it
It's an interesting idea but moving on a full path must be left aside for the 1st version. Because, moving at a constant speed require to know the length of each path element and the formula is quite complex.
To me, if the path must be changed, the new path will probably start where the object currently is.
Could you give some examples? I can see a use of removing the last path element to revert what was planned but I don't see why a user would want to modify it from the middle or the start as if it used again, it would be to loop so the same path would be kept. |
Okay I finally understand it now. I have no idea what description, labels, etc... should I use, but I'll solve it when I get to it.
You misunderstood what I said (though I admit I kind of rushed the explanation there).
And you can have an action like this which just plays one of the saved paths:
So you could basically save paths, and call them in at any time. Similarly to how the previous method worked. No need to calculate curve lenght (kinda sad that its very hard to calculate. constant speed would be so much nicer).
I am not sure how much this proves my point (if it does at all) but here is a very simple game where changing the movement midway can be very convenient: example.mp4(also I'm really proud of this extension. This tiny game ^^ took me less than a minute to make) |
I find it difficult to see which features should be in the extension. What do you think about making a list of games that could be done with this extension? For instance, in Galaga, a shoot'em up, there are waves of enemies that follow a curve.
It looks nice. I don't see a use case either, but there may be something. I wonder if, for something dynamic, the expression would be easier to use because users can put variables for the point coordinates directly (a bit like the
I have the impression that giving names to path elements is more complicated than necessary. For instance, with this set of actions:
users don't have to use neither index nor name. |
Wow this looks really cool. :) |
!update |
✅ Successfully updated the extension. |
I updated the thing finally. Well... more like reworked the thing, because I decided it would be easier to start from fresh, and just copy paste my knowledge into a blank extension. Changes in a nutshell:
Some answers:
This is actually a pretty big problem not for just you, but also for me. I made this extension with the mindset "hey this looks kinda cool! I bet some people would use such a versitale tool". And I bet that is true. But I personally can't really think of too many cases where this could be really that useful.
I have no experience with the pathfinding behavior at all, and it also looks like I don't have enough experience with english as well. New example game:I also have a new example game. It is quite fun actually, even though it has horrible artwork (I might fix this eventually. I couldn't be bothered right now) Multiple control points?I also have the idea of making movement curves with multiple control points. I actually have no idea how to do this, so I either figure out the online formula, or just make some ugly mess with my own solution. Though I kind of don't like the idea of the latter one too much... |
Great job! The events are looking good. Some suggestions:
Good practice:
|
Yes they could. But I don't think it makes any sense. It is much easier to understand, and faster to use if I place the easing in there as a parameter. The movement already uses it as a parameter, so it just makes sense if the expressions used it as well. I've been using Gdevelop for a good while, but I only came across the
If you want to change the path destination but want to stay on the same progress.
Yeah I have no idea how to do that. I might give it a shot, but I kind of want to focus on fixing other stuff first, and maybe try my hands on advanced paths with multiple control points.
I don't think it makes a difference, and also it doesn't really make any sense to me.
I know. I used miliseconds because tween used it as well (which you probably figured out already).
? |
I guess that beginners will use the behavior and the expression is for advance users. The
We want to use seconds everywhere in the events at some point. So, no new extension will be added with milliseconds.
You can use the
What do you mean? |
But
Fine. Whatever.
I'm not sure if I understand you still, but I'll figure it out.
This is mostly for fun, and I might not even include it in the extension even if I succeed. But I really want to try and make a more flexible curve. |
@pampogokiraly: Will you be able to make an unlimited search range and add the ability to pass through obstacles to a certain object and its instances? |
It's not a path finding extension. Users of this extension must build the path by giving coordinates. |
Hi @pampogokiraly |
Good to hear someone is excited :)
What I imagine, is that people would use it for animations. But most of the time you can just use already existing tools (like physics) to do the same, which is basically my biggest worry.
That looks nice. Exactly what I was hoping for. Using the extension for animations. |
!update |
✅ Successfully updated the extension. |
Alright. New version up and running. Changes:
Other notes:
Updated example game: |
I added some features to the extension. I'm not done yet, but I wanted to keep you updated. The project: A build of the project: New features
Missing features
|
I added a 2nd behavior that uses speed and acceleration instead of a duration and easing. a build of the example: |
@pampogokiraly Thank you for your work on this extension, I've merged a version with additional features in the community list. Fell free to open a new PR if you want to do some changes. |
Description
Adds a behavior that allows objects to move smoothly on (bézier) curves.
Here is a short video of it in action
https://user-images.githubusercontent.com/66256867/184871120-5b4aa7b1-dc2f-46b0-9c94-c0d29b5d680b.mp4
The easings are still missing from all four non-behavior, the "AppendPath", and the "ChangeEasing" events. But Davy said that he/she will help with with them, hopefully with some text editing black magic. Doing this manually would be painful.
How to use the extension
Add the behavior to the object.
Use the action "Append a path" to add a new path to the object. The control points control the arc of the curve.
Use the above action multiple times to add multiple paths to the object. All of them will be played one by one.
Checklist
What tier of review do you aim for your extension?
Reviewed
Example file
Version1.zip
Extension file
CurvedMovement.zip