Precognition?

Blitz3D Forums/Blitz3D Programming/Precognition?

PoliteProgrammer(Posted 2007) [#1]
Hi all!
I've been thinking about this idea for some time now. I'm thinking about how a system that gives the user a limited insight into the future would work.

Let me clarify:
I want a system where the player can see the actions of an NPC in advance and react accordingly. The delay would only be short, say ~1 second. You'd see what they were about to do (at ~ 25% opacity) before they did it.

Now, my real question is - how? Of course, I could have two sets of variables e.g. x_future and x_now
The main program loop would change ONLY the future variables. A special function would update each variable x_now with the value x_future after say 1 second.

But, how would you do it? I'm looking for a more elegant solution than what I've suggestion above, so any other suggestions would be welcomed!

J


Danny(Posted 2007) [#2]
Ok forget about precognition - for now.

First create an ai routine where your npc's react to what they see NOW (which is difficult enough ;).

Once you got that to work, you should be able to relatively easy tweak it to what you want - by simply feeding the NPC's FALSE information!

So instead of providing the location of where the player is NOW for example, you give it the location of 'where you predict the player will be in 1 second from now'.
Direction Vector * velocity is your faked / predicted location.

With that idea you can take it further...

Predicting how the player would react is ofcourse slightly more tricky. But if he's attacked, good chance he will defend himself with his currently equipped weapon...

hope that helps,
Danny


Paul "Taiphoz"(Posted 2007) [#3]
What I would do is this.

I would create my NPC, I would set my NPC to 25% Alpha, and I would make it do what ever I needed it to do, ok so you know have an NPC walking around doing its thing that looks like a ghost.

All you need to do now is give it a friend, a copy of the NPC set to 100% thats just using the first NPC's old vecotrs as its current vecotrs. if you follow me.

To the player, it would look as tho he's seeing a ghost image of what the NPC at the back is about to do, when in reality all he is seeing is the NPC at the back just copying the one at the front which happens to be set to 25% alpha.

Nice and simple and does not require any fancy coding.