Comments (2)
Sharing additional considerations regarding the current command parsing / matching --
Currently a list of matched object is built using findNearby, i.e. inside target and in target's location (contents and extra matches) -- where target is (usually) a player. Let's call this (inside + location) the 'environment'. Determiners (if any) will apply on this list.
While this is certainly quite ok for 'this' targets, it turns out to be confusing for 'any' targets, especially for get-like and put-like commands.
- "get item from container", for instance, will try to resolve item from the environment, at no actual use.
- "get item" will look inside first, then in location -- it's probably even worse here, since we quite certainly don't want to get something we already have, and determiners however will apply to the whole list (so item.1 may be in player inventory, while we would have wanted the 1st item in room).
I have toyed with the idea of keeping the lists separate, and adding new verb qualifiers more precise than 'any', resolved after a verb is potentially matched (by pattern only): get {any-in-location}, get {any-in-this} from {this}, put {any-in-inventory} into {this}, etc. to ensure objects to be looked for at the appropriate place.
That could perhaps be interesting for 'this' targets too: drink {this-in-inventory} requires target to be 'handled' by player, drink {this} would match any drinkable target in location too (e.g. pool of water, etc.).
I haven't been further than giving it a thought (since it's a breaking change for the client's verb editor too) so I am unsure there are no edge-case, and that the added complexity would be that beneficial.
Perhaps something easier may be considered. But you can at least see the idea here -- it reverses the current logic (first matching objects, then attempting to apply verbs) by first collecting applicable verbs and then try to match objects more precisely.
from room.js.
from room.js.
Related Issues (20)
- Add more unit test coverage
- Create black-box functional tests HOT 1
- Include a proper changelog for this release
- Add a contributors document to give proper credit
- Create an upgrade script to upgrade 3.x worlds to 4.0 worlds
- Add customizable server login messages and help messages
- Node 8.0.0 can't run the tests
- Investigate performance
- Add right prompt
- External text files on objects HOT 2
- Robustness issue in get-xxx and/or save-xxx socket commands
- Make login/authentication (a bit) more state-automata friendly
- Robustness issue in responses to 'request-input' events
- Array types do not update? HOT 2
- how do you add a new trait? HOT 5
- Parser: Incorrect ordering of exact and partial matches
- An in-range update of hashids is breaking the build 🚨 HOT 3
- http://roomjs.dose.ninja/ don't work
- An in-range update of socket.io is breaking the build 🚨 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from room.js.