How would I make an object copy a players movements and then replay it later on?Now

Dear Blenderartists,
Hey guys Jon here. Last night I started development for a new game I’m creating called “Clock Blockers”. The game is based on the concept thought up by samandniko of CorridorDigital. They made a video of it here:https://www.youtube.com/watch?v=CBawCe6du3w
So basically how the game works is that their are 5 rounds. During those rounds the players(2) will try to kill each other in various ways. Once the oppenent dies or the round ends, the next round starts, except this time, another instance of the player would be added on each team. What happened the first round between the two players still happens, but the second instance of the player can change the outcome by helping their’ previous instance. You should watch the video if you want to truly understand the concept.

Recently I have run into a conundrum. In order for this game to work, I need to be able to replay a player’s actions. Like a macro of sorts, but on a different object. How can you make an object follow a player’s actions after the player’s action has already been executed?
Thanks,
Jon

Moved from “General Forums > Blender and CG Discussions” to “Game Engine > Game Engine Support and Discussion”

You’d need to write a script that logs your player’s actions to a dictionary (or a series of properties, maybe?) then have your AI extract that log to use as instructions.

Like, for example, if your player walks, have the system log which direction and for how long the player walks. Then, log when the player stops. Then, log when the player walks again. Then, log when the player uses something/attacks/etc. And in your AI script, use the logs to move your AI.

As suggested, you can simply log actions over time, and play them back.

That said: The video doesn’t really clear up the details of gameplay, so it’s hard to determine how difficult it would be to encode the mechanics.

When any of your earlier copies are “unlinked” what happens to your current copy? Does it just stand around until the unlinked copy dies? How exactly are those control adoption rules defined? Also, what would be the precise algorithm for triggering an “unlink” on a given entity? In the tire example, the unlink operation is first performed on the entity hiding behind the tire, and then on the entity who can suddenly see him. If those are truly the preconditions for an unlink, the code would be something like:


if no_longer_hiding or can_see_enemy:
    unlink()

But how do you distinguish between entities that are actively hiding, and those that are merely occluded by some object in the world? And how do you distinguish between something being visible, and something that a human player would actually see?

… I think this is one of those game ideas that works better as a movie than it would as an actual game.

So how would one go about doing this? I’m not fluent in python…

Yeah, this kinda thing kinda requires Python fluency. =P
It’s a pretty grand idea for a game project, so if you’re unfamiliar with the development process, you should probably learn the ropes of the GE first, and learn some Python in the process.

You might have a look at TimeShift - record location and orientation, replay it later at another object (2.49-2.5+)

How about appending position and orientation in a list every frame and then iterating through that list setting the positions and orientations in order later on? That’s the simplest method I can think of but it can cause huge, Huge memory leaks.

As for a proper method, as Monster suggested, you can try timeShift and see if it works with the current blender version. (Not on my pc to test it)