Saturday, November 30, 2013
Nodal interface, missions, and delegation. But let's talk about missions...they're most interesting
One of the many challenges that I face with implementing missions is determining when an actor is "responsible" for the success or failure of the mission. A mission is, fundamentally, saying "I want X to happen and I'll pay Y if it does." Well, that's what a mission
seems to be saying. But that's not quite right, let's be more careful how we phrase that: "I want X to happen and I'll pay
you Y if
you make it so." Yes, in order to be compensated for anything,
you must be the one to cause it, directly or indirectly. But this implies that we can look at the state of the world and understand how it got that way. Well, even worse, it implies that we understand
who made it that way. Like all AI-related things, it looks easy from the outside, but is most definitely not.
It's not even that the problem is one of implementation. It's also a real conceptual / philosophical question. Suppose you put a bounty on X. Suppose that bounty hunters Y, Z, and W go after X. Y takes 99% of X's health, but at the last moment, Z swoops in and happens to deliver the killing blow. W is nowhere to be seen. Who gets the bounty? A naive trigger such as "if this bullet causes death, credit the owner with the death of this ship" would say that Z deserves credit. Does he? Maybe, I guess it's not too bad if we give it to him. But even the ability to recognize Z as the responsible party requires some work - in particular, we have to define some trigger logic in the world to keep track of it. Without that logic, we'd have no idea whether Y, Z, W, or that massive asteroid that appeared out of nowhere was to blame for the death of X. But how do you generalize that logic? How do you keep track of actions in a generic way?
Here's an idea: perhaps you log the state of the world before an actor is given a turn to influence anything, then you log the state after the actor performs his actions for the frame. Any differentials are credited to the actor. This would solve the aforementioned case. Or wait, would it?
No, it wouldn't, because it's not the person who kills - it's not even the gun - it's the bullet, right? But the bullet is in motion via natural physical laws. Once out of the chamber, it really doesn't have anything to do with the person anymore. So does the bounty belong to mother nature?
How do we know who fired the bullet? "Duh, just mark the bullet when a person fires one." Of course, an obvious and intuitive solution, but how do you generalize that? How do you provide "backtrace" information for every entity in the game that's involved in some sequence of events? Do you have to log every tiny detail of everything that happens, just so that you can look back to figure out "whodunnit"?
As always, lots of questions
But these are at least some pretty fun conceptual ones
Tomorrow I head back to the coding cave. Really looking forward to doing some late-night code sprinting to pull some more stuff together for the video
Also looking forward to seeing LT in all it's shiny glory again, as it just doesn't look that fantastic on this HD4000
PS ~ I'm going to stop posting the devtime.ltheory.com link until it's fixed again...kind of misleading for the time being