Author Topic: Survival - Hunger/Thirst/Sleep  (Read 4018 times)

Offline arelim

  • Full Member
  • ***
  • Posts: 158
Survival - Hunger/Thirst/Sleep
« on: June 17, 2011, 08:16:42 PM »
I have my plan for my first DC game ... in general, the idea is going to be very simple ... barely really a game ... something like Legend of the Red Dragon (if anyone remembers that old online game) ... simple town with a just a few options ... and the pc can leave the town and use a menu system to explore the forest and have various random encounters (mostly combat) ... mostly a nice small scope game just to get a feel for the system and maybe create some art. :)

One thought I had to extend the complexity of the game was to have some kind of hunger/thirst system ... where the player got hungry after a while and had to consume food items ... or drink something ... or even sleep.

So I thought I would ask you gurus some thoughts on how to do that... I was thinking a ASL variable that starts at say ... 100 ... and increments down every hour or so ... until it reaches zero and then the player starts taking damage. Eating would just increment the ASL variable back up. I think I understand how to use food to increment the variable back up ...

But what I can't think of is how to get the variable to decrease every hour ... would I do this with a GDPL script? can GDPL do that? (can anything do what I want in DC, for that matter...)

I also thought of maybe using some kind of poison or disease... but I don't know if those can damage something other than health.

also, two things that would be good would be...

1. A display of your current satisfaction somewhere on the screen.

2. A message that pops up every hour after the PC's hunger has reached 0 that says how much damage they just took and that they are hungry and need to eat.

Any thoughts on how to do this? If its not possible in DC ... thats fine. It is really just a thought.

Thanks

Offline SilentThief

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 891
Re: Survival - Hunger/Thirst/Sleep
« Reply #1 on: June 17, 2011, 08:45:22 PM »
possible to do it like they did in FRUA:

http://www.contrib.andrew.cmu.edu/~jk9t/ua/UANL14.html#cake

Im a big fan of the tricks they used in the UANLs, and I'll throw them out every now and then. DC has vast amounts of resources that FRUA didn't, but the logic for most of the game runs the same

ST
« Last Edit: June 17, 2011, 08:53:51 PM by SilentThief »

Offline arelim

  • Full Member
  • ***
  • Posts: 158
Re: Survival - Hunger/Thirst/Sleep
« Reply #2 on: June 17, 2011, 09:46:34 PM »
Interesting approach, thank you.

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Survival - Hunger/Thirst/Sleep
« Reply #3 on: June 18, 2011, 02:36:16 AM »
DC - unlike FRUA - allows you to use possession of ordinary items, not just special items, to trigger events, and to remove items from a character's inventory via an event. This means you should be able to keep track of the number of 'rations' held by the party, and allow the player to see this.

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2344
    • Dinonykos Dungeon Craft
Re: Survival - Hunger/Thirst/Sleep
« Reply #4 on: June 18, 2011, 01:23:38 PM »
Interesting approach, thank you.

You may find the end of this
http://www.ironworksforum.com/forum/showthread.php?p=1233805&highlight=food#post1233805
thread at the ironworks forum interesting.
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Online manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9857
Re: Survival - Hunger/Thirst/Sleep
« Reply #5 on: June 18, 2011, 03:33:31 PM »
The difficulty with doing this (food/hunger poison/disease) is figuring out how to show it to the player. Everything else is really easy. :D

I just read over the UANL article, and DC can do all of that in one script -  you can count down hours, minutes, days, weeks or whatever you would like.
It's not exactly the same, but here is a tutorial for tracking the phases of the moon, which will give you a look at one way of time keeping, and also a way in which the party is made aware of the phase of the moon.
I think that one could use an EXAMINE type event for an NPC that joins the party right away could show how hungry the party is...(just thinking out loud)
http://manikus.reonis.com/files/DCTutorial_logicblockevent_moonphase.pdf

Now using poison/disease to effect something other than HP is relatively easy - by the use of "Affected Attributes". DC has the ability to "Get and Set" most attributes in the game based upon the designer's whim and patience with writing a script or using the spell editor.
For example, you might have an item, "Ugly Juice" that when drank lowers a character's Charisma (or a monster "withering gaze", etc). A Special Ability (SA) is created that does the calculation and applies such things to the intended target. You simply write the script and attach it to the appropriate item
BIG caveat - this is under version 1.0, under .914 there are no SAs, so you do it in the Spell Editor, creating a spell that is attached to a monster's attack, item, or even is a castable spell. If you want to do this outside of combat, you could also do it as a Logic Block event and use pretty much exactly the same script that would be in the SA.

I won't post an example of the script in this thread until I know what you want and what version you are using, etc. as I don't want to scare you away. :)
As to using a newer version...please check out a post coming soon in the "Dungeon Craft Design" sub-forum here. :D

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Survival - Hunger/Thirst/Sleep
« Reply #6 on: June 18, 2011, 04:20:03 PM »
The difficulty with doing this (food/hunger poison/disease) is figuring out how to show it to the player. Everything else is really easy. :D

That is the crux of the matter.  ;)

I set up some items (rations, torches, coats) in a provisioner's shop (using Question List, Who Pays and Utilities events).

The items displayed in the character's inventory as "Rations: Stage 5", which was a bit wonky, so I hex edited "%s: stage %u" to "%s: %u      " in the engine. It now reads "Rations: 5". (I hope Paul doesn't see this, but old habits are hard to break.  :-[ )

Timed deductions can be done via a Utilities event with a GPDL trigger script or any other method you choose. Running out of rations can trigger a damage event which will explain why the damage is being inflicted. You could even set up a text statement to warn the player when a low ration level is reached.

So this would give a visible inventory, an optional warning message, and damage with an explanation. It will work in both v.914 and v1.0.
Some days it just doesn't pay to gnaw through the straps.

Online manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9857
Re: Survival - Hunger/Thirst/Sleep
« Reply #7 on: June 18, 2011, 04:25:30 PM »
The difficulty with doing this (food/hunger poison/disease) is figuring out how to show it to the player. Everything else is really easy. :D

That is the crux of the matter.  ;)

I set up some items (rations, torches, coats) in a provisioner's shop (using Question List, Who Pays and Utilities events).

The items displayed in the character's inventory as "Rations: Stage 5", which was a bit wonky, so I hex edited "%s: stage %u" to "%s: %u      " in the engine. It now reads "Rations: 5". (I hope Paul doesn't see this, but old habits are hard to break.  :-[ )

Timed deductions can be done via a Utilities event with a GPDL trigger script or any other method you choose. Running out of rations can trigger a damage event which will explain why the damage is being inflicted. You could even set up a text statement to warn the player when a low ration level is reached.

So this would give a visible inventory, an optional warning message, and damage with an explanation. It will work in both v.914 and v1.0.

Awesome! Now let's figure out how to do it without hed editing the engine. ;)

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Survival - Hunger/Thirst/Sleep
« Reply #8 on: June 18, 2011, 04:37:06 PM »
Awesome! Now let's figure out how to do it without hed editing the engine. ;)

That, O Gatekeeper, is up to you!

If you, like me, prefer "Item: [value]" to "Item: Stage [value]", I'm sure you could get it changed.  :)
Some days it just doesn't pay to gnaw through the straps.

Online manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9857
Re: Survival - Hunger/Thirst/Sleep
« Reply #9 on: June 18, 2011, 04:44:07 PM »
Awesome! Now let's figure out how to do it without hed editing the engine. ;)

That, O Gatekeeper, is up to you!

If you, like me, prefer "Item: [value]" to "Item: Stage [value]", I'm sure you could get it changed.  :)

I was more thinking of a solution that didn't involve changing the code (whether by me or Paul). Were these items or Specail Items?
Because maybe you could use the Event attached to an item to display, of course, then you have to figure out a way to keep the player from dumping it, whether accidentally or purposefully. :)

Offline arelim

  • Full Member
  • ***
  • Posts: 158
Re: Survival - Hunger/Thirst/Sleep
« Reply #10 on: June 18, 2011, 09:58:55 PM »
Actually, that moon phase script is great ... gave me lots of good ideas.

I'm using .9140

From the post that Dinonykos pointed out ... it sounds like I couldn't have a hunger value for each person in the party ... it would have to be the whole party's current hunger level... is this correct?

I was initially thinking it would be each person in the party ... just to give the player more to pay attention too and manage ... :) ... but its not the end of the world if all I've got is the hunger level of the whole group ...

We need the ability to add a couple custom events to a pre-scripted event menu like CAMP, TAVERN, SHOP, etc...

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Survival - Hunger/Thirst/Sleep
« Reply #11 on: June 19, 2011, 03:53:38 AM »
We need the ability to add a couple custom events to a pre-scripted event menu like CAMP, TAVERN, SHOP, etc...
This can be done using the question button event. If you need more options than there are buttons, make one of the buttons 'MORE' or 'NEXT' or similar, and have that button chain to another question button event (which should include a 'PREVIOUS' button or similar). In the first event, select 'Return to question' for the 'NEXT' button.

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2344
    • Dinonykos Dungeon Craft
Re: Survival - Hunger/Thirst/Sleep
« Reply #12 on: June 19, 2011, 04:26:44 AM »
From the post that Dinonykos pointed out ... it sounds like I couldn't have a hunger value for each person in the party ... it would have to be the whole party's current hunger level... is this correct?

Well, you could use a quest or variable value to track the hunger of individual party members, and e.g., make this value decrease by one per day, but if you allow the player to add or remove characters, then it would perhaps become complicated, especially if the party members are not pre-generated. If you only use pre-generated characters, you could keep track of party members joining and leaving the party via the NPC(-not)-in-party trigger.

Furthermore, the player should be warned if hunger reaches a certain level (could be done via step events, and the value could influence strength, hit points or anything else). You could then use items (food) to decrease the hunger value.

Just an idea: Could things like gems be used as a replacement for food? (Of course, this would demand some "hacking"... :D)

The items displayed in the character's inventory as "Rations: Stage 5", which was a bit wonky, so I hex edited "%s: stage %u" to "%s: %u      " in the engine. It now reads "Rations: 5". (I hope Paul doesn't see this, but old habits are hard to break.  :-[ )

While quest- and special items stages are displayed in the "test mode" (if you start your game from the editor), the values are hidden in "normal mode" (if you start your game directly) if I remember right. I am not sure if this is important here (since I did not completely understand what you did, though it sounds ingenious :) ), but maybe it is something to consider...
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Offline SilentThief

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 891
Re: Survival - Hunger/Thirst/Sleep
« Reply #13 on: June 19, 2011, 09:47:14 AM »

Just an idea: Could things like gems be used as a replacement for food? (Of course, this would demand some "hacking"... :D)


This reason right here is why I make requests to be able to add and subtract currency slots. Strangely enough, you CAN add to them but not subtract, at least I have not found any way to do so. If we could add and subtract from currency slots, then you could designate the bottom two currency slots for food and water and the party would automatically "share" when you pool and share your currency. This opens up such possibilities as "create food and water" spells, purify spells (and the opposite effect, contaminate)

and of course means the mod designer would have to put in some reason to have these spells and food items in the first place....

ST

Offline arelim

  • Full Member
  • ***
  • Posts: 158
Re: Survival - Hunger/Thirst/Sleep
« Reply #14 on: June 19, 2011, 10:13:02 AM »
We need the ability to add a couple custom events to a pre-scripted event menu like CAMP, TAVERN, SHOP, etc...
This can be done using the question button event. If you need more options than there are buttons, make one of the buttons 'MORE' or 'NEXT' or similar, and have that button chain to another question button event (which should include a 'PREVIOUS' button or similar). In the first event, select 'Return to question' for the 'NEXT' button.

Well, yes ... I think that works well when you are doing non-standard locations/events/menus ... but if you want to incorporate one of the pre-scripted events that have their own menus ... like TAVERN ... then it gets a little clunky ... because the 'MORE' button is really whats calling the TAVERN event ... and the menu options might seem a little unusual for the player ... for instance, for my project I might end up with something like ...

First menu the player sees in a tavern ....

ORDER FOOD | MORE | EXIT

Player clicks 'MORE' ... and gets...

FIGHT | DRINK | LISTEN | EXIT ....

And to go BACK to the last menu, the player clicks on EXIT ... which is very clunky and would confuse ME in a game ...

It would be better just to have the tavern menu be :   FIGHT | FOOD | DRINK | LISTEN | EXIT

Now, with a tavern, I could probably accomplish this by duplicating most functionality in the existing pre-built tavern event with a question event and my own event chains ... so that can be solved ...

But what about when you want to add a button/question to shops? then you get stuck in the clunky method above.

Of course, since thats what I've got ... I'll make it work ... probably do something like have a shop where the menu was "TALK | BUSINESS | EXIT" ... and the 'BUSINESS' button took you to the normal shop event ... of course, having to use the EXIT button to get back to the 'TALK | BUSINESS | EXIT' menu would still be a little clunky ... but we can't have everything.

Still, just thinking, having the option to add like 1 or 2 question buttons to those menus would be nice.



« Last Edit: June 19, 2011, 10:15:45 AM by arelim »