Adventuron, a new text adventure engine

I think I added “about” as a standard preposition and it obviously caused this unintended side effect, sorry. I’ll try to allow prepositions and verbs to overlap.

I have tested the following as working (use the if statement instead of your match):

: if (preposition_is "about" || verb_is "help") {
      : print "Your help message here!" ;
   }

Thank you.
I think there’s also a little problem with Undo not returning any messages:

> undo
>

Undo will only undo when rewind is enabled.

game_settings {
   rewind_enabled =true
}

That said, when rewind is not enabled, Adventuron should give a response, so marking this as a bug, and will fix this.

do you have some natural language (parts of speech) parser in the system then?

It’s not really that sophisticated (at least yet).

It uses (language specific) pattern matching and word category dictionaries to try to work out to parse something as a verb, noun, adverb, proposition, conjunction or adjective.

Articles generally speaking are ignored, but Adventuron is aware of converting between definite and indefinite articles (as required by supported languages) in the relevant print routines.

how do you deal with ambiguous terms? just statistically, or based on sentence position (dependency parsing)? for example what is lock here:

lock the chest
open the lock

I wrote up some alternatives here, trying to get to grips with the options here

It’s basically just pattern matching. If there is an overlap between verb and noun, then the first time the noun/verb is encountered, the verb/noun is treated as a verb, on subsequent encounters of the verb/noun, it is treated as a noun.

It’s not using any special techniques (at the moment). The parser was developed from observation, I’m not hugely versed in formal natural language processing.

There are still edge cases that exist, and I’m moving through them as I encounter them.

I noticed you used RION for the markup. Why did you choose that over say, YAML?

What language is the engine written in and is any part of it open source? I’d like to have a poke around :smiley:

Is there any microcode that could be displayed, other than the instructions visible to the programmer? Something like the Assembly language between the C language and the processor.
I’m not sure I’m clear!

Adventuron’s syntax is like a version of JSON. It’s interpreted by the engine (after building a few internal lookup tables). There is no microcode to see. It might be possible to peek inside the game state in a future update, which is a separate model to the gamecode.

Adventuron (1.0.0 Beta 56)
Changing the colour of the text of system messages does not seem to be able to include ${}:
unknown_noun = This game does not require use of the word <${noun}<8>>.

I’ll add this to the issue tracker. Hopefully will be an easy fix.

Are you coding something new?

Yes, something simple and easy in French, in the style of Scott Adams’ games. I have an old game design called “Sleep of the Dragon”, that I’d like to finally finish.
It won’t be perfect for French system messages, but I’ll deal with it. For the compass directions I’m going to do it like this:

strings {
   compass : dynamic_string {("Issue(s) : "+(
      is_at "dome" && is_exists "porte_2" ? "O, D" :     
      is_at "dome" ? "D" :   
      is_at "penombre"  ? "M" :
      is_at "coffres" && is_couloirsecret ? "E, M, D" :      
      is_at "coffres" ? "M, D" :
      is_at "antre" ? "O, M" :      
      "")
   )}
}

theme_settings {
   redescribe = auto_beta       
   layout = SB D P* "compass" O
}

Vous êtes sous un dôme de verre.

Vous remarquez trois statues, des jumelles à monnayeur et une porte ouverte.

Issues(s) : O, D

Il y a aussi une torche de cristal.

>

1 Like

It does not appear to be possible to use ${} in a print function:
: print "You have typed the verb: ${verb}." ;

‘lose_game’ does not appear in the documentation in section 3.7.2. Common Commands.
This is also the case of ‘win_game’.

In system_messages: prompt, it doesn’t work properly if there is a line break in the message; input is shifted.
prompt = What next?\n>>

What next?
>         GO NORTH

It’s not really a problem because I can put “What next?” in on_tick{}.

on_tick {
   : print "What next?" ;
}

Updated.

How do I center a text with spaces in a text box? There is a mismatch. I’ve tried with an unbreakable space, but it doesn’t work.

on_startup {
   : print "^c^^n^**********************\n*_LAND_OF_THE_GIANTS_*\n* LAND  OF THE GIANTS *\n**********************^m^" ;
   : press_any_key ;  
}

center-min

Some default system messages are not the same as those displayed in system_messages {}. This is the case for nothing_to_get:

nothing_to_get = You can't find it.
system_messages {
   nothing_to_get = You look around but can't see any ${noun} anywhere!
}

The reason for this is that you are using the “Bamburgh” (default Adventuron) font, and this font is proportional - meaning that character height is consistent but character width varies depending on the character.

If you use the “daad” or “clairsys_10” fonts you will find that they are fixed character widths and everything will line up.

Information on font settings are here:

https://adventuron.io/documentation/#Fonts

You can also import any of Damien Guard’s fonts and they should work as monospace fonts too.

If you really want Bamburgh (perhaps because of French glyph support), then you will have to eliminate the other * characters and the text will still look good as centred text.

Chris

1 Like