Post subject: Movie Resync (game development)
nesrocks
He/Him
Player (247)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
So, I'm making a game for PC. The game is a tile based vertical platformer with intertia physics. It has ladders and enemies. For the purposes of this thread, think resyncing a game like NES Ice Climber. It has proven to be very difficult to program an AI that can play the level optimally, or even find the right path to the end (there may be dead ends). So I implemented input sequence recording for my own use. I play the level once, so the AI has at least one valid solution as to how to reach the end of the level. This is working perfectly. Now for the next step, I want to program some simple terrain movement algorhythms so the AI can get off track and do some stuff that would be different on each playthrough (mainly fight enemies). It is a multiplayer game, so the other player causes unpredictable things to happen. I'm now thinking how to make it resync to the input sequence. For each keyframe (that is, a frame where a difference in input has been detected), I save not only each button state, but also x, y, xspeed, yspeed and frame difference from the last keyframe. I'm thinking this may prove to be very difficult to resync, but there are some points that I can consider: - Some waypoints are easier to sync than others. Those waypoints where xspeed and yspeed are zero are really easy to resync to. The waypoints where at least one of these is zero may be hard to sync, and those where neither is 0 may be very difficult to sync. - This may be prone to programming oversights where some situations were not foreseen and the AI can't sync. I hope can debug and refine this if it happens. - Slight variations on x, y, xspeed or yspeed may be rounded if it is close enough, so the AI can resync without the user noticing (the character "snaps" into place on resync). Does anyone have any ideas?
Dimon12321
He/Him
Editor, Reviewer, Experienced player (597)
Joined: 4/5/2014
Posts: 1229
Location: Romania
I'm not a professional analyst, but I shall attempt. The more complex physics you make, the more difficult is to repeat the footage (walkthrough) using the same input. Let's take a medium level with all main assumed technics, objects and enemies you have constructed. If you gonna follow your plan, so, at best, AI will pass a level like you did. At worst, something will become wrong. Here is the main perpetrator: RNG. It must be exact! So, IMO AI should work like a bot, not like an input playbacker. It should process a route itself. Will it find a ladder or a small platform if it go left/right? If an enemy throws a fire at it, when it's a good moment to crouch/jump over? Should it go up, if an enemy is above the ladder? And so on. You can simplify the route by marking spesific places (creating special attributes that will route the AI), make the AI to try again if it can't jump on a platform, create a command list to make the players cooperate with AI. Here is my idea. You are the constructor, so you choose!
TASing is like making a film: only the best takes are shown in the final movie.
nesrocks
He/Him
Player (247)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Thanks for the reply! The problem is that I have a hard time programming the AI to find paths, considering it is not a top-down game like gauntlet. It is a game like super mario bros, and it can get quite complex to find the path because there are physics to consider. Maybe in the end I'll still use waypoints generated by me playing the level so the AI can know that those represent a valid path, but the AI will know how to traverse it instead of blindly following the input. I guess I'll have to do a lot of programming and testing... By the way, the input is not desyncing currently. It plays back my gameplay 100% of the time. What I wanted to do was to make the AI decide to stop following the input briefly, but then go back to it.