Page 1 of 1
DPRK (North Korea) Text Adventure
Posted: Tue Nov 27, 2012 4:19 pm
by Jizaboz
I figured this board would be the best place to formally announce that this is being working on. I've already had a lot of fun with Hugo, and have decided to keep chugging along a bit more in this language for a side IF project of mine that so far only existed as plot layout written on a notebook.
Here's a rough screenshot of the prototype, based on the infamous "cafeteria" code. This is what I did on Thanksgiving waiting for my turkey to cook:
Next up will be creating new areas to move into, as well as updating the graphic after the move. After that, I hope to get inventory control before moving onto conversation. Most functions of basic verbs seem pretty self-explanatory by looking at examples. There's definitely a steep beginning learning curve here as opposed to Inform, but it is nice to actually do coding for fun in something closer to C and not feel like I'm speaking in riddles.
Posted: Tue Nov 27, 2012 5:51 pm
by Roody_Yogurt
Looks like you're off to a good start. Let us know if you have any questions about things!
Posted: Wed Nov 28, 2012 11:47 am
by Tdarcos
You could include the relative "unfairness" or "randomness" of treatment where some people get selected for arrest, imprisonment or execution, apparently at random.
And stay off the phones:
* An American ambassador visiting North Korea was held at the border until he paid his outstanding phone bill. There is no direct phone service between the US and the DPRK so he had to relay calls through the U.S. embassy in Canada. They wouldn't let him leave the country until he paid the phone bill, about $27,000. In cash.
* But at least he got out unscathed, one guy wasn't so lucky. Someone made an unauthorized phone call from North Korea to another country. He was executed for doing so.
* You have to turn your phone in when you enter the country; apparently you do get it back when you leave. Inside the country I think they do have phones and I suspect you can get one but it's tied to you, and I wouldn't be surprised if all calls are monitored. Call the wrong person or say the wrong thing and your visit might be extended, say by several years at forced labor.
Other points:
* North Korea is an extremely poor country, and the whole idea is (if you're one of the poor bastards who are a resident) that for anything you have at all, even basic subsistence, or even that you're still alive, you should give thanks (and pray) to your benefactor, the leader of the country, the late Kim Jong Il. Yes, I said, late, the DPRK is a thanatocracy where the country is ruled by a ghost.
* Lots of pictures of the current leader.
* Everyone is paranoid that they'll be grabbed up, and as bad as their existence is, being made into a forced laborer in a country where everyone already is a slave, is even worse, in ways you can't imagine.
* Almost everyone wears a standard (gray) uniform.
If I'm wrong on these points then you might want to include that as exposition in the game.
Note: This is a message dealing with an adventure game, and per Jonsey's agreement, is exempt from the 10-line limit.
Posted: Wed Nov 28, 2012 12:26 pm
by Jizaboz
Yeah, definitely TDarcos. A lot of the "scary" aspects of the country will be pointed out.. though I don't want to give too much away about what will happen.
The game will have 3 PCs.. one is an American tourist, one is a citizen of Pyongyang, and another from a um.. I'll just say MUCH less comfortable situation. I've done a lot of research about the country over the past few months out of no motivation but just fascination for how different things there are.
I really think the hardest perspective to write will be from the perspective of the fairly well-to-do person living in the capitol city of Pyongyang. Getting into the mind of someone who is a true patriot of the country will probably be pretty tough.
Posted: Wed Nov 28, 2012 1:16 pm
by pinback
Tdarcos wrote:You could include the relative "unfairness" or "randomness" of treatment where some people get selected for arrest, imprisonment or execution, apparently at random.
And stay off the phones:
* An American ambassador visiting North Korea was held at the border until he paid his outstanding phone bill. There is no direct phone service between the US and the DPRK so he had to relay calls through the U.S. embassy in Canada. They wouldn't let him leave the country until he paid the phone bill, about $27,000. In cash.
* But at least he got out unscathed, one guy wasn't so lucky. Someone made an unauthorized phone call from North Korea to another country. He was executed for doing so.
* You have to turn your phone in when you enter the country; apparently you do get it back when you leave. Inside the country I think they do have phones and I suspect you can get one but it's tied to you, and I wouldn't be surprised if all calls are monitored. Call the wrong person or say the wrong thing and your visit might be extended, say by several years at forced labor.
Other points:
* North Korea is an extremely poor country, and the whole idea is (if you're one of the poor bastards who are a resident) that for anything you have at all, even basic subsistence, or even that you're still alive, you should give thanks (and pray) to your benefactor, the leader of the country, the late Kim Jong Il. Yes, I said, late, the DPRK is a thanatocracy where the country is ruled by a ghost.
* Lots of pictures of the current leader.
* Everyone is paranoid that they'll be grabbed up, and as bad as their existence is, being made into a forced laborer in a country where everyone already is a slave, is even worse, in ways you can't imagine.
* Almost everyone wears a standard (gray) uniform.
If I'm wrong on these points then you might want to include that as exposition in the game.
Note: This is a message dealing with an adventure game, and per Jonsey's agreement, is exempt from the 10-line limit.
ABSOLUTELY FUCKING INCORRECT!!
You saw the words NORTH KOREA and remembered a PAGE LOAD OF RANDOM FACTS ABOUT IT, and figured that was your CUE.
JONSEY!!!!!!!
SPLIT THAT SHIT!!! (and then BAN HIS ASS.)
Posted: Wed Nov 28, 2012 3:23 pm
by Jizaboz
Haha I could have pointed out that some of TDarco's post is actually not quite as true anymore. Maybe make a 10-line list of every statement that people who have been there say is incorrect.
But this will do.
Posted: Wed Nov 28, 2012 5:45 pm
by pinback
Jizaboz wrote:Haha I could have pointed out that some of TDarco's post is actually not quite as true anymore. Maybe make a 10-line list of every statement that people who have been there say is incorrect.
But this will do.
I realized I knew I was making a grievous error when I characterized his post as a page-load of "facts", instead of "random factoids that may have one time had the slightest basis in truth but at this point probably everything he said was constructed of false-remembrances and pork patty dinner stuck in his brain."
Posted: Wed Nov 28, 2012 10:15 pm
by Ice Cream Jonsey
ABSOLUTELY FUCKING INCORRECT!!
You saw the words NORTH KOREA and remembered a PAGE LOAD OF RANDOM FACTS ABOUT IT, and figured that was your CUE.
Ben is correct. So I think it's time we established a new rule.
When Talking About Adventure Games And North Korea, The Message Line Limit Is 20 (Twenty) Lines For Commander Tansin Darcos
OK? Do we all agree to this? Jizaboz? Aardvark? Ben? Kung-Il?
Posted: Wed Nov 28, 2012 10:49 pm
by pinback
When discussing either Korea, and only with regard to adventure games, he should be allowed 20 lines MINUS the difference between the 38th parallel and whatever specific latitude he is making wildly false statements about.
Posted: Wed Nov 28, 2012 11:16 pm
by Ice Cream Jonsey
Ok but let's add 4 lines to whatever the result is, that way, he at least gets 4 lines.
I also think that stops us from overcomplicating the whole deal.
Posted: Sat Dec 01, 2012 3:25 pm
by Jizaboz
Alright, first request for some coding help here.
So, from the Cafeteria example, the "currentpicture".
Code: Select all
global currentpicture = "/nkimages/traffgirl1.jpg"
I'm hoping to rework the inventory/status window soon, but for now I'm really unsure how I should go about updating this upon something like (pseudo code) "n_to {current picture = "/nkimages/statues.jpg"
}".
I see "UpdateGraphicsWindow" and other graphic-related code in the CZK code and I've tried a few things sort of like that, but maybe I'm over-complicating it for just trying to update a picture every time a player moves and in the future when a "scene" occurs.
Posted: Sat Dec 01, 2012 6:23 pm
by Roody_Yogurt
I'm not entirely sure what's being asked here, so I'll just go over each part of it. I think we need to go over three things.
- Set up a resource file.
It's nice to set up a resource file so your game isn't distributed with a bunch of files. You do it with something like:
Code: Select all
resource "MSTRYHS1"
{
"/home/Gerynar/HugoDev/MysteryHouse/graphics/exterior.jpg"
"/home/Gerynar/HugoDevel/MysteryHouse/graphics/interior.jpg"
"/home/Gerynar/HugoDevel/MysteryHouse/graphics/note.jpg"
! Some more pictures here
}
You'll also want to change the line in the DrawWindows routine from:
Code: Select all
LoadPicture(currentpicture)
to
Code: Select all
LoadPicture(MYSTRYHS1,currentpicture)
(where "MYSTRYHS1" is the name of your resource file)
The perk of doing it this way is that from then on, you can just set the currentpicture to the name of the individual picture and don't need to use paths or anything.
- Have DrawWindows called every turn.
Just add the following line to the main routine, so DrawWindows is called after every succesful turn:
I guess the cafeteria code already does this.
- Change the currentpicture global, as needed.
Then yeah, it's just a matter of changing the currentpicture global at times the picture should change. With your example, I'd do something like:
Code: Select all
n_to {current picture = "statues" ! extension isn't necessary since we're using a resource file
return statue_room ! so we still make it to the right room
}
Assuming that there are other things with pictures to look at in the room, we'd also add it to the room's long_desc property so when the player LOOKs, it resets to the room picture:
Code: Select all
room statue_room "Statue Room"
{
long_desc
{
currentpicture = "statues"
"Statue Room description."
}
s_to other_room
}
Posted: Mon Dec 03, 2012 8:45 am
by Jizaboz
Thanks man! This will help a ton to get the ball rolling.
Posted: Wed Dec 05, 2012 11:23 am
by Tdarcos
pinback wrote:Tdarcos wrote:(various items)
ABSOLUTELY FUCKING INCORRECT!!
Okay, smarty, what parts are incorrect?
* "The DPRK refused to allow Mr. Richardson to leave the country with the soldier's remains and cross into the DMZ until he paid, in cash, the $10,000 telephone bill for calls to the U.S. State Department"
-
The Hour, Norwalk CT, January 20, 1995
http://news.google.com/newspapers?nid=1 ... 81,2220889
* A North Korean man has been executed by firing squad for calling a friend in South Korea on his mobile phone. -
London Daily Mail, March 4, 2010
http://www.dailymail.co.uk/news/article ... phone.html
* "North Korea is a famine state. In the fields, you can see people picking up loose grains of rice and kernels of corn, gleaning every scrap. They look pinched and exhausted."
- Christopher Hitchens,
On North Korea and Kim Il Sung
http://www.ruthfullyyours.com/2011/12/1 ... te-please/
Posted: Thu Dec 06, 2012 4:24 pm
by Jizaboz
Tdarcos wrote:
* "The DPRK refused to allow Mr. Richardson to leave the country..
Haha now that's worse than Sprint's billing rate!
Tdarcos wrote:
* A North Korean man has been executed..
I could see this happening, considering that's illegal there and they do not play around punishment-wise.
Tdarcos wrote:
* "North Korea is a famine state. In the fields, you can see people picking up loose grains of rice and kernels of corn..
Corn as well as cabbage (and probably rice) will be big factors in this adventure.
Today after work I tried making a revision of my code. I had a few errors I could clean up but I'm not sure about these yet:
Code: Select all
193: trafficgirl.long_desc: Error: Syntax error: currentpicture
193: trafficgirl.long_desc: Error: Illegal assignment
314: routine drawwindows: Error: Syntax error: loadpicture
314: routine drawwindows: Error: Syntax error: dprk
314: routine drawwindows: Error: Syntax error: currentpicture
314: routine drawwindows: Error: Expecting value following: ,
The offending lines:
line 193 (this is within the long_desc{ bracket of the first room):
Line 314 (314 is LoadPicture(DPRK,currentpicture) :
Code: Select all
run pictureWindow.win_init ! Initialize
window ! Re-open the last-defined
{ ! window (i.e., this one)
LoadPicture(DPRK,currentpicture)
}
and my resource.h:
Code: Select all
resource "DPRK"
{
"images/traffgirl1.jpg"
"images/statues.jpg"
}
I'm in a windows environment with the images folder sitting as a sub-folder in the same folder as my source. I realize it's just syntax errors (still getting the hang of things) but a nudge in the right direction would be cool. I'll post the whole source once I get the image properly changes between 2 rooms for reference.
Posted: Thu Dec 06, 2012 5:47 pm
by Roody_Yogurt
I would guess that currentpicture is not declared as a global variable for some reason (it should be in the original code), like:
Also, I would guess that "resource.h" has not been properly included. Also, the LoadPicture line should probably be:
Code: Select all
LoadPicture("DPRK",currentpicture)
Posted: Fri Dec 07, 2012 4:12 pm
by Jizaboz
Cool! Got it going. I'm going to edit it a bit before posting though.
Had that global commented out btw (duhhhh) and didn't realize before that last build. Also, the quotes on DRPK were needed.
Thanks again.
Posted: Mon Dec 10, 2012 4:51 pm
by Jizaboz
Doh, no I don't. I must have had some old stuff laying around letting the images load outside of the resource file. After cleaning up my folders and trying to re-compile I'm getting an error:
Code: Select all
C:\Hugo\source\DPRK.hug:323: routine drawwindows: Error: Syntax error: loadpicture
I've noticed the flack's cafeteria code also seems to throw this if I don't have the image in place, so I need some sort of correction for using a resource files is my best guess. The actual game will load, but no pictures are displaying. I decided to clean up the source folder after I was having a hard time getting a 3rd image into the game.
Current code:
Code: Select all
!::
! Days in DPRK
!::
!:: Flags
!#set BETA ! Compile with the comments-in-transcripts library addition (requires "beta.h")
!#set GLK ! Compile with glk checks
#set HUGOFIX ! Compile with HugoFix Debugging Library commands available (type $? in game)
!#set HDX ! Compile as Hugo Debuggable Executable (see below for details)
!#set PRECOMPILED_LIBRARY ! Use a precompiled header library (see manual)
!#set VERBSTUBS ! Include the grammar and routines from verbstubs.g and verbstubs.h, respectively
!#set USE_ATTACHABLES ! Use attachable items
!#set USE_PLURAL_OBJECTS ! Use plural objects
!#set USE_VEHICLES ! Use vehicle objects
!$set VERSIONS ! Print library versions at compile time
!#set NO_AUX_MATH ! No advanced math needed
!#set NO_FONTS ! Don't use font effects
!#set NO_FUSES ! Don't use fuses
!#set NO_MENUS ! Don't use menus
!#set NO_RECORDING ! Don't allow transcripts
!#set NO_SCRIPTS ! Don't use character scripts
!#set NO_STRING_ARRAYS ! Don't use string arrays
!#set NO_VERBS ! Don't use any standard verbs
!#set NO_XVERBS ! Don't use any standard "out-of-world" verbs
!:: switches ! example how one can add compiler switches to source
!#switches -ls ! print compilation stats to .LST file
#ifset HUGOFIX
#set DEBUG
#endif
#ifset HDX
#switches -d ! if the -d switch is not set in the compiler itself, #set HDX will produce
! a Hugo Debuggable Executable (.HDX) with extension .HEX
#endif ! Sneaky!
!:: Pre-Hugolib.h Constants (some constants must be set before hugolib is included)
!constant AFTER_PERIOD " " ! include one space after full stops (as opposed to two)
!constant INDENT_SIZE 0 ! no indentation in room descriptions and room content listings
!:: Grammar Library Inclusions (grammar must come first)
! put your new grammar here
verb "screen"
* DoScreen
! new grammar needs to be defined before the including verblib
#include "verblib.g" ! Verb Library
#ifset PRECOMPILED_LIBRARY
#link "hugolib.hlb" ! Your Precompiled Library
#else
#include "hugolib.h" ! Standard Hugo Library
#endif
!:: Other Library Inclusions
#ifset BETA
#include "beta.h"
#endif
#ifset GLK
#include "glk.h"
#endif
#include "resource.h"
#include "window.h"
!:: Other constants and global variables
constant IFID "put-IFID here"
!:: Game Initialization routine
routine init
{
#ifset BETA
if word[1] = "script"
transcript_is_on = true
#endif
STATUSTYPE = 1 ! 0 = none :: 1 = score/turns :: 2 = time
counter = -1 ! 1 step before first turn
! If STATUSTYPE = 2 (time), counter is minutes since midnight, so a game that starts at 3 pm
! should have:
! counter = 899
! (900 minutes minus the one minute the main routine will add on the first turn)
TEXTCOLOR = BRIGHT_WHITE
BGCOLOR = BLACK
SL_TEXTCOLOR = LIGHT_RED
SL_BGCOLOR = BLACK
color TEXTCOLOR, BGCOLOR
verbosity = 2 ! 1 = normal (rooms described only if not previously
! described)
! 2 = full (rooms described every time they are entered)
display.title_caption = "Days in DPRK" ! used for GUI clients for title bar text.
prompt = ">"
window 0 ! resets the windows in case the player is restarting a game
cls
#ifset GLK
glkcheck
#endif
DEFAULT_FONT = PROP_ON
Font(DEFAULT_FONT)
!:: Opening Text
! "Intro to game"
print "" ! For a blank line between the intro and the game title
Font(BOLD_ON)
"Days in DPRK"
Font(BOLD_OFF)
"Three days from three different perspectives in the Democratic Peoples Republic of Korea"
#ifset BETA
string(_temp_string, serial$, 8)
"beta build: \B20";
StringPrint(_temp_string, 6, 8)
StringPrint(_temp_string, 0, 2)
StringPrint(_temp_string, 3, 5)
"\b"
#endif
print BANNER;
#ifset HUGOFIX
print " (Now with HugoFix Technology TM!)"
#else
print ""
#endif
! print IFID
#ifset BETA
"\n(\INOTE: This beta release is intended for testing only, not for
distribution to the general public. Please report any errors,
bugs, etc. to the author. To make a comment, type \"\B* COMMENT TEXT\b\" at the prompt.\i)"
#endif
player = you
location = streetcorner1
old_location = location
move player to location
old_location = location
FindLight(location)
DescribePlace(location)
location is visited
CalculateHolding(player)
#ifset USE_PLURAL_OBJECTS
InitPluralObjects
#endif
}
!:: Main game loop
#ifset PRECOMPILED_LIBRARY
replace main
{
#else
routine main
{
#endif
counter = counter + 1
! PrintStatusLine
DrawWindows
run location.each_turn
runevents
RunScripts
if speaking not in location
speaking = 0
}
player_character you "you"
{
}
!----------------------------------------------------------------------------
! STREET CORNER 1
!----------------------------------------------------------------------------
room streetcorner1 " PYONGYANG STREET INTERSECTION"
{
n_to {currentpicture = "statues" ! extension isn't necessary since we're using a resource file
return streetcorner2 ! so we still make it to the right room
}
long_desc
{
"You are standing with your group at a street intersection in Pyongyang. You have no idea what streets cross before you. Your attention is drawn to a traffic direction girl standing on a round platform in the middle of the intersection. The others in your group start pointing at her and taking pictures."
}
}
scenery trafficgirl "Traffic Girl"
{
nouns "traffic" "girl"
in streetcorner1
long_desc
{
currentpicture = "traffgirl1"
"The traffic girl is busy directing the few automobiles that drive by while trying to ignore the people taking pictures of her."
}
}
global currentpicture = "traffgirl1"
global currentstatus = "\nSTATUS \nCondition: Excellent \n Mood: Amused \n \n INVENTORY \n pack of cigarettes \n postcard \n digital camera \n $40"
!----------------------------------------------------------------------------
! STREET CORNER 2
!----------------------------------------------------------------------------
room streetcorner2 " THREE LARGE STATUES"
{
long_desc
{
"Here are the 3 statues of the 3 leaders."
currentpicture = "statues"
}
}
scenery statue "statue"
{
nouns "statues" "statue"
in streetcorner2
long_desc
{
"The statues are impressive."
}
}
!global currentpicture = "statues"
!global currentstatus = "\nSTATUS \nCondition: Excellent \n Mood: Amused \n \n INVENTORY \n pack of cigarettes \n postcard \n digital camera \n $40"
routine DoScreen
{
print "The screen width is "; number display.screenwidth; " characters."
print "The screen height is "; number display.screenheight; " characters."
print "The line length is "; number display.linelength; " characters."
print "The window lines height is "; number display.windowlines; " characters."
print "The status line height is "; number display.statusline_height; " characters."
print "This interpreter ";
if display.hasgraphics
"supports graphics."
else
"does not support graphics."
}
window_class pictureWindow
{
! The inventory window is the top-right rectangle of the screen:
win_left
return 1
win_top
return 1
win_right
{
if mod(display.screenwidth,2)
return (display.screenwidth/2 - 1)
else
return (display.screenwidth/2)
}
win_bottom
return display.screenheight/3
win_textcolor BLACK
win_backcolor BLACK
}
window_class statusWindow
{
! the description window is the top-left of the screen
win_left
{
return (marginWindow.win_left + 2)
}
win_top
return 1
win_right
return display.screenwidth
win_bottom
return display.screenheight/3
win_textcolor LIGHT_RED
win_backcolor BLACK
}
window_class marginWindow
{
! the description window is the top-left of the screen
win_left
{
if mod(display.screenwidth,2)
return (display.screenwidth/2 + 2)
else
return (display.screenwidth/2 + 3)
}
win_top
return 1
win_right
return display.screenwidth
win_bottom
return display.screenheight/3
win_textcolor LIGHT_RED
win_backcolor BLACK
}
routine DrawWindows
{
Font(PROP_OFF)
window (display.screenheight/3+1)
{
color BLUE, BLUE
cls
color TEXTCOLOR, BGCOLOR
}
run pictureWindow.win_init ! Initialize
window ! Re-open the last-defined
{ ! window (i.e., this one)
LoadPicture("DPRK",currentpicture)
}
run pictureWindow.win_end
run marginWindow.win_init
window
{
cls
}
run marginWindow.win_end
run statusWindow.win_init ! Initialize
window ! Re-open the last-defined
{ ! window (i.e., this one)
print currentstatus;
}
run statusWindow.win_end
}
replace PrintStatusline
{
if display.linelength < 80
display.statusline_height = 2
else
display.statusline_height = 1
Font(BOLD_OFF | ITALIC_OFF | UNDERLINE_OFF | PROP_OFF)
window 1, (display.screenheight/3 +2), display.screenwidth, (display.screenheight/3 +2 + display.statusline_height)
{
color SL_TEXTCOLOR, SL_BGCOLOR
cls
locate 1, 1
if not location
print "\_";
elseif not light_source
print "In the dark";
else
{
if FORMAT & DESCFORM_F: print "\_";
print capital location.name;
}
! (The part we're changing)
! print to 65; ! is 65 characters good for every window size? No!
! Instead, let's begin by writing the entire 'SCORE / MOVES' to array _temp_string
! (_temp_string is an array declared by the library)
text to _temp_string
if STATUSTYPE = 1
print number score; " / "; number counter;
elseif STATUSTYPE = 2
print HoursMinutes(counter);
text to 0
! Ok, we've closed off the string array
! Now, if the screen is wide enough, let's move to the end of the screen MINUS the length of the _temp_string array
! plus two extra spaces for good measure (so there's a little space to the right on the status bar)
if display.statusline_height = 1
print to (display.screenwidth - (StringLength(_temp_string) + 2));
else
{
locate 1, 2
if FORMAT & DESCFORM_F: print "\_";
}
! Now let's print it!
if STATUSTYPE = 1,2
StringPrint(_temp_string)
}
color TEXTCOLOR, BGCOLOR
Font(DEFAULT_FONT)
}
resource.h:
Code: Select all
resource "DPRK"
{
"images/traffgirl1.jpg"
"images/statues.jpg"
! Some more pictures here
}
I have an images folder sitting within the Hugo source folder.
Posted: Mon Dec 10, 2012 5:40 pm
by Roody_Yogurt
resource.h is one of the Hugo standard library files. It seems like you may have replaced it with your own "resource.h" file (that you are using for defining your resource file). If that's not the case, I'll look at it closer.
Posted: Tue Dec 11, 2012 8:35 am
by Jizaboz
Roody_Yogurt wrote:resource.h is one of the Hugo standard library files. It seems like you may have replaced it with your own "resource.h" file (that you are using for defining your resource file). If that's not the case, I'll look at it closer.
Um.. no need to look at it closer. I don't know how I pulled that one off. I guess the filename was on my brain as I typed out a name for a resource file. Whups! Thanks again.