collabot thread
Hello there.
Woah there are some new names in this clan that I haven't met before, nice to meet you! Hope you'll
at least stay for a week enjoy your stay here. :)
I'm back again from my usual inactivity period, only this time I've brought a quite unusual stuff with me.
If you have time to kill, please watch this video and then click that spoiler thingy below.
Update 2016/08/15: video is outdated, see this post
You clicked the spoiler button. I'll assume that you have watched the video.
Note that the video you just watched is a product of a socially inexperienced cave-dweller who tried his best to get his point across without being boring.
Even though he gave his best effort, he realized that the video is far from perfect. So here is a recap and some additional informations.
Video Recap:- Collabot (tentative name) is a bot that lets you and some other people to control it in-game, so you and those other people can "play" at the same time.
- You can request a bot at the deployment page.
- In the game, you can control the bot using the collabot_controller.lua script. (Attached below)
- The people who may control the bot are called "masters". There is also a special kind of master which called the "grandmaster".
- A grandmaster has additional operator powers over the bot. They can force-enter and force-spec a bot, add/remove player to a bot's masters list, and also dismiss a bot at any time. (Bot Commands will be detailed below)
- A bot is controlled through whisper messages that will be generated by the controller script. (Bot Control will be detailed below)
- There are currently 2 control modes that determine how the masters may control their bot: Free Control Mode and Roulette Mode. (Control Modes will be detailed below)
- The bot may not be used in official rooms. Not that you can summon a collabot there anyway, I have prevented it. (But in case I wrote a faulty code and it lets you summon a bot to an official room, please inform me)
- Collabot is made not to enhance the current gameplay, but to provide a new "cooperative" experience. Honestly, it was inspired from twitch plays pokemon and I don't know how it would work in toribash :v
Bot Control:- Click on any joint to change its state.
- Press Z on a joint to cycle between contracting/extending state (or their counterparts in some joints).
- Press X on a joint to cycle between holding/relaxing state.
- Press C on a joint to hold/relax all the joints.
- Press V on a wrist to change its respective hand's grip state.
All the changes that you've made are local (meaning that the bot's actual joint/grip states stay unchanged) unless you submit those changes.
Unsubmitted changes are indicated by yellow overlays.
- Press Left Shift + Space to submit your joint/grip changes. Submitting will make the bot actually change its joints/grips. It does NOT end the turn.
- Press Backspace to revert all your unsubmitted joints and grips changes so they match the bot's current states.
- Press Space to confirm the bot's current joint/grip states and end the turn.
Whether you are able to submit/confirm the bot's states or not depends on the Control Mode.
Control Modes:- Free Control:
- Every master can submit and confirm the bot's states.
- May become a hell of a mess if not properly coordinated.
- Roulette:
- Each turn only one master may submit states changes and confirm the bot's states. This master is called the active master.
- An active master is chosen randomly from the bot's masters list every a set number of turns.
- Partial Control (not implemented yet):
- The summoner (one who requests the bot) or grandmaster for the bot must specify which parts of the bot that can be controlled for each master.
- Each turn, every master may simultaneously control the bot, but limited only to the parts that they may control.
- May become a hell of a mess even if properly coordinated.
Bot Commands:- /set_bot X: sets the current active bot to X. This is the first command that you have to run.
- /bot_reactiontime X: sets the bot's max reaction time to X. It means that when X seconds have passed since the beginning of a turn, the bot will auto-confirm its current state if it hasn't been confirmed yet.
- /bot_masters: lists the bot's current masters.
- /bot_setmaster X: [Grandmaster Only] add X to bot's masters list.
- /bot_unsetmaster X: [Grandmaster Only] remove X from bot's masters list
- /bot_clearmaster: [Grandmaster Only] remove all masters from the masters list, except the grandmaster.
- /bot_grandmaster: displays bot's current grandmaster.
- /bot_setgrandmaster X: [Grandmaster Only] change bot's current grandmaster to X.
- /bot_enter: [Grandmaster Only] force-enter the bot.
- /bot_spec: [Grandmaster Only] force-spec the bot.
- /bot_dismiss: [Grandmaster Only] kicks the bot softly.
- /c YOUR_MESSAGE: broadcasts YOUR_MESSAGE to all of the bot's masters.
- /deactivate: deactivates the controller. To be able to control a bot, you must use the /set_bot command again.
Some things to note:- The bot doesn't like to be left alone.
It checks for its grandmaster's presence every 30 seconds. If it fails to find its grandmaster in the room, its heart will be filled with dread and will promptly leave the room.
(I made this rule so there will be no bots camping in some rooms because their grandmaster didn't/forgot to dismiss them)
- The server will kick you if you are too hyperactive.
Remember that bot controls are submitted through whisper message? Well, it turns out the function to generate a whisper through lua script is a little bit wonky.
Sometimes instead of just sending the intended whisper message, it also sends the duplicate of that message plus some junk data.
This (partly) was the one that caused me getting flood kicked out of the server in the video.
The way to prevent that unwanted kicks from happening is to give some delay between every whisper messages sent to the bot.
This includes state changes, state confirmations, /c messages, and every bot command invocation (excluding /set_bot and /deactivate).
I'm still trying to find the best way to handle this problem, but until then we'll have to stick to that "safety advice".
Last but certainly not least:
- THE BOT HASN'T BEEN PROPERLY TESTED YET.
As you can see in the video, I was using the bot alone. I haven't tested it with two or more people yet (lolstupid). I've tested the bot but without the "colla" part.
So if you are interested in testing the bot with me, let me know, that would be great.
k so what do you think?
tbh a part of me still thinks that this concept is stupid lol, but at least by posting it here I will know whether that part of me is right or not.
Anyway, thanks for spending your time watching/reading this. I'm going to take a quick nap.
Link to the deployment page:
http://nodejs-fgnds.rhcloud.com.
I've temporarily added a passphrase field in the form for security reasons. If you want to test the bot, PM me or reply here to request the passphrase.
Last edited by J0Y; Aug 16, 2016 at 08:00 AM.