|
Post by OddChild on May 8, 2006 18:53:37 GMT -5
It would be neat, and needed to be able to embed video files into games.
It would be neat to be able to embed Realplayer, WMplayer, and QTime with easy commands. That way intros etc, can be played with ease.
It would be neat to be able to embed other objects too, but I would recomend that you make those 3 and IE easy.
Is it currently possible to use OCX activeX via the VBscript? I haven't gotten around to trying it.
;D
|
|
|
Post by Guilect on May 8, 2006 20:19:32 GMT -5
Well, how about this. Since we are using Microsofts DirectX technology, it would be possible to use DirectShow to play:
*.mpg;*.mpeg;*.m2v;*.avi;*.asf;*.mov;*wmv
movie types.
Not sure about VBScript and embedded ocx's.
|
|
|
Post by OddChild on May 9, 2006 10:13:28 GMT -5
That would be good. How would that be do able? By wma do you mean WMV? since wma is sound.
|
|
|
Post by Guilect on May 9, 2006 10:59:30 GMT -5
you are correct it should be wmv, I have corrected it.
Brutus2D would need to have the DirectShow functionality programmed into it.
|
|
|
Post by OddChild on May 9, 2006 18:23:18 GMT -5
That will be good. BTY is it possible to resource files and call them, so that they are embeded in?
|
|
|
Post by Guilect on May 10, 2006 6:45:31 GMT -5
oddchild asked: short answer: no. The best bet is to use a file packer like the one that Kuron demonstrated here: brutus2d.proboards44.com/index.cgi?board=generalgamming&action=display&thread=1147089161Most big game programs do not store the graphics in the exe. They use external files such as wads (e.g. Quake) or paks to hold the graphics, sounds, etc. This allows changes to the exe to be separate from the media. This allows small patches to be made for the exe and makes it easy for modders to alter the graphics to generate a nearly completely different game based on the same game engine. Medium sized game programs seem to use the file packer method. That is, all the files (exe and media) are separate but glued together to form one file. Then at run time the media is temporarily separated again from the one file (usually to the application directory) and upon completion of the executable these temporarily generated media files are deleted. This helps to keep your media safe from those who might otherwise 'borrow' it. Lastly for a game program with a very small amount of media, there is a technique where you convert the media files into a string array. You put this string into your program to 'embed' the data. At run time you copy this string from your program back to a file again.
|
|
|
Post by Guilect on May 10, 2006 7:42:06 GMT -5
here is an example of how to embed a small graphic into your program.
Copy the program into Brutus2D. Save the program somewhere you know. Run the program. You will see a green marble image that was created from within the program. It was not a seperate image file.
option explicit
dim bRunning bRunning = True
dim background
sub main()
if (graphics.initialize <> True) then exit sub graphics.setTitle "Demo - Load Image - press [ESC] to exit" key.initialize BuildMyResourceFile1 background = graphics.loadimage("marble-003.png") do while bRunning = True if key.pressed(1) or key.pressed(0) = True then bRunning = False graphics.clear 255 graphics.setimage background graphics.display loop key.terminate graphics.terminate
end sub
Call Main()
'============================================= Sub BuildMyResourceFile1() If system.fileexists("marble-003.png") = True Then Exit Sub End If Dim mydata, a, b, i mydata = "" Dim ResourceData(9) ResourceData(1) = "89504E47D A 1AA 0 0 0 D 494844520 0 0 1E0 0 0 1E8 2 0 0 0 B45239F50 0 0 4 67414D410 0 AFC8375 8AE90 0 0 1974455874536F6674776172650 41646F626520496D616765526561647971C9653C0 0 7 774944415478DA6260A0190 8 2046FCD2C222C25FBF7CC52AC5CDC3FDF6CD5B3C7A1 2 8 A7D12 822 3FBEFF0 324 95D9158C44E45544F88579FFFCFDF7FCCDBBC7B7DE3E3AF6F6E7EB7F4059E 4E8EF EF3F60351 2080B0182D222AF2E5F31720C3204CD43A5C51CE4B9E8741828981F537C3FF3FC FFBE337CFDF6E3C3BBB 6FEE1F7B7E69EBE367C7BE1 55F2F0F2BC79FD6 CD" ResourceData(2) = "1C800 42375A5048F0FBB7EFA A67CDE358AD26EAAFF18FEFF62F8F383E1D377864FBF3FFEFEFDF6DFBF8FFFFF7C61F8FBE9FFEF1FC 7FBFFF7D7EF7F3F565AF3F3CFACDC9C5F9FEDD7B64A30 2 8819D35CE328D1E0D59A426AB2BF187EFF64F8F993E1F3F 86F7BFBFFCFEFBE9EF9F2F7FFF7CFAF7EBF3EF9F5F7E7DFFF4F3C7973FAC1C8CA2BA5CDFBFFEFDF8F03B2F1F2F24C 210 200 5374703 20102 519464F C6BBDAC1DA807578B73A9BD45 253088F1623 2F3F33E5BF3 375EB671DDE7AE4C4AEE4 109492743FC38E8 E 6DC858933085DE5031B7186A7FC9ABE743CCFC818F0 4218FDEFDF3F2943AE" ResourceData(3) = "B0D55A1C2CE2C0306561E06467E0FFCFC0FC83E1C3EF2F7FFE2 4DFCF2EFF7D7FF7F7F0 8D66FCFDE33FD0CE7FBF19FFFCF97 B43 884 95D83E3FFAF5F9F58F3F7FFE40C 4 8 2026787A0 921 F52A3C1C924073791944CD18C 1D19C C519649918D840A67C67F8F7E33F30E0FFFDFCFFE7F73F6084FEFDFD17E89AFF20AFFDFFFDF3EFFFFFC 4A7E2 70A3800 2080A0463 C3483F5458C65D1918E ACC DC16C 7AB6C 89FAC AEBCC DCC 7F18FF7DFDFBE7DB9F7F3FFEFDFEFE1768D C34F867F7FFEFD5 6 D6DFFFC FF1818FF31FEFFC7F0EBEB5F1E616631532E78703 4 1013245F0 498B8 C9FFC06061" ResourceData(4) = "F82FC82066C860CFC0C0FF83E1EB6B86773F3FFDFCF3EDFFDF9FC A024F1EBEF9F9F7FFF0 DDB 3414E8DE3FC C094FE7 C86 EA4 A FCFC276FCB3 3710208058801898DF4 145845BDF880BEFCCFC0C8CCC0F28DE1392BC3AFE3C 875E30DCFEFDE9D7BFEFFFFE7C3 B91788FEFF660 6 E61FA0EFFEFCFF7 74FCBFFFFFFFFE634 3B12A8995F829D5D94E9EB6B506 6 8 201688E3E5CCF8D81844815AFE3330BD6378BF831 9813FEDC67B8F0E1C98B1F9F7EFEFBF61F12D6FF7E2 D 5 6 F4FFBF7F81E 670 6 3430B880A11 349A918589958585939759D280EBC16E508E3 8 20A8D1C2CA1CFF402A815EFC" ResourceData(5) = "F58EE1D17B86273FFE7CF9FEF2CBAF8F3FFF7FFFFFFBFB3FA0B97F7F0 43E3DF3FA0AB41D18 72F1EFBFFF81294 141ACC4CCC6CC 40C4C8CCC8AFCCCAB01B6426400 418DE61464FDB F2E8EF5FC 1F81243015FFFDF8F7D7C77FFFBEFEFFFDD 98DAFEFDFE9 4C61A0D00 258C3F60A57FFE83323E3034189958D818D8D99959389859B999B84538191840D912200 CD64703 308 C3C0608 FD74FF455B4 82863441B08075967D3B9AE0FD6 BD83BA98728F4A516DD331EBBA7057B 151FCD5C325ABF9D7C1384C0481C23235F816FE088F2B 2028E3E3BB5FBF197EFC62F8E 35F7F3FF7F5FFFFD1 A539603880" ResourceData(6) = "B3C94F60EA65FCFB8BE91FD8D5C0A00 66566028330 239D8D91859D819D93998D97895D82E9D78F7F10331 2 8 EAEA37B77FFC6078F7E7D35FA06321E6FEFA2 32F7DF376 605AFE3 34FAD77F60608192DD1F26607E3 6 5 D0E18CC0F29093999D83859513E85E66E 41167649D68FF A1E91A2080A046BF3CF9F5E7D33FFF819 8 E8E42FC0A4F61F6C2E38A07F2 C397E1D76F90E940F7FE5 46DC6F508664646460E3605 461DB084E2E06266E763E614671 26F6A7473F41CC4 8 2026487D1 2C159FEEFAFAFF3BD0E87FBF3FFF5 6 5 D0BDBF80EEFD9 CCC4C062E82FD03850ECFDFEF77 1493C 407359" ResourceData(7) = "D99859D918D8D899D8389959799938C598B854593E1CFBF1E5D93FA08140631 2 8 6434A41EBABAF1CD9F8F7F7F3 B 62A0ABBFFCFFF5EDCFDF1FC A0684 96F A024F1EFEF6F60217 CA7BC0DCCDC2C6C4C6C1C4C2C9C4C1C3C2C1CFCC25C6CA2ECDCCC5C77569F51BB8810 1 4 8D46603DF460E797877 3FFFF9F5F7F75760591 C 937F7FBEFFFDFBF3EFEF5FC0F21394D1C199101866C 2C1C4C1C9CACC050E60 6 3430EA849939A5585 9478DE6EFB7463C37 A05110331 2 8 5AA8FEF8F1838585E5C3C31FE21A5CFFFE3182C FDCD0 4ECBE0F05 B91718BE7F99981999D819814998D E85E6E26767E66" ResourceData(8) = "4E31562E59361E2D16E6F7C EB126F7F7DFDF7CB972F10331 2 8819B99EFDF4E2C7D74FBF4594397EFF2 A56860C82 83F817C85C504E656 66653646764E16364E16761E26761 162E71564E69661E2D562E6 F63DA9F EE1DFAC AC24E1551 400 218C6 A 1 6BA0F7F7BE7F7EFF875F86D 98708145F32F60A FB3 2A7C18598129811964283031F030729 B17249B2722AB08 A8F2B07C61DA937AFFE29AB7C0EAF1DDDB77703 1 2 8 7BB5CB25C52AE7C6C32BCAA 16FBCFC6CAC 8A3776462670BCB19 327349B070AAB070F371BDDDFE6957C3A36797BE6156BB0 1 84AFB120A8C72A67C52720C5CEC9C3" ResourceData(9) = "C 8C34662E66361 464E5166362916666 C6F7C77E5E58F5FAE686F B81AB 0 1 44B8893 2C7F85D5394 94D9B8C55881CEFFF1EDEFA727BF5F1EFFFAE9E96FFC4D1C800 A261C3C 208068880 2 C 0 854424272A6C6E430 0 0 0 49454E44AE426082"
For i = 1 To 9 a = ResourceData(i) While Len(a) > 0 b = "&H" & Left(a, 2) a = Right(a, Len(a) - 2) mydata = mydata + Chr(CInt(b)) Wend Next
system.filewrite "marble-003.png", mydata End Sub
|
|
Kuron
New Member
Posts: 29
|
Post by Kuron on May 10, 2006 11:45:25 GMT -5
I am heading to bed right now, but later today, I will look through a few "third-party 'free' alternatives" I have here and see if I have anything that might work off the shelf with B2D. Going from memory, I think at least one of them should work with B2D.
|
|
|
Post by Guilect on May 11, 2006 6:28:39 GMT -5
I have added ActiveMovie commands to Brutus2D. You can load, play, pause, stop, get length, get time remaining, move, resize, etc. the movie types listed in a post up above.
It will be included in the next release of Brutus2D.
Note: One file type that I verified works is the Apple QuickTime type *.mov. It works. I just am not sure what requirements are needed. The PC I tested on has QuickTime installed on it. Not sure if it would have played had QuickTime not been installed on it. I seem to recall early versions of Windows Media Player could play .mov files okay so maybe it is built in. But be aware that if you plan on using a .mov file your target PC may be required to have QuickTime installed on it. Does anyone have any further info? Once the next release of Brutus2D comes out, if someone with a clean Windows install could check on this that would be helpful to a lot of folks.
|
|
Kuron
New Member
Posts: 29
|
Post by Kuron on May 16, 2006 21:47:27 GMT -5
As of a year ago, DirectShow is no longer a part of the DirectX SDK, and is now part of the Windows Platform SDK, will this cause any conflicts for end users of our games who may be running newer versions of DX and newer services packs of XP/2000?
I got sidelined with a nasty cold that has been going around. The ones I was thinking of would not easily work with Brutus due to the resources they extract needing to be loaded from memory as opposed to being loaded from the drive.
|
|
|
Post by OddChild on May 17, 2006 5:53:58 GMT -5
I suppose I could use an external scripting program and just extract and delete... i've got my eyes on autoit. but that might seem kinda wierd...
Open the exe.... CPU usage jumps up... everything extracted... game starts... game ends.. CPU usage jumps up as everything is deleted...
|
|
|
Post by Guilect on May 17, 2006 6:32:27 GMT -5
My installed version of DirectX is 9.0c. Although DirectX 5 and DirectX 7 are long gone, I am still playing games that where compiled using those SDK's.
|
|
Kuron
New Member
Posts: 29
|
Post by Kuron on May 17, 2006 15:57:14 GMT -5
You could also use one of the many free zip (or other compression DLLs) and access the DLL directly from B2D and extract the files from a zip and then load them and then delete them after they load.
That is because DX9 is backwards compatible, albeit the last version of DX to be backwards compatible.
I was curious only because DirectShow is no longer a part of DX, its a part of Windows itself. I wasn't sure if DX would try and play it itself or hand it over to Windows via some abstraction layer.
|
|