Skip to content

Theorizing About Structure

jordan4ibanez edited this page Jan 5, 2017 · 10 revisions

There are many ways to go about implementing features and functions into the api, hopefully I will be able to write them down on this page.


State Based Decision Making


  • Each state should set the mob self.state to it's class number
  • State 0 will be standing
  • While jumping it should be 1, while still in air, 1, when landing, back to 0
  • Walking around should be state 2
  • Attacking 3
  • Etc etc etc
  • Make states not conflict or override each other

Hostile Mobs Attacking


  • A hostile mob will have to find a player or mob in the area to attack.
  • The mob will check to see if direct line of sight is true.
  • If false the mob will have to path find until direct line of sight is true.
  • If true the mob will stupidly walk towards the player.
  • When stupidly walking towards the player the mob will have to open a voxel manip around it, to see if the node it is about to walk into is more than a 3 node drop.
  • If it is more than a 3 node drop then the mob will have to pathfind around it until going directly to the player is possible without falling down.
  • If the mob makes it to 2 nodes of the player then it will initialize counting down it's punch timer.
  • A mob will punch the player doing X amount of damage.
  • A mob will repeat whatever step it needs to to keep attacking player.

Pathfinding


  • Pathfinding should be a class internally stored in each mob.
  • (Implemented) Pathfinding should be utilized to find the shortest distance to the player.
  • (Implemented) If direct line of sight is true then try to stupidly walk directly to the player.
  • (Implemented) When stupidly walking towards the player the mob will have to open a voxel manip around it, to see if the node it is about to walk into is more than a 3 node drop.
  • The mob should have an api variable which tells it if it can use a ladder to get to the player if in area.
  • If using ladder mobs should climb the ladder and continue the steps above when trying to reach player.
  • If player is completely unreachable, mobs should go back to randomly doing what they do, until player enters node that is reachable

Classes


  • Each class should do a specific thing, jumping, attacking, animation, particles, sounds, and should be neatly structured to be readable and efficient.

Builder Mobs


  • A builder mob (IE a villager) should go to the center of the structure it's about to build.
  • It should load the structure schematic into memory.
  • The mob should check to make sure it is not overwriting another mob's structure.
  • The mob should create a virtual render of the structure using entities which take the shape of the nodes it will place.
  • The mob should start from the ground and clear away all nodes it needs to to prepare the area for building.
  • The mob should start from the ground and build the structure up.
  • When the building is built, it should work as a mob spawner to spawn other mobs defined in it's internal table defined in the api.
  • The spawned mobs should repeat the process to create villages.
Clone this wiki locally