Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Need opinions/input about my planned replay system implementation

Discussion in 'Editor & General Support' started by Deleted User, Sep 28, 2013.

  1. Deleted User

    Deleted User

    Guest

    Hey there everyone. Right now, I'm in the planning stage of the development of my first Unity game. I really need to get your thoughts/input about this certain issue I'm facing and how I will tackle it. Oh yeah... I have a small amount of experience in programming so while I can't really call myself an expert, I'm not really a total beginner. With that out of the way, here I go.

    I'm planning to develop a 3D side-scrolling platformer game for the iOS (minimum iPhone 4). One of the features I want to implement is a replay system so players can upload their own gameplay on some kind of leaderboard and show to others how they went about with the level. The fact that I'm trying to develop a replay system for my iOS game kinda throws me off already since I've heard some pretty bad stuff about it when it comes to memory. :(

    I'll go out on a limb and say that:
    • The game would run at 30fps (wanted to go for 60, but hogging battery power doesn't sound ideal to me).
    • A stage can take a maximum of 300 seconds to finish (if the player really wants to upload their first time in the stage).
    • There's going to be a maximum of 5 buttons (left, right, jump and 2 special skills).
    • The camera will always follow the player.
    • Physics are only utilized in the game for basic stuff like collision detection.
    • Enemies only appear in placed spawn points once players get close enough to them, and they will have fixed behaviors.
    With all that and memory limitation in mind, I've decided to focus on storing player input and enemy spawn states (via boolean values) every frame and use that data in a simulation that can recreate the player's gameplay. So I think it goes like this?

    At every frame :
    Check and save player input state
    Check and save enemy spawn point state (if enemy has been spawned yet)

    If I'm thinking right, I'd be able to make a replay of the same gameplay by recreating the same player input . Since enemies do the same thing once they spawn, I guess only have to worry about spawning them at the right time in the simulation (hence the spawn check). Only problem I can see with this is if I want to start adding behavior variation during development.

    I might have missed some other stuff, but this is what I have so far. All this was based on a small research I did online. Am I miraculously on the right track, or did I screw up big time from the start? And if I was actually right, any way I can improve this at all? How would I go about this in Unity? (A clue is fine, but in-depth stuff will be really appreciated.)

    Thanks for taking the time to read my post. :)
     
  2. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,700