TREP重大技术突破---录像与回放

作者 maxchen, 2007 十一月 12, 12:24:34

« 上一篇主题 - 下一篇主题 »

maxchen

引用费茨注:关于TREP请参考
http://www.gmly.info/wiki/doku.php?id=%E8%87%AA%E5%88%B6%E5%85%B3%E5%8D%A1:trep

引用自: 中文版游戏流程录制与回放
游戏流程录制与回放,在我看来,这个功能是TR4引擎自制补丁有史以来最为先进与强大的补丁。你可能会问:为什么?因为这个补丁允许你录制游戏的流程并进行回放!也许,你会记得在PC版的TR4与TR2的试玩版里有类似的功能,但他们只能回放CORE预先使用第三方工具录制的游戏流程,也就是说不允许玩家录制自己的游戏流程。但现在,有了这个补丁,你就可以录制你自己的游戏流程,比如如何解谜,如何跑限时门,如何通过一些高难度动作取得秘密地点等等。而且随着不断的研究与深入,有可能能在同一个关卡不同关里连续录制,更重要的是,实录之间哪怕很长,存储的文件也很小(译者:我测试录制10分钟,再用ZIP格式打包,文件只有80K)。

现在游戏流程录制的机制其实很简单,就是只记录玩家的输入(如键盘)与LARA的位置以及速度值。这就意味着只要使用TREP对如重力,武器参数,尖刺或者滚球的行为等项目进行修改都会严重影响游戏流程的回放。例如:你录制的一段游戏流程,然后使用TREP对tomb4.exe进行修改,当你重新回放你的游戏流程的时候,就会出现很奇怪的事情。如LARA卡在墙里了,自动使用了错误的物件等等。还有,现在TREP把很多的参数记录存放在SCRIPT2.DAT里,所以错误的使用SCRIPT2.DAT也会可能出错。所以有一条原则是一定要遵守的:录制与回放游戏流程一定要使用相同的tomb4.exe与SCRIPT2.DAT,相同的TREP设置。



另外一点,录制游戏流程的过程中,请不要使用武器与药包的快捷键。因为TR4引擎对这些快捷键的处理跟其他控制键不一样,它们的数据是不能写道游戏流程存档文件中的。

游戏流程录制与回放的过程中,游戏会实时的显示一些关键的信息在屏幕上。在录制的时候,游戏画面上会显示已经录制的时间,存档文件占用的磁盘空间与总共使用的帧数。同时,在屏幕的上方会显示一个用于表示录制缓冲区使用状况的小进度条。程序在录制的过程中,是以8K为一个单位进行存储,进度条完成一次,就等于程序已经把8K的数据存储到磁盘中。而回放游戏流程的时候,画面上会显示这个游戏流程的总长度,现在已经播放的时间与这个游戏流程所占用的磁盘空间。

下面来介绍一下如何进行录制与回放。首先,你可以录制33个不同的游戏流程(从0到32),要进行切换时,只要按F3,程序就自动使用下一个游戏流程,按SHIFT+F3,程序会切换回前一个游戏流程。而且,在游戏进行总与显示动画店时候,都可以切换游戏流程,而且画面上会同时显示相关信息,如下图:



要进行回放,只要按F4就可以了,而且在游戏进行总与显示动画店时候,都可以马上回放当前的游戏流程。如果单前的游戏流程是空白的,程序将不做任何反应。要进行录制的话,在游戏过程中按F2,要停止录制只要再按一下F2就可以了。但为了避免覆盖已经录制好的游戏流程,请再按F2进行录制前确认你已经选用了正确的游戏流程。当开始录制的时候,游戏会进行初始化,为的是重置一些重要的参数与计数器,这时候游戏的画面就像游戏过关时的进度条,当画面上出现"GET READY。。。。"信息时,就可以开始录制了。

所有游戏流程的存档文件都会存储到/demo子目录下。如果游戏根目录下没有这个字目录,程序会自动创建。每一段游戏流程的存档文件都包含三个文件:demosave.x, savegame.x 与 trepsave.x(x代表33个游戏流程中序号)。当你要跟其他古友分享你的游戏流程时,青年宫同时提供这三个文件,每一个文件都是回放所必需的。同时,请不要把这里的savegame文件作为常规游戏存档文件使用,因为录制使用的savegame文件为了防止玩家作弊,使用了不同的存储格式。

关于这个功能,有些事情是一定要注意的。理论上,你可以录制整个游戏的流程,哪怕你进入物件选择画面或者存档画面,游戏都会继续进行录制(译者:我测试时,进入存档画面,程序会出错自动退出)。当你进行回放时,你也可以看到你游戏的时候进入了物件选择画面或者存档画面。但回放过程中看到的进入存档画面进行存档,实际上并没有进行存档。但是,在进行录制的过程中,切勿进入读档,暂停换面与回到游戏主裁当画面,因为那样肯能会使程序发生错误或者出现其他怪异的问题。而且,当LARA在游戏中死亡的时候,你应该马上停止录制,因为LARA在游戏中死亡,游戏会回到主菜单画面。

另外,这个补丁允许在游戏主菜单中回放你录制好的游戏流程。当你在游戏主菜单画面中长时间不按任何按键,游戏会反复播放制定的游戏流程,就好象TR2与PS版的TR3。如果你看过SCRIPT.TXT的内容的话,你会发现其中有一个参数就是InputTimeout,现在我们就是使用这个参数的了。要注意到是,主菜单画面回放的游戏流程使用的文件同样存储在\demo目录下。为了不在录制时覆盖主菜单画面回放的游戏流程使用的文件,程序设定主菜单画面回放的游戏流程使用的文件使用的序号是大于32。当你想在主菜单画面回放3个游戏流程,就可以在\demo下把你已经录制好的游戏流程文件按照以下方式命名:

demosave.33    demosave.34    demosave.35
savegame.33    savegame.34    savegame.35
trepsave.33    trepsave.34    trepsave.35

如果你还想使用更多,就按照这个规律以此类推进行命名。主菜单画面回放的游戏流程的总数由Title autoplay demos amount parameter设定。如果你不想在游戏主菜单画面中回放游戏流程,只要把InputTimeout设置得很大就可以了。
引用自: 英文版Demo recorder / player
From the long history of custom patches, i think, this is the most advanced and promising patch. Why, you may ask? Well, because it allows you to record and replay custom demo files! Maybe you remember that PC versions of TR2 and TR4 demo had something like this, but of course, these versions supported only playing of Core's pre-recorded demos. Supposedly, Core used external tool to record gameplay demos, so there was no chance to record custom user demo file... But now you can do this! Imagine — now you can record your walkthroughs (there is possibility to record non-stop multi-level demos without interrupting recording process), tricks, speedruns (remember all these QuakeDoneQuick-like projects? Now you can create same thing with TRLE levels!) and then share them with all TRLE community! Let others see how you play your favorite custom levels!

ABSOLUTELY IMPORTANT WARNING ABOUT DEMOS: Current demo format is plain simple; it only records player input (i. e. keys pressed) and Lara's position and speed values. It means that ANY changes in ANY significant TREP options, like gravity, enemy HP, weapon settings, static mesh hard collision, spikes / rollingballs behaviour, and even flare particle effects may result in CORRUPTED DEMO REPLAY. For example, if you've recorded some demo with one TREP settings, then re-patched .exe with different settings and tried to replay your demo, it may result in very weird glitches, like Lara stumbling into a wall, some enemies being left behind (although they must've been killed), wrong inventory items used, etc. Also don't forget that some important TREP settings are now set via SCRIPT2.DAT file, so wrong SCRIPT2.DAT file also may cause a mess. So, the gold rule is: always record and play demos with same .exe or with same TREP preset applied, and also with same SCRIPT2.DAT file.
ANOTHER IMPORTANT WARNING: do not use weapon hotkeys and medkit hotkeys when recording a demo! Since these hotkeys are not treated by TR4 engine as usual control keys, their values can't be written into demo file.



Demo player and recorder will provide you any important information you may need in real-time. Recorder shows you how much time you've already recorded, as well as amount of disk space that is already occupied by your demo and overall amount of frames recorded. Also, in the top part of the screen, you will see small indicator which shows you demo recording buffer status. Demo is written to disk by 8-kilobyte blocks, so this indicator will continously fill and then reset again, when 8 kilobytes limit is reached and data is being written to disk. And demo player simply shows you overall and played demo time and size.

Now a bit information about playing and recording controls. First of all, you must know that you can record your demo in 33 different slots — from 0 to 32. To switch between these slots, you must press F3 (switches to next slot) or SHIFT+F3 (switches to previous slot) either in title flyby or in-game. You will get a quick info about current slot, like this:



To play demo, press F4 key either in game or in title flyby. Demo will be immediately loaded from current slot (if current slot is empty, nothing will happen) To record demo, press F2 key in game. To stop recording, press F2 again. Please be sure that you've selected correct slot for your demo, cause you can easily overwrite existing file by accidentally pressing F2 key. Note that, when recording a demo, game will re-initialize itself to reset some important variables and counters (it will look like ordinary loading screen, except «GET READY...» message above loading bar).
All demos will be placed into /demo subdirectory. If there is no such subdirectory, it will be created automatically. Each demo sequence consists of three different files: demosave.x, savegame.x and trepsave.x («x» means number of demo slot). When distributing your demo files, please be sure that you've included ALL THREE FILES, because all of them are needed to play your demos. And don't even try to use demo savegames as usual savegames, because they're using slightly different file format to prevent cheating!

Funny fact about demo player: since you can theoretically record whole game walkthroughs, it doesn't stop recording when going into inventory screen and save game screen. When you will replay your demo, you will also see that you've entered inventory or savegame screen, but, as for the latter, IT WILL ONLY LOOK LIKE you've saved your game — actually, since game is in demo mode, no actual data will be written to disk. But BEWARE of entering load game and paused screens when recording! Moreover, NEVER exit to title without stopping demo recording! If you will not stop recording before game will exit to title, something nasty may happen. Also you should immediately stop recording, if Lara is dead (or else game will automatically exit to title, and you will encounter same nasty bug).

In addition to user-controlled demo player, this patch will enable title menu demo autoplay. Like in TR2 and PlayStation TR3 versions, game will cyclically play specified amount of demos, if you haven't pressed any keys in a timely manner. You already know that classic SCRIPT.TXT contains unused InputTimeout value, so now this value WILL be used for this patch.
NOTE: Title autoplay demos aren't using same slots as ordinary demos! There is a simple fool-protection method that prevents user from overwriting your demos that you may bundle with your level — in other words, all title autoplay demos are using slots 33 and above. That is, if you will use three different demos for title flyby (it's default value), they should be placed in /demo subfolder with these names:

demosave.33    demosave.34    demosave.35
savegame.33    savegame.34    savegame.35
trepsave.33      trepsave.34       trepsave.35

If you will use more than 3 demos, then you should use slots 36, 37, and so on. Amount of title flyby demos to play is specified with Title autoplay demos amount parameter.
If you don't want to use title demo autoplay at all, simply set InputTimeout to a VERY BIG value, like 500000. It means that user will have to wait ~5 hours until demo autoplay will actually begin, i bet that no one have such large amount of patience.

love2000

不是吧。。。竟然支持录像功能了?? :tongue9:

重大突破啊!! :brushteeth:

费茨

 :tongue9:真的假的

也太强了......
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》

费茨

唔......看了一遍,看起来这个功能才刚刚开发,使用时还有许多需要小心的地方。不过相信后续版本会大大增强这个功能并提高软件易用性。相信会带来新一轮关卡制作手段的进步。

技术文章就交给max了哈哈 :laughing11:
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》

love2000

引用自: 费茨 于 2007 十一月 12, 13:02:17
唔......看了一遍,看起来这个功能才刚刚开发,使用时还有许多需要小心的地方。不过相信后续版本会大大增强这个功能并提高软件易用性。相信会带来新一轮关卡制作手段的进步。

技术文章就交给max了哈哈 :laughing11:

羡慕啊。。能看懂。。。偶看的都头晕。。 :crybaby2:

费茨

引用自: love2000 于 2007 十一月 12, 13:09:03
羡慕啊。。能看懂。。。偶看的都头晕。。 :crybaby2:

呵呵,人各有所长嘛。

简单的说,现在的功能类似CS的回放方法,只记录常规的键盘操作,劳拉位置以及某些关卡参数,而且暂时很简单。

因此如果录制和回放的游戏环境不一样,有可能会出问题。期待这个问题能尽量消除 :glasses2:
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》

love2000

引用自: 费茨 于 2007 十一月 12, 13:15:31
呵呵,人各有所长嘛。

简单的说,现在的功能类似CS的回放方法,只记录常规的键盘操作,劳拉位置以及某些关卡参数,而且暂时很简单。

因此如果录制和回放的游戏环境不一样,有可能会出问题。期待这个问题能尽量消除 :glasses2:

了解了。 :laughing11:

sddcdx

 :hello2:
内置录制功能意味着不再象其它工具那样吃资源;简单地记录键盘输入和游戏状态意味着录像文件尺寸很小。喜欢录像和喜欢看录像的朋友有福了!

无情却有情

在这个引擎下,突破应该比较艰难,但也值得期待~~~ :tongue9:
置身古墓关卡,常常顿悟"东边日出西边雨,道是无晴却有晴"

费茨

引用自: 无情却有情 于 2007 十一月 12, 18:29:28
在这个引擎下,突破应该比较艰难,但也值得期待~~~ :tongue9:

能走到今天已经是奇迹了。要相信民间高手的实力 :thumbsup:
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》

maxchen

刚刚测试了一下,录影10分钟,把记录文件用ZIP格式打包,文件才80K!!!!!!!!!!!!!!!!
我的神啊!

费茨

引用自: maxchen 于 2007 十一月 12, 20:30:28
刚刚测试了一下,录影10分钟,把记录文件用ZIP格式打包,文件才80K!!!!!!!!!!!!!!!!
我的神啊!

:tongue9:

是不是这个也可以用来做过场动画?
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》

maxchen

不可以。
现在的技术,过场动画只能使用视频或者所谓的cutscenes

无情却有情

引用自: 费茨 于 2007 十一月 12, 19:15:57
能走到今天已经是奇迹了。要相信民间高手的实力 :thumbsup:

确实这样,希望有7代引擎制作的关卡,相信更有艺术震撼力~~ :blob8:
置身古墓关卡,常常顿悟"东边日出西边雨,道是无晴却有晴"

费茨

那个就不要指望了,CD还指着它继续做8代呢。要不是CoreD当时实在难以为继了,现在的编辑器也未必能得到。

不过就算是这么说,还是觉得编辑器的发布是一个奇迹,怎么可能呢......
邓攸无子寻知命,潘岳悼亡犹费词
                          ——唐·元稹《遣悲怀》