Chatgpt Makes a game engine... and a game(now with touch support)
I recently decided to use GPT to create a game engine based on an entity component system. The first attempt didn't go as well as I had hoped, and I ended up starting from scratch. This time around, I was able to get a mostly working game engine right away. However, I did run into a small issue with the handling of dt (delta time) for movement. GPT was treating it as if it were in seconds instead of milliseconds.
I spent a few evenings tinkering with different components and getting them to work properly. During this time, I had GPT create a sample game that required some assets. One of these assets was the player character and present you see below, which was generated by GPT as an SVG file and then converted to a PNG.
The game was a bit bare-bones, so I asked GPT to add a gradient background and create a particle system to create a "snow" effect. GPT was able to create a functional particle system, but it was unable to properly integrate it with the entity component system. I took the code it provided and used it to create my own particle processing system, and then modified the starting conditions to make the snow appear all over the screen instead of just at the top. I also played with the parameters to get the desired effect.
And without further ado, I present to you a holiday game created by GPT! Use the arrow keys to move around and collect presents, and have fun!
After releasing the holiday game created with GPT, I spent several hours working with the language model to add touch input support. Unfortunately, we ran into a few issues along the way. One problem we encountered was trying to use the filter function on things that aren't arrays. We also struggled with properly updating touch points and ensuring that they were accurately reflected in the game. Another issue we faced was that GPT did not include a reference to the canvas element, which was necessary for properly referencing the position of the canvas for touch points. Additionally, GPT kept trying to access attributes of touch points that are not supported by all browsers, which caused further complications. Despite these challenges, I was eventually able to get touch input working in the game with the help of GPT. However, in hindsight, it might have been faster for me to simply read up on browser touch APIs and implement them myself rather than relying on GPT. In the end, I still had to learn about the touch API and spend a few hours debugging before I had working code.
After releasing the holiday game created with GPT, I spent several hours working with the language model to add touch input support. Unfortunately, we ran into a few issues along the way. One problem we encountered was trying to use the filter function on things that aren't arrays. We also struggled with properly updating touch points and ensuring that they were accurately reflected in the game. Another issue we faced was that GPT did not include a reference to the canvas element, which was necessary for properly referencing the position of the canvas for touch points. Additionally, GPT kept trying to access attributes of touch points that are not supported by all browsers, which caused further complications. Despite these challenges, I was eventually able to get touch input working in the game with the help of GPT. However, in hindsight, it might have been faster for me to simply read up on browser touch APIs and implement them myself rather than relying on GPT. In the end, I still had to learn about the touch API and spend a few hours debugging before I had working code.
Comments
Post a Comment