Possibility of creating replay feature in C2

Get help using Construct 2

Post » Thu May 09, 2013 1:46 pm

In the past, I used to create a simple replay system in a framerate dependent game. Basically, from the start of the stage, I logged which keys do the player pressed and released at which frames. It works just fine with simple game loop (I don't even have frameskipping at that time)

Now in C2, since we got ourselves independent framerate here and the ways things go around are different. If I am to record all the keys that the player pressed and released, I will need some ways for this. The same program running twice may result in very tiny bit timetick and this might not work.

So anyone got an idea?

I prefer to log just the keys pressed and released and the random seed values to make the original run and the replay run identical. But sure, there are more matters at hand. Still, we have such replay feature in Team Fortress 2, so it should be possible. Furthermore, Blizzard's Heart of the Swarm kicks this up a notch by allowing the player to "drop in" and continue from any part of the replay.

While recording software allows us to store everything we see on the screen into a video file, the problem is the file could be big, especially on longer replay.keroberos2013-05-09 13:53:51
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
22
S
9
G
11
Posts: 408
Reputation: 7,990

Post » Fri May 10, 2013 1:28 am

Yes, it's possible, it's really complex if you use array for every objects that record the values like X, Y, Instance variables, etc.

You can save .json as replay file from array, then load .json file to play the replay.

R0J0Hound made this simple version of ghost replay, you may research it:
http://dl.dropbox.com/u/5426011/examples16/mario_record.capxJoannesalfa2013-05-10 01:28:40
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Fri May 10, 2013 1:48 am

Interesting... is there perhaps a way to record replay data, save it, and then put it back into the game as a demonstration of how to play the game, similar to the Luigi help feature in Mario Bros WiiU?

*EDIT
Or is that what you said? ow do we save JSON data so that it can be used later?AnD4D2013-05-10 01:50:07
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 929
Reputation: 9,356

Post » Fri May 10, 2013 2:31 am

@AnD4D yes, take a look .capx, i've recorded the demo and it loads the replay on start.

https://dl.dropboxusercontent.com/u/76227787/demomario.capx
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Thu Feb 13, 2014 9:54 pm

Hi,

I downloaded your example, and its incredible how simple the code looks like. But, I have trouble understanding how it works (I am pretty new to C2).

Do you think you could write a short explanation of the design principles behind it, and how it works?

thanks,

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354


Return to How do I....?

Who is online

Users browsing this forum: badmoodtaylor and 10 guests