• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
vlad2048

General advice on making a replay system ?

8 posts in this topic

I've already made the beginning of a 2d (4p max) multiplayer game on ipad. I'm using cocos2d. The games last maximum 1 minute. I want to get a replay of the most epic ones and use them to decorate the front menu (kind of sceensaver function)
I've already done some replay system (for the same game on PC), but they had some problems/bugs. Mainly from a lack of a consistent interface across all the game objects for replays. I know it's very vague sorry.

My question is, do you have any general advice on making a replay system ?

Even if it's stupid advice. Like "implement StartRecord() and StopRecord()", any advice from someone who has implemented one. Like a postmortem on gamasutra would be great
0

Share this post


Link to post
Share on other sites
I created a replay system my game. In my case, the task was made a lot easier because I'd thought about that feature from the very beginning and the game code design was designed in a way to make replays easy.

If it's not too late, I'd suggest designing your code with this in mind. The most important part is to isolate everything as much as possible. In my case, the main game is encapsulated in a class that has a function which is basically Update(input)
The game only relies on the arguments to the update function and doesn't try to read anything externally. That way you can pass in either inputs from an actual device or prerecorded inputs and everything will work the same. Also, when you start a new game, an entirely new instance of the game class is created, so there's no issues with accidentally forgetting to reset variables or the like.


The biggest problem I had was floating points. It turns out that due to the boneheaded design of the Intel FPU, floating point math is not necessarily deterministic in the sense that the same source code can lead to different results. (I believe that it is deterministic at the machine code level if you're careful with rounding modes, but who wants to program that way?). I discovered that there were actually differences between my game behavior between debug and release builds due to this problem. I ended up linking the debug build of my game to a version of the physics engine compiled in release mode, which made most of the problems go away. It could still theoretically be nondeterminsitic but I have yet to see a problem.
0

Share this post


Link to post
Share on other sites
Thanks very interesting.
I will go the route of recording the inputs, it's definitely the easiest. And try to make it as seamless as possible in my code. I need to work within the cocos2d framework though but it should be possible

Also the gamasutra article mentions using a stream to avoid having to create data structures. This seems like a brilliant idea, I'll try that
0

Share this post


Link to post
Share on other sites
Personally, I just used std::stream and store the (run length encoded) numbers in text form. Binary would save space but it's more complicated to code and it's nice to be able to inspect the replays manually anyway.
0

Share this post


Link to post
Share on other sites
Without reading the article, or have any prior experience of writing replays, here's what my brain came out with:

1. Fixed-rate framerate. 30fps, or whatever. At least the logic part of your game, if you go with multithreaded.
2. Record all actions with timestamps and frame when they occur. Actions should also record all randomized values.
3. You are going to end up with a long list of actions.
4. Replay them.
0

Share this post


Link to post
Share on other sites
[quote name='alnite' timestamp='1304555066' post='4806670']
Without reading the article, or have any prior experience of writing replays, here's what my brain came out with:

1. Fixed-rate framerate. 30fps, or whatever. At least the logic part of your game, if you go with multithreaded.
2. Record all actions with timestamps and frame when they occur. Actions should also record all randomized values.
3. You are going to end up with a long list of actions.
4. Replay them.
[/quote]

That's the basic idea, but RLE is more efficient than timestamping while being just as easy to implement.
0

Share this post


Link to post
Share on other sites
My replay system that i used basically stored all the objects on the screen at a fixed time, like every 60 mS. I found minor inconsistencies when using the Input method that and I didn't always get the same replay. So, to guarantee I didn't have that issue, I just stored the location of the objects (as well as when sounds go off). Make sure you squeeze this into as small a format as you can, but, for 1 minute, this shouldn't be that big. You could look at using zlib to compress and uncompress when storing it off.

FWIW, it's really neat, as I would record the last stage of my side-scrolling shoot-em up, and, after you beat the game, while the credits are rolling, it would be replaying the last level in the background. i thought it was awesome :)

GL!
0

Share this post


Link to post
Share on other sites
[quote name='vlad2048' timestamp='1304469399' post='4806200']
I've already made the beginning of a 2d (4p max) multiplayer game on ipad. I'm using cocos2d. The games last maximum 1 minute. I want to get a replay of the most epic ones and use them to decorate the front menu (kind of sceensaver function)
I've already done some replay system (for the same game on PC), but they had some problems/bugs. Mainly from a lack of a consistent interface across all the game objects for replays. I know it's very vague sorry.

My question is, do you have any general advice on making a replay system ?

Even if it's stupid advice. Like "implement StartRecord() and StopRecord()", any advice from someone who has implemented one. Like a postmortem on gamasutra would be great
[/quote]

Since you have a multiplayer game (this assumes its playable over the network and not just local multiplayer), just record the initial game state when you want to start the replay, and record all of the network messages afterwards (both that you send and receive). Playing back the network messages will give you a full replay. If the game only lasts a minute maximum, just always record all of the network messages.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0