Created
November 10, 2024 12:34
-
-
Save danbri/9ef039980c7c9ba5f71ed2468c1e0b90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sure! I’ll help you port the given data from the classic Colossal Adventure to Ink markup, suitable for use with Inkle’s tools like inklewriter or inkjs. | |
Due to the complexity and length of the data, I’ll demonstrate how to convert a portion of it into Ink format. This will provide you with a template and method you can use to convert the rest of the data. | |
Understanding the Data Structure | |
First, let’s understand the structure of the provided data: | |
1. Room Descriptions: Sections labeled with numbers (e.g., 1, 2) followed by room descriptions. | |
2. Short Room Descriptions: These provide brief descriptions of the rooms. | |
3. Travel Table: This defines how rooms are connected and under what conditions. | |
4. Vocabulary: Lists of words and their corresponding codes used in the game. | |
5. Object Descriptions: Information about items in the game. | |
6. Messages: Various messages that can be displayed during the game. | |
7. Hints: Hints provided to the player under certain conditions. | |
Converting to Ink Markup | |
Ink is a scripting language for interactive narratives. Here’s how you can structure the game in Ink: | |
1. Rooms as Knots: Each room will be a knot (=== room_name ===) with its description and choices for navigation. | |
2. Variables: Use variables to track the player’s inventory and game state. | |
3. Choices: Provide options for the player to interact with the environment. | |
4. Conditions: Use conditional statements to handle game logic (e.g., locked doors, items required). | |
Example Conversion | |
Below is an example conversion of the initial rooms and their connections from the data provided. | |
Ink Script: | |
// Initialize variables | |
VAR location = "end_of_road" | |
VAR has_keys = false | |
VAR grate_unlocked = false | |
=== start === | |
{location == "end_of_road": | |
You are standing at the end of a road before a small brick building. | |
Around you is a forest. A small stream flows out of the building and down a gully. | |
* [Enter the building] | |
~ location = "inside_building" | |
-> look | |
* [Walk up the hill] | |
~ location = "hill_in_road" | |
-> look | |
* [Go into the forest] | |
~ location = "forest_1" | |
-> look | |
* [Follow the stream] | |
~ location = "valley" | |
-> look | |
} | |
=== look === | |
-> room_{location} | |
=== room_end_of_road === | |
-> start | |
=== room_inside_building === | |
You are inside a building, a well house for a large spring. | |
{has_keys == false: | |
There are some keys on the ground here. | |
* [Take the keys] | |
You pick up the keys. | |
~ has_keys = true | |
-> room_inside_building | |
} | |
* [Go outside] | |
~ location = "end_of_road" | |
-> look | |
* [Descend the stairs] | |
The stairs lead down into darkness. | |
* [Proceed down the stairs] | |
~ location = "below_grate" | |
-> look | |
* [Stay here] | |
-> room_inside_building | |
=== room_hill_in_road === | |
You have walked up a hill, still in the forest. The road slopes back down the other side of the hill. | |
There is a building in the distance. | |
* [Go to the building] | |
~ location = "end_of_road" | |
-> look | |
* [Go back down the hill] | |
~ location = "end_of_road" | |
-> look | |
* [Go into the forest] | |
~ location = "forest_2" | |
-> look | |
=== room_forest_1 === | |
You are in open forest, with a deep valley to one side. | |
* [Go to the valley] | |
~ location = "valley" | |
-> look | |
* [Go back to the road] | |
~ location = "end_of_road" | |
-> look | |
=== room_valley === | |
You are in a valley in the forest beside a stream tumbling along a rocky bed. | |
* [Follow the stream] | |
~ location = "slit_in_streambed" | |
-> look | |
* [Go back to the forest] | |
~ location = "forest_1" | |
-> look | |
=== room_slit_in_streambed === | |
At your feet all the water of the stream splashes into a 2-inch slit in the rock. Downstream the streambed is bare rock. | |
* [Follow the dry streambed] | |
~ location = "outside_grate" | |
-> look | |
* [Go back to the valley] | |
~ location = "valley" | |
-> look | |
=== room_outside_grate === | |
You are in a 20-foot depression floored with bare dirt. Set into the dirt is a strong steel grate mounted in concrete. A dry streambed leads into the depression. | |
* {grate_unlocked == false} [Try to open the grate] | |
{has_keys: | |
You unlock the grate with the keys. | |
~ grate_unlocked = true | |
* [Descend through the grate] | |
~ location = "below_grate" | |
-> look | |
-else: | |
The grate is locked, and you don't have a key. | |
-> room_outside_grate | |
} | |
{grate_unlocked == true} [Descend through the grate] | |
~ location = "below_grate" | |
-> look | |
* [Go back to the slit in the streambed] | |
~ location = "slit_in_streambed" | |
-> look | |
=== room_below_grate === | |
You are in a small chamber beneath a 3x3 steel grate to the surface. A low crawl over cobbles leads inward to the west. | |
* [Climb up through the grate] | |
~ location = "outside_grate" | |
-> look | |
* [Crawl west] | |
~ location = "cobble_crawl" | |
-> look | |
=== room_cobble_crawl === | |
You are crawling over cobbles in a low passage. There is a dim light at the east end of the passage. | |
* [Continue west] | |
~ location = "debris_room" | |
-> look | |
* [Go back east] | |
~ location = "below_grate" | |
-> look | |
=== room_debris_room === | |
You are in a debris room filled with stuff washed in from the surface. A low wide passage with cobbles becomes plugged with mud and debris here, but an awkward canyon leads upward and west. | |
There is a 3-foot black rod with a rusty star on an end here. | |
* [Take the black rod] | |
You pick up the black rod. | |
~ has_black_rod = true | |
-> room_debris_room | |
* [Climb up the canyon] | |
~ location = "awkward_canyon" | |
-> look | |
* [Go back east] | |
~ location = "cobble_crawl" | |
-> look | |
// Continue defining rooms and their connections similarly. | |
Explanation: | |
• Variables: We use variables like location, has_keys, and grate_unlocked to keep track of the player’s current location and inventory. | |
• Room Descriptions: Each room’s description is provided under its respective knot (e.g., === room_inside_building ===). | |
• Choices: Options are provided for the player to interact with the environment, pick up items, and move to other locations. | |
• Conditions: Conditional statements handle game logic, such as checking if the player has the keys to unlock the grate. | |
How to Proceed | |
You can continue this process for the rest of the rooms and data: | |
1. Define Variables for Game State: Track items, puzzles solved, and other state changes. | |
2. Map the Travel Table: Use the travel table to define how rooms are connected. | |
3. Handle Objects: When objects are in a room, provide options to interact with them and update variables accordingly. | |
4. Implement Game Logic: Use conditional statements to handle scenarios like locked doors, light sources required, or puzzles. | |
5. Include Messages and Hints: Use Ink’s text display features to show messages or hints when appropriate. | |
Tips | |
• Modular Approach: Tackle the game section by section to make the conversion manageable. | |
• Testing: Regularly test your Ink script to ensure that navigation and game logic work as expected. | |
• Reuse Code: For repetitive patterns, consider writing reusable functions or templates. | |
• Consult Ink Documentation: Refer to the Ink documentation for advanced features and best practices. | |
Conclusion | |
While converting the entire game is a substantial task, this example should provide a solid foundation to continue the process. By systematically mapping out the rooms, objects, and interactions, you can recreate the Colossal Adventure in Ink markup. | |
If you have any specific questions or need further assistance with certain parts of the conversion, feel free to ask! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment