Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Text-Based Game  (Read 1260 times)

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Text-Based Game
« on: March 05, 2014, 12:29:56 pm »

~WARNING~
This game is subject to severe amounts of Development Hell as I battle bouts of depression, more important projects, school, and my impending adulthood. Do not expect this game to be released any time soon, unless you are willing to help. And if you are, realize this game is indefinitely free.
~Warning End~

Story:
You open an obscure program on your terminal. After throwing many errors, the program connects you to a Command-line chat client. The person on the other end is named Mackey Tsesse. She has found her room mysteriously transported into some sort of labyrinthine facility. Your task is to build up trust with her and help her escape/rescue her friends and family. ( Depends on the inevitable scope of the project. )

Gameplay: Largely non-existant atm. Gameplay exists of a very buggy and formulaic conversation tree that implements what is probably the worst parsing algorithm ever made. ( Mind you that the game is largely a patchwork of C and C++ that is... highly "unique". ) Nonetheless, it's pretty ok. You introduce yourself, are asked a few questions ( which Mackey is supposed to remember but doesn't yet ) and then she asks you for suggestions on where to go and what to do. You can suggest any of the four doors in the room, and she will enter into the next room and give you a very brief description of the room. Then the game ends. That's all I've got done now!

Source code: Not yet released.

Shobak

  • Bay Watcher
  • May be slightly unhinged.
    • View Profile
Re: Text-Based Game
« Reply #1 on: March 05, 2014, 05:07:11 pm »

I like the idea. If you want I may be able to offer some help - I mainly code in Java/Python, but I know enough C/C++ to write something useful.

One thing that would be interesting could be the implementation of hunger/thirst/sleep counters, with Mackey acting on her own to look for food/water - it could be implemented as [See Food? -> Eat Food; Else -> Move at Random] or by giving her a (perhaps limited) memory and using a pathfinding algohoritm to reach the nearest room that contained food - that may very well be not there anymore.

Have you looked into alternatives to C/C++? I think that Inform 7 would be more appropriate for this sort of game (or Python, but I'm biased).
Logged

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Re: Text-Based Game
« Reply #2 on: March 06, 2014, 09:08:13 am »

Thank you. Both for your offer and for your interest. I will gladly accept both.

Yea. That'd be good. I was planning on adding several psychological aspects, such as:
-Opinion of you. ( the player ) {Theoretically you'll be able to say pretty much anything that you could say to a human. Including sexually harrassing her. This, obviously, will lead to a game over. First time you'll be given a warning, something along the line of "No... that's like super inappropriate. Don't talk to me that way." Then, "look, I have a boyfriend, I have a kid with my boyfriend". On the third strike, she'll shut down the terminal and the game will display a message that says "Terminal disconnected. She'll never forgive you." And the game will be unplayable until you go in and delete your save data. Opinion of you drops highly if you harass, continually mock, or intentionally try to send her into dangerous situations, even though she has sense not to go through obvious traps without good reason. }
-Worry about her family, especially her daughter. ( requiring you to console and encourage her to keep moving )
-Dealing with the psychological trauma of the near-death situations. ( She can obviously handle them far better than a normal person, but she still has her limits. )
-How she deals with hunger, thirst, and lack of sleep. { Which falls into what you said and makes much sense. I just don't know how to do it. }

I would, but C and C++ are all I know. And even those barely. I tried learning java at one point and found myself frustrated and confused. Besides that, my Java compiler and workstation don't work right. All I can seem to get to work is Code::Blocks and MingW, but that's probably just cos I dunno how to set up the Java IDE. ( I believe it's a fork of the Eclipse IDE. )

This game is going to be very complex as it requires a Turing-passed AI that would solve problems independently of the player and could actually have a psychological opinion of the player and scenario. It should feel like you really are helping a woman escape some unknown kidnapper and get back to her family. Or at very least that you're roleplaying this in a chat room.

Shobak

  • Bay Watcher
  • May be slightly unhinged.
    • View Profile
Re: Text-Based Game
« Reply #3 on: March 10, 2014, 05:39:38 pm »

First, I do apologize about the delay - a few things came up and I couldn't use my computer for a few days.

Second, why do you want to write this game? Do you want to create a game, or do you want to learn C/C++/computer programming by writing a game?

If you want to simply create a game, you should really look into Inform 7/TADS/interactive fiction - or into Python/Java.
By the way, Eclipse is what I use for Java - you have to simply download and [install|unpack] it, if I'm not mistaken (you have to download & install the Java SDK) - and for Python the python interpreter and Notepad++ are enough, but there are IDEs available (PyScripter under Windows is one).

If you want to learn to program in C/C++...  :o This is a very ambitious first project. If you are very focused you might be able to pull it off, but you'll get frustrated and angry a lot along the way.


Most of the things that you want to add should be fairly simple to implement:
  • Opinion of the player: a simple counter should be enough - she starts with 0 (indifferent), and each action will either increase or decrease the counter. If the counter is too low (i.e. <-10, <-126) you die.
  • Worry about her family: a counter! Let's call it morale, and she starts with 100 (or 127). Morale decreases slowly all the time. Some action or events may [decrease|increase] it, or make it decrease faster or slower. If her morale is too low she'll get more depressed - taking more time to do most actions, or refusing them outright. (like in Cataclysm: Dark Days Ahead)
  • Psychological trauma: we may model it with  :o two counters - permanent stress and temporary stress.
An useful model for PTSD is the {insert name here}. Each person has a glass - filled not with water, but with delicious, delicious trauma. Everyday stress fills the glass, slowly - and usually the glass empties itself fast enough to not spill. But, if stress is "water", we may think of PTSD as a stone, dropped in the glass - if you don't take care the glass will overlflow more often.
  • Hunger, thirst and sleep: you could track proteins, carbohydrated, lipids, vitamin C, vitamin Bx, iron, copper and everything else - but you shouldn't make things more complex than what's needed. Three counters will be enough - thirst, hunger, fatigue. They start at 0 and increase slowly with time - but actions may make them increase more (to represent calories burned walking or sweat). If they get above some treshold your actions are penalized. If they reach another treshold you die (or fall asleep). Water/food/sleep will bring the counters down.

One last thing: you don't need to make a game good enough to pass the Turing test - and probably you won't be able to pull it off. What you do need is good writing to set the atmosphere.
Logged

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Re: Text-Based Game
« Reply #4 on: March 11, 2014, 08:10:23 am »

That's ok. I've been busy with my birthday. I'm an adult! woo...

Both. More to make a game, but I want to actually *code* it.

I have Eclipse, the JDK and even the ADK. As for Python, I'll have to look into that.

Duly noted. I'll probably migrate to another language. It's not my first C/C++ project though.

Sure, it's that would be simple enough, and for these first stages of development is probably how to go. Eventually, I want to her to be able to form distinct "feelings", not just a sliding scale. Still, it'll probably just end up factoring into a single scale anyway.

Oh, that's good.
And no, I was just tracking hunger and thirst similar to the way DF does. Basically Hunger equals: "Time" since last meal+Exertion. Thirst is similar but quicker. And I need better formulas because hunger increases quickly at first and then increases slower into the next levels of hunger. Drowsiness increases slow at first, and then increases geometrically. And only after a little while since the last sleep. Mm... Time scale is something I have to create also, and here's where I really need advice. How does one reliably keep track of in-game time?

Hmmm... that's fair. This particular game though, doesn't have much room for exposition and the idea is for it to pass a Turing test. Barring that, at least be acceptably intelligent seeming. As per writing, I'm writing the dialogue. I don't really want her to just monologue though. There will be some vague narration, but most of the story is told by the character.

Shobak

  • Bay Watcher
  • May be slightly unhinged.
    • View Profile
Re: Text-Based Game
« Reply #5 on: March 11, 2014, 05:48:56 pm »

Happy birthday! (I guess...   :-\ You don't seem too happy..)

About her feelings, you could probably use a finite-state automaton to switch between, for example, indifferent and creeped out, but you'll lose granularity. Or you might represent her current state as an (x, y) tuple on a plane, or use a n-uple, or wathever.
I don't know how human feelings could be represented - there are lots of shades.

You don't need strange & convoluted formulas to increase the hunger/thirst/drowsiness counters - unless they make you happy - you just have to set the appropriate tresholds. For example, a few months ago while messing around with Inform I used three 16-bit integer variables, increasing them by 1 each turn (one minute). Then, when hunger reaches 480 (8 hours passed from the last meal) I would print "You feel hungry." once every 10 turns or so. At hunger 10'080 (a week) the game ended saying "You starved to death.".
You just have to set the appropriate tresholds and print more and more urgent message, with increasing frequency - and maybe add penalties to actions and morale.

About the time scale, you could use a global integer variable that contains the number of intervals of time (seconds or minutes) elapsed since the start of the game. Then each action could advance the global time by a variable number of intervals - for example, moving from a room to another room could take [sqrt(current_room.area)/mackey_speed] +-10% seconds, and each question could advances the time by [(question_length/player_writing_speed)+(answer_length/mackey_writing_speed)] +-20% seconds - or you could simply say that moving from a room to another takes 10 seconds, and each question answered between 30 seconds and 2 minutes.

I have a few questions: how does Mackey answers the player's questions? Does she talks to the player, or does she write on a terminal? Is there a terminal present in every room? Is the facility equipped with CCTV?

Even if the current scenario doesn't have much room for exposition, you may have the player stumble on files about Mackey and her family (maybe giving the option of telling her), other possible "prisoners" in the facility and the facility itself.
You could even add other "prisoners" and have them interact with Mackey and between themselves.
You could offer the player the option to put Mackey in contact with her family (or even of faking it), or drop her family in the labyrinth along with her.
Logged

moocowmoo

  • Bay Watcher
    • View Profile
Re: Text-Based Game
« Reply #6 on: March 11, 2014, 06:26:39 pm »

Just wanted to chime in and say that the game concept is interesting.
Logged

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Re: Text-Based Game
« Reply #7 on: March 12, 2014, 08:11:23 am »

Thanks. ( I am, just a bit apprehensious. I'm getting better about it. )

Yeah, there are.

Mm... I guess not with the timing system you suggested.

She answers questions via a terminal for that purpose. It's a sort of social experiment to see how Mackey deals with the isolation and various other stressors and how random detached entities (ie "The Player" ) empathize and whether there is sufficient data to suggest that teamwork is effective over the internet. Or something. It's not like I have to reveal it outright so long as it's implied enough for enough of the players to figure it out. Also, Mackey can't know since it would skew the results. Similarly, the Player is never meant to be told outright, nor is the GLADoS-like entity to be revealed. There are CCTV's but you don't get the feeds from them. At best the computer system will give you small descriptions/hints but mostly you have to let Mackey describe it to you.

Yeah, alright. I already have character bios for all of the family Mackey knows since I didn't actually make a new chara for this.
I do like the idea of you being able to use her family against her. I wouldn't personally, but it should be an option. It'd have to be done carefully or you'd either throw her into a "controlling by fear", "you BASTARD", or "suicidal" mode. Family threatened and family dead are the two greatest stressors that can occur. And Mackey loves her daughter enough that she'd do anything to protect her. On the otherhand, it would make you one of the most sadistic and megalomaniacal people. ( Who uses a woman's infant daughter against her? ) That still should definitely be an option, but I don't know how one would control multiple characters. I'd have to build new objects with their own trust values and such. Might wait on a sequel for that.

@moocowmoo: Thanks!

darkflagrance

  • Bay Watcher
  • Carry on, carry on
    • View Profile
Re: Text-Based Game
« Reply #8 on: March 12, 2014, 12:08:48 pm »

Perhaps you can see things on the display that Mackey cannot see. For example, she might find documents containing exposition, background, or experimentation logs that seem to be blank to her, but that can be read through the camera's filters. They might say things such as "Subject 9328 expired today from unexpected experimental complications" and hint that terrible things had or are about to happen to her family, or perhaps there might be news stories on crimes that Mackey and her family had committed. The truth of any of this information would be unknown. You would then have the option of questioning Mackey on the information, divulging the nature of the experiments or her family's predicament, or concealing information, either out of hope that it was false or misleading, or out of fear of destabilizing her mood.
Logged
...as if nothing really matters...
   
The Legend of Tholtig Cryptbrain: 8000 dead elves and a cyclops

Tired of going decades without goblin sieges? Try The Fortress Defense Mod

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Re: Text-Based Game
« Reply #9 on: March 12, 2014, 02:10:00 pm »

Yea. Or perhaps, if I can work out how, we could have a second terminal where one can try to "hack" into the database of the facility to discover things that can impact the main game.

Shobak

  • Bay Watcher
  • May be slightly unhinged.
    • View Profile
Re: Text-Based Game
« Reply #10 on: March 13, 2014, 05:01:52 pm »

Well, if this unnamed group went to the lenght of building an entire facility and kidnapping at least one person they'll probably keep most incriminating files in the facility itself, perhaps behind a secret door or a few yards of steel.

I'd guess that the player accidentally hacked the interface between the facility and the external world - it is very unlikely but possible (maybe a third party that don't want to expose itself is helping him). Everything else would be stored in the facility itself, maybe accessible from the terminals in an observation room - and Mackey might be able to enter the observation room and hack into the terminal herself.
(It would be funny if Mackey must only reach the observation room - the terminal is password-protected, yes, but someone has written the password on a post-it and placed it on the display)

Using her familiy against her is only one of many options - I personally would put her in touch with her family (or somehow fake it if they are unavailable or dead) to help her/increase her morale at first. And then I would probably organize a crusade against everyone involved in the experiment (as they either kidnapped her or erased her memory, both grievous crimes) and place bombs in their bathroom.

You do remember where are we [posting|talking], yes?
( Who uses a woman's infant daughter against her? )
Dwarfs. Or adventurers. Probably by bashing her head in with her daughter's corpse and then eating it.
But most of them are probably the most sadistic people around anyway, so my point is moot.
Logged

CaptainMcClellan

  • Bay Watcher
  • [WAS_NEVER_HERE][CUBE]
    • View Profile
Re: Text-Based Game
« Reply #11 on: March 13, 2014, 08:49:55 pm »

Mm. True.

Yea. Or perhaps it's part of the experiment. It's a really good way to supply false information that seems trustworthy. If you're a trusting type. I think I'd like it better your way though.

Yea. Yea. Good point.