Jump to content

Game Engine Script - Simple Verbs


Love Zhaoying
 Share

You are about to reply to a thread that has been inactive for 661 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

(Question is near the bottom).

I am working on a use-case for my interpreter and other connected scripts. 

In the search for an initial use-case, an easy choice is to create a "game engine".  Text-based, but this being Second Life there's the option of doing different HUD things, playing sounds, etc.

Anyway, without "cheating" by Googling classic text-based "Adenture-style" games, I came up with an initial list of simple "commands".

Some of these commands are highly variable, and would act on an object either "seen" (that you can "look at" in the game), or in the game "inventory", etc.  In that spirit, I will be making that type of command as open-ended as I can, while still following the principles of "Keep It Simple".

Here is a list of initial commands in alphabetical order from the "Help" message.  Add to this things like "Roll", "Fight", "Load", "Save",  etc.

 

            Say("Help:");
            Say("Note: All commands must start with command prefix: '" + sPrefix + "'");
            Say("channel # - New channel number");
            Say("drop - Drop item from Inventory");  // *
            Say("inventory - Show items in Inventory");
            Say("look [object] - List nearby objects / List object details");
            Say("move [direction], or just use N/S/E/W - Move North, South, East, West"); // *
            Say("prefix char - New command prefix");
            Say("remove - Remove worn item back to inventory"); // *
            Say("status- Show current Status");
            Say("take - Take item into inventory"); // *
            Say("use - Use item in inventory");  // *
            Say("wear - Wear item from inventory"); // *
            Say("help - This help message");

When it comes to "verb" commands, I want to keep it VERY simple:  "Verb" command first, followed by 1 or more things / objects that "verb" command should act on.

Here finally, are a couple questions:

1. Does this list sound like a good start? Am I missing something obvious?

2. I was trying to think of a suitable "verb" command for taking multiple objects (from game "inventory), and combining them for use to "make something else". 

Examples: A "stick" and "obsidian blade" may make a "spear" or "arrow".  Different cooking ingredients when combined may make a "recipe".  Different mystical items when combined may make "potions".  Combining different chemicals may make a weapon, there's the classic "saltpeter" + "sulfur" + "charcoal".

After I thought about it for awhile, I think the most obvious choice for the "combine thing1 thing2 thing3" verb is.. "combine".  The rule I wanted to follow if "verb" followed by "one or more items". What do you think?  "Combine" seems more clear then "add" or "mix" which could be used for certain specific  cases.

Thanks in advance for your feedback,

Love

 

Edited by Love Zhaoying
Link to comment
Share on other sites

  • Lindens

Your project has piqued my interest, I'd love to hear about how it progresses, so keep the updates coming.

One thing you might consider is looking at something called a Z-Machine Interpreter.  I believe there are a couple out in the wild as open source. (I've had a long back-burnered project to port it to LSL)

https://en.wikipedia.org/wiki/Z-machine

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, Rider Linden said:

Your project has piqued my interest, I'd love to hear about how it progresses, so keep the updates coming.

One thing you might consider is looking at something called a Z-Machine Interpreter.  I believe there are a couple out in the wild as open source. (I've had a long back-burnered project to port it to LSL)

https://en.wikipedia.org/wiki/Z-machine

 

Perfect! This sounds on the surface like the kind of thing I'm doing. 

My reason (excuse? pretext?) to do it, is to add features to a general-use interpreter!

Thanks so very much for your reply and the information,

Love

Link to comment
Share on other sites

As someone who has built a MUD codebase/parser from scratch in the past... and hosted a number of MUDs... that did this exact kind of thing...

You probably want to alias some of these commands, like 't' for take and 'd' for drop. People will tire of typing them repeatively quickly.

Partial matching names is good too... and if you have two objects that start, for example, with arrow you could say get 2.arr (which grabs the 2nd object of arrow)

So  t 2.a would be a shortcut for take 2nd arrow, assuming you had no other object that started with 'a'. :D

 

Edited by Lillani Lowell
spelling
  • Thanks 1
Link to comment
Share on other sites

57 minutes ago, Lillani Lowell said:

You probably want to alias some of these commands, like 't' for take and 'd' for drop. People will tire of typing them repeatively quickly.

Great idea! I planned on "complete aliasing" (meaning, multiple options for most words/commands), but the "short versions" did not occur to me.

58 minutes ago, Lillani Lowell said:

Partial matching names is good too... and if you have two objects that start, for example, with arrow you could say get 2.arr (which grabs the 2nd object of arrow)

So  t 2.a would be a shortcut for take 2nd arrow, assuming you had no other object that started with 'a'. :D

Wow!

Link to comment
Share on other sites

17 minutes ago, Coffee Pancake said:

To follow on from Lillani ... not knowing any of the active or contextually operational words might have been "fun" in the 80's, when such head scratching was required to stretch out the gametime, please don't just make the help command issue a pithy message.

Just checking: Does this mean, let the user figure out the commands where that makes sense to let them, instead of giving all the commands (and aliases, especially), shortcuts, etc.?

Edited by Love Zhaoying
Link to comment
Share on other sites

1 hour ago, Love Zhaoying said:

Just checking: Does this mean, let the user figure out the commands where that makes sense to let them, instead of giving all the commands (and aliases, especially), shortcuts, etc.?

The opposite of that. If it's possible to do a thing, or use a specific word, there should be clear easily accessible documentation of it.

Something like "help take" should also mention that "t" is an acceptable shortcut (if it is) and perhaps list a couple example invocations. "help" or "help commands" should list all the available words (perhaps not their abbreviations, I'd say its fine to leave shortcuts under their full-name) and group them into thematic sections.

  • Thanks 1
Link to comment
Share on other sites

57 minutes ago, Quistess Alpha said:

The opposite of that. If it's possible to do a thing, or use a specific word, there should be clear easily accessible documentation of it.

Something like "help take" should also mention that "t" is an acceptable shortcut (if it is) and perhaps list a couple example invocations. "help" or "help commands" should list all the available words (perhaps not their abbreviations, I'd say its fine to leave shortcuts under their full-name) and group them into thematic sections.

I misread your post, now I get it. Thanks!

But for contextual commands specific to an item, users will have to guess which items to "combine" for instance, unless the goal required me to give them a recipe. 

ETA: I already moved "help" to its own script for the Console, and for the Game Console. So, having help on individual commands won't add any impact to the main scripts. But to generalize the Game stuff, will ultimately have the Help read from a Notecard (which will take care of aliases, etc.). Will probably post about the Console in a couple days.

Edited by Love Zhaoying
Link to comment
Share on other sites

3 minutes ago, Love Zhaoying said:

But for contextual commands specific to an item, users will have to guess which items to "combine" for instance, unless the goal required me to give them a recipe. 

Yeah, but you should make the 'basic rules' clear. if combining flint and wood is different than combining wood and flint, that should be made clear, as should whether you can combine 3+ things, or combine something with itself. It's very hard to make a puzzle about understanding the basic operations. it's possible (see 'Baba is you') but you'd really need to set-up and "motivate" a solution that really required doing something that wasn't explicitly provided as a possibility.

  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, Quistess Alpha said:

Yeah, but you should make the 'basic rules' clear. if combining flint and wood is different than combining wood and flint, that should be made clear, as should whether you can combine 3+ things, or combine something with itself. It's very hard to make a puzzle about understanding the basic operations. it's possible (see 'Baba is you') but you'd really need to set-up and "motivate" a solution that really required doing something that wasn't explicitly provided as a possibility.

Yeah, adding a contextual "hint" feature is a possibility too. 

Link to comment
Share on other sites

This is very interesting. Your desire to keep it very simple might actually end up a lot more complicated in the long term. Compare for example:

"Use <object>"  with "Use <object> with <target>"

Let's imagine a scenario like this:

"You follow the ancient temple steps along the cliffside. Harsh winds and frequent use have made these a difficult and uneven terrain. To make matters worse, a monk of the old gods approaches you on these narrow steps.

You see: Steps, metal rings in the wall, Monk

Inventory: Stick.

Directions: North/South"

Now imagine being the player. They want to use the stick, how will you determine what to use it with?

"You use the stick and beat up the monk who curses you with the wrath of the old gods"  versus "You use the stick to test the stairs. They seem  sturdy enough to hold two"  versus "You use the stick on the metal rings, creating a makeshift handrail, giving you stability to let the monk pass"

It would also solve your trouble with combine or trying to find a word for combine. That said, combine with a list of parameters would work reasonably well. But I warn you now, I personally would totally try to "combine stick monk" and get a multiple instance of object error. *cough*

Your overall list of words is decent but as an og rogue liker, I'm wrinkling my nose at wear versus equip (and the oft forgotten wield). Probably just a personal failing of mine.

Depending on what you want to do, you might be missing an interaction to talk, for example say -  speak out keyword to any present. Also you may want environmental interactions since your use is limited to inventory. Remove I would not understand as unequip but rather throwing it away and as for direction, I think up and down could be useful too. Ladders and pitfalls.

Other than that, good start.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, ValKalAstra said:

This is very interesting. Your desire to keep it very simple might actually end up a lot more complicated in the long term. Compare for example:

"Use <object>"  with "Use <object> with <target>"

Let's imagine a scenario like this:

"You follow the ancient temple steps along the cliffside. Harsh winds and frequent use have made these a difficult and uneven terrain. To make matters worse, a monk of the old gods approaches you on these narrow steps.

You see: Steps, metal rings in the wall, Monk

Inventory: Stick.

Directions: North/South"

Now imagine being the player. They want to use the stick, how will you determine what to use it with?

"You use the stick and beat up the monk who curses you with the wrath of the old gods"  versus "You use the stick to test the stairs. They seem  sturdy enough to hold two"  versus "You use the stick on the metal rings, creating a makeshift handrail, giving you stability to let the monk pass"

It would also solve your trouble with combine or trying to find a word for combine. That said, combine with a list of parameters would work reasonably well. But I warn you now, I personally would totally try to "combine stick monk" and get a multiple instance of object error. *cough*

Your overall list of words is decent but as an og rogue liker, I'm wrinkling my nose at wear versus equip (and the oft forgotten wield). Probably just a personal failing of mine.

Depending on what you want to do, you might be missing an interaction to talk, for example say -  speak out keyword to any present. Also you may want environmental interactions since your use is limited to inventory. Remove I would not understand as unequip but rather throwing it away and as for direction, I think up and down could be useful too. Ladders and pitfalls.

Other than that, good start.

Great thoughts and advice!  My rambling seat-of-the-pants thought process is below!

In your example, I probably would not "using the stick" means to use it against the monk, unless the user typed, "fight monk".   Or unless the monk starts a fight with you!

So in that case: the monk is irrelevant when you use the stick. You have to use a verb with the monk ("fight monk", etc.).

But also - I have not "thought through" how to use "weapons" yet. 

However, here is what I was thinking:

1) Assume a limited number of weapons at one time.  Since I am not a "fighting game guy", my mind went to "one".

2) You would have to "wear" the weapon. When fighting, the "worn" weapon would automatically be "used".  

So basically, in an "only one weapon" scenario, there is no need to explicitly "use" the weapon so long as you are wearing it.

I will eventually think this through, for the "multiple weapons - pick one each fighting turn" scenario.

But for now, my thinking process comes from the example of a "torch": It's dark. You wear (or.."use" INSTEAD of wear?) the torch. The torch is "lit" automatically, and stays "lit" until it burns out, determined by the number of "turns" the torch is good for.

So, having written out the above, perhaps the weapons are the exception - don't "wear" them, just "use" (or "wield") them when needed?  That way, if you have 3 different weapons, whichever one you "use" last is the one you use in each fighting turn.  

Unless you can "wield" / "use" multiple weapons at once - one in each hand, etc.

I was originally thinking you get to "wear": 1 set of armor, ("wield") 1 weapon, 1 magic item at a time.

The data structures for each item are going to be designed to drive the usage (worn / used / wielded / hit points / magic points / health points). So in theory, how you use / how many you use would be defined by each item and the type of usage (worn / held / wielded etc.).

I just don't want to make the "grammar" complicated.  By this I mean, except for the "combining of items", I don't want more than one "object" or "verb" in a command (until I have to).

Ow, my head.

Thanks,

Love

 

Link to comment
Share on other sites

Verbs aside, development on this project is going amazingly well. I will probably post a new thread about some of the programming paradigms that I'm using, not "new to me", just "new to me for LSL". 

Examples: Custom "Events", "Watches", "Blocks" (not quite like a semaphore), and lots more.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 661 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...