How to best simulate a vehicle in motion.

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
pinback
Posts: 15873
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

How to best simulate a vehicle in motion.

Post by pinback »

This is a style thing, so I'm just asking for input from you, the aspiring text game player:

If I want to implement time passing in a vehicle (car, train, etc.), and I want things to happen/appear during the course of a trip, what is the most player-friendly/interesting way to do that?

The simplest would just be a bunch of pauses, inviting the player to hit the spacebar or whatever in between moments, as the vehicle moves along...
The exit sign for Hamiton, OH whizzes past on the right.

MORE...

A sign for Shoney's towers over a local flea market past a small tree line.

MORE...

Tom Sawyer comes on the radio for the eighty-third time today. They really need to get over this.
I am wondering if there's a way to do it more interactively, but that's not awkward. You can prompt for them to continue driving, but that's no good. You're already driving. Things are happening, even while you just sit there. Prompt to type "z" over and over? That's tiresome and awkward, I think.

I dunno. Is there any way to do it other than MORE, MORE, MORE?
In the yard, not too far from the car.

User avatar
Jizaboz
Posts: 3211
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: How to best simulate a vehicle in motion.

Post by Jizaboz »

One thing I've done like the train in the Meeting Robb Sherwin game is giving some scenery to look at. That way, the player can burn times "waiting" or "looking".

The train moves long the track. In the cabin you see an LCD television high on one wall, a train line map on the opposite wall, and a newspaper is laying on the seat beside of you. The landscape outside whizzes by.

So you've got all of these things you can look at, read, whatever. Looking at the landscape doesn't provide many details because it's going by so fast.

You could also have random events like "An old man bumps your seat as he walks back to the bathroom.", "You hear the brakes of the train." To fill in the space if the player is just typing "wait" over and over so that he'll get more feedback than just "Time passes.."

User avatar
Tdarcos
Posts: 7654
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: How to best simulate a vehicle in motion.

Post by Tdarcos »

Ben, the question you asked is exactly the sort of example that proves the point I made in the introductory article on Hugo, when I said it is a domain-specific language. In a way, it could also be said to be an environment-oriented language, the environment being text-specific, line input oriented systems of the 1980s and earlier. This is not a "knock" on Hugo; if the type of game you are writing fits the environment, it works beautifully. When it does not fit the paradigm, it falls short. And in this case, what you want to do gets the short end of the stick.

What you want is available to applications directly running in Windows, Macintosh and (while I do not know from direct programming experience I presume it is) in Android, in which things that happen are events: keypress, timer, mouse move, hover, mouse click, etc. When these events happen ("fire"), an event handler is called, it processes the event that fired, and quits, whereupon "we return to our regularly scheduled program, alreqdy in progress." If the program wasn't running, then the system returns control to whatever is running, and the program waits for another event to fire.

Hugo does have a (very) limited event processing capability through the PAUSE command. It doen't allow you to do something and listen for a keypress or other event to fire and rudely interrupt it, but what it does is pause for either a keypress or a mouse click.

Due to my ongoing vision problems I can't look it up in the Hugo manual, but if you look there for the PAUSE command, it mentions that a system variable returns a value informing you whether the game continued because of a keypress, and if so, which key, or if a mouse click, what X,Y position the click was at within the application window. Given this, you could display a graphic image - or even in text if you like - say a 1000x500 pixel image, divided into quadrants. They have text painted on each of them
* Click here or press '1' to skip this one exit
* Click here or pres '5' to skip the next five exits
* Click here or press 't' or 'T' to skip 10 exits
* Click here or press ENTER to skip all exIts until you reach your destination
Then in text below the sign it says:

Click outside the sign or press SPACE to take this exit. Choose where you want to go now.

Now, if you get an invalid keystroke or a click on the lines between the boxes, you can tell hem to try again. You know how big each box is, X tells you which of the two, Y tells you which one, or the click was below the sign.

Another possibility. In the SYSTEM command - I think it's SYSTEM(61) but don't hold me to that - there is supposed to be a keypress check or key read function. either it does not work or I was using it incorrectly, I'm not sure, but I could not get it to work. As it turns out, I was thinking of doing something similar, a bus or train moving through its stops until you signal (or indicate to exit the train because) you are at your stop.

Another possibility: I'm using the stock Hugo runtime system. Nikos' HUGOR replacement for the standard runtime might provide this functionality, either in the documented SYSTEM call or having already added it as an undocumented one. Or if it's not there you could try wheedling Nikos into adding an additional (undocumented) SYSTEM call to provide character input without having to PAUSE.

Or as a last resort (if you read C) read the Hugo runtime (or Nikos' HUGOR runtime) system source for the SYSTEM command and find out what that system call for reading a key does, if anything. If you're really desperate, add the processing code (if you know C) yourself.

Good luck.
"Perhaps she'll understand, if you tell it to her, plain."
- Don McLean, Castles in the Air

User avatar
Ice Cream Jonsey
Posts: 25262
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: How to best simulate a vehicle in motion.

Post by Ice Cream Jonsey »

pinback wrote: Wed Jan 22, 2020 6:39 am This is a style thing, so I'm just asking for input from you, the aspiring text game player:

If I want to implement time passing in a vehicle (car, train, etc.), and I want things to happen/appear during the course of a trip, what is the most player-friendly/interesting way to do that?

The simplest would just be a bunch of pauses, inviting the player to hit the spacebar or whatever in between moments, as the vehicle moves along...
The exit sign for Hamiton, OH whizzes past on the right.

MORE...

A sign for Shoney's towers over a local flea market past a small tree line.

MORE...

Tom Sawyer comes on the radio for the eighty-third time today. They really need to get over this.
I am wondering if there's a way to do it more interactively, but that's not awkward. You can prompt for them to continue driving, but that's no good. You're already driving. Things are happening, even while you just sit there. Prompt to type "z" over and over? That's tiresome and awkward, I think.

I dunno. Is there any way to do it other than MORE, MORE, MORE?
You can just use a daemon and have it print events that are happening each turn, no matter what!

Also, wait is probably defaulted to 3 turns every time someone does a wait, so if you make that 1 turn instead, it will have a better effect when your daemon runs. I think there's sample daemon code in the last Hugo repo of mine you woulda snagged!
the dark and gritty...Ice Cream Jonsey!

User avatar
pinback
Posts: 15873
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: How to best simulate a vehicle in motion.

Post by pinback »

The cat in F209 was a daemon, so I get that part. Settings wait-turns to one is an important step, thanks for that. I guess I'm just trying to figure out clever ways of making the player "wait" without feeling like he (or SHE, sorry everyone) has to type "z" over and over.

I think Jiz'z's idea is best. Let there be plenty of things to look at while they're there, but still have the daemons running, so if you look at something, or wait, or fiddle with a whoozit, time still passes and the next thing outside the window is shown.

Thank to everyone. Even... yeah, thanks everyone.
In the yard, not too far from the car.

User avatar
Ice Cream Jonsey
Posts: 25262
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: How to best simulate a vehicle in motion.

Post by Ice Cream Jonsey »

Object: Nudie mag. One of them there with different races. 10 pages or more. That will kill a few turns!
the dark and gritty...Ice Cream Jonsey!

User avatar
Flack
Posts: 7870
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Re: How to best simulate a vehicle in motion.

Post by Flack »

One way to do it would to be put, say, 5 objects in the area and use a counter so that once the player has viewed all five, the game moves on. Each one could be a one/two thing, so that you get the object information and then something about the scenery.
"Jack Flack always escapes." -Davey Osborne

User avatar
Tdarcos
Posts: 7654
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: How to best simulate a vehicle in motion.

Post by Tdarcos »

Let me tell you something. Today, by accident YouTube autoplay stumbled upon three different Star Wars histories, each at least 40 minutes, covering the rise, fall, rise and fall, "lather rinse, repeat" of the Galactic Empires going back over 20,000 years! While each gave different minor details going back to 20,000 years BBY (Before the Battle of Yavin, i.e. when the first Death Star was blown up), major details were the same. There's probably enough information of these analyses of the franchise history to do a couple hundred pages. Put something like that in and they can be skipping one exit each page.

Or you could do "Snorts Indicated Swimsuit model" magazine. "The models look better after you've had the indicated snort" of whiskey (or cocaine.)"
"Perhaps she'll understand, if you tell it to her, plain."
- Don McLean, Castles in the Air

User avatar
Flack
Posts: 7870
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Re: How to best simulate a vehicle in motion.

Post by Flack »

Thank you for, I think, telling us something.
"Jack Flack always escapes." -Davey Osborne

Roody_Yogurt
Posts: 2080
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: How to best simulate a vehicle in motion.

Post by Roody_Yogurt »

For a train, I would probably have just a daemon describing things as they pass by outside the window (or the occasional train sounds). For a car ride, depending on how much attention we want to draw to the outside world, I might opt for a conveyor belt experience, where each street or leg of journey gets its own room description. You could either force the descriptions outright ("The driver turns right onto Pinback Boulevard. Pinback Boulevard (in the limo) Yadda yadda yadda") or just signal the transitions ("The driver turns right onto Pinback Boulevard"), making the player type >LOOK if they want to see the new surroundings (and using up a turn in the process which would hopefully help with the >WAIT problem).

Flack's look-at-things suggestion is also good in some situations. It all depends what you're trying to accomplish with the scene.

User avatar
pinback
Posts: 15873
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: How to best simulate a vehicle in motion.

Post by pinback »

One of the vehicles in question is a rollercoaster. Since there's nothing else to do in there, I think it's just between forcing "z"s and changing the description on a daemon every turn, or just a bunch of text with "MORE..." in between 'em.
In the yard, not too far from the car.

User avatar
Flack
Posts: 7870
Joined: Tue Nov 18, 2008 3:02 pm
Location: Oklahoma
Contact:

Re: How to best simulate a vehicle in motion.

Post by Flack »

Is it possible in Hugo to put an enter-able woman inside the enter-able coaster car?
"Jack Flack always escapes." -Davey Osborne

User avatar
Jizaboz
Posts: 3211
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: How to best simulate a vehicle in motion.

Post by Jizaboz »

Ted Bundy on a Rollercoaster Simulator 2020

User avatar
Tdarcos
Posts: 7654
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: How to best simulate a vehicle in motion.

Post by Tdarcos »

uote=Flack post_id=105813 time=1579999614 user_id=840]
Is it possible in Hugo to put an enter-able woman inside the enter-able coaster car?
[/quote]
While I suspect you have an ulterior motive in asking thus question (as I indicate below), I will answer thar with a "yes" as nested enterable objects are permitted.
Jizaboz wrote: Sun Jan 26, 2020 12:11 am Ted Bundy on a Rollercoaster Simulator 2020
Oh Jiz, I hope you're not being duplicitous too, like I suspect Flack is. His comment had no inference about killing or mistreatment of women. As dense as I am, it was clearly an inference that made a call back to his "Do you want to enter 1) the shower or 2) Paul's girlfiend" comment that I think clinched his win for MVP of 2019. I would think you'd have seen the connection.
"Perhaps she'll understand, if you tell it to her, plain."
- Don McLean, Castles in the Air

User avatar
Tdarcos
Posts: 7654
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: How to best simulate a vehicle in motion.

Post by Tdarcos »

Fuck! I missed the error until after I saved. I'm getting sick of this.

Goddammit, I want post editing turned back on!
"Perhaps she'll understand, if you tell it to her, plain."
- Don McLean, Castles in the Air

User avatar
pinback
Posts: 15873
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: How to best simulate a vehicle in motion.

Post by pinback »

Classic Jiz, always bein' duplicitous and whatnot.
In the yard, not too far from the car.

Post Reply