Lab 5 – LLMize
Procedural Content Generation for Computer Games
Vojtěch Černý
cerny@gamedev.cuni.cz
Prerequisites
The Task
Enhance one of your creations so far with LLMs!
It has to affect gameplay (!)
Attempt solving one of the big issues ☺
Codebase
Start with any of your previous HWs...
The most designed for are murder_mystery and roguelike
Both of the repos got an „llm“ branch
Google Gemini
We‘re going to be utilizing Gemini models?
Why?
For Gemini-3.1-flash-lite (pretty small model, but useful)
(enough for some tasks, for some might need to split work to multiple days)
Gemma 4 is also decent, two variants, each get another 1500 requests/day
Gemini-3.5-flash (decent model all around, came out 2 days ago)
(can do final test in)
Google Gemini - technical
Need an API key (for free):
For Python:
.env
GEMINI_API_KEY=xxxx
For Kotlin:
local.settings
GOOGLE_API_KEY=xxxx
Watch out for repetitions
LLMs want to repeat themselves
Why? LLMs are predicting text.
What text is likely to follow? The one that has already followed!
Beware of this when you want the llm to feel original or have choice...
This sneaks up when you don‘t expect it.
e.g. NPC chooses to be joking/serious for a question based on circumstance
But because he was joking on the question before (and it‘s in the context)
He will most likely be joking again... And again...
Watch out for not enough variability
LLMs want to repeat themselves
Why? LLMs are predicting text.
What text is likely to follow? The one that has already followed!
Beware of this when you want the llm to feel original or have choice...
This sneaks up when you don‘t expect it.
e.g. NPC chooses to be joking/serious for a question based on circumstance
But because he was joking on the question before (and it‘s in the context)
He will most likely be joking again... And again...
Options (for inspiration)
Options (for inspiration)
Big issues to solve
Criteria
Submission details
Questions / Problems
Q & A
Vojtěch Černý
cerny@gamedev.cuni.cz