Tuesday, October 28, 2014

My First Gameplay Demo Ever

That's right, I have a gameplay demo for you.  Yes, that also means that it's somewhat playable.  The AI fights back.  It's really stupid, and it only works on the one map that I've made, but it does the trick.  It's actually about 4 lines of code.  However, it proves that my AI setup works, all except for the actual thinking part.  I'll probably make plenty of modifications in the future, but the foundation is done and tested.  This is a pretty big milestone for me.  I know I've said that before, but this takes the cake.  I've never had an AI to play against, and it happens to kill me almost every time I play.  He's easy to kill, but he takes me out before I can finish him off.  Here's the video:


It still looks like the screenshots, except the color of the opponent.  Sorry his routes are a bit hard to see.  I would change it, but I've already uploaded the video.  At least I made him a different color.  Otherwise, it would look really confusing.

Anyway, you'll notice that he keeps attacking even after I've split his parent nodes, which destroys the system in a chain reaction.  Watch it twice, the first time watch me take him out, and then watch him attack me.  I make the first strike (he doesn't defend himself, so it's not quite fair), and I keep trying to stop him from attacking me, but he gets me in the end.

This AI follows a decision tree with two branches, and it always builds from the last node created (starting with the bottom-left node).  If the AI controls 4 nodes, build 350 pixels to the left.  Otherwise, build up 200 pixels.  Like I said, it's stupid, but it works great for this video.  It really looks like it's trying to beat me.

Let me know what you think.  I'm really proud of this milestone.  Thanks for reading!

clevceo

No comments: