Up to Main Index Up to Journal for October, 2018 JOURNAL FOR THURSDAY 25TH OCTOBER, 2018 ______________________________________________________________________________ SUBJECT: Thoughts on mobiles, creatures and critters DATE: Thu 25 Oct 19:21:09 BST 2018 With the upcoming Halloween release I wanted to include something new for the players. At the moment the release would be a roll-up of all of the hidden, behind the scenes changes that have been going on. So in effect nothing new as far as players are concerned. When I stopped development, to concentrate on testing and fixing bugs, I was working on mobiles. Mobiles are all of the NPCs (Non-player characters), creatures and critters that inhabit the game world. So far mobiles can only have simple actions. For example, a frog with the following three actions defined: Action: AFTER→10s JITTER→20s OnAction: The frog croaks a bit. : The little frog leaps high into the air. : The frog hops around a bit. Every 10 seconds, plus 0 to 20 seconds, one of the three messages will be picked at random and displayed to players in the same location as the frog: >look Secluded path by shed You are on a small secluded gravel path screened off from the formal gardens by large bushes. To the south is a small shed with its door facing you. A rock has been positioned by the shed, from the looks of it by someone who thought it was artistic. The gravel path you are on leads northward. You see a small frog here. You can see exits north and south. > The frog hops around a bit. > The frog croaks a bit. > The frog hops around a bit. > To make mobiles more interesting I started work on an OnBehaviour attribute. The idea was to add behaviours such as moving around, eating, sleeping and so on. That didn’t end well. I could also see myself adding more and more OnXxx handlers as time went on. I needed something more generic. Then a few days ago I had a bright idea. Why not modify Action to be a list of commands? That way any player command or scripting command could be used. For example: Action: AFTER→10s JITTER→20s OnAction: $ECHO The frog croaks a bit. : $ECHO The little frog leaps high into the air. : $ECHO The frog hops around a bit. : $MOVE : LOOK : SAY Ribbit! At the moment there no $ECHO or $MOVE commands, commands that start with a dollar ‘$’ are for scripting only. The idea is, $ECHO just sends out the specified message to the current location. This gives us the current action behaviour. The $MOVE command would make the mobile wander around by picking a random exit at the current location. The LOOK command would be just like a player looking around, you would see “A small frog starts looking around.”. Now and again you would see “A small frog says: Ribbit!”. With the above example the frog would have a 1 in 6 change of moving to a new location. By adding multiple $MOVE commands you could increase it to 2 in 7, 3 in 8 or whatever. I have contemplated adding weights to the actions, something like: Action: AFTER→10s JITTER→20s OnAction: $ECHO The frog croaks a bit. : $ECHO The little frog leaps high into the air. : $ECHO The frog hops around a bit. : 10→$MOVE : 2→LOOK : SAY Ribbit! Now the frog would have a 10 in 16 chance of moving, and a 2 in 16 chance of looking around. I wanted to keep things very simple, so I’ve ignored adding weights for now — adding 10 instance of $MOVE would have the same effect. As it is I’m not sure if there is enough time to get all of this done and tested by Halloween. I’m not going to rush things, and if it’s not ready it’ll be a shame but that’s fine. Only 6 days left till Halloween… /\oo/\ -- Diddymus Up to Main Index Up to Journal for October, 2018