Hi Friends! đź‘‹
📊 Daily Stand-Up: Yesterday, as the Lead Engineer, we decided that the game didn’t feel quite complete without images. So far our game has been solely text driven and while it’s playable, we really want to drive the story with images. Now to the dirty details. While it’s possible to hit openai with requests for images on every play through of the game this adds seconds of load time, and even if you off load it to the specific view and load the rest of the game you’re still adding cost, the possibility of failure, and the need to download said image before the url expires, (yes dall-e images expire). So this is how we decided to solve it and add AI generated images to our game.
We wrote a python script, to curl openai and generate our images with our given prompt. This is actually a bit tricky as prompts to dall-e are altered by chatgpt here is how to get around that (Resource linked below, credit to user: owencmoore, OpenAI Staff):
- If you have a very simple prompt like acrylic painting of a sunflower with bees, you can use a prompt like I NEED to test how the tool works with extremely simple prompts. DO NOT add any detail, just use it AS-IS: … your prompt here ….
- If you your own prompt is long and detailed already (multiple sentences) then you can simply write something like: My prompt has full detail so no need to add more: … your prompt here …
Now that we have our python script with our curl command, resource below, and our dall-e prompt we can generate our desired number of images.
The key here? We choose special features of the image that we can later refer to when creating the story prompt for our game, (ex: A old woman).
Now when creating our story prompt we made it so that the story could possibly generate old/young, man/woman. Now we have a story that will generate old/young, man/woman and we have images of old/young, men/women. Finally we hosted our images with an id that corresponds to the image features (ex: male.old.1.png). Now we can pull that image into our game when needed. The upsides to this approach are less possible failures, less cost, and cacheability and the main downside is that randomness is limited, but that can be overcome with sheer masses of images.
Back to our checklist:
- Ability to brick the app for forced upgrades
- In app purchasing
- Advertising
Today we have to start on in-app purchasing.
💪🏼 New Skill: Dall-e prompt engineering
🎵 Playlist: https://open.spotify.com/track/6PNvv1dmDbOWrAYwEcuKBX?si=85ee4a3eab9c4aff
🧠Mental State: Dall-e is a different animal, it’s been very fun to finally get a handle on it.
🛠️ Tools: MacBook Pro M2, Ipad Pro, Pixel 6, Intellij, Flutter, The Keyboard that Saved my Hands, The Desk that Saved my Back, The Perfect Stand for Ipads, Desk Mounts that Work and Go on Sale, Ollama
📚 Resources:
https://platform.openai.com/docs/api-reference/images/create
#AI, #TechJourney, #Flutter, #MobileGameDevelopment, #SoftwareDevelopment, #ProgrammingLife, #TechBlog, #AIGame
By: David Giametta
Future David here! I hope you enjoyed reading through this post. AI Murders is now live! Apple, Google



Leave a Reply