Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Adventuron Thread

A topic by Adventuron created Feb 05, 2020 Views: 519 Replies: 53
Viewing posts 1 to 14
Host

Use this thread to ask Adventuron system related questions

Submitted

I'm dabbling with a few ideas to get around the two-word limitation and still make the game feel rich and atmospheric, yet player friendly.

Let's say I have a road that goes north and south and a hotel off to the west. There are connections to the north and south, but no connection to the west. You can ENTER HOTEL to enter it and GO EAST (or E) to return from the hotel to the road. The latter is implemented using a oneway exit. So far, so good.

However, you can also EXAMINE HOTEL to discover that it is to the west. Once you know this, you can GO WEST (or W) to enter the hotel to save typing. This is implemented as follows:

   : match "examine hotel" {
      : if (is_present "hotel") {
         : print "To west.";
         : done;
      }
   }
   : match "w _;enter hotel" {
      : if (is_present "hotel") {
         : goto "room_hotel";
         : done;
      }
   }

Why is west being shown as an exit from the road when it doesn't have a connection defined? Is Adventuron parsing my match statements and determing that an exit west is possible and adding the exit when I don't want it shown? If so, can I prevent this? I only want exits shown when a connection is defined, not when it's in a match statement.

Host(+1)

By default, Adventuron scans the on_command table for exits.

As with most things, this behaviour is configurable ...

game_settings {
   # basic = only use connections table and do not use on_command table.
   exit_list_calculation = basic
}
Submitted

Perfect! I knew there'd be something tucked away somewhere.

(1 edit)

One technical question. Let's say that i write object definition as : 

cat_lump : scenery "YELLOW FURBALL" msg = "SOME TEXT" ;

So "cat_lump" is just a tag identifier for object. But it seems the engine uses this when writing "get lump". When i write "get furball" or "get yellow" the engine does not recognize any of these two words. Then "YELLOW FURBALL" is just a description text visible in scene but it is not used by engine when parsing get/take commands?

Submitted

As you have discovered, the object id consists of an (optional) adjective followed by a noun and it is preferable that these are the same as the object description, so "cat_lump" should be "yellow_furball". You can use the vocabulary{} block to define synonyms for furball. I'm sure Adventuron can explain this better than I can.

Host

Yes, the text in the quotes is just narrative only. 

The id of the object is a shorthand for the associated adjective and noun, but specifying explicit adjective and/or noun will override this behaviour. 

You can also switch off this entity_id association in the game_settings {} section, but it is on by default, and I think it's a sensible default.

objects {
   noun              : scenery "anytext";
   adjective_noun    : scenery "anytext";
   anything_you_line : scenery "anytext" noun="lump" adjective ="yellow";
}

You can't specify multiple nouns or multiple adjectives per object, but you can create noun groups and adjective groups that the parser will automatically collect together:

vocabulary {
   : verb      / aliases = [pet, stroke]
   : noun      / aliases = [cat, creature, feline]
   : adjective / aliases = [yellow, golden]
}

In the : match "" {} section, you can use any item in a noun group to match on, and it will treat it the same as any other member of the group. That is : match "stroke cat" {} is exactly the same as : match "stroke feline" {}, the player could type STROKE CAT, or STROKE FELINE, or PET CAT, or PET FELINE, and it both these match statement would match all 4 of these inputs. 

If you want a completely different noun to represent the same object, but the noun is not a synonym, then you can also chain together nouns in match statements like this:

// You may not want to put "lump" as a synonym for cat, therefore you can just list it as a different match item

: match "stroke cat; stroke lump" {
   : print "Cat Purrs."
}

I'll be using questions in this thread to bolster the documentation so thank you for reminding me I need to improve this.

Both of you thanks. Very usefull to know this. :-)

On mobile now so i can't test this. But i need to ask to be sure if i change it on paper for later. If i have two items where only adjective is diferent for example "brown cat" and "gray cat". Can the engine work with commands examine, get, drop etc by writing "get brown" instead of "get cat"?

Host

Get and drop and examine will automatically disambiguate 

The player will be asked which cat they mean and will have to type a number next to names of the options.

Get brown or get blue will not work. Verbs with subjects (currently) expects a noun.

Ok, thank you. Got solution for this.

Submitted (1 edit)

I think it's a little bit confusing. I mean, the rules say "[...] sane responses to common inputs" and in my mind "pet brown cat" make more sence than "pet cat" with question "more specific?". And the problem is if player types "pet brown cat" the game will ask him "which one cat you want to pet?" anyway. As a player I think "what? I just told you which one! Why are you asking me again?".

I hope I clearly expressed my thought. Sorry if you confused, it's hard to write in English in the morning. It's not about the jam, it's about overall engine logic.

Host

Adventuron is being upgraded to a proper entity matching system soon fully aware of the context of a noun referred to by a verb and how to disambiguate using natural language, but right now, it's a weak area.

 All I can suggest is to try to find a way to give each cat an individual noun for now, or try to just call all cats, cats without an adjective at all, except in the examine message.

You can create multiple objects with the same noun like this:

cat_1 : object "a cat" treasure="true";
cat_2 : object "a cat" treasure="true";
cat_3 : object "a cat" treasure="true";
cat_4 : object "a cat" treasure="true";

I know this isn't ideal, and if I can upgrade the entity matching system before the end of the jam, I will. I'm about to set off on a long journey, so that's the best I can suggest for now unfortunately.

Submitted

Ordinarily, you could say GET BROWN CAT or GET GREY CAT and Adventuron knows exactly which object you're talking about from the object ids brown_cat and grey_cat. If you just say GET CAT and only one is present, it knows to get that one. If you say GET CAT and both cats are present it prompts you for clarification and you have to enter 1 or 2. (Personally, I hate this mechanism, but that's just the way it is.)

Because of the two-word restriction in this jam, you must be able to do everything with two words (verb + noun), so you can't use three-word inputs (verb + adjective + noun). However, you can be a little more creative. I have a similar situation and the way I'm handling this is if you say GET CAT, it says "Which one?" You can then say GET BROWN or GET GREY. This is easily implemented with some clever match statements and appropriate tests.

In my case, the objects requiring disambiguation are in the same location. It gets a little more complicated if they can move around. In this case, you can say GET CAT and if there's only one cat present, then you get it. If there's two or more cats present, then you do what I described above.

Submitted

And returning to the question about clearing screen.  I failed getting the desired result based on your recommendations. Let me explain: I want the win message to be shown without a header. Like an introduce message. But no clear_screen, no theme setting didn't help achieving this.

Host

What version of adventuron are you running? see menu.

Also can you post the exact clear screen message you are using?

Submitted

I've erased everything already but try to reproduce. I've tried this (as you advised in the documentation thread): 

: if (treasure_deposited() == treasure_total()) {
    : clear_screen hide_status_bar = "true" ;
    : print {(win_msg)};
    : press_any_key;
}

in the on_describe of treasure room. Maybe I put it in the wrong place. 

Message is displaying, but after key press it going to standard screen with header. I can't get how to stop game here.

Vertsion 1.0.0. Beta 22

Host

Ah, you want "win_game". 

The standard treasure hunt mode will automatically wire up the win game, but as you chose "treasure_hunt_mode = bespoke", you have to use the win_game command yourself.

: if (treasure_deposited() == treasure_total()) {
    : clear_screen hide_status_bar = "true" ;
    : print {(win_msg)};
    : win_game ;
}
Submitted

Thanks, will try it tomorrow.

Submitted

Where I should place the "treasure_hunt_mode" line?

Submitted

Inside game_settings{}. The possible values are default and bespoke. The tooltip explains more.

Submitted

It still renders header with room title and treasure count.

Submitted

That's correct. treasure_hunt_mode applies to the whole game.

If you use default mode, it automatically determines the end of the game for you and prints the message in the all_treasures_found_win_game system message.

If you use bespoke mode, you have to determine the end of the game yourself. That's what Adventuron was describing. This is where you get the opportunity to clear the screen and remove the status bar.

Reading back through your thread, it looks like you want to clear the screen when the game is over. It's 2:00 a.m. here, so I haven't got time to solve your problem right now, but Adventuron did describe this in the documentation thread (the one that's now locked). He gave you two methods to do this. Can you please try this and get back to me if it doesn't work. Remember that the code he gave you goes into the on_tick{} block. If it doesn't work, post the whole of your on_tick{} block here.

Submitted (1 edit)

I've tried as you described. Doesn't work.

on_tick {
   
   : set_integer var = "rnd_tick" {(random(count_descs))} ;
         
   : if (treasure_deposited() == treasure_total()) {
      : clear_screen hide_status_bar = "true" ;
      : print "You remember nothing, just have the feeling that this night was full of fear and adventure.";
      : win_game ;
   }
   
}
 

And the result screen attached. I don't want the red header to be shown. 


Submitted

AND! If I place "press_any_key" right before the "win_game", it looks as like I expect! But then it shows header and waits for one more key press...

Submitted(+1)

It looks like as soon as you print something, the status bar comes back. I'm not sure if this is by design or not. Unless Adventuron has a better solution, I think the best way to overcome your problem is to apply a new theme without a status bar before clearing the screen. Here is a complete game based on the treasure hunt example in the tutorial that does what you want.

start_at = treasure_room
treasure_room = treasure_room
start_theme = two
locations {
   treasure_room : location "The treasure room";
   tomb : location "A tomb";
}
connections {
   from, direction, to = [
      treasure_room, east, tomb,
   ]
}
objects {
   lamp : object "a lamp" at = "tomb" treasure = "true";
}
game_settings {
   treasure_hunt_mode = bespoke
}
on_tick {
   : if (treasure_deposited() == treasure_total()) {
      : set_theme "my_theme";
      : clear_screen;
      : print "You remember nothing. You just have the feeling that this night was full of fear and adventure.";
      : win_game;
   }
}
themes {
   my_theme : theme {
      extends = two
      theme_settings {
         layout = D X O
      }
   }
}
Submitted

I'm using beta 22 and have capitalization = original in theme_settings{} and inventory_list_empty = "nothing" in system_messages{}. When I take an inventory at the start of the game (when the player is empty-handed), the list of carried items is displayed as "Nothing". The capitalisation setting is being ignored and the original string is being converted to sentence case. (This was confirmed by using other strings for test purposes.)

Incidentally, I have a lead-in phrase, so "nothing" is used for consistency with all the objects, which are also lower case.

Host

sorted this already but not updated app yet.

Submitted

Thanks.

Submitted

When using a separator, is it possible to have this without any border padding so that it goes from edge to edge like the status bar?

Host

Possible... Let me see what I can do.

Long haul travelling at moment (airport) so updates will take a while.

Submitted

Not a high priority, so take your time.

Submitted

Is it possible to test whether an object is a treasure inside a command handler? Something like:

: if (is_treasure "_") {
   //Do something
}
Host

Not 100% on this, but I think there is a way to do this using existing commands. Need my computer to check. Likely won't have an answer for a few days.

Submitted

No problem. I've found a different way of doing what I was trying to achieve. Just needed a bit of creative thinking.

Submitted

Is it possible to change the "HANDS FULL" message when you've exceeded your inventory limit? My player character doesn't have hands.

Submitted(+1)

Yes.

themes {
   my_theme : theme {
      extends = two
      system_messages {
         cannot_carry_any_more = "Hands full."
      }
   }
}
Change the cannot_carry_any_more string to whatever you like.
Submitted

How could I find that out? It doesn't appear in the Ctrl-Space autocomplete menu, it's not in the documentation, and it doesn't appear in the error message that I can generate with a bad message name.

Host(+1)

Yes. sorry about that. I'll have to fix this more urgently given the problem it appears to be causing. If you want autocomplete to work for a theme that extends another theme, comment out "extends = two" in your theme.

The system messages, I'll have to document fully in the documentation too. Thanks for letting me know how much this has inconvenienced you, and I promise to correct this.

Submitted

Oh, that's a very easy workaround! I just didn't think of it. I honestly would have been OK if the answer was to go read some JavaScript source code or something like that. Thank you!

I'm a programmer. I know documentation is hard. This is an impressive system!

Host

The system was aimed at beginner level programmers, so I kind of purposefully omitted any features (like theming) that would possibly intimidate beginner level coders. I still choose to omit this from the side-panel documentation, but I'm treating the html documentation as the advanced documentation. It's still a work in progress and sometimes I dump information in chapter 9 as it's required. I'll reword the structure and order of things and move them into their own chapters later. Understanding the pain points is useful to make sure that the documentation is there to remove them. 

Submitted

If you are using "extends = two", this suppresses some of the Ctrl+Space hints. This is a known bug that Adventuron will fix in a future build. It is mentioned in one of the other threads. If you temporarily comment out this line, you can see the Ctrl+Space hints for most (if not all) all of the pre-defined system messages. Once you've finished fiddling with the system messages, don't forget to uncomment "extends = two".

Submitted (2 edits) (+1)

On  the beta 27 version appears strange bug (or feature?). It waits for keypress after each print of room description when entering a room. After "refresh" ("look" command) it appears sometimes, but if you go from room  -- it waits, and if you then return -- it waits again. It reproduces every time you go to another room.

Didn't test on the compiled game, just in editor.

UPD. And after key pressed description dissappears and keep empty until next "refresh" with "look".

I think it's kinda bug with autoredescribe.

Submitted

I just want to chime in... I haven't been able to reliably reproduce the issue, but even just moving around the map seems to randomly trigger a "press any key" state on some screens, and I also suspect the auto redescribe has something to do with it.

Host(+1)

Please check out the following post:

https://itch.io/jam/treasure-hunt/topic/691248/beta-27a-released-bugfix-release-...

Pay attention to the changes to the way that objects and exits are listed. If this behaviour does not suit your game, you can use a custom theme to re-assert your preferences (code snippet given in the post above).

Host(+1)

Please check out the following post:

https://itch.io/jam/treasure-hunt/topic/691248/beta-27a-released-bugfix-release-...

Pay attention to the changes to the way that objects and exits are listed. If this behaviour does not suit your game, you can use a custom theme to re-assert your preferences (code snippet given in the post above).

Submitted(+1)

My biggest lesson from this jam was that it is really hard to test your own game without the help of others. However one idea sprung to mind. How about having a setting that prompts the user if we can log the inputs that give a bad response. This way we could bulk fix this and focus the feedback on design problems. This is not a feature request I’m just curious of your take on this. 

Submitted

I think that would be hard to do, but a transcript would be handy. You could then get your testers to send a transcript so that you can see what they tried. It is very tedious wading through a transcript, but you will see all sorts of things that they tried, but didn't submit in their test report.

Submitted

Quick question now that I'm fiddling about with graphics again.  My layout is SB G O X SEP.  Can you add space between the status bar and the graphic?  I can only get them to sit flush at the moment.

Submitted

I can't find anything. There's status_bar_padding_top, bottom & horiz and padding_horz, but no padding_top (what you need) or padding_bottom. See what Adventuron says. As a stop gap, you could use an extra separator with a blank image.

Host

As of beta 31c, you can use layout

layout = SB + G D X O

+ = force add leading vertical padding (uses screen/paragraph_spacing_multiplier as the vertical padding amount). (off by default for graphics)

- = force remove trailing vertical padding (uses screen/paragraph_spacing_multiplier as the vertical padding amount). (on by default for graphics)

start_at    = my_location
start_theme = my_theme locations {
   my_location : location "You are in a room." graphic = "blue" ;
} themes {
   my_theme : theme {
      theme_settings {
         layout = SB + G - D X O
      }
      status_bar {
         : fixed_text "Left" ;
         : fixed_text "Right" ;
      }
      screen {
         paragraph_spacing_multiplier = 1
      }
      colors {
         status_bar_paper            = #fff
         status_bar_pen              = #000
      }
   }
} assets {
   graphics {
      blue : base64_png "iVBORw0KGgoAAAANSUhEUgAAAQAAAABQCAIAAAB56TxyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADkSURBVHhe7dNBDQAwCACxOdsX8YhCyDWphb4/C1kCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCkCYAaQKQJgBpApAmAGkCEDZ7YUT2KK7hXcoAAAAASUVORK5CYII=";
   }
}
Submitted

Perfect!  Many thanks.