Project Overview
Each game starts with two decisions. How many storage slots should you rent for the distributors, and how often should you restock? Renting more slots gives you room to hold more inventory, but raises your monthly rent. With fewer slots, peak sales days may leave you paying for an emergency delivery.
We developed this educational simulation with Walsin Lihwa. Students practice vendor-managed inventory (VMI) by managing stock for wire distributors on the supplier’s behalf. At the end of each month, players use the profit and loss breakdown to decide what to change for the next month.
My Role
I built the game's frontend and backend from the written project requirements. The frontend lets players choose how many storage slots to rent and how often to restock, then review daily inventory and monthly results. On the backend, I implemented the daily inventory simulation with scheduled and emergency restocking and connected it to the database to read and write each game's strategy, inventory records, and results.
Set a strategy for each distributor and product
After a player enters their student ID and name, the system creates a game record. The three distributors (Beigai, Zhongtong, and Nansheng) each stock three wire products (IV, VV, and CVV). Players set the number of rental slots and the days between restocks for each of the nine combinations, then start the month’s simulation.
Carry inventory forward and apply the day’s sales
The simulation screen advances one day every five seconds. Each product starts with the previous day’s closing inventory for that game. On a scheduled restock day, the system tops up the stock to that month’s rented capacity, then deducts the day’s sales from the shared historical data.
If demand still exceeds available stock, the system records the shortfall as emergency replenishment and sets closing inventory to zero. It saves the opening inventory, sales, regular and emergency restock quantities, and closing inventory in a daily record. Players can see when and where the shortage occurred.
Review costs and adjust next month’s strategy
At month-end, the system groups the game’s records by distributor and product. It calculates service revenue from sales volume and rent from the number of slots rented that month. Regular restocking is charged for each delivery that took place, while emergency shipping is charged by the quantity needed to cover the shortage. The breakdown shows which costs affected profit.
If emergency shipping costs are high for a product, players can rent more slots or restock more often next month, then see whether the savings offset the extra rent or regular deliveries. After 12 months, the system totals annual revenue and expenses and applies the configured dividend rate to the year’s profit or loss.
Separate shared reference data from game records

SellRecord and DayRunning. The first provides the historical sales for a day. The second records the calculated inventory and replenishment for that day in one game.Every game can use the same historical sales and cost parameters, while players choose their own storage capacity and restocking interval. The system stores those two kinds of data separately. The five tables in consult hold shared dates, distributors, products, sales, and cost parameters. The four tables in transaction store player records, monthly strategies, daily operations, and monthly results by game ID.
The system keeps one copy of each day’s historical sales. The simulator combines those sales with the previous day’s stock and current monthly strategy for that game. That makes it possible to compare the effects of different strategies on inventory and profit under the same demand. The daily records also show which distributor and product generated a cost on the monthly report.
Trade-off
Daily simulation and month-end settlement need data from both databases. They use the date, distributor, product, and game ID to find the corresponding records. Shared data can be updated in one place, but reproducing an old game after changing sales or cost parameters requires the original version of that data.
| Table | Description |
|---|---|
| comparedate | Date-to-month mapping table |
| parameter | System parameters (service revenue, rental fees, replenishment costs, emergency shipping costs, dividend rate) |
| producer | Distributor records (Beigai, Zhongtong, Nansheng) |
| product | Product records (IV, VV, CVV) |
| sellrecord | Historical sales records (daily sales per product) |