Developing a web-based economic strategy game: take over a small business in a real Spanish city and try to make it work.
Anthropic added a $100 Cloud credit to my account so I thought I’d try something that can run mostly unattended.
Claude Cloud runs from a GitHub repository so I’ve created one here https://github.com/robotzero1/Traspaso with an initial CLAUDE.md and SPEC.md file created by Claude after a brief discussion of what I wanted.
Off we go…
Milestone 1 is complete. We had a brief discussion about needing opening hours rather than just hours per day because some businesses are very reliant on certain parts of the day.

Milestone 2 is complete. I wanted to know how far it’s possible to measure footfall:

Milestone 3 is done with some choices made by Claude. I want to keep the game pretty low key without a hard failure or win scenerio.

Milestone 4 is done. It’s not making a simple game for sure!

Milestone 5 is done:

Milestone 6 is done:

I thinking the game should be in English for an international audience but I like the use of the Spanish terms to make it more authentic feeling to play.
Milestone 7 is done:

Thought it was time to take a look at the front end…
A few commands…

and I have the interface to play with:

It’s pretty complicated but this is OK because we are making the game’s financial engine at the moment and we need to test the maths are good before automating any boring elements.

I did a one month test. The game’s obviously not finished but it seems wildly optimistic with it’s income figures.


2184 customers spending an average of 3.86€ (nearly all will only be spending 1.50€ on a coffee). Also the total number of customers is about 15 per hour in a 17 seat café. Not normal for Spain. Let’s see what the next milestones bring.
Milestone 8 is done but I have to do some extra steps…

Quite a lot of cool stuff in this milestone:

Hmmm… there was a lot of messing around on this milestone to get the Streetmap data. Something that might have been easier if the whole thing was built locally.
Apologies to the Overpass team if I was abusing your API for the tiles…

Assuming it’s actually doing this properly, it’s incredible how quickly it moves through this stuff. I would have taken days to set up these tests and look over the results.

Seems to be happy with the footfall…

I’m not really happy with the way footfall is done through the day as some places in the city are swarming with people at times and other times .. dead. This is the improvements:


So, after the changes…

I found some real population data on the Zaragoza Ayuntamiento website (https://www.zaragoza.es/web/espacio-de-datos/servicio/catalogo/?query=poblacion)

After some pulling, regenerating the geo stuff and pushing back to the repository…

nice!

Some results are in…

OK, now it seems to be going in circles tweaking things to make the game work in different scenarios. I’ll leave it running and then ask it some questions about average spend etc to see if if has sensible values for Spain.
The average spend figures were too high for a typical café in Spain so these have been adjusted. I wanted to have the simulator be closer to real life than be a game that was fairly easy to win so I got some real figures from Google for business success and failure in this business type.

Still some figures to add to the pricing engine but these can be left to later. Now onto some more fun stuff like making it into an ‘idle’ game that keeps running and sends a daily update to the player.
The new milestones:

The context must have been getting huge because the cloud credits were being burnt though. I got Claude to write a note to itself, /cleared and now we are on milestone 11.
Stopped blogging progress because I switched to another project while this one was running but here’s the rest of the milestones up to today:
Stage two: real time, the app and the viability check (7 October)
- 11. Daily simulation. The café now trades day by day on the real calendar. That brings in busier Fridays and Saturdays, public holidays, the Pilar week, and day-to-day weather (rain days from AEMET; rain closes the terrace). The days add up to the calibrated monthly totals, so the earlier calibration carries over.
- 12. Real-time clock. One game day per real day. Every night at 23:00 Madrid time, each café’s day is played; missed nights catch up. Decisions apply from the next day. Hiring takes a week and letting staff go takes 15 days’ notice. Events wait 3 days for an answer, then take a default. There’s no fixed end.
- 13. App and push notifications. The game installs on a phone like an app. Each night you get a notification with the day’s customers and takings, the month’s profit at month end, and any event needing a decision. You choose which of these you get.
- 14. Viability check. A standalone tool: pin a real café on the map and enter the listing’s figures, your money and how you’d run it. It plays 1,000 five-year futures (about 30 seconds) against the real cafés and bars nearby. You get survival at 1, 3 and 5 years, yearly profit with a range, when the traspaso is earned back, and flagged risks.
- 15. Payments. Stripe Checkout for the full viability report and for bigger starting capital (€30k free; €60k and €100k paid). IVA is included, a box waives the 14-day withdrawal right, and terms, privacy and disclaimer pages exist as drafts.
- 16. Going live. A deployment guide for one EU server, health checks with an uptime endpoint, nightly backups, and GDPR basics (download your data, delete your account, old data pruned).
Stage three: selling and buying (8 October)
- 17. Valuation calibration. What a buyer would pay was fitted so that a café run the typical way sells for about 93% of its traspaso after a year. Listings are asking prices, and buyers agree a little below.
- 18. Selling. You list the café, privately or through an agency. Buyers turn up at random over weeks or months, fewer if you overprice. You can accept, reject or counter. A sale completes at the month end after a 30-day handover. You pay the gestoría, any agency commission, and income tax on the gain. Net worth now counts the café at what you’d actually walk away with.
- 19. Closing down and quick sale. Close at the month end, paying two months’ rent as notice and staff severance (20 days a year), and sell the equipment for scrap. Or sell to a buyer of last resort at half the café’s value.
- 20. Buying again. After a sale or closure, buy another café with the cash left. Listings come and go week by week. Your old café, if sold, stays on the map as a possible rival. A career table tracks every café you’ve run.
- 21. Balance for selling. A test owner who sells and rebuys every year was added to the simulations, the “flipper”. At first flipping beat keeping one café: a money machine. With realistic frictions (haggling, months between cafés, buying costs) it no longer does for a typical owner. The viability report now shows what the café would sell for after 5 years.
Stage four: real data and buying costs (8–9 October, under way)
- 22. Public-source research. Sourced the Zaragoza hostelería wage (€1,375 × 14 plus the October payment), employer Social Security (32.15%), annual working hours, the self-employed fee bands, the €80 flat rate for new self-employed owners, IVA, the income-tax instalment, and opening hours.
- 23. Buying costs. A traspaso now costs more than its price: the legal deposit plus an extra guarantee, the buyer’s lawyer, and the licence transfer. “Cash needed” shows on every listing (median café €45,400).
- 24. Market data.
docs/data-requests.mdThis session isn’t running, so its files can’t be opened. Send a message to start it again. lists what to gather: time listed, agreed vs asking, agency fees, lease terms, café prices and busyness. Waiting on your figures. - 26. Pedestrian counting page (built 9 October, the latest work). A phone page to count passers-by at a spot for 10 minutes. Waiting on your counts.
- 27. Where every number stands. Every parameter is marked real, fitted, guess or design. A sensitivity check showed which guesses matter most: what customers spend, how much rivals take, and how readily passers-by stop.
- 25. Price and quality response. Not started; waits on the price and busyness data.

Leave a Reply