Search

Geek Girl Joy

Artificial Intelligence, Simulations & Software

Tag

Prototype

Mr Good Bot – Looking For Adventure

Today we implement a solution for the bug I mentioned last week and add a “Quick Say” feature to the admin interface.

Screenshot of the updated Mr. Good Bot Admin Interface
Screenshot of the updated Mr. Good Bot Admin Interface

Also, if you squint just right you might notice that the statement field changed to a text area element.

This is to make entering longer sentences more convenient because the element can be resized or stretched (drag the bottom right arrow) as needed.

Additionally, for your enjoyment, here is a higher resolution version of the featured image without the title text.

Mr Good Bot Looking For Adventure Wallpaper
Mr Good Bot Looking For Adventure Wallpaper

Here are the other posts in the Mr. Good Bot series:

Q&A

Q: What’s with the bot on a motorcycle?

A: It will make more sense after you read the code.

Q: I skipped ahead and read the code. So… you’re making some kind of overly obscure and hamfisted Steppenwolf reference?

A: Yeah… okay look it’s the end of the year and I have a lot of doings happening and the things, you know!? Like, what’s wrong with a Steppenwolf gag?

Q: Sure okay whatever, but then why not like, call it like… “Born To Be Wild”?

A: That’s silly! Bots are built not born. 😛

Plus that’s a bit of an obvious choice isn’t it?

Also, I’m all about trying not to get sued and Looking For Adventure seems less “infringy” while also being imbued with a positive child like imaginative sense of future.

Q: Fair enough, but… why isn’t Mr. Good Bot wearing a helmet? You realize that under California Vehicle Code 27803, Mr. Good Bot is required to wear a helmet and is clearly guilty of an infraction under the law?

A: Under most circumstances you are correct but you see, that law was clearly written to apply to endoskeletal citizens and Mr. Good Bot is an exoskeletal being so technically his head is a helmet and with “Jury nullification” being what it is… I’m sure no conviction would be forthright!

In any case, this interview is now over and all further inquiry should be directed towards Mr. Good Bot’s attorney!

A Bugged Bot

My little QA tester Xavier managed to find a couple of bugs in our prototype.

He found a way to get the bot into a state where it wouldn’t talk even if it had something to say and wasn’t speaking.

The bug seems to occur in two cases:

Continue reading “Mr Good Bot – Looking For Adventure”

Mr Good Bot – Administrative Speech Protocols Enabled

I’ve enabled the administrative speech protocols for Mr. Good bot allowing us to control his speech in real time outside of the database and I built out a nifty admin interface!

Screenshot of the Mr. Good Bot Admin Interface
Screenshot of the Mr. Good Bot Admin Interface

It works well enough but it makes a terrible wallpaper so here’s the featured image as a wallpaper:

Administrative Speech Protocols Enabled Wallpaper
Administrative Speech Protocols Enabled Wallpaper

And, for those of you who prefer more vibrant colors in their wallpapers, here’s the full color alternative (real 😉 ) version:

Administrative Speech Protocols Enabled Wallpaper Alternate
Administrative Speech Protocols Enabled Wallpaper Alternate

Now, if you’d like to know a little about how the admin system works and get the code (don’t worry it’s free), keep reading…

Continue reading “Mr Good Bot – Administrative Speech Protocols Enabled”

Mr Good Bot – Mostly Assembled

Mr. Good Bot is mostly assembled and we’re not looking at any code today (okay maybe just a little) but we’re really just going to talk about how Mr. Good Bot works and all the recent commits I made to Mr Good Bot over on GitHub.

Also, here’s the featured image from today’s post as a wallpaper. It depicts Mr. Good Bot being mostly assembled… I liked the look of hanging wires instead of legs, hence the name. 😛

Mr Good Bot Mostly Assembled Wallpaper
Mr Good Bot Mostly Assembled Wallpaper

If you need a refresher on this series, here are the other Mr. Good Bot posts:

 

So with Mr Good Bot being mostly assembled I thought we would take this opportunity to go over the recent additions.

Continue reading “Mr Good Bot – Mostly Assembled”

Mr Good Bot – Database

Today Mr. Good Bot gets his life long wish of having a brain… wait, no… that was Scarecrow bot.

Come to think of it… Scarecrow bot never did get his brain, just a GED certificate out of the bottom of an old steamer trunk!

In any case, like Scarecrow, Mr. Good Bot needs a brain.

Thankfully this won’t take a trip to the Emerald City and surviving the Chordettes lollipop-guild-fanclub or swarms of flying-monkey bots!

 

Mr. Good Bots brain will be a My SQL database which allows the system to store important persistent data needed by front-end & back-end code.

If you are new to my content or just need a refresher, here are other posts in this series:

If you just want the featured image for this post as a wallpaper here you go:

Mr. Good Bot Database Wallpaper
Mr. Good Bot Database Wallpaper

 

So with that…

We’re, off to create a database…

 

Continue reading “Mr Good Bot – Database”

Mr Good Bot – DaisyBell.wav

Welcome back, today were going to start the process of figuring out how to add speech to Mr. Good Bot.

If you need to catch up, here are the other posts in this series so far.

Mr. Good Bot Series

And if you’re just here for the pretty pics, here you go…

The Featured Image:

Daisy Bell Wav Featured Wallpaper
Daisy Bell Wav Featured Wallpaper

Also, you might just want the image inside the audio wave, so… here’s that as well:

Daisy Bell Wallpaper
Daisy Bell Wallpaper

So with the important stuff out of the way, I guess all that is left to do now is figure out how to make Mr. Good Bot talk and decide what he should say first.

Continue reading “Mr Good Bot – DaisyBell.wav”

Mr Good Bot – Random Assembly Required

Today were going to look at assembling Frankenstein… I mean Mr. Good Bot.

By the end you will have the code needed to run Mr. Good Bot in his most basic capacity.

Before we proceed though, I caution all braves souls who dare venture further, this post will be frightfully technical and you need to be prepared for the coding horrors that lay ahead!

If your stomach turns at the sight of raw code (i.e. most sane folks) then I would suggest you keep right at the fork and head towards A Spooky Real Neat Blog Award for a more engaging and seasonally festive experience.

Though before you go, if you just want the featured image for this post, here’s the wallpaper

Random Assembly Required 1920 by 1080 Wallpaper
Random Assembly Required 1920 by 1080 Wallpaper

Otherwise, here are the other posts in this series if you need to catch up:

The Anatomy of a Good Bot

Mr. Good Bot uses HTML & CSS as the UI/Front End and a little JavaScript to request an updated image frame from the server.

This methodology allows for a simple implementation that I can make accessible on my air gaped home intranet to any authorized device with an IP Address and a browser.

Meaning Xavier can use a “smart device” (laptop, tablet, cellphone, watch, etc…) to keep his robot buddy with him while he’s running around playing.

It’s also possible to modify Mr. Good Bot slightly to accommodate multiple concurrent users.

Meaning Mr. Good Bot could even serve as my families own “smart home” digital assistant and we wouldn’t have to worry about unscrupulous 3rd parties monitoring everything we do or say!

All digital assist bots monitor you for “Learning & Quality Assurance”, look it up!

A Good Bot should be like a pet, a trusted and beloved family member, not a spy for BNN!

As it is (NOT A JOKE) Big Neural Network can and does monitor you at “their discretion”  through your “virtual assistant” with the stated intent at best “to sell you more shit” (paraphrasing)!

But… Let’s not turn this into another rant that gets me blacklisted again. 😛

In any case, because the interface is basically just a webpage Mr. Good Bot has access to all the functionality a web browser offers with the computation of a server, all over my LAN. 🙂

This opens up the possibility to do just about anything we want without relying on BNN tech.

Continue reading “Mr Good Bot – Random Assembly Required”

A Spooky Real Neat Blog Award

Welcome, I was nominated for the A Real Neat Blog Award by a Real Neat Blogger!

She’s PINK, geeky and knows more about training Pokémon than your niece and nephew combined!

She’s also into cosplay and story telling.

Check her out here: https://pinkiespokemon.com/

Thank you for the nomination Pinky!

I feel like I should say that Pinky is not a sponsor but she did award me this opportunity to stand here before you all and run the gauntlet… I mean, accept this prodigious award and shamelessly promote the hell out of myself without fear of villagers with pitchforks and torches showing up to stake me in unmentionable places… but this post isn’t about my kinks!

Also, since social protocol demands you respond relatively quickly to these kinds of things or else the boogeyman will show up in the middle of the night and repossess your blog, I’m postponing this week’s Mr. Good Bot post but we will continue soon.

Here’s the Mr. Good Bot series so far:

A Spooky Real Neat Blog Award

Real Neat Blogger Award

Here are the rules:

  • ✓ Display the Award Logo.
  • ✓ Thank the blogger who nominated you and post a link to their blog.
  • Answer the questions of the one who nominated you.
  • Nominate 7-10 bloggers.
  • Ask them seven questions.

 

Here are the questions:

  1. What is the thing that you fear most?
  2. You are a character in a horror movie (a teenager) what trope would you be?
  3. What do you think comes after death?
  4. You are now a Horror Villain, what is your backstory and what is your main weapon?
  5. What is the weirdest (mysterious) thing you have ever experienced (think ghosts, aliens , elvis spotting etc)
  6. You become a ‘classic’ monster you can choose between, A vampire who sparkles and has to drink to death. A werewolf, who loses control at moonlight and will hunt, a green skinned warty witch who eats children or a regular zombie what do you choose?
  7. What is your favorite scary movie?
  8. (Bonus question : What is that weird thing standing behind you?)

Today I’m going to answer these questions and hopefully not flunk the exit exam!

Oh, and here’s the featured image you can use as a wallpaper.

A Spooky Real Neat Blog Wallpaper
A Spooky Real Neat Blog Wallpaper

 

Continue reading “A Spooky Real Neat Blog Award”

Mr Good Bot – Composite Animation

Many years ago, in what seems like another life… I had the advantageous opportunity to work for the Walt Disney Corporation, not a sponsor but as I said I did used to work for them as a contracted Computer Technician for a few years.

I was young and had my A+ back when it still meant something and stood as a confirmation of basic competency!

I’m just kidding, an A+ was never meaningful (allegedly and IMHO)!

Anyway, mostly my job amounted to “burning/cloning” hard drive images, light software and OS configuration as well as installing the equipment for the end user.

Occasionally I’d fix a broken printer, upgrade some RAM on a laptop, spend a little time in the LAN closet correcting the patch panel port list because the dedicated local department sys admin liked paper records.

On top of that there were the near constant departmental moves… oh the lost weekends! 😛

Nothing complicated though and along the way I met a lot of really smart and wonderful people!

Aside from the people, the two highlights I will always remember fondly Continue reading “Mr Good Bot – Composite Animation”

Mr Good Bot – Front-end

Welcome back for another episode of let’s build a bot! This week we’re building the front-end of Mr. Good Bot!

So look out the window and pick up every stitch because beatniks are out to make it rich!

Come, let the Bene Gesserit Reverend Mother Joy Muad’Dib guide you in the Weirding Way!

And… in case you missed it, those last couple sentence are an obscurish (but stupidly clever) way of joking that I’m a witch.

Like Donovan sang (paraphrasing)… “It must be the season of the October crone!”.

Yeah I know… its less funny if I explain it like that but I’d hate for the censorship bots to think I’m starting a cult.. okay, okay… another cult!

Look, I still contest it was valuable research alright!

Nonetheless, I don’t want to end up on the blacklist again, so… let’s just build the dang bot!

Mr. Good Bot’s Front-end

Sam (my research bot) and I went down into my bot dungeon… er… I mean “subterranean research facility” where we set about designing and constructing Mr. Good Bot for the amusement and bewilderment of all!

Design Considerations:

  • Any and all code should be short, simple and sweet… like me (that’s not true).
  • Everything should be easy for ANYONE, even illiterate people, to use and modify… wait, no… excuse me, that’s insensitive! What I meant to say is, people who can’t read and write code. 😛
  • Ideally Mr. Good Bot would be “skinable” to have more than one look and maybe even have the option to wear “accessories” because even though you never have the time, sometimes… accessories are fun!
  • Extra credit for cross-platform operation.
  • I’m juggling many irons in the fire ATM, so I should try to get the most effect for the least amount of effort on this project. Sort of a “Pareto’s principle of strategic half-assery”.

While discussing our options for rapid prototyping Mr. Good Bot, Sam and I made this list of methods we might use to animate the new bot:

Potential Animation Methods:

  • Still Frames.
  • Dynamic Layered SVG.
  • Pure HTML & JavaScript Canvas Animation.
  • A 3rd Party Animation Library.
  • Sacrificing a virgin… uh.. martini to summon an ancient automaton.

After careful consideration of all the factors Sam was frightfully dead-set on that last method because it involved his Bender Rodriguez impression!

Sam mentioned something about the possibility of meeting the great ToBoR “groking well” but the simulations he ran indicated the probability of success was inconclusive at best and likely low if positive.

So, I made Sam stop wasting my quality Spiced Melange Web Colors and we looked at our other options.

SVG

We decided against Dynamic Layered SVG’s because I have first hand knowledge that most technologically impaired geeks prefer raster over vector image creation.

As silly as that may seem at face value, I can understand why some feel that way.

Sometimes it really is just more fun to manipulate the squiggly colors as little quantized pixels of Joy rather than the product of markup or an equation!

Moving beyond the clearly undue self-aggrandizement for a moment, raster is a simpler and a more straightforward concept that many people already know and are comfortable with.

Also, using SVG would require that people use a very particular svg object naming convention that I would have to define and if you recall there is the critical half-assery constraint to account for.

On top of that, I’ve had issues with seamless performance with crossplatform SVG animations… but if the moons of Arrakis align just right you can make interactive SVGs work!

HTML & JavaScript on a Canvas Element

Two things:

  1. This violates the need to be simple and modifiable by everyone.
  2. It’s kind of a pain in the ass for rapid prototyping! 😛

Nuff said.

3rd Party Animation Library

Look, I’m not going to say it’s not doable, but… it’s going to be a lot like that time Napoleon marched across the alps… extravagant and full of propaganda and in the end you’re left asking “Why?” and declaring “Never again!”!

I won’t subject my audience to that level of abuse!

Still Frames

After considering all options available, Sam and I decided to go with still frame animation because it would be the easiest for non-coders to play with and it is the only option left standing after reviewing all the other options!

Simply put, everybody can draw a picture.

You can use these raster image editors if you don’t already have one:

I use GIMP for manual raster image work by choice (it indiscriminately works on Win, Mac & Linux, but the fact it’s free ain’t half bad either!) and Photoshop is a good choice also.

Although, I would add that having to run Photoshop on a virtual machine to be able to use it on Linux after having paid for it is BS!

GIMP is a lot like VISA (not a sponsor!) it’s everywhere you want to be, though unlike VISA there are no late payments!

Oh, and uh… in case it’s not abundantly clear, #its_never_a_sponsor!

“WHAT?! You mean… we have to draw every face permutation?”

No! Of course not! That would be wasteful & magically delicious… I mean… silly & redundant!

We just need to draw each isolated component but we’ll probably get into all that next week or the week after assuming I don’t take the opportunity to write about Project Orion for Columbus Day because that just totally makes sense to me. 😛

Front-End Code – MrGoodBot.php

Below is the code for this week, it creates a web page and uses CSS to add a little style!

There is a select dropdown element used for changing the skin, the “value” property is the name of the subfolder the skin is in, note it will be case sensitive on Linux.

After that there is an image tag with the element id of “face” and as you might guess this is the DOM object we use to draw Mr. Good Bot’s face.

Lastly, there is a little JavaScript that uses AJAX “POST” requests to change the face image.

Note the random numbers appended to the source link image name to prevent browsers from caching the image and not updating after it is loaded the first time:

Face.src = ‘skins/current_face.png?’ + Math.random();

Once the new face image is loaded, a timeout is used to wash, rinse & repeat ad infinitum with the decisions for assembling the face left to the backend code which we’ll cover in an upcoming post.

As is, when loaded you will just get a black screen but this code is boilerplate and fully functional and ready to display our bots face.

The Code

Copy -> Paste -> Run!

<!DOCTYPE html>
<html lang="en">
<title>Mr Good Bot</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
    background-color: #000;
    overflow: hidden;
}
.pullright{
    float:right;
    text-align:right;
} 
</style>
<body>

<select id='skin' class='pullright'>
    <option value='Default'>Default</option>
    <option value='Nucleus'>Nucleus</option>
    <option value='Pixel'>Pixel</option>
    <option value='Pumpkin'>Pumpkin</option>
</select>

<img src="" style="width:100%" id='face'>

<script>
var Face = document.getElementById('face');
function AnimateFace(){       
   var httpRequest = new XMLHttpRequest();
   var Skin = document.getElementById('skin');
   Skin = 'skin=' + Skin.options[Skin.selectedIndex].value;
   httpRequest.onreadystatechange = function(){
      if(httpRequest.readyState == 4 && httpRequest.status == 200){
         Face.src = 'skins/current_face.png?' + Math.random();
         setTimeout(AnimateFace, 120 * Math.floor(Math.random() * 11) + 1);
      }
   }
   
   httpRequest.open('POST', 'Face.php', true);
   httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   httpRequest.send(Skin); 
}
AnimateFace();
</script>

</body>
</html>

Mr. Good Bot Goes to GitHub

You can follow along for free on GitHub as I release and update Mr. Good Bot’s code.

GitHub: MrGoodBot

 

Mr. Cool Bot Wallpaper

In keeping with last weeks Good Bot themed, time-honored tradition of including a wallpaper, here’s another, please enjoy!

Mr. Cool Bot Wallpaper

Mr Cool Bot 1920 x 1280 Wallpaper
Mr Cool Bot 1920 x 1280 Wallpaper

 

Next week we’ll look at how to create faces & skins for Mr. Good Bot but for now it looks like my ride is here so I’ll see you all next time and thanks for reading!

 


If it is by will alone that you love bots then set your mind in motion!

May thoughts acquire speed, bots acquire stains, the stains become you supporting my content through Patreon for $1 or more every month!

But, if all you can do is like, share, comment and subscribe… well that’s cool too!

Much Love,

~Joy

 

 

Blog at WordPress.com.

Up ↑

%d bloggers like this: