Blocksworld Guide

How to make an AI for Blocksworld

How to make an AI

Overview

Ever wanted to make an AI, but don’t know how to? This guide will help you on how to make a melee AI!

Introduction

Ever wanted to make a battle AI in Blocksworld, but you don’t know how to? Well it’s pretty easy! Today I will show you how to make an AI. Let’s get right into building!

Design Your Blockster

The first step is really important; designing a blockster for your AI you will make! For today, I turned a normal blockster into a blockster from a magic show!

After designing your blockster, think of a name for it. Eventually, it’ll be the name of your AI. I chose Show Biz Blockster, because it’s from a magic show!

The Intro Quote

After thinking of a name and designing your blockster, I think it’s now time to move on to the next step, intro quotes! Although they aren’t really necessary, it adds a little context to your AI!

To make an intro quote, go to the blockster’s action panel. Then add the code:
On play (>) Speak
When you add the speak action, it should take you to where you’re able to edit the speech! This’ll be our intro quote. Then, type in your intro quote. I put “Oh, my tophat!” just for the knack of it, since I couldn’t think of anything else.

Adding A Health Bar

Now that we added an intro quote, why don’t we add a health bar? A health bar is really important for your AI. Without it, other AIs can’t defeat it! It’s pretty easy to add a health bar sometimes; just put it on top of the blockster’s head! But in this case, I won’t be able to due to the tophat, so I have to use merging to get the health bar on that blockster.

Now we need to add a hero or villain tag to the AI. Select the blockster’s panel, then add the following code if you want to make your AI a hero:

(>) Hero
Sight Line Villain (>) Model Signal “SeeVillain”
No Sight Line Villain (>) Model Signal “NoVillain”

Otherwise, if you wanna make your AI a villain, add this code:

(>) Villain
Sight Line Hero (>) Model Signal “SeeVillain”
No Sight Line Hero (>) Model Signal “NoVillain


Then, if your AI is a hero, remove the villain tag, but not the sight line. Otherwise, if it’s a villain, remove the hero tag.

Adding A Weapon

Let’s add a weapon now. If you want your blockster to attack and defeat the other AIs, then add a weapon! We’ll do a melee weapon for now. Next time, I might do a tutorial on how to make a ranged battle AI.
First, go to the gear section. It should be the column that has a hat! Scroll down until you see a sword. Pick any weapon. For me, I picked a baton, since it’s also related to my AI. Then, drag it to the blockster’s hand. You might need to turn it for the blockster to hold it perfectly. Now, at the weapon’s action panel, add the following code:

(>) Triangle Tag
Model Signal “NoVillain” (>) Hide
Model Signal “SeeVillain” (>) Appear
Hit Block Villain (or Hit Block Hero) (>) Explode (Radius 1.0)

Use Hit Block Villain if your AI attacks villains. Otherwise, if it attacks heroes, use Hit Block Hero, just for the block only, and not the model.

Then, select the blockster to go to its action panel. Add the following code:

If your AI’s a hero:
Model Signal “SeeVillain” (>) Chase Villain

However. if it’s a villain:
Model Signal “SeeVillain” (>) Chase Hero

Conclusion

Now you have successfully made your AI! Here’s what my final product looks like:

SteamSolo.com