Hey Joseph, I apologize for not looking at your proposal in more depth at first. My life is quite busy and I don't do much with kams at this point in time. However, I have some feedback now...
Thank you greatly for the feedback, about being busy its not a problem at all, you are offering much more than I had expected. Ill try to shoot you a pm w/ my intentions & plans when I get a few more minutes.
Arrays vs. sets: it is faster to check to see if a value is in a set than in an array, particularly if the set is large.
Sweet thanks for the information! I never knew about sets, read that they had the 'fast lookup abilities of a hash' but wasn't really sure if that would apply here.
Speaking of which, please note that all command parsing in kams begins by taking the first part of the input prior to a space (or the while thing if no spaces) and treating that as the command.
This was one of the changes I have on my ToDo list. From the 'lazy player' perspective this is one of the first things that I noticed about kams. I intend to change command parsing to allow the player to type for example rem shirt, rather than having to type remove completely. As part of the rewrite Ill have the command parser grab everything before the first whitespace or "common command operator" and search for an exact match.. failing an exact match for commands other than admin, issues etc I will let a simple regex find the correct command. Yes I understand that most mudui now-a-days allow for aliasing but I wouldn't want or expect a new player to decide how they want to shorthand each command and write an alias for them all.
I think this approach should be maintained, because it helps keep command parsing from becoming too slow. This also means that (currently) there is no mechanism that allows shortest-match processing of commands like you are attempting with whisper.
Ill try it out and let you know what the processing difference is, but in reality this is a text-based game unless we create a memory leak somewhere I don't see parsing as something that will slow it down to a noticeable level.. unless lets say someone using kams manages to get 10k+ players online & scripting.
Now that I am seeing more of it, the syntax (and the code) for your new system seems quite complex. Do you think it is something players would use instead of just emotes?
Yes It does have a complex option, but it also has many very simple options. for example just putting ? ! . at the end of a communication phrase changes the verb. As well as things like whisper defaulting to quietly.. Ive played games w/ similar .. and less complex options before, and honestly I think that a mix is the best.. it gives something to everyone (the players that want to be able to talk simply, and the players that want to delve deeply into the roleplay and look 'cool' while they are doing it.)
>say (happily) Whee!
Happily, you exclaim, "Whee!"
Oyi nope I didn't know about that.. I will have to find that thanks for the heads up.. easier to not break something that I know exists.
In any case, have you considered using
StringScanner? It might be simpler.
Ive taken a look at it, I don't really like the way it duplicates the strings, but basically with that exception I am effectively re-inventing the wheel by doing the command parsing in a fashion similar to what strscan does.