Blog
November 2026
For a student, something that's much more memorable seeing a supply and demand diagram on a slide is a live market simulation where they trade against their peers. Ten minutes of play, then a chart of what the class actually did, and the theory has something to stick to. Most instructors agree with this, yet few run experiments in class. The usual reason is the overhead: finding a game that matches the lesson, getting 100 students onto it at once, and keeping everyone in step while you explain what's going on.
oTree has been used for classroom games for years, and with oTree AI (OTAI) the overhead is mostly gone. You tell the AI agent what game you want, in your own words, and it builds a working version that runs on students' phones and laptops. If you'd like a different payoff table, a third treatment, or a twist that fits this week's topic, you ask for the change in the same chat.
This post walks through a typical class session from start to finish, and shows the oTree features that make each step easy.
Start a project in OTAI and describe the game. Be as specific as you would be with a teaching assistant. For example:
"A double auction for a single good. Half the students are buyers with private values, half are sellers with private costs, drawn from the schedule in my lecture notes. Three trading periods of 3 minutes each. After each period, show each student their own profit."
Other games that work well in a lecture include public goods, trust and ultimatum games, Cournot and Bertrand competition, lemons markets, beauty contests, voting games, bank runs, and common-pool resources. OTAI also builds psychology classics such as the Stroop task and IAT, if you teach research methods.
Before the lecture, have OTAI's bots play through the game, then play it yourself in a few browser tabs. The bots catch the cases you might not try by hand, like a student who never submits a bid.
Create a session with a few more participants than you expect students. Unused slots don't matter. On the session's Links tab, next to the session-wide link, click the QR code button. It opens a full-screen QR code you can put on the projector. Students scan it with their phone camera and they're in; nobody has to type a URL or create an account. The link is also shown in large text below the code, for the few students who prefer to type it.
Students arrive over a few minutes, and some read faster than others. Often you want the whole class to start together, or to stop after round 1 so you can discuss it before round 2.
For this, ask OTAI for an admin gate, for example: "Students should wait on a page after the instructions until I start the game, and again after each round until I release them." Students who reach a gate see a waiting screen. When you're ready, click Open gate in the session's Monitor tab, and everyone moves on at once. Latecomers who reach a gate you've already opened go straight through.
The Monitor tab also shows how many students have joined and what page each one is on, so you know when the room is ready.
The best part of a classroom experiment is the reveal: prices converging toward equilibrium, contributions falling round by round, offers clustering at 50/50.
Ask OTAI for an admin report and describe the charts you want, for example: "A chart of every trade price in order, with a horizontal line at the competitive equilibrium price, and a different color for each period." The charts appear in the session's My Charts tab, which you can show on the projector. Each time you click Refresh, the charts update with the latest data and animate to the new values, so you can show results after each round and the class can watch the market change.
After class, you can download all the data as a spreadsheet, for example for a homework assignment where students analyze their own market.
If you run a one-off demo, the session-wide link is all you need. If you run experiments across the semester, create a room for your course. A room's link never changes, so you can put it in your course page or syllabus once, and students use the same link every week. Each week you create a new session in the room, with whatever game you're teaching that day.
The room's page shows how many students are waiting before you start the session.
If you add each student's ID to their link as a participant label
(for example ?participant_label=s1234567),
you can match each student's data across weeks,
for example to give participation credit.
A student who closes the browser and opens the link again goes back to the same place in the game.
You can get a game running in an afternoon. Describe it to OTAI, run it through the bots, and play it in a few tabs. Then walk a couple of colleagues or TAs through it, so you've practiced explaining the game before you face the lecture hall.