Luet oppimateriaalin englanninkielistä versiota. Mainitsit kuitenkin taustakyselyssä osaavasi suomea. Siksi suosittelemme, että käytät suomenkielistä versiota, joka on testatumpi ja hieman laajempi ja muutenkin mukava.
Suomenkielinen materiaali kyllä esittelee englanninkielisetkin termit.
Kieli vaihtuu A+:n sivujen yläreunan painikkeesta. Tai tästä: Vaihda suomeksi.
Chapter 11.1: Your Text Adventure
Task Description
Forget about the forest, the remote, the batteries, and the other elements of the given game world and write a new text adventure game. Use any elements you like. Let your hair down and create!
Here are some ideas that you can develop further if you like. But feel free to ignore this list and come up with something entirely of your own instead.
Classic adventure. The player could explore an ancient pyramid, for instance, or venture into a ruined castle. The game world consists of rooms, passages, and the like.
Modern adventure. For instance, the player could be a first-year student at university who needs to accomplish one thing or another. The game world consists of buildings and rooms on campus.
Mystery adventure. The player has to recover a lost item, find out whodunnit, or something of the sort.
Action adventure. For instance, the player might need to escape from somewhere.
Literary adventure. The player takes the role of Alice, Captain Ahab, Clarice Starling, Marjane Satrapi, Randle McMurphy, Dolores Abernathy, or someone else.
Inhuman adventure. The player character is a dog, an insect, a robot, a microbe, a planet-eating space creature, a sentient kumquat, or anything you like.
Something completely different. Anything that makes a game. For instance, the areas of the game aren’t spatial locations but states of mind, stages of life, or something else.
ChatGPT is allowed for thematic content. As an exception to O1’s usual policy, in this assignment you are allowed, if you wish, to use ChatGPT or similar “AI tools” for the purpose of creating content for your game: sketching out a theme and generating in-game texts. But in this assignment, too, your own program code must be written by you, not by ChatGPT.
Task requirements in more detail
The game should have:
Areas that the player can enter.
Challenges or puzzles that the player needs to deal with in order to win the game.
At least a few new textual commands that the player can use for doing something meaningful.
A new victory condition that the player must reach to win the game. It needs to be something other than simply walking over to another location. You can also include loss conditions (e.g., the player character dying), but that’s optional.
A welcome message that indicates what the game is about and what the player should try to accomplish. If you prefer that the goal of the game is revealed only while the game is in full swing, that’s okay, too, as long as it doesn’t take a disproportionate effort to discover the goal.
A help command that prints out instructions for playing. Include any commands you added that the player should know about.
One or both of:
A command of the form use itemname, which makes the player character use an item. What happens as a consequence should depend on the item.
Non-player characters — human or non-human — that move about in the game world and are somehow useful, dangerous, or otherwise meaningful.
Within the module that you submit, you should also include:
A file that contains a “cheater’s map” of the game world (cf. the given
forest_map.gif
).This map should be in PNG, GIF, or PDF format or (failing that) as a character-based diagram in a plain text file.
Name it
map.png
or something similar.Place it in the module’s root folder.
A walkthrough that describes, step by step, how to win the game.
Write the walkthrough in the same file as the map or in a separate
walkthrough.txt
(or similar) at the module root.The teaching assistants may use the walkthrough as they assess your game. A less frustrated TA may go easier on the marking. :-)
On Marking
O1’s teaching assistants will manually assign a mark to your game.
The marking won’t be very strict. If your game fulfills the above requirements, you can expect to get at least half the available points. Indeed, you can expect to get more than that unless the assistants discover serious flaws such as game-breaking bugs or completely illegible source code.
The game does not need to be a mind-blowing spectacle for you to score the full points. For that, it’s enough that you submit a reasonably high-quality program that works and fulfills the requirements.
Your code will be read by a human, so write clearly. Remember O1’s style guide. You don’t need to obey that guide or any other specific set of guidelines slavishly; the important thing is that you get the basics right so that an unknown person can read your code with reasonable effort. Indent your code, pick sensible names for variables, and so forth. If your code is very hard to read, you’re unlikely to score full marks.
You aren’t required to write comments in your code, but you may do so at your own discretion.
The size of the game is not the point. Although a larger game world may result in a more interesting game, adding more areas merely in the hopes getting more points is not worth it. You can very well score full marks with a small game of just a few well-functioning areas.
The assistants may award additional points at their discretion. You can score them for technical quality but also for interesting and fun details in your game.
We’ll publish the scores two weeks after the deadline, at the latest.
Each of the assistants picks their own favorite among the games in their packet. In making that decision, the assistant may use any criteria, such as entertainment value, originality, or technical merits. We’ll reward the assistants’ favorite games with movie vouchers and make those games available for other O1 students to see in A+, unless you specifically request that we don’t do that.
Further Instructions and Hints
Have fun.
We accept games in English, Finnish, and Swedish.
You can build on the given Adventure module. You’ll need to edit some or all of the classes. The class
Adventure
, especially, needs a complete makeover or could even be replaced by a different class altogether.You may very well focus on building the game logic and leave the user interface(s) untouched.
You are allowed to change the user interfaces if you want to. Indeed, you are completely free to change anything in the given code and add whatever you wish.
The game does not need to be compatible with both the given
AdventureTextUI
andAdventureGUI
. One user interface is enough (and you can even create your own if you choose). In any case, it’s good to follow the principle of keeping the game’s inner logic independent of the user interface.
Hopefully, inspiration will hit you and you’ll create something fun. But don’t bite more than you can chew: there’s only a limited amount of time until the deadline.
You can ask the teaching assistants to help you estimate how time-consuming it might be to implement a feature that you have envisioned. Ultimately, though, you are personally responsible for your own schedule.
Try to work on one feature of the game at a time, finishing it before moving on to additional features. That way, you’ll have something submissible even if you run out of time before you can implement every feature that you had planned.
Additions to the game mechanics are welcome but optional. For instance, you may wish to consider: new directions to move in; vehicles; attributes or abilities for the player character; weights for items that limit what the player can carry; complex commands that consist of multiple words; etc. etc.
Since your game will be played by an actual human, don’t forget the help command or the walkthrough. Try to ensure that your game is understandable. For instance, if the game has a bug that unexpectedly and imperceptibly teleports the player to a different location, the game may be a pain to play and assess.
If you wish to write additional comments or instructions for the teaching assistant, you can also include a
readme.txt
orreadme.pdf
file.Also make a readme file in case you used ChatGPT or similar tools to generate thematic content for your game. Provide a brief description of how you used the tools.
In Aalto IT’s Linux labs, you can use Inkscape, Dia, or GIMP to draw the game map. There are many alternative graphics programs, too; use whatever is available in your environment.
If you want to use O1Library’s tools in your game, go ahead and do so but read the box below first. In fact, you may want to read the box in any case.
Dependencies between IntelliJ modules
If an IntelliJ module depends on the classes in another module, you
need to indicate the dependency. If you don’t, your import
s
from the other module won’t find their target.
Most O1 modules already define such a dependency to O1Library. You can see this in the settings: select File → Project Structure in the menu, then pick one of the earlier modules and open the Dependencies tab on the right. (On a Mac, the corresponding menu item is IntelliJ IDEA → Preferences.)
As given, Adventure is an independent module. If you want to use O1Library in your game, find the above setting, click the plus icon, and select Module Dependency when prompted.
Renaming your game module
If you wish, you may pick a different name for your game module instead of the generic “Adventure”.
Right-click the module in the Project view and select Refactor → Rename.
IntelliJ asks if you’d like to rename the module, or the directory (folder) on disk where the module is located. Usually, it’s a good idea for a module and its directory to have the same name, so pick Rename directory and then repeat the same operation and pick Rename module.
Using files in your project
Some ambitious students might want their game to make use of external files. For example, you might want to load some information about the game world from a file or enable the player to save their game.
Using files is definitely not a requirement! If you’d like to pursue it nevertheless, you’ll find some basic information about file handling in Chapter 11.3 and can expand on that with a web search or through our resources page.
Submitting the Assignment
This assignment cannot be submitted for auto-grading via IntelliJ’s A+ Courses plugin. Instead, package your program as per the instructions below and submit it via the browser.
Preparations
First, update IntelliJ’s A+ Courses plugin to version 4.1 (or newer). Here’s how:
In the IntelliJ menu, select File → Settings → Plugins.
In the list of plugins, there’s an Update button next to A+ Courses. (If you happen to have version 4.1 of the plugin — or newer — already, the button won’t show up and you’re good to go.) Press the button.
Press Restart IDE and return to your game module after IntelliJ restarts.
Make doubly sure that you’re looking at the exact version of your program that you intend to submit and that all the files are saved. Then make triply sure.
In IntelliJ, go to the Modules tab where you’ve downloaded various course modules onto your computer. At the top-right corner, there’s an Export Module icon that looks like this: . Press it. A small dialog pops up.
Select your game module (Adventure or whichever name you gave it). Mark whether you did the game alone or with a pair (which affects the name of the zip package file that will be produced). Also pick the folder where you’d like to place the resulting package file (your home folder will do, for example).
Press OK. IntelliJ creates a zip package of your game. Locate the
.zip
file on your computer, in the folder you chose earlier. Examine its contents to make sure it contains everything you want it to. It should contain the entire module, source code and all.
Submitting the zip file for marking
Your attention, please!
If you did the assignment with a pair, please make sure you’ve selected a pair submission in A+. Only one member of the pair should submit the assignment!
A+ presents the exercise submission form here.
Great work! Because this message is prerecorded, any observations regarding your performance are speculation on our part. Please disregard any undeserved compliments.
Feedback
Please note that this section must be completed individually. Even if you worked on this chapter with a pair, each of you should submit the form separately.
Credits
Thousands of students have given feedback and so contributed to this ebook’s design. Thank you!
The ebook’s chapters, programming assignments, and weekly bulletins have been written in Finnish and translated into English by Juha Sorva.
The appendices (glossary, Scala reference, FAQ, etc.) are by Juha Sorva unless otherwise specified on the page.
The automatic assessment of the assignments has been developed by: (in alphabetical order) Riku Autio, Nikolas Drosdek, Kaisa Ek, Joonatan Honkamaa, Antti Immonen, Jaakko Kantojärvi, Onni Komulainen, Niklas Kröger, Kalle Laitinen, Teemu Lehtinen, Mikael Lenander, Ilona Ma, Jaakko Nakaza, Strasdosky Otewa, Timi Seppälä, Teemu Sirkiä, Joel Toppinen, Anna Valldeoriola Cardó, and Aleksi Vartiainen.
The illustrations at the top of each chapter, and the similar drawings elsewhere in the ebook, are the work of Christina Lassheikki.
The animations that detail the execution Scala programs have been designed by Juha Sorva and Teemu Sirkiä. Teemu Sirkiä and Riku Autio did the technical implementation, relying on Teemu’s Jsvee and Kelmu toolkits.
The other diagrams and interactive presentations in the ebook are by Juha Sorva.
The O1Library software has been developed by Aleksi Lukkarinen, Juha Sorva, and Jaakko Nakaza. Several of its key components are built upon Aleksi’s SMCL library.
The pedagogy of using O1Library for simple graphical programming (such as Pic
) is
inspired by the textbooks How to Design Programs by Flatt, Felleisen, Findler, and
Krishnamurthi and Picturing Programs by Stephen Bloch.
The course platform A+ was originally created at Aalto’s LeTech research group as a student project. The open-source project is now shepherded by the Computer Science department’s edu-tech team and hosted by the department’s IT services; dozens of Aalto students and others have also contributed.
The A+ Courses plugin, which supports A+ and O1 in IntelliJ IDEA, is another open-source project. It has been designed and implemented by various students in collaboration with O1’s teachers.
For O1’s current teaching staff, please see Chapter 1.1.
Additional credits for this page
This chapter draws inspiration from classic adventure games by Infocom and the work of David Barnes and Michael Kölling.