PDA

View Full Version : battle recorder idea



Kraellin
06-17-2001, 21:33
i was just reading maltz's web page story in the general discussion and got an idea. a number of folks have wanted a battle recorder for a while now and i'm one of them. it occurs to me that we 'almost' have one right now, or at least something that could simulate it with a little work.

and magy, i know you were toying with this idea, so perhaps you've already investigated this and if so, then plz post what you found out.

but here's the idea. maltz used a number of screenshots in his story on his web pages. why couldnt we make a mod that does nothing but take a series of screenshots during a game, say once per second or once per 5 seconds or 10 or whatever we wanted it to. all any movie is is a series of stills run together quickly to simulate motion. the br (battle recorder) wouldnt have to be full motion photography. it just has to be enough to show you how a battle went. a simple viewer could then be made to 'play back' the recorded screenshots in the order in which they were taken in a sort of slideshow format. it wouldnt be true motion but it could be a decent substitute and very useful in training.

the br would run in the background, obviously, and perhaps ca would even be willing to incorporate a hotkey or something to trigger it on and off during a battle. but even without ca's addition you might still be able to do it with an alt/tab out of game, start the recorder and alt/tab back into the game. the trick, i suppose is how to get your br to trigger something in another task, but surely this can be done.

oh, and dont ask me to do it, i'm not a coder. i'm just throwing this out to some of those around who know more about this than i do.

K.

CaPeFeAr
06-18-2001, 00:50
k.....i have made flash video of battles in order to put them on my website...i have found a few problems but have managed to overcome most of them.. first...the current form .tga is a super high quality photo that takes up alot of room....on my first video i made...i converted all the .tga to .gif ..it was almost a minute long with a good frame rate...500 or so pics...but the drawback was that even in .gif form the .fla file was almost 100 mb... when i tried to convert all the pics to .jpeg it looked very ugly...the image quality was horrible...(i use psp7) ..in the end...i now have a finished video ready for my site....it consites of almost 20 .gif and is 4.7seconds...after a little image compression i manged to get the file size down to 3.6mb....now im having a problem getting my product onto the site...i use geocities and for some reason my .html ( im using dreadweaver) files arent uploading properly.... http://www.totalwar.org/ubb/frown.gif ....i know u have lots of experience activly using screenshots so maby u can help try and get the file size down on a nice movie. any help that u can offer would be appericated http://www.totalwar.org/ubb/smile.gif

------------------
do you have a comment to make, a question to ask, or a concern about a current fearful ways member? plz feel free to stop by Fearful Ways - The Mori Family (http://www.geocities.com/fearful_ways/)

Kraellin
06-18-2001, 11:32
hi cape :)

boy, i'm not sure. does geocities have a file size limit? and what's your overall capacity on the site? you might be exceeding it with another 3.6 megs.

i'm guessing you want to compress that file down some more, but if you've already done it once then i'm not sure. what did you use to compress it? compression routines vary a great deal from program to program. you might look around for another one. i saw one not too long ago that claimed to be very good with almost no loss in resolution, but i'll be danged if i can think where now.

yeah, jpg or jpeg would have been my first try also, but as you already found out the qualifty suffered too much. the next one i would have tried would have been .bmp. we used to use those on a linux server a while back. i dont really recall how it compares to .gif. if i remember right, .gif was developed by compuserve cause they needed and wanted smaller file sizes also...or was that another one? lol. it's been a while.

if you cant find a better compression or a better format then about all yer left with is splitting the file and putting it back together on the web site or with whatever app you're using to let folks view it.

if memory servers me, you can even send it up to your site as a zip and there's a viewer that will read the zip without unzipping it to the directory, i think it uses the user's own memory or something like that, and then let the person see the file as you wanted. this saves you a fair amount of space on your own site.

one other option is to get another free site somewhere and simply link it to your home site. stuff the file there and when someone clicks on your link on the home site, it simply takes them there to view the flick as if it were a page on your own site.

there's lots of tricks to this stuff, the first being, use other folks resources as well as your own, particularly the end user's.

we used to run a mammoth game on telnet and you wouldnt believe what we used to pack into a 25 meg space and the number of tricks we'd pull to save resources and still have an incredible game going. of course, it helps to have 2 genius coders working for you too. one is now teaching microsoft folks what a computer is and the other is going to harvey mudd after graduating high school a couple of years early ;) i'll tell ya a story some time about teaching the one in high school that 2 + 2 doesnt equal 4 ;)

yer using psp7...with the animation editor? i just bought the full version of psp after using the shareware for years...yeah, i felt guilty. it's the only shareware program i've ever paid for...but then again, it's the only one i've ever used for any length of time. so, how is it? i havent installed it yet.

also, what did you use to make the flash video? how did you get the captures while playing the game? you said they were .tga's so i'm assuming you were using the screenshot button, but were you just sitting there manually pressing f2 every so often or did you automate it with something?

tosa and i were just talking about this today and we figured there was a program out there that would automate the screenshot thing, so, tosa went to tucows.com and did some searching. i'm not sure what he found but he did make a list of some stuff. i know you can do this, break into one task with another cause it's done all the time on other games. we just didnt know if it was a script thing or what. asheron's call has these that were done by third parties to run the game for you while yer not there and it's basically just a script file. i just dont know how they're doing it. i suppose i could tear into the script and read it, but like i said, this isnt a project i'm going to do myself.

i would also hazard a guess that, with the .html or .ubb code thing in the dojo here that you could easily link your flash video thing here in the dojo for viewing once you have it on your site, if you so desired.

there is, besides zip and normal compression routines, a routine that used to be called 'folding'. i'm not sure anyone is still using it these days. it made normal compression routines seem pretty lame. seems like to me that it had one drawback, though. at times, for seemingly no reason, it would do a massive corruption to the unpacked file when unpacked, so it may not still be around. it didnt do it often, but just enough that it may have been abandoned.

the idea was similar to folding a piece of paper. each time the file was 'folded', it would halve the file size. there was a limit on how many times you could do this, of course, but it was well more than once. theoretically, it sounded good. just not sure they ever worked the kinks out of it.

btw, i'd love to see your file. send it to me at starfire@apex.net if you can.

K.

Kraellin
06-18-2001, 11:52
oh, now i remember where i found that thing that allows you to unzip to memory. one of my genius coders made it :) we stored our entire game map in zip files or .lzh, i think it was. when someone entered a certain portion of the map, or were about to, the program would unzip the file to memory so the person could 'be' on that portion of the map. when they left that area the unzipped map was purged from memory and a new one was opened. very simple and very efficient. you could effectively do the same thing, unzip the file to the user's memory and let them view it that way. you then dont ever have to unzip the file on your precious site space. very simple.

but i'm not sure i answered your original query; how do you get the bloody file up to the site to begin with? well, 3.6 megs isnt a big file any more. is it already zipped or are you trying to xfer it up as a .gif? can you get others files to upload? do you have a talley on your current unused space on the site? what ftp program are you using? if dreamweaver has one of those autoupload routines you might check the site addy's and security stuff to make sure it's correct. try another ftp program if yer using dreamweaver to upload. try a smaller test file, say 1 meg and then delete it after it uploads.

the other thing you can do for file size is simply reduce the image sizes. we all hate doing it, but sometimes it's the only way.

i'm also guessing that you'd rather have the file running on your site rather than making it a download for others to view on their machines, but that is an option also.

K.

Kraellin
06-18-2001, 12:10
umm, a couple other things occur to me...i keep thinking of these things after i post the last one ;)

here's what i'd do before i did anything else: go into psp and take just one of the .gif images. convert it to .bmp and check the file size. then do it with .pcx and check the file size. you can keep on doing this with other file types as well. this is one of the greatest strengths of psp and i've always loved it about them.

you can also do color reductions on most of the file types. do you really need 16 million colors? i'd drop it down quite a bit. if it's already in 16 bit, 256 color, try going one lower and check the quality. even try it in 8 bit. and if yer really desparate, try it in gray shade. as you try each of these file types, make a copy of each one. save them. after you've found one you think will give you decent reduction and still maintain enough quality, zip it up. then zip up a few of the others and compare file sizes again.

and if you're really desparte and know your file formats, you can cheat even more. strip the headers out of all your files and compress the remaining files. make a separate header file and zip it also. send all this to the site and create a little program to have the images utilize the header info in your header file for each of the image files as it's read.

almost every image file consists of 2 parts, the image itself and the header. if all your images are .gif and all are the same size and bit type and number of colors, then if you have 1000 images, why in the world do you need 1000 headers? you dont. you just need one.

if you've read my thread about .bif files in the mods section then you'll see where this idea comes from and it's what, i believe, the CA coders have utilized for stw in their image files.

ok, i think i've about covered it now :) took 3 posts to do it, but that shld give ya something to go on.

K.

CaPeFeAr
06-18-2001, 17:17
wow .....thats gives me a lot to look into...lol.....first off let me awnser some questions.....geocities allows for 5mb uploads andand 15mb total....so thats not a problem.....but im not that handy with code....i did reduce the color to 256....the quality suffered little...the original file after .gif conversion was 36mb...so 3.6 finish result i guess is ok....my only problem is getting it there....i used dreamweavers upload and the one provided by geocities....i guess im doing it wrong..sad thing is i cant upload the files seperatly and use the pagebuilder geocities offeres....it seems that the only uploadable formats are jpeg..gif..htm...and html...i cant even get my .wav's on it yet http://www.totalwar.org/ubb/frown.gif ......ahhh i hope its geocities and not me but i guess i need to go take a class in computer programing or somethin .....lol

------------------
do you have a comment to make, a question to ask, or a concern about a current fearful ways member? plz feel free to stop by Fearful Ways - The Mori Family (http://www.geocities.com/fearful_ways/)

Kraellin
06-19-2001, 02:01
ok, that seems weird to me that you cant upload anything but the file types you mentioned. uploads shldnt really care what the file type is. unless, .... is geocities on a linux server or something? but even then, you shld be able to upload just about anything. it shldnt really be checking for a file type in an upload. uploads and downloads shld be pretty much blind. unless, geocities is doing some kind of check and then blocking certain file types i dont know why that would be happening. i mean, can you upload text files? zips? these are very common to sites and i think you must have something else going on there with your upload stuff. try wsftp. there's a version out there that is still shareware or freeware and it's a pretty good program.

also make sure yer uploading to your own directory. sometimes it's not apparent where the file is going.

can you upload those other file types still? try it out and make sure you can upload anything first. if you can upload anything then we can eliminate things like address problems and such. one thing that often happens in uploads is we forget that you have to use ftp protocols and not http: protocols. i've also tried to upload things to wrong directories, which tends to piss off site admins. they think i'm trying to hack there system ;)

it's been a while since i played with web sites and servers, but i'm fairly sure it's something simple. if the space is available on your site and the file size is below minimum then it shld only be a protocol or addressing thing. i cant really see geocities blocking file types in the uploads. they may not be able to use or run certain file types but they shld be able to accept the upload regardless.

K.

candidgamera
06-19-2001, 04:40
Kraelin:

Hope am not being rude here, breaking in on the dazzling discourse going on. (You're pretty self-effacing about your capabilities must say http://www.totalwar.org/ubb/smile.gif).

Have you worked at all with powerpoint? Wouldn't be the sexy solution being discussed of course. Probably a problem sharing a slideshow on the net, ect.

Just recently jumped into working some with it at work, and it seemed pretty intuitive.
The part for STW I like, for training and record, is putting text, arrows, ect. onto the slides.

Haven't tried my hand yet at it, but am going to try bringing in some of my jpegs-from-tga's to make a slide show and see how it goes.

Kraellin
06-19-2001, 10:40
hi candidcamera (sorry, but i still recall that one from that name thread :),

self-effacing, eh? i'd say more like long-winded :), but thanks ;)

no, i dont really know powerpoint. is it a slideshow type thing? ah, guess it is if yer editing with text and stuff. yeah, i think that's pretty cool. i also like what maltz is doing with his stories in that other thread.

if ya get something working on your slideshow, plz post it somewhere so we can all see it and if ya run across anything that might help make a makeshift battle recorder, why let us know here.

K.

candidgamera
06-19-2001, 11:58
Kraelin:

(I think you mean randomspambler)

Long-winded - sounds like some my posts http://www.totalwar.org/ubb/smile.gif.

powerpoint is the basic business presentation software package that's part of microsoft office - does slideshows.
Might be hard to post like I said.

I'll let you know how I make out though.

Kraellin
06-19-2001, 21:32
ah, ok candid,

yeah, i guess i have heard of powerpoint, just never used it. in fact, i've got office 2000 around here somewhere, just never installed it. is it any good?

cape,

how you comin along? did you get it uploaded?

K.

MagyarKhans Cham
06-23-2001, 07:05
My Khan states that he can programm a battlerecorder which will be his finest programm ever made. but for this he needs just a little help from teh developers. since that is an utopie he left the idea....

sigh

The Daimyo
06-28-2001, 16:50
Any of you guys have another game that uses a battle recorder feature? I advise you go out and get one,(like Rouge Spear Urban Operations) and have a look into how that actually works in a reasonable fashion. I don't mean to shoot anything down here, but I must profess, the idea of doing the screen-grabs is not gonna work.
I'll breeze over how this should work though, as per the other methods used by other games that also use the same or similar 3D engines.
Rather than taking pictures, it records the movements and actions of each object and/or physical item that does something that occurs during play. It records it using a simple scripting routine that merely follows the action as it happens. No pictures taken, no CPU overhead, and no wastes of space.
The scripting engine is usually built into or added into the game by the developers, but I have seen some that were made by 3rd parties, did the same thing.
Now, what this scripting unit does is record all of this data into a file that the game can use when you want to view the match after it happened. These files can be of any type that is readable by the executable as it's own media. This isn't an MPEG or AVI, or anything like that. Most of the time it's a C+ file, or whatever type of program that the game's engine uses.

It's a program that simply recalls everything that happened and uses the game's own 3D Battle Mode program to reenact the whole script with all of the recorded bits of action. For some games these records only take up about a meg of space, others can take up to 5 megs or so.

Screenshots here take up like 1-2 megs or roundabouts, per shot! Even if you changed them all to a smaller format, a game that takes 20 minutes would be astronimical in size like that, then imagine one of those 1 hour games, in slow motion! Eek Gad no!!!

This can be done....it may require developer assistance though.
http://www.totalwar.org/ubb/smile.gif


------------------
The Daimyo
Miaowara "Kakizaki" Tomokato
@ http://www.planettotalwar.com

Kraellin
06-28-2001, 22:44
the daimyo,

yes, i understand what you're saying and i agree that my idea would be clumsy and bulky. never thought it would be anything but. but heck, i've got 40 or 50 gig of hd space sitting around doing nothing so the bulky part doesnt bother me much. heck, it could even be done by writing to a cr-rw drive and a clean rw cd, though that might be a bit slow, but saves to the hd could also be thrown over into a cd-rw for saving later.

i'd love it if someone worked out the way you're talking about, particularly if the dev guys did it. i'm just looking for something in the interim to show me where i went wrong (or right) in my games. it doesnt have to be a full recall of the game. i just want to be able to study why i lost to you or someone else.

i suppose i could just set up a video camera from my other computer trained on my screen and capture it that way, though. or maybe send it out as a feed to my tv and let my vcr capture it. aint technology fun :)

K.

The Daimyo
06-30-2001, 20:11
Hehe...desperate aren't we? http://www.totalwar.org/ubb/wink.gif

Actually, if we ask nicely, perhaps they'll think of it. I dunno, but it's worth a shot.
I'd like to grab the code for it from one of these games here, I will have to look into that over the weekend here. I just finished setting up my new PC's and learned how to use a bunch of new software, so I think I can get back to the games and the sites now! http://www.totalwar.org/ubb/smile.gif

I'll let you know what I find here very soon. Don't lose hope on this, it's a needed extra I think.



------------------
The Daimyo
Miaowara "Kakizaki" Tomokato
@ http://www.planettotalwar.com

CaPeFeAr
07-01-2001, 08:08
geocities is a piece of junk.....i have started my own site at my isp and it is fine....a bit small (5mb) but at least it has no ads.....i can also use ftp to transfer now so i have no problems with this part any more.. as far as the battle recorder idea...i think the vcr is the best idea yet....although a script file that would allow u to look at the whole map at any given time not just what u saw in battle would be super cool... http://www.totalwar.org/ubb/smile.gif

------------------
do you have a comment to make, a question to ask, or a concern about a current fearful ways member? plz feel free to stop by Fearful Ways - The Mori Family (http://www.geocities.com/fearful_ways/)

qwertyuiop
07-01-2001, 15:05
What you suggest would be pretty damn hard to do with any effeciancy unless they had something like unknown command line options.

Screenshots are out of the question.

Using the win32 hooks would be a bitch unless you knew exactly how the game worked internally. Same with editing/ripping the raw memory.

They only way again is some command switch, game counsol or much assistance from the developers.

The Daimyo's way is what I was thinking. But since the game doesn't do this nativly it would have to be made by the developers.

Then again they logicly take it to the next step and make a replay feature with save. I doubt this would be hard to it is worth suggesting. Unless they have a half assed 3d engine with corners cut all over the place that is totaly non reusable.

The moral of the story, CA needs to do it. Unless there are some all star ASM hackers out here.

------------------
It takes a big man to cry, but it takes a bigger man to laugh at that man.
-T-

qwertyuiop
07-01-2001, 15:30
In addition a smart person with a hex editor and decompiler can do a lot, but not of this magnitude.

Modifying a program running in memory is presise work, and 3rd party knowlege of shoguns guts is 0.

Somthings that are possible are say changing the weather in a active battle, or say the direction of the wind. But when it comes to completly dynamic values such as the position or honour of a certian man, inside a certian unit, on a certian team.

Do they use dynamicly allocated arrays, or linked lists, or raw memory tables, do we know? Do we even know for what those are, let alone in what maner are they used and organized.

Just to let you guys think.
The vidio recorder is the best idea, then run it through a tv tuner card to record http://www.totalwar.org/ubb/smile.gif
Alas, that is even huge.

Oh well good luck, I have created more doubts than answers now.

------------------
It takes a big man to cry, but it takes a bigger man to laugh at that man.
-T-

Kraellin
07-01-2001, 17:29
well, at least i got ya thinkin ;)

lemme see if i got this right, daimyo, and cape... if you could locate the strings that represent each unit and record them someone relative to each other and the map and their other stats, you could make a 3d viewer that would allow not just a playback of things from the view you had but also the view of anywhere on the battlefield at any given time? sorta makes sense, doesnt it.

well, i've also got a vid card i'm not currently using that has vid in and vid out. maybe i'll just set it up on this computer and run it to my vcr and tv. aint technology fun :)

K.

qwertyuiop
07-01-2001, 23:13
It makes sense, but lets say you somehow get some code that rips unit positions from the game every second and puts them in a file. We still don't have the terrain, so why do you need this new 3d viewer?

Do we know the way a shogun map is encrypted?

I could do a java applet that would play the battle and give the user say stats when they put the mouse over units. However this map seams hard, somehow then something would have to give me a the heights of the land and where forests are on the map. Some kind a of basic trerrain matrix.

For the level of information you can get I believe 3d is a little over the top.


------------------
It takes a big man to cry, but it takes a bigger man to laugh at that man.
-T-

CaPeFeAr
07-02-2001, 22:18
the terrian of each map is broke down into map cordinates...x,y and z..these are fixed values and can be edited within the map editor...which means they allow access to them...u would not have to hack them. what u need is a program that can quicly scan the map in use and store the map points into a table of some sorts. these points could then be used as the framework for where each unit is in prespective to each other..without a scale of some sorts this would be impossibe....the map points provide this scale.

------------------
do you have a comment to make, a question to ask, or a concern about a current fearful ways member? plz feel free to stop by Fearful Ways - The Mori Family (http://www.geocities.com/fearful_ways/)

Kraellin
07-03-2001, 05:04
yup, the map itself is pretty easy. in fact, rob already decoded most of it. that's how he made 'flat map' or 'green', i forget which, but he just edited it with a hex editor. he didnt use the normal map editor. amd from what he told me, it's pretty straight forward...textures #'s, height data, etc. very easy and sequential. he did say there were a couple of bytes on the ends of each tile designation that he didnt know yet, but other than that he pretty much had it down.

i tried to get him to write up his findings in a file and send them to me but he never did. but my guess is that it wouldnt be too hard to do the map part and recreate it in a viewer, even if you didnt use all the fancy graphics.

the hard part is the unit data. that, to my knowledge has never been decoded, which seems quite odd to me since this is a fairly popular game and normally the hackers have things torn apart before a good game ever gets out of beta. i could prolly figure it out with a bit of hunt and peck hacking, but it's just not my bag. besides, i think i've actually solved my initial request. i've got a way now to capture to a vcr directly and just play it back on the computer or the tv :)

K.

qwertyuiop
07-03-2001, 10:58
I seriosly doubt it. Rad what I wrote on the problems with #1 finding there system and #2 implementing it properly. Its not somthing easy like the weather.

Make a contest. That would be intresting, maybe then it is possible.

Depends what type of terrian. It would be quite a challenge from someone who isn't a game programmer to do the calculations in order to draw a piece of terrian that is not all jagged and screwed up.

-----------
Yes you would have use a hex editor. If there maps were incoded in ascii that would be massive. Each character using byte then having to use a couple of them to represent the wanted information. When you could easly do the entire bit of information in that one byte. Say times the file size by 5, then you need to do ascii conversions while decoding the map using more time.

...I seam to have gone off in a tanget. Theres your lesson on efficiancy today kiddies http://www.totalwar.org/ubb/smile.gif Maybe I could write a thesis on this.
--------------


Wait, that gives me a idea. I have seen it done. Although, I don't think it was fed a x,y height matrix. It was a picture with different colours I think. I will look around in a couple days.

If someone has somthing like this I can convert any *smaller* piece of code to any language with in reason.

------------------
It takes a big man to cry, but it takes a bigger man to laugh at that man.
-T-

The Daimyo
07-10-2001, 17:01
Well this one's still chugging along, and with new folk's input that is almost spot on I think.
All this talk of ripping and memory reading is giving me a headache though, and it's just gonna net us zero in the big picture I think. Not to mention it's against the Liscence Agreement, which they will get pissed about if any of us do it so thoroughly. http://www.totalwar.org/ubb/wink.gif

As far as the maps go, I don't think that determining relative or exact positions is that much of a chore if it's built into the game already. Doing this as a 3rd party project would be impossible unless you could crack the whole darn game open, and then have all of the tools and recompiler codes to put it back together again. (see Humpty Dumpty...)

The maps, from what I know, are designed with 3D Studio Max R2.5/3.0. This means that we'd need pluggins to nab them effectively and make use of so many of them. That's what the game engine is for, so it's not relevant to the project I think.
What we're in need of is an application that works with the program, like the Stats Recorder, but it musn't get in the way either. From what I can tell, the stats recorder doesn't present a hit to performance. In other game's that come with playback and game film saves it's not usually a problem either, after they tweak it a bit. Some first off 3D ingame-camera recorders were problematic and caused lag or misallocation of memory resources to the point of crashing the game or hosting client.
That was usually due to hasty coding or half baked solutions to other inherant flaws in the game's physics and 3D graphical modes.

I don't think that would be a problem here since we're dealing with 2D sprites on a 3D battlefield. But, therin lies another question I have. How do the game's with 2D sprites "enmass" on 3D or 2D battlefields employ their recorders?
I've only had experience with 3D on 3D games so far when it comes to the recorders. This would be new to me, but I am going to guess, not much different.

Has anyone from the Dev. Team been asked about this yet?


------------------
The Daimyo
Miaowara "Kakizaki" Tomokato
@ http://www.planettotalwar.com

Kraellin
07-10-2001, 19:23
good post, daimyo.

i kinda think the dev team has their hands full right now so asking would most likely just be a further thorn in their side, i'm thinking.

K.

MagyarKhans Cham
07-13-2001, 07:23
keep it simple and it will work. my khan has the ideas how to do it and has stated it elsewhere somewhere

------------------
http://home-4.worldonline.nl/%7Et543201/web-mongol/mongol-images/mongolsmiley.gif Quote Although the enemy moves fast, a mongol arrow will kill him at last[/QUOTE]