MicroSims Quick Start
Getting Started
Getting started is easy!
- Go to your favorite generative AI tool such as OpenAi's ChatGPT. GPT-4 is the best version to use but it has a $20/month fee.
- Type in a chat that starts with "Generate a p5.js file that does..."
- Copy the generated code and paste it into the p5.js Editor. You will need to replace the default code.
- Press the "Play" button (the red triangle)
- Save your MicroSim and share the link with your friends!
That is it! Most people can generate their first MicroSims in a few minutes.
You can also use the custom GPT called the Knowledge Graph Builder which has been fine-tuned on the p5.js reference library.
If you don't like what you saw, go back to your generative AI tool and create a more specific request. Then copy the result of this new result into the P5.js editor. Just keep repeating this process until your simulation does what it needs to do. You may have to repeat this a dozen times, but most users find that they are still 10x more productive than having to learn to write code!
If you like what you see you can create an account on the P5.js editor and come back and show your class.
That is it! There are many other tools that we can explore to make this process even easier and tune the quality of the output to specific tasks.
Background on Processing
One of the reasons that generative AI is so good at generating these simulations is that Processing has been around for about 23 years. It is widely used by artists, teachers and others to generate high-quality animations with interactive controls. As a result, there is ample code online that generative AI tools are trained on.
Avoid the Urge to Fix the Code
Always go back to the ChatGPT and tell it what is not working and suggest a fix.
Start with a Simple Prompt
Start with a simple prompt that describes the core function that you would like done.
Add Controls
Start adding controls such as sliders and buttons. A good simulation always allows the user to change parameters such as the animation speed and how to start, stop, step and reset the simulation.
Focus on Usability
Share Your MicroSim
The best way to share your simulation is to create a pull request with your working simulation. Make sure you read the MicroSim structure document to get an idea of how to best structure your code.
If you are not clear on how to do a pull request, you can always open an issue in GitHub and post your code there.
If you need help, please contact Dan McCreary on LinkedIn.