NPC AI code

I spent the night coding the NPC wanderer AI and I’ve managed to get satisfactory results. I want to make a video tomorrow, because it’s better to actually see something like this in action rather than looking at pictures of it. That said, here’s a pic:

Some random points:

  • limit of 1 town center block; no spawning without it
  • time between spawns: 5 seconds
  • spawn distance from town center: 32 blocks, or 2 chunks
  • town limit from town center: 16 blocks, or 1 chunk
  • time between NPC nextThink calls: 1 second

Of course all of these values are for testing purposes, I’ll be changing them to suit the game as things are built.

I did a couple of retarded things while I was coding, which I’ll go over in the video. I’ll end this post with another picture:


Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: