Inspiration

Shower thoughts make good projects! No, but seriously, we wanted to utilize OpenAI's new ability to utilize pre-made function calls to generate new code to handle unique situations! This idea can be used in many fields, especially robotics where machines must be created to handle dynamic uncontrolled environments to be used everywhere.

What it does

We start playing a basic game of pong, but whenever something scores, it seems that rules are changing! Each time someone scores, we will dynamically change the rules of the game, from simple changes such as ball speed and direction, to complex ideas such as portals, additional barriers, and gravity and wind! Welcome to GPongT, where GPT is our friend who always changes the rules to try to win! This means the codebase dynamically changes and expands WHILE YOU PLAY THE GAME.

How we built it

We used pygame to create the base pong implementation. When someone scores, we make an API call to the openAI API, with a prompt asking it to generate new functions to make the game more difficult or interesting. We are then given the response, which we parse into multiple new python libraries. Then, at the beginning of the next game loop, we will call all functions present in these libraries, essentially adding the rules to the game! Our biggest focus in this project was utilizing LLMs to generate accurate code that is re-usable and without edge cases. We also had interest in systems, because we are dynamically changing the running code at runtime.

Challenges we ran into

One of the most difficult tasks was to figure out how to dynamically add rules. We had to draw out an entire pipeline on a whiteboard to figure out the flow of data. We also believed that in order to run this newly generated code, we would have to create multiple processes and easily/seamlessly switch between them! This was an immense systems challenge, that we managed to solve using importlib, which loads in code during runtime.

Accomplishments that we're proud of

We had to use a lot of systems knowledge to figure out how to load new data into a process that was already running.

What we learned

This was our first time using pygame, making api calls to openai-api, and modifying our executable. We also learned alot about low-level link time, load time, and run times!

What's next for GPongT

We hope to get the LLM to reuse functions that it has made, allowing it to build complex scenerios with several rules that build together. Additionally, we hope to slowly implement greater and more creative usages/rules, as we give the LLM more information. Also we sometimes have b See our futures.md for more details.

Categories

  • Best pitch
  • Best AI hack
  • Best LLM hack
  • Best Arcade Themed
  • Best Design

Built With

Share this project:

Updates