Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

4x4 Archipelago

A procedurally generated, text-based fantasy RPG · By agat

How did you accomplish this astonishing feat, Agat?

A topic by undergarden created Apr 12, 2023 Views: 565 Replies: 2
Viewing posts 1 to 2
(+1)

Hi Agat! 

I adore 4x4 Archipelago and I'm having my students play it for my Advanced Video Game Storytelling class this week for our discussion of procedural narratives and gameplay, alongside Wildermyth. Online I've found (very zoomed out) screencaps of the overall intricacy of your design and I've copy/pasted parts of the gameplay text to demonstrate how the game alters the text based on character class and based on other procedures including RNG.

I wonder if you'd be willing to share some snippets of your code to help students better understand the procedural aspects of the game? We're all curious about how granular the procedural aspects are. Thanks for an absolutely delightful game in any case! 

Developer(+3)

Hi!

Thank you for your kind comments about my game. It's really awesome to know it's useful for your class, too!

As for the code: Twine games are by definition open-source. You can download Archipelago and open the „index.html” in the Twine editor to see everything. A warning, though – as an amateur developer with no background in coding, I did a poor job with optimising my code – for one thing, it contains a lot of unnecessary repetitions. (I've learned a lot since publishing Archipelago, so now I can see how messy that code is). Because of this, the editor also works very slow with this project, at least the offline one – the online editor available at https://twinery.org/2/ handles it a lot better.

I'll gladly share some info on how the procedural generation was designed from the conceptual standpoint – which will be more transparent than the actual code.

One of my goals with Archipelago was to create a game that has a lot of replayability, but also feels as fair as possible, despite all the procgen. There is a lot of randomness and luck involved, of course, especially with travel events and exploration events, but the „skeleton” of the game is always the same, with equal number of quests of each main type, dungeons, mines etc.

There are about 70 presets for islands (name, terrain type, unlockable story) in the game. Those are for flavour only, as the actual activities on each island are randomised later (except for a few bonus „special” encounters, like the puffins on Puffin Island). I created two „activity” pools (arrays) – one contains markets and NPCs (Witch, Enchanter, Collector), and the other – dungeons, mines and „overrun” areas (those places where you can fight a lot of enemies of a single type). So, an island can have a market and a dungeon, but it won't have a mine and a dungeon, because they're similar, exploratory activities.

Side quests are also divided into categories (A, B and C in the code). Quests A typically require no combat or resource spending, so they can be completed at the start of a playthrough to get some EXP and silver. There are always 3 quests A, randomly selected from a pool. Quests B have some requirements – like having a skill or spending resources. There's always 3 of those as well. Quests C feature a big boss enemy, unique for each quest, but in almost all of them the combat can be avoided. This requires spending a lot of resources or having high-level skills. There are always 2 quests C.

Dungeons were also fun to create from the procedural generation point of view. There are 2 easy, 2 dangerous and 2 deadly dungeon „maps” (passage arrangements in Twine), and each always has one of 3 room connection presets applied, as well as a „thematic overlay” (name, description, enemy pool, trap pool, boss). There are 3 categories for those overlays – crypt, cave and ruins. So, for example, Bare Bone Hall can appear as any of the 2 „easy” dungeons. Room description and names will be assigned randomly from the „crypt” pool, and the enemies will include frail skeletons, death wolves, skeleton warriors and skeleton archers, as determined by the Bare Bone Hall preset.

Those are some methods I used to try and make the game varied and replayable, while also avoiding wild differences in difficulty between playthroughs.

If you, or your students, have any particular questions, post them here – I'll be happy to answer them.

Cheers, Agat

(+1)

Wow, thank you, Agat! It is very generous of you to provide so much detail -- it's incredibly helpful. We will all learn a lot from what you share here! And again, it's a marvelous game.