Mobs! Yes, we have mob’s in the world’s now – due to my lack of Blender skills I’ve only got a zombie mob in at the minute but the logic that controls them (both client and server side) is all working correctly. There’s probably a bit more to do on the AI aspects of the mob’s, they can get stuck on isolated single paths and float up steps (rather than jumping).
In order to make the mob’s of any use, I allowed them to attack humans and cause damage. This meant creating a health system so players can die, along with the various UI things (such as flashing the screen red on a hit) and then finally the logic for a mob to “attack” a player. In the near future I will expose the various options that control this to JS – both globally (i.e. affect all mobs with defaults) and locally (affect a single mob).
I’ve also added in a HUD system which allows players to add text, prompts, inputs, etc. to either all connected players or a single player. This will be handy for showing things like world play guides to a player when he connections, or when a round is finished. At the moment this is fairly basic at showing just text for duration, but it should be fairly easy to expand to lots of different HUD components (windows, labels, button, etc.)
Finally, I’m going to start work on adding in a “generic script entity” – This entity will be placed like any other entity but allow just random (or maybe not that random). Java-script to be added to the entity.
The reason for this script entity is the requirement that you will probably want to write code in isolation, for example if your level has a section of flicking a switch to make a bridge appear – you probably want the Java-Script that performs this operation to be “near” the bridge and script. Therefore you add a script entity there and put all your logic for that part of the world in there. When the player get’s to that part, the switch then calls the Java-Script in your script entity to make the bridge work.
The other major reason for this is initialisation, you probably want to set things BEFORE the world start’s (at the point where Cubiverse initialises the world because the first player has joined OR during a reset of the world – like when one team has won). I’m still toying with the idea of allowing you to control the order in which each script entity executes, so you have some idea in which order your Java-Script will run BUT I do think that assuming you have no control may assist with learning.