Open andrew-peng-144 opened 3 years ago
Spawning system:
In the tiled map, can define point locations where enemy may spawn. And maybe associate a percentage change to spawn for each. Idk.
For each spawn point, specify the species ID and the modifiers. Things dont have to be exact, there could be a randomization system.
What would happen in game is that when that area is loaded, then the mob could instantly spawn there.
This could also handle fun things like a room in a dungeon with a trapped chest, which when activated, spawns mobs. So this is a different activator than the above bullet, it's not instant.
I think this is comprehensive for now. This handles spawns in dungeons, and also could handle a large overworld, since you can define constant points where enemies MAY spawn. And it still feels natural.
The big question is whether the world will be unleveled (morrowind) or leveled (like skyrim).
A mob, or any enemy that the player can fight, is an actor.
But all mobs of a certain type has a set of base attributes. So all mobs of that type will have identical stats, by default. These can be changed with modifiers, like buffs, like damage increase. Similar to the item system. An enemy that you run into will be of a certain species, but that enemy itself may have some certain modifiers.
There's basically a main list of all the base enemies, or "species". Ordered by ID. Ex a goblin has ID 42, that entry can be something like this at position 42:
to reiterate, things like walk speed are its BASE attributes.
Let's say you encounter a goblin that has 20. That's an entity, so it has physics and graphics, and its entity data will be something like: