Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Tutorials
#1

How to add emotion to a sackbot

Archive: 15 posts


http://i1.lbp.me/img/ft/73164d4062e149779633312473d8a1b74b67d094.jpg

Hi there, this is Data - correction - Stellakris, and today I would like to talk about sackbots and emotion.

As you may have found out already, sackbots don't automatically have all the vivid emotions you sackpeople have. Once you take control over a sackbot, you can use the directional pad until your thumb bleeds, but this android will remain stoic as always. "So, can we change this?", you may ask. Affirmative!


http://i.imgur.com/QlwwM.png

Here you see, next to the neutral emotion, the four basic emotions sackpeople possess: happy, sad, angry and scared. Each emotion has three degrees that you can select by using the directional pad. For instance, to act jolly, press up on the pad once. To be totally overjoyed, press up a few more times.

After three presses into a chosen direction, a sackperson returns to his neutral state again. When in a certain emotion, regardless of degree, one presses the opposite direction once to immediately return to the neutral state again.

This is what we'll replicate with logic.


The Emotion Chip

http://ic.lbp.me/img/ft/93cb1e3fc73d09cb301172aa2928974c1925ce44.jpg

I'll assume you are all familiar with the basics to control a sackbot, right? Invisible holo, invisible controlinator attached, set to transmit and containing a follower that chases a tag on the sackbot. The sackbot has a controlinator of his own, set to receiving.


http://i1.lbp.me/img/ft/bc14dad3b1d8ba1b82a7f7d791dfab8112d5c002.jpg

Here we go. We add our Emotion Chip to the sackbot circuit and on top we start off with another receiving controlinator; you can wire the other one to here as well, but often it is way easier to just keep things modular.

Now, wire the controlinator's d-pad outputs to two signal splitters. Each splitter needs to be wired to two 1-shot counters that reset themselves; this will make sure that the player needs to press and release the button before he can press it again.

Also, set the transmitting controlinator on the holo to disable the popit controls. Else we will not be able to test the d-pad during Create Mode, since the d-pad buttons are reserved for Create Mode functions like fast-forwarding, rewinding and hovering.

Wire all counters to a separate channel on a 5-gate selector. Make sure the fifth input is untouched and set the selector to activate output #5. Wire output #5 to a behavior chip that is set to the neutral emotion.

What this would do, would we take control over the sackbot, is that we can select 4 states on the selector using the d-pad; behind this states we will stick our basic emotions!


Happy at the press of a button

http://i5.lbp.me/img/ft/0652e489105a58a36db250295ff1a1891e2ac2ea.jpg

Let's start with one (in this case, d-pad up, the happy emotion). Wire gate #1 of the selector to the activation input of a new microchip. On this chip, start a new 4-gate selector which we will use for the degree of this happiness emotion. Wire the first three gates to behavior chips: the top one slightly happy, the second one very entertained and the bottom one extatic.

We want to cycle through these degrees using the same button that activated this basic emotion, d-pad up. So, wire the vertical d-pad signal to the chip and lead it into a signal splitter. Stick two self-resetting 1-shot counters behind them again and wire the positive one (meaning 'up&apos to the cycle input of the selector.

Now, if we'd take control, we can switch from neutral to happy by pressing up, and cycle through the degrees of this emotion. It is not entirely polished yet, though.


http://id.lbp.me/img/ft/30d3f28131452f3d113e1f76971c23e89093fffe.jpg

We want to be able to cycle through all degrees and end up back at the neutral state. Also, pushing d-pad down should bring us back to neutral immediately. For this we wire the last output of the selector and the negative signal from the splitter to an OR gate. We connect this OR gate to a 4-gate OR gate on the chip below and wire that to the neutral input of our main selector.

Normally, if we'd be in happy state and we'd press down, we would activate the sad state, but because the selector channel for neutral is #5, the highest spot, and higher gates take priority on a selector when it receives multiple signals at once, the selector turns to this neutral state after all!


http://i3.lbp.me/img/ft/db3d02acb36119f13be5dad04c55a4dcb0634f17.jpg

We need to have the emotion reset back to the first degree when we activate the chip or else, when switching emotions, we land in the emotional state where we left our sackbot before and that would look weird, disturbing and socially inept. For this, stick a battery on the happiness chip, wired to another self-resetting 1-shot counter and lead that to the first input (the first emotional degree) of the selector.

The problem now, is that when from a neutral state pushing up once will set the degree selector to state 1, but the signal from the d-pad fires at the same time, causing the degree selector to cycle ahead one more degree! We need this to be cancelled on chip activation! So, stick a 3-gate XOR gate, wire the up-signal through it to the the selector's cycle input; then wire the battery's signal to two other inputs of the XOR gate.

When a XOR gate receives two or more signals at the same time, it will not let anything through. So, the split moment that the chip activates, there is no possibility for the d-pad signal to cycle the selector at the same time.


Going full Emo

http://ie.lbp.me/img/ft/c4e420ee1f8d3ffd5b223771ce4a9f41660c588b.jpg

Now, before we duplicate this chip and turn the copies into other emotions, add a few tags. I put a blue tag here named 'Happy' and three red ones named 'Normal', 'Higher' and 'High'. These tags, the red ones activated with each degree, will allow us to do stuff with that in the level and turn this emotion business into a gameplay element!


http://i1.lbp.me/img/ft/511fea2dd293779f101a9cce6708c1655c850bf2.jpg

Alright!! Duplicate that happiness chip three times, hook 'em up (make sure you know which port/d-pad direction is associated with it) and modify the behaviors each copy has on board. And don't forget the blue tags.


http://if.lbp.me/img/ft/fbf8fc44d4c26bb9790307bbbce4ecb665f5e7a0.jpg

Be aware that the d-pad down emotion (sad) and d-pad left emotion (scared) require you to swap the positive and negative d-pad signals on the chips.


http://i6.lbp.me/img/ft/c56f6d4b08da6769467bcff158efe1feb396d37a.jpg

Here is an example of logic that could be found in your emo level: a tag 'Happy' + ( 'High' or 'Higher) are required in order to activate something. Like, the door to the medicine cabinet.

A great example of a level that uses a sackbot with emotions is Mnniska's Flowerbucket (http://lbp.me/v/0grm01).



http://i4.lbp.me/img/ft/194cb1cb5177518fd531b04066dd61480dd75b32.jpg

"How many Vulcans does it take to change a light bulb? Approximately one point zero zero zero zero..."
2012-04-19 00:43:00

Author:
Antikris
Posts: 1340


Nice tutorial my friend
Have you ever thought of starting your own Youtube Channel? I bet you would be up there with LBP2-torials (comphermc) and SilverScorp. (ScorpSkull). (Sorry if I spelt your name wrong).
2012-04-19 01:57:00

Author:
Wolffy123
Posts: 406


pretty neat tutorial, I myself have a sackbot that uses logic to express emotion like a normal sackboy would, but it's made by a friend iBubek, I'll need to post some pics later to show how he did it, it's done with incremental sequencers, I like your method as well, pretty easy to follow along with 2012-04-19 02:34:00

Author:
damaz10
Posts: 771


Nicely done. I have one question though (sorry if you already answered it and I just missed it): does your chip make the bot behave exactly like a regular sackboy? By that, I mean if you're happy and you press down, do you switch to neutral or do you go straight from happy to sad?2012-04-19 10:54:00

Author:
Sehven
Posts: 2188


Nicely done. I have one question though (sorry if you already answered it and I just missed it): does your chip make the bot behave exactly like a regular sackboy? By that, I mean if you're happy and you press down, do you switch to neutral or do you go straight from happy to sad?

If you are happy and press down, you go to neutral; if you press down again after that you will turn sad.

However, if you are happy and press left or right you go straight to respectively scared and angry.
2012-04-19 11:00:00

Author:
Antikris
Posts: 1340


your tutorials are always so fun to read.2012-04-19 21:27:00

Author:
shane_danger
Posts: 283


I tried doing this before, I was way off.2012-04-19 21:30:00

Author:
Megaboy93
Posts: 77


Ah, finally one which works accurately! Nice use of the override on those microchips! Priority given to a single neutral chip there, plus the XOR gate, purely genius!
And the best part is that you can close the whole microchip if you want to be able to change the emotion for a cut-scene... but...
If you are Happyx3 and you close it for the cut-scene, you'll be Happyx1 when you get the control back. The fix would be an extra input in that 4-in OR coming from a battery-pulse thing like you did in each chip. Then you would be neutral. I would also add the possibility of overriding each emotion with a tag, and then we're ready for better transition where the cinematic would start with the sackbot change emotion gradually to the desired one, and end with an emotion which could then be changed using the system. Yay!
2012-04-20 23:09:00

Author:
Unknown User


If you are happy and press down, you go to neutral; if you press down again after that you will turn sad.

However, if you are happy and press left or right you go straight to respectively scared and angry.

So it works perfectly! Somehow yours looks more elegant and much less over-engineered than mine Kudos.

Something that I've thought about would be to make a game where you interact with other characters, but, instead of selecting a text reply as in KOTOR, Mass Effect and other Bioware RPGs, you would respond with your emotional state, and the other characters would react appropriately (so like if you're angry they'll try to apologize, if you're happy they'll respond positively, if you're sad they'll try to console you, etc).
2012-04-21 07:11:00

Author:
Sehven
Posts: 2188


Something that I've thought about would be to make a game where you interact with other characters, but, instead of selecting a text reply as in KOTOR, Mass Effect and other Bioware RPGs, you would respond with your emotional state, and the other characters would react appropriately (so like if you're angry they'll try to apologize, if you're happy they'll respond positively, if you're sad they'll try to console you, etc).

That would be awesome. After I made this tutorial I saw that it has potential for a d-pad menu as well, but your idea is so much cooler. It might be difficult for a player to predict an NPC's response, though, in order to make an informed decision on what emotion to show; if you can create an easy to learn pattern and ease the player into it before throwing him into the deep, I think you are holding a winning ticket here.
2012-04-21 10:36:00

Author:
Antikris
Posts: 1340


It might be difficult for a player to predict an NPC's response, though, in order to make an informed decision on what emotion to show; if you can create an easy to learn pattern and ease the player into it before throwing him into the deep, I think you are holding a winning ticket here.

Yeah, I hadn't really planned anything out beyond the "this is a neat idea" phase It didn't have any place in the level I was working on at the time so I just set it aside for later.
2012-04-22 04:24:00

Author:
Sehven
Posts: 2188


This, is, an, awesome, tutorial! The behaviors work perfectly. I haven't found any problems with it at all! Thank you very, very much for this tut.

2012-05-26 13:05:00

Author:
Unknown User


Nice! http://lbp.me/u/Shadowk302012-06-12 18:43:00

Author:
Unknown User


Keep in mind that each sackbot brain can have it's own "Animation Style". Most of the story characters animation styles have unique actions for their emotes. Ex. Sackbot putting his face in his hands and cries (Clive sad), smiling and clapping (Victoria Happy) etc. (Although, most of them are the same for any degree of the emote..) This allows for even more life-like sackbots and many more combinations of different animation styles built into one responsive sackbot. 2012-06-26 06:56:00

Author:
Dortr
Posts: 548


To anybody who has tried this, out of curiosity, what's the thermo hit like for adding in the additional 13 emotion chips, noticeable or negligible?2012-11-17 17:53:00

Author:
julesyjules
Posts: 1156


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.