Honestly on my side I just save a PG as bookmark, and that’s it ^^ Why don’t you do so ?
Ah yes, sure ! Maybe not by default, in order to let the user free of triggering the autoformat at any moment, but for sure it would be nice ! And it will even be necessary on dev side, if we don’t want to have to deal with indentation levels in the code snippets, json-based… Best will be to code format-less, and add an auto-format on top if that
Ah I think there is a confusion here, sorry if it was not clear. I was not speaking about specifically the Playground in this post ^^ When I said :
I was really speaking about another project idea, a “template” as well as you can download some in Unity or Unreal… Could be a .zip or whatever. For sure it’s not a big matter to let a way to load the template in the Playground in order to have a quick test “for real”, but obviously I would never code a game inside the Playground
By the way, to be honest, most of the time when I run a test in the playground, I actually code in my code editor and paste it to playground… I’m so used to some shortcuts which are missing in the Playground editor that I miss them so much.
Examples of what I am missing most, and could be added to the Playground are :
Moving a line with auto indent, using CTRL+ARROW :
Create new cursors with CTRL+ALT+ARROW
Maybe one day in the Playground ?
Ahah. AI is fashion nowadays, I’m sure it will come sooner or later
I started to do it, but it there was several reasons I gave up:
It requires to do the action manually.
You have to rebookmark if you create a newer version of the PG.
I ended up with hundreds of bookmarks in a chaotic order.
I think it should be on by default and I could turn it off and the PG would remember my choice.
Template repos on GitHub will be great for this.
This is another thing that should be solved. Easilly copy code with ES6 imports to BABYLON namepaced code and vice versa.
You bet on it
Hmm, this is already supported Monaco is Monaci everywhere.
Want my opinion? For whatever it’s good for I think the AI is already here today. I use it. Many people use it. But I think, in essence, the AI needs to be looked at/treated like any (human) ‘team member’. You cannot let it take over and just relying 100% on it. Speaking about code and moreover a ‘code base’ that needs to be solid and might be depending on context, I wouldn’t let the AI take over. For sure, not today. And likely not tomorrow. I think there’s a certain level of ‘control’ we need to make sure we keep for ourselves. By delegating just everything to the AI, we are loosing track and thus, loosing ‘control’.
Anyway, on a side note, I very much enjoy this thread (and then, the project )… and the way everyone seem to engage into this. I think @Tricotou you are onto something here… something big I’m not sure how much I can be of help, but know that you do have my full support and I’m eager to see what will come out of it Meanwhile, keep up the good work and have a great sunday
I have my reasons to disagree (at least for now ). This isn’t about ‘programming’ but here for my latest experience with the AI. Artifical Intelligence - #234 by mawa
I could (finaly) take some time to put on the table a PR for this new feature @Deltakosh as discussed, I made it JSON-based in order to ease the edit later on
source code is the same than CTRL+SPACE menu (tools/playground/public/templates.json)
any new code block from this code generator is now as well available from the CTRL+SPACE menu
added a structure json in tools/playground/public/procedural.json which is used to build the drop down menu
the fetch("templates.json").then() has been move to the monaco constuctor since now it’s used from different places.
NB: the code generator is not “100%” based on the JSON (for now…?) since some conditions have been included outside, such as for example a shadowGenerator check (cannot be enabled on hemi light), etc.
NB: In the monaco editor I added a if (model.isDisposed()) check (see line 720 & 727), but I could not find exactly when the error Model is disposed! is triggered. Seems to be a bit random
Demo :
Link available soon to give it a test, when bjsplat is done building the stuff (If it builds )
Also, since it stores locally your params, it’s a nice way to setup your prefered “Playground Template” (for example, I prefere ArcRotate Camera by default), and then you just need to hit Run on a new playground to switch to your prefered params
Hum Weird. To me the problem here is that the code snipped loader returned nothing (ending in an empty code with no camera). It could happen only in the event of the JSON load not working. But here the JSON released is fine. Do you have any error in console ?
Also, does CTRL+SPACE in the editor open the new snippets ?
Ah yes, the JSON file hasn’t changed its name, so default caching would indeed be the issue.
By the way thanks to your screenshot, I just noticed that I’m missing a linesep (\n) at the very beginning, before first comment
I’ll wait for first feedbacks (and eventually bugs), and concatenate all suggestions and fixes in a new PR
@RaananW it seems that this last PR has created a potential bug where loading a Custom Playground ID can lead to a “forever engine load UI”. This PR is a fix :
Also, I make profit of this PR to fix the potential cache issue spotted by @labris as well as the missing "\n" at beginning of generated code
opening the discussion here (cc @PatrickRyan ). We discussed with @RaananW and I wonder if this would be easier for user to use it as a wizard so we can avoid the risk to remove user code?
I have set a Run Auto button on top of the DropDown menu, which somehow does the same than the Safe Mode param of the Playground. Indeed it’s set to true by default but we could change this to false (in that case the user must hit Run to replace the code)
Eventually, we could replace the word "RUN" by "REPLACE CODE" to make it clear…