Home For Fiction – Blog

for thinking people


July 2, 2025

Marco Polo: a Text Adventure Game

Programming

game, javascript, programming, video games

Technically speaking, the JavaScript program I’ll be talking about today is a text-adventure game. And yet, it isn’t quite that – not like Mansion Escape, let alone The Clock Village. Yes, Marco Polo is a text adventure game – free, open-source, available to all – but at the same time it’s sort of a hybrid game.

Marco Polo emulates the text-adventure video games of the 80s, yet it’s also inspired from the eponymous board game of the same period. You assume the role of Marco Polo, the famous explorer who traveled from Italy to China and back. You must cross the entire continent of Asia, experiencing adventures and dangers, trading, and successfully negotiating with others.

With the exception of the intro, outro, and basic game functions (showing instructions, starting, saving, or loading a game), Marco Polo is a pure text adventure game interface: There is text, and you enter commands. It’s retro, and it’s supposed to be.

Marco Polo text adventure screenshot
Here’s a typical screen of the game, showing the “Amiga” theme. Other themes include a default green-on-black, amber (see image further below), and silver-on-black

Marco Polo Text Adventure Game: Some Basics

The goal of the Marco Polo text adventure game is to find your way to Beijing and back to Venice, from where you start, having experienced (among others) 6 affective events — experiences that cause a lasting impact on you.

Most of the game involves moving from city to city using various modes of transportation – horse, caravan, or ship – and trading items like silk, gems, handicraft, and others. Obviously, the goal is to buy cheap and sell expensive.

Moving from city to city the game code can also throw random events at you, which affect your progress – either positively or negatively.

Game Metrics and Progress

Besides money (necessary for moving), other important metrics include xp points, free passes, and weeks elapsed.

Xp points affect, among other things, prices of transportation (the more experienced you get, the better deals you can strike), whereas free passes refer to official documents (granted by various authorities) that can influence certain events in the game.

As for the number of weeks elapsed, that affects your movement (the older you get, the slower) as well as the probability of encountering an affective event – the older you get, the more likely it becomes.

The main concern (especially early in the game) is financial management. It’s easy to run out of funds because of increased maintenance costs or trading failures. If you run out of funds, you return to Venice and start over with new funds but without transport or cargo. Other metrics, such as the number of weeks elapsed, xp points, or events remain unaltered. In that sense, running out of funds is not a failure, but a setback.

Overall, it’s a better idea to start modestly, using a horse for movement and avoiding risky trading, until you build up enough experience.

Marco Polo text adventure screenshot
Here’s the amber theme, showing the output of the handy “help” command, which lists all the available commands with syntax examples and other details

Marco Polo Text Adventure: Get the Code, Improve it, or just Play the Game!

The Marco Polo text adventure game should be more-or-less complete to play as is. Still, although I have tested it, I can’t exclude the presence of bugs. Feel free to examine the code on Github, improve it, adapt on it.

If you want to play it, you can simply click this link – the game is hosted on raw.githack. As a free service, uptime cannot be guaranteed. If the page is not up, try later.


I don't show you ads, newsletter pop-ups, or buttons for disgusting social media; everything is offered for free. Wanna help support a human internet?

(If you'd like to see what exactly you're supporting, read my creative manifesto).