Conversation
|
Thank you for submitting an extension. The result looks impressive. The code is quite big. Does it come from a library or did you wrote it specifically for this extension?
A few suggestions from a quick look:
Let me know if this makes sense and if you can make these changes or part of it. This will help update the extension when new GDevelop versions are released. |
|
Tried it and it looks very very cool. It's a big extension but let's see if we can get it inside the experimental extensions! |
|
!update NatureElements.zip |
|
Extension updated with errors: |
40b91ca to
3133e84
Compare
|
Hello, just to make sure, are you waiting for feedback or are you still working on the extension? |
I've done the refactoring per your comments. Tried updating a few days ago but got an error (again). See here Currently traveling, but I'll give it another go later today. Got a nice new demo as well. |
|
@D8H awesome! I'll update the demo as well in a bit. It uses the incorrect extension version anyways. |
3133e84 to
fea1ee3
Compare
|
Again, looks awesome. Give us a few days to see how we can get this in the experimental extensions :) |
Thanks, @4ian ! I'm in no rush :) Altho I'd love to swap in a better, more custom-tailored demo (example file). |
@D8H Thanks! |
fea1ee3 to
0d78ceb
Compare
|
@D8H JS type errors fixed. Updated the extension file. |
|
Is the demo/example file up to date on your first message, or are you working on it separately? |
@4ian File was too large to upload via GitHub. I’ll clean it up in the next few days. For now, I updated the demo with a Dropbox link. EDIT: Got the Demo down to 40 MB but was unable to replace it, getting "failed to upload" error. Dropbox link updated with the smaller file. |
|
Some of the variables are typed with
runtimeScene.getGame().getImageManager().getThreeTexture(resourceName);Feel free to ask if something is unclear. |
|
For the demo keep it on Dropbox and we'll import it in the GDevelop-examples repository when the time is good. "Time is good" is a bit vague, but in my mind we should aim for:
For type annotations, I'm wondering though if we should really do something to allow extension to have "extension wide" types (so that you would get autocompletions in every single code block in the extension). We'll have to think about it... |
0d78ceb to
822dc27
Compare
|
@D8H @4ian Extension updated, based on your guidance.
Let me know if this is what you had in mind, and if there's anything else to tackle. |
|
I didn’t have much time to check so I just have a few questions:
It’s probably not worth sending an updating. I can continue checking the current version. |
The try-catch was defensive, mostly because the behavior identifier changed during refactors. This can be simplified now.
Can you let me know if once a behavior property type is defined in the editor, is its runtime JS type guaranteed to match it exactly? If so, I can tighten several unknown types. Used it just as a stricter boundary type while replacing broader any / Object typing.
No particular architectural reason. If there is a preferred GDevelop-side convention for classes, I can adapt to it. Let me know.
Simply as a defensive IIFE wrapper. Not strictly required, but felt like a safe pattern. I'll remove it.
Agreed.
Somehow I have completely missed this 🙈 Perhaps a call for a UI upgrade? 🙃
Let me know what else you find, and I'll revise it all at once. |
|
To give you a view of what we're trying to do:
This is not necessarily a long process, just explaining my reasoning. I might be able to help doing some changes at some point.
If you look at the top and the bottom of an empty JS event, you will notice that the code is inside a JS function, it's not the global scope.
Indeed, it would be better to have a button that actually look like one. It may take a while before we have the time to improve it. On that note, I added 2 sections about object and resource parameters in the doc.
If you can define classes, it will help me understand which part of the code it related to which data.
Most property types are either numbers or strings. Acessing When I can, I try not to use these getters either. If you take a look at the 3D particle emitter extension, for each property, there are 1 action and 1 expression to access them from the main events. Their skeletons can be generated by the editor as explained at the end of this section. In this extensions, these couples of functions are used for several purposes:
The good part is that:
But, sometimes it's just more convenient to use |
|
@D8H Alright, all of this makes sense. Thanks for sharing the links also. Let me know when it's ok to do a revision - maybe befor you dive in deeper? |
|
Yes, if you want to do a good part of the suggestions, I guess it's already quite a lot so I will indeed take a look after your next version. |



Description
This extension adds wind swaying ability and optional GPU instancing to 3D objects (trees, grass, bushes) with frustum and distance culling.
How to use the extension
How to use:
Import your 3D object (tree, bush, grass...) and add the Foliage swaying behavior to it.
Choose from various object settings and parameters, then add the object to your scene.

Add the Update foliage sway action, choose its parameters, and run it every frame.

Optionally use the Set wind gust action at the beginning of the scene.

Play your scene.
Checklist
Example file
NatureElementsDemo.zip
Extension file
NatureElements 1.0.2
Extension by @baldieandbaldie-commits
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!