- Published on
Devlog #8 - Mobs & Spawns
Let's start off the week by putting Fisherman Gorton in his place. He's going to be fishing for eternity off the coast of Noob Island like before.
Hey, buddy. Long time no see.
Now since there are a lot of MySQL tables to create and my brain is still dead, I'm going to make a lot of tables. Starting with FactionDefinitions / FactionDefinitionTranslations. FactionDefinitions is just an id for now, that's easy. FactionDefinitionTranslations has all the names, let's create that and add a few. There were 15 factions. The first few were Crab Crusaders, Skele Assassins, and Pirate Order. That's enough for now.
Now it's time to make the MobDefintion, MobDefintionTranslations, and MobDefinitionSpawns tables. MobDefintion has id, sprite name, level, health, min damage, max damage, attack speed, movement speed, faction id, and I will be adding all stats/attributes that players can have so that later enemies can be much more complex. Faction xp was previously defined per MobDefinition but I'm going to change it to using AO's system which was to use a modified xp table to determine faction xp. MobDefinitionSpawns define where a mob can spawn, how far it can move, how often it randomly moves, and drops. I added the first few Crabby spawns so we can see something once all the data is in place on the server and client. And now once again I must load this data into the server.
With all mob definitions loaded on the server, I now have to group mob spawns with their mob definitions, and then group those with their zone owners. In FO mobs could only spawn in one zone but in FO2 they can spawn in any zone. And then I got all the spawner code in place. And then the crabs came to town.
They're alive and spawning. Now they need to wander around. Thanks to the actor/component system we're using, most of the code was already there to be used. And they be movin'.
So we've already got mobs spawning and moving around. Great progress.
Now I need to fix the font issue which had a solution here:
https://forum.babylonjs.com/t/is-there-a-way-to-turn-off-filter-of-fonts/39122/23?u=pixelodo
Thankfully it was an easy fix. You have to explicitly wait for fonts to load before using them sometimes.
Player info and other things using the font looking a lot better now.
I also setup health and energy regen which filled up Gamer's health and energy in the picture above. Still need to do numbers over the head but regen is now working on the server.
We're getting pretty close to starting a fight with those crabs but first we need to handle selection of actors in the client.
That's it for this week. By next Friday I hope to be able to punch a crab to death and loot its corpse. I never thought I'd write that sentence.
Have Fun & Keep Gaming!