Programmable robot?

I want a robot that can be programmed, and also will improve its ability to do the task for which it is programmed. Difficulty: the task has multiple steps and how well it performs relates to all the steps being included and in order. Some steps can be skipped or put in an arbitrary order, and the task will still be complete.
Now, I know there’s an example of a robot that can learn by watching the player, but I want the robot to be told to complete each step and know that it’s part of the task it’s being taught. Any help would be appreciated.

Here’s how I would do this:

Borrow the implementation from Robo 2 that allows the player to give a robot a set of commands to follow as a program. (Not Robo 1, which is not detailed enough.)

When the player starts writing a new robot program, though:

– change the command prompt to show that the player is in a new mode of interaction and commands will be taken as robot instructions;
– parse the player’s commands but don’t actually follow through on them. Intercept really early in the action sequence – putting something in ‘setting action variables for…’ might work [hacky] or [cleaner] you might add a step to the action sequence entirely that just checks whether the player is in programming mode and if so aborts the action and stores it as part of the robot’s program. See the “Delicious, Delicious Rocks” example for how to add a step to the action processing rules in general;
– end this mode when the player stops programming.

Interesting solution. I was thinking I would use “robot, blah” but this seems more elegant.
Now, what about the other half of it: determining that the training is complete (has all the steps and in the right order), while allowing the task to be done anyway if the training is half-assed?

You could do that, if you wanted to instead redirect from the persuasion rules (say). But this way would be less typing for the player.

Need more information there. I was assuming that you had a world model for the robot to interact with using its programming, and you were just going to test afterward whether the thing it was supposed to be achieving had, in fact, been achieved.

If that’s not the case, then I guess you write some code to look at the program and decide whether it fits certain requirements you have – but without knowing what the requirements are in more detail, I can’t advise.

Hmmm… let’s say the robot’s task is to clean the room. It has to pick up the trash and put it to the garbage can. It has to dust corners and wipe down the walls, as well as mop the floor. Each of those sub-tasks has a cleaning item it has to pick up. If it does everything, the task is 100% complete. However, it could just pick up the trash or just run the dry mop over the floor, and the player will get some feedback that it completed the task, but not very well. So they can retrain it and add more to the task. This should also allow some screwups too - after mopping the floor, it picks up the trash which just gets the floor dirty again.

In that case, yeah, I would definitely just code this as an actual simulation of a cleanable room, and let the robot actually interact with it. That way the player gets to see the step-by-step interaction the robot has with the environment and get full feedback on what goes wrong at each step.

So:

– model the room that needs to be cleaned and the cleaning tools required;

– write any custom cleaning commands you need using the instructions in the Advanced Actions chapter so that they can be performed by someone other than the player; make these commands have Carry Out rules that do whatever world state changes you need (e.g., when someone moves the trash, the floor becomes dirty again). Also add some responses if the player tries to do these cleaning actions himself. (A check rule to say “That’s the robot’s job!” or the like, if you want to make sure that the player delegates.)

– if you need to do scoring/a puzzle solution based on this, check the world state every time the robot program ends and confirm that everything that needs to be clean is clean. If so, mark the puzzle complete; if not, add some comment to the player that the cleaning attempt could have gone better. (They will presumably already have seen why it went wrong by watching the robot.)