[TADS3] Weather

10 views
Skip to first unread message

Brian Ronk

unread,
Jul 23, 2004, 1:20:19 PM7/23/04
to
Does anyone know of a good way to implement weather in TADS3? I want
to be able to do an x sky, and see that it's raining, snowing, sunny,
cloudy, whatever. I found timeSys and the sunlocation(I think that's
it) libraries and will look at those to see what I can do with them.
I think what I want to do will be kinda like the sunlocation, but more
complex. It can effect NPCs (where they are, etc) and even items (a
cup might fill with water if held out in the rain). Any ideas would
be helpful. I'm a newbie to this, and am still going through Eric
Eve's Getting Started (great help though)
Thanks

Eric Eve

unread,
Jul 23, 2004, 2:06:15 PM7/23/04
to

"Brian Ronk" <ri...@lycos.com> wrote in message
news:8af8cc87.04072...@posting.google.com...

> Does anyone know of a good way to implement weather in TADS3? I
want
> to be able to do an x sky, and see that it's raining, snowing,
sunny,
> cloudy, whatever. I found timeSys and the sunlocation(I think
that's
> it) libraries and will look at those to see what I can do with
them.
> I think what I want to do will be kinda like the sunlocation, but
more
> complex. It can effect NPCs (where they are, etc) and even items
(a
> cup might fill with water if held out in the rain). Any ideas
would
> be helpful.

Well, you could start with something like this:

enum raining, snowing, sunny, cloudy;

modify defaultSky
desc()
{
switch(weatherType)
{
case raining: "It's overcast and wet. "; break;
case snowing: "Flurries of snow fall from the cloudy sky. ";
break;
case sunny: "It's a clear blue sky with scarcely a cloud to
be seen. "; break;
case cloudy: "Dark black clouds frown across the leaden sky.
"; break;
default: "You see nothing remarkable about the sky. ";
}
}
weatherType = nil
;

Of course, you may need something more complicated, depending on
what exactly you want to achieve. How do you want it to affect
NPC's, for example? Is it enough to test defaultSky.weatherType in
NPC descriptions, or might you want some means of selecting
ActorState according to weather? Is it your intention to implement
HOLD OUT CUP as a command? In that case you could perhaps test for
defaultSky.weatherType == raining in Container.actionDobjHoldOut()
and fill or not fill the container accordingly.

Perhaps you first need to get a clearer definition of what exactly
you want to do, however. Maybe you already have, but I can see a
danger of leaping in here with a half-baked idea and then finding
halfway through that you've chosen the wrong tools for the job
(e.g., in your case perhaps what you really need is not a minor
tweak to defaultSky's desc method but a set of WeatherState objects
that define different kinds of behaviour according to weather type).

> I'm a newbie to this, and am still going through Eric
> Eve's Getting Started (great help though)

I'm glad you're finding it useful.

-- Eric


Brian Ronk

unread,
Jul 26, 2004, 8:33:34 AM7/26/04
to
"Eric Eve" <eric...@NOSPAMhmc.ox.ac.uk> wrote in message news:<cdrk2q$hv8$1...@news.ox.ac.uk>...

Hmm... That would probably work. As long as I check with the NPC
what the weather is. I havn't planned what I want to do with it quite
yet. I'll probably have mostly snow in the game I'm planning right
now. I think at least initally it will be for part of the description
of the area. If the weather is snowing, then the room description
should mention that. I'm still in the planning stages for this idea,
so I'm sure more and better ideas will come as I go.

Eric Eve

unread,
Jul 26, 2004, 8:45:11 AM7/26/04
to

"Brian Ronk" <ri...@lycos.com> wrote in message
> Hmm... That would probably work. As long as I check with the NPC
> what the weather is. I havn't planned what I want to do with it
quite
> yet. I'll probably have mostly snow in the game I'm planning
right
> now. I think at least initally it will be for part of the
description
> of the area. If the weather is snowing, then the room description
> should mention that. I'm still in the planning stages for this
idea,
> so I'm sure more and better ideas will come as I go.

It does sound to me like you need to plan what you want to do with
your weather before you try to work out how to implement it. If it's
just a question of room descriptions then all you'd need is to add
an extra property to libGlobal, say weather:

modify libGlobal
weather = nil
;

Then maybe define an enum for different weather conditions:

enum sunny, raining, cloudy, snowing;

Or whatever your need, and perhaps finally, in a header file you'd
include in all your game source files, you might have

#define gWeather (libGlobal.weather)

Then your room descriptions (and defaultSky) could simply test
gWeather to decide what to display.

Anything more elaborate than this might need a different
implementation - it all depends what you actually want the weather
to do.

-- Eric


Gene Wirchenko

unread,
Jul 27, 2004, 11:06:02 AM7/27/04
to
ri...@lycos.com (Brian Ronk) wrote:

[snip]

>Hmm... That would probably work. As long as I check with the NPC
>what the weather is. I havn't planned what I want to do with it quite
>yet. I'll probably have mostly snow in the game I'm planning right
>now. I think at least initally it will be for part of the description
>of the area. If the weather is snowing, then the room description

^^^^


>should mention that. I'm still in the planning stages for this idea,
>so I'm sure more and better ideas will come as I go.

You are in the library. Drifts of snow cover the lower shelves,
and there is more coming. The librarian is shovelling snow off
her desk.

>ask librarian about weather
She hands you the shovel. "Weather this!", she snarls.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Brian Ronk

unread,
Jul 28, 2004, 9:37:56 AM7/28/04
to
Gene Wirchenko <ge...@mail.ocis.net> wrote in message news:<udobg0l020gcl9lv3...@4ax.com>...

Ok, how about Outdoor Rooms mentioning that instead...

Eric Eve

unread,
Jul 28, 2004, 11:09:19 AM7/28/04
to

"Brian Ronk" <ri...@lycos.com> wrote in message
> > >Hmm... That would probably work. As long as I check with the
NPC
> > >what the weather is. I havn't planned what I want to do with
it quite
> > >yet. I'll probably have mostly snow in the game I'm planning
right
> > >now. I think at least initally it will be for part of the
description
> > >of the area. If the weather is snowing, then the room
description
> > ^^^^
> > >should mention that. I'm still in the planning stages for this
idea,
> > >so I'm sure more and better ideas will come as I go.
> >
> > You are in the library. Drifts of snow cover the lower
shelves,
> > and there is more coming. The librarian is shovelling snow
off
> > her desk.
> >
> > >ask librarian about weather
> > She hands you the shovel. "Weather this!", she snarls.
> >
> > Sincerely,
> >
> > Gene Wirchenko
>
> Ok, how about Outdoor Rooms mentioning that instead...

I assumed that's what you had in mind, but you could, of course,
have indoor locations affected by the weather conditions too
(there's a leaky roof, or the rain pounds the window while the wind
rattles the doors). Again you have to decide what you want your
weather effects *for* before you can meaningfully think very much
about how you might implement them. For example, is your weather
going to be purely atmospheric (in the literary rather than the
meteorological sense) or is it going to effect the plot and puzzles
in some way? Do you need changes in the weather to be plot-driven,
turn-count-driven, or real-time driven? Is snowfall going to block a
road or simply make a field look picturesque? If you have a
snow-coverered field will you want/need to implement footprints in
the snow if the PC or an NPC walks across it? Is your rain going to
cause flooding in a nearby river, or simply encourage your PC to
carry an umbrella? I'm sure TADS 3 would be able to handle all these
possibilities, but no one can tell you how (or will be willing to
write a long treatise explaining how) until you come up with a more
concrete scenario.

On the other hand, if at this stage you're trying to feel your way
towards what's implementable before commiting yourself to a
particular plot or game design, you might simply want to devise a
dummy game for your own trial purposes and try out various ideas in
it.

-- Eric


Gene Wirchenko

unread,
Jul 28, 2004, 2:34:53 PM7/28/04
to
ri...@lycos.com (Brian Ronk) wrote:

>Gene Wirchenko <ge...@mail.ocis.net> wrote in message news:<udobg0l020gcl9lv3...@4ax.com>...
>> ri...@lycos.com (Brian Ronk) wrote:
>>
>> [snip]
>>
>> >Hmm... That would probably work. As long as I check with the NPC
>> >what the weather is. I havn't planned what I want to do with it quite
>> >yet. I'll probably have mostly snow in the game I'm planning right
>> >now. I think at least initally it will be for part of the description
>> >of the area. If the weather is snowing, then the room description
>> ^^^^
>> >should mention that. I'm still in the planning stages for this idea,
>> >so I'm sure more and better ideas will come as I go.
>>
>> You are in the library. Drifts of snow cover the lower shelves,
>> and there is more coming. The librarian is shovelling snow off
>> her desk.
>>
>> >ask librarian about weather
>> She hands you the shovel. "Weather this!", she snarls.

>Ok, how about Outdoor Rooms mentioning that instead...

OK:

You are not out of the woods yet. There are small patches
of snow on the ground below gaps in the tree coverage. The
odd snowflake lands on your coat.

However, back at the library:

You are in the library. There is a window on the south
wall. Through it, you can see nothing but a void. It is as
if the outside world does not exist.

Better:

You are in the library. There is a window on the south
wall. Through it, you can see what was once a grassy field
and that the snow is really coming down. The library's
bookshelves are filled with books that you just have not had
time to read.

>close curtain
No more snow.

I have a many-faceted intellect. I hope "facetious" is the
adjectival form of "facet". <flip, flip> Oops, no. Bad luck.

James Mitchelhill

unread,
Jul 29, 2004, 5:50:00 AM7/29/04
to
"Eric Eve" <eric...@NOSPAMhmc.ox.ac.uk> wrote in message news:<ce8fj0$o8u$1...@news.ox.ac.uk>...

> If you have a
> snow-coverered field will you want/need to implement footprints in
> the snow if the PC or an NPC walks across it?

This is hideous to implement well. (At least it was in TADS2, I don't
know how much easier it would be in TADS3, possibly a little better as
I understand there are some nicer built in data structures, which
would be useful). The main difficulties are in formulating the
appropriate description, because there's a lot to take into
consideration. Keeping track of this information in a reasonable way
also causes difficulties.

If there are multiple actors, you have to consider whether the
footprints are distinct enough for the PC to be able to identify the
maker. As time passes and more snow falls or the snow thaws, the
footprints should get more indistinct to the point where they become
vague and unidentifiable. Footprints have direction - they can pass
through a location rather than just being there, so if you want to
implement this level of detail, you need to keep track of who made
what footprint, what direction they came from and where they were
going. And since it may be possible for an actor to travel through a
location more than once from and to different directions, you need to
cover that circumstance as well.

Wandering around inside a location may make a mess of footprints.

But the real difficulty is taking this information and making it into
something that you can read without your eyes forcing themselves shut
to avoid the tortured English. Two or more actors footprints that go
the same way should ideally be described as such. If footprints become
vague, so should that.

Implementing all this becomes a major headache. And there's more,
which I decided was taking things too far, although it's possible.
Ccould you refer to an individual trail of footprints, obscure a
trail, does dragging an object cause other marks in the snow... what
if a character takes their shoes off - apart from getting cold feet of
course - or hops, or walks backwards? Is there a difference in the
resulting trail if the actor is running?

> On the other hand, if at this stage you're trying to feel your way
> towards what's implementable before commiting yourself to a
> particular plot or game design, you might simply want to devise a
> dummy game for your own trial purposes and try out various ideas in
> it.

This is excellent advice. When implementing simulationist things I
find it's a big advantage to write out the end result that you'd like
to see. From that, you can work out what features the implementation
needs. Ideally, of course, it should allow easy extensibility when you
decide you need it to behave another way.

--
James Mitchelhill
disord...@hotmail.com
http://kallisti-jam.blogspot.com

Eric Eve

unread,
Jul 29, 2004, 6:23:13 AM7/29/04
to

"James Mitchelhill" <disord...@hotmail.com> wrote in message
news:7a2f9b54.04072...@posting.google.com...

> "Eric Eve" <eric...@NOSPAMhmc.ox.ac.uk> wrote in message
news:<ce8fj0$o8u$1...@news.ox.ac.uk>...
>
> > If you have a
> > snow-coverered field will you want/need to implement footprints
in
> > the snow if the PC or an NPC walks across it?
>
> This is hideous to implement well. (At least it was in TADS2, I
don't
> know how much easier it would be in TADS3, possibly a little
better as
> I understand there are some nicer built in data structures, which
> would be useful). The main difficulties are in formulating the
> appropriate description, because there's a lot to take into
> consideration. Keeping track of this information in a reasonable
way
> also causes difficulties.

And you do an excellent job of going on to spell out why this is.
TADS 3 might offer a few more powerful tools that TADS 2 to do it
with, but it would still be pretty hideous, I think, unless you kept
the implementation fairly vague ("there are fresh footprints in the
snow" rather than "a fresh set of footprints (your own) leads from
the gate to the front door, crossed by a second pair of footprints
(apparently made by some small quadruped) leading from the small
yard to the east to the copse just to the west, while an older set
of footprints, which seem to have been made by some wearing size ten
rubber-soled boots, leads from the southwest corner of the
snow-covered lawn to the wooden gate at its northeastern corner.").
As you probably surmised, my example of footprints (which you've
most usefully expanded upon) was intended to invite the original
poster to consider what he actually wants to achieve with weather
effects such as snowfall.

-- Eric


Brian Ronk

unread,
Jul 29, 2004, 10:03:33 AM7/29/04
to
Some good ideas here. I'll bet I could definately use weather as a
puzzle somehow. And footprints in the snow... tracking someone down
maybe, or following someone?
I want to add some skiing to my game, but right now I'm not sure how.
Like I said, I'm in the early planning stages (story, setting, chars,
etc.) so some of this will come in time. Although I'm betting my idea
will not be as small as most recent IF games. While I havn't played
much of his games, I have a feeling it might be somewhat akin to Paul
Allan Pranks games... Although my original inspiration are the old
Sierra Quest for Glory games, so it will end up being closer that that
type of Adventure/RPG type of game.
I definately have a lot of work with this idea, and as I get rolling,
I'm sure I'll be releasing tests for people to play, and asking for
help with things.
Anyway, thanks for the ideas.

Carolyn Magruder

unread,
Jul 29, 2004, 3:58:50 PM7/29/04
to
ri...@lycos.com (Brian Ronk) wrote in message news:<8af8cc87.04072...@posting.google.com>...

>And footprints in the snow... tracking someone down maybe, or
following someone?

Or maybe the opposite... you have to find a way to avoid leaving
footprints in the snow, or someone tracking you down will find you.

Carolyn

Andrew Plotkin

unread,
Jul 29, 2004, 4:12:54 PM7/29/04
to

Occasionally I toss around an idea for a puzzle which involves leaving
several sets of tracks through the game world -- no two trails are
allowed to cross.

Then I think about how to implement it. Doable. But not without pain.

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
* Make your vote count. Get your vote counted.

Gene Wirchenko

unread,
Jul 29, 2004, 6:16:04 PM7/29/04
to
carolyn...@yahoo.com (Carolyn Magruder) wrote:

The Courtyard
The courtyard is approximately thirty feet sqaure and is
covered in two inches of snow. There are four statues
equally spaced, and there are gates to the north, south, and
east.

>n backwards
You cautiously walk backwards towards the north gate but
slip on some hidden ice and bash your head against a statue.
The good news is that no one else knows which way you are
going; the bad news is that you do not either.

Esa A E Peuha

unread,
Jul 30, 2004, 4:42:57 AM7/30/04
to
carolyn...@yahoo.com (Carolyn Magruder) writes:

Beyond Zork had this kind of puzzle, although they weren't _your_
footprints you had to hide.

--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

James Mitchelhill

unread,
Jul 30, 2004, 7:20:16 AM7/30/04
to
> As you probably surmised, my example of footprints (which you've
> most usefully expanded upon) was intended to invite the original
> poster to consider what he actually wants to achieve with weather
> effects such as snowfall.

Absolutely. The reason I replied was partly because, having
implemented this recently, I thought the information might be useful
to anyone considering these problems and partly because I wanted to
share the full horror. In my implementation I ended up having to
rewrite from scratch a couple of times because I hadn't considered
carefully enough what I needed to do.

--
James Mitchelhill
disord...@removeme.hotmail.com
<http://kallisti-jam.blogspot.com>

Reply all
Reply to author
Forward
0 new messages