Author Topic: Game Recording System  (Read 4420 times)

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6257
    • http://www.outpost2.net/~ck9
Game Recording System
« Reply #25 on: July 17, 2006, 08:00:33 AM »
*makes a mental note that, if he eve makes a game, it should be made to be able to be recorder-adaptable later*
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #26 on: July 20, 2006, 05:50:14 PM »
Well, another update on the recorder and playback system:

I figured out what was going wrong. It has nothing to do with packets being truncated or not recorded at all. What was happening was, I was setting the value that UsesMorale() gets to the opposite of what it should be. (After rereading the code for UsesMorale() in the exe, I realized what was happening). This caused the wrong morale setting, causing a game 'desynch' and crash.

After fixing this problem, recordings play through to the end as they should.

I also improved it in other ways:

- The recorder doesn't use a fixed filename anymore. When the game ends, it will pop up a Save File dialog asking you for the filename to save the recording to.
- The recorder will stop properly whether you close the game with the X in the upper right, by winning/losing, or by quitting through the game settings menu.
- The playback DLL overwrites its own DescBlock with that of the mission DLL. This way, the correct game mode is selected (single or multi), and other flags such as boolUnitMission will be set properly.

The next thing I plan on doing is seeing if it's possible to change the player viewpoint during play. This may or may not be possible by manually changing the value of TethysGame.localPlayer.

I also want to have other notifications recorded such as players getting dropped, etc. since these don't get saved at all. (The player will just stop building new units, etc.. their ore routes will continue going).

Some bugs/ugliness still exists, in that you have to use the loader when recording, and you have to use run script to load the playback.
Saving/loading still won't work yet.
« Last Edit: July 20, 2006, 05:51:18 PM by op2hacker »

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2902
Game Recording System
« Reply #27 on: July 20, 2006, 07:58:48 PM »
hmm now when I record a game, afterwords it asks me what I want to name it, which is cool, but when I save it it becomes this blank file called outpost2.ini that opens with notepad and is completely empty, I hit properties and its 0 bytes
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #28 on: July 21, 2006, 05:17:53 AM »
Hmm, that shouldn't be happening.

Are you actually typing in a name? Or just hitting 'Save'?

There should be no way that it's overwriting the INI file. Did this happen just once or every time?

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2902
Game Recording System
« Reply #29 on: July 21, 2006, 09:01:30 AM »
so far its happened every time, I put in different names, play different types of games, and the results are the same
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 405
Game Recording System
« Reply #30 on: July 21, 2006, 04:56:13 PM »
You might want to block the close the game messages from playing unless it's the last human player standing, as soon as someone quits, the recording will quit  :(.

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
Game Recording System
« Reply #31 on: July 21, 2006, 05:19:03 PM »
Though, you still want it to react to different methods of quitting (self destruct, transfer, etc.).

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 405
Game Recording System
« Reply #32 on: July 22, 2006, 08:50:43 AM »
The recording I made for CCF is messed up badly. Researches are ignored, and random events arn't replicated to name a few. However, it may have been caused by a partial game desync.
« Last Edit: August 06, 2006, 08:11:36 AM by Mcshay »

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #33 on: August 08, 2006, 05:04:05 AM »
Yeah, if the game desynched when you were playing it, there's a very high probability that it could mess up playback.

Offline Amrazek

  • Newbie
  • *
  • Posts: 17
Game Recording System
« Reply #34 on: August 08, 2006, 12:42:05 PM »
I realize this is being primarily done for multiplayer, but are there any plans to allow its use in singleplayer too?   :D
 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4114
Game Recording System
« Reply #35 on: August 08, 2006, 01:04:40 PM »
thanks for your work.

sounding good :)

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #36 on: August 08, 2006, 01:53:13 PM »
Yes, it will be able to record all types of games.

Single player in fact was the first type of game I tested it on.

Basically, the recorder kicks in for every game. It gives you an option to save the recording (well, currently it's a big ugly box that pops up asking for a filename) at the end of the game.

Offline Amrazek

  • Newbie
  • *
  • Posts: 17
Game Recording System
« Reply #37 on: August 25, 2006, 11:10:30 AM »
Any progress so far?  Looking forward to it greatly  :D  

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #38 on: August 25, 2006, 12:10:31 PM »
I haven't been working on it lately, been working on the mapper mainly.

I hear plenty of reports about it crashing though :/ Sirbomber, Arklon, Mcshay have all tried recording various games (odd bugs or crashes would be happening).

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
Game Recording System
« Reply #39 on: August 25, 2006, 01:57:56 PM »
Quote
Sirbomber, Arklon, Mcshay
Yes, the Three Stooges.

And we managed to get a recording stuck in an endless loop (not a crash loop, but it would repeat the same few commands over and over and over endlessly).

Offline Amrazek

  • Newbie
  • *
  • Posts: 17
Game Recording System
« Reply #40 on: October 10, 2006, 12:42:24 PM »
So ...  How's it coming?  :D  

Offline Brazilian Fan

  • Sr. Member
  • ****
  • Posts: 303
Game Recording System
« Reply #41 on: October 10, 2006, 01:50:50 PM »
Where can i get it? :heh:  

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3170
Game Recording System
« Reply #42 on: October 11, 2006, 12:57:31 PM »
Wow!
I just played a recording. You heard me correctly.
During the original game, I used a... "special tool" that caused the game to end, but during the recording (with said tool disabled) it never ended. When the recorded packets stopped I was able to control Player 1's (in this case, Fox's) (ex-)base. Or the Earthworker in the corner (the only thing left to control). I could idle structures too.

Now, if only there was a program that saved how everything was on a map and exported it to a dll (or a form ready to be imported into a dll).
« Last Edit: October 11, 2006, 01:02:38 PM by Sirbomber »
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4114
Game Recording System
« Reply #43 on: November 12, 2006, 10:46:21 AM »
Hows it coming ? :D

Offline Brazilian Fan

  • Sr. Member
  • ****
  • Posts: 303
Game Recording System
« Reply #44 on: December 25, 2006, 06:33:16 AM »
So, any news?

Offline Moley

  • Jr. Member
  • **
  • Posts: 95
Game Recording System
« Reply #45 on: January 03, 2009, 04:23:38 PM »
its so anoing that you put up all of this cool stuf and even people saying thay have it and it is awsome but dont put up a download <_<
EDIT:ummmmm...... sry for that rude bump
« Last Edit: January 10, 2009, 05:52:01 PM by Moley »
I HATE SPELLING!!!!!!
if i spell something or screw up grammer,
ignore it or tell me if you dont understand what i typed.

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3170
Game Recording System
« Reply #46 on: January 03, 2009, 05:49:59 PM »
This is over two years old... Besides, there's no download because it was buggy and didn't work right in most cases.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3103
Game Recording System
« Reply #47 on: January 05, 2009, 09:25:20 AM »
Seeing as how this project has kinda fallen "into the void" I may as well "resurrect" it a little bit, as the concept was kinda cool, so I might as well publicize the download for it. (It doesn't work right half the time anyhow).

Installing

First of all, you can download it from here: http://blackbox.outpost2.net/op2recorder-2.zip

Extract the zip into your Outpost 2 game directory.

Recording a game

To record a game, start Loader.exe (it will start Outpost2.exe and hook certain code that is needed to capture command packets), and host/join a multiplayer game "as usual." If you don't start the game with Loader.exe the recording functionality will not be enabled and you will not be able to record games.

Play the game as usual. When the game terminates, you should get a box asking where you want to save a .rec file (this file contains the record of ingame events, etc. used to try to play back a game).

At this point, if you want to play another game I recommend that you exit the game and restart it (again, use the Loader if you want to record the game).

Playing back a recording

Start Outpost 2 normally (WITHOUT the loader, if you start it with the loader all sorts of odd things are going to happen when you play back the recording and it will probably crash). (To be safe, exit all copies of OP2 you have running and restart them normally without using the recorder loader).

At the main menu, press D to access the debug menu. Click "run script."
You should be given a list of DLL files. Find op2playback.dll in the list and select it. Press OK (you don't need to bother with any of the options at the bottom of the screen).

A box should pop up asking for a .rec file to load. Select the file you want to load. After this, the game should load, hopefully starting to play back the recording (you'll be seeing it from player 1's perspective).

This is where it tends to get buggy. The recording tends to desync, so you may start seeing very unusual things happening (things building in the wrong places, research being done that was never done), etc. or it may just crash. So in this regard "use at your own risk" -- I make no guarantees that it's going to work right. (And it probably won't).

Sometime I'll find the source to this, clean it up, and post it up on SVN if people want to work on this and try to make it work properly.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 3857
Game Recording System
« Reply #48 on: January 05, 2009, 10:05:04 PM »
Hmm, yes, I'd like to get my hands on the source to this toy. :)

I'm guessing either insufficient starting state got saved, or dropped/reissued network packets could be the cause of the desync. Either that, or the right packets get reissued at the wrong time. I've been giving some thought to the packet execution delay when pondering things such as this.