[GAME INTRO PLAYER] Alternative Movie Player

Advanced game related topics
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

[GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

I was thinking about this one a lot, because I can not share this without media to be useful at all.
The media is big, so I can't provide the link here forever...

On the following link you can download a zip that has only code and media. 113 Mbyte long, so please download only,
if you are seekeing/interested in a codecless animation solution for games. Thank you.

The included animation is a marketing video of a 10 year old board game (from YT). I'm not getting paid by them,
so I won't even display their name here. I just needed a sample video to play with the animation player.

Edit: Updated the link to the 6'th iteration.

https://nextcloud.cloudns.ph/index.php/ ... zoiXTBdfqk

PS: Delete the project file and load with the main.pb, as pb projects hasl full paths in it.

I might remove the link later to free up my space. The code is free, if you find it useful, it's all yours to
modify, use, share it back, whatever.

It's 16:9 by design, in any other desktop, the video is stretched. It can be modified of course to any needs.
On MAC, it's not fullscreen. While Piero provided the solution, I don't have a MAC, so I did not implemented his method.
Edit: Implemented, but not tested.

Well, have fun!
Last edited by miso on Tue Aug 19, 2025 11:06 am, edited 8 times in total.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 616
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by minimy »

Hey miso, really nice solution to play movies.
Nice job as allways.
Thanks for share!.
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

As I tested this, I had a couple of problems. Different machines played this with different speed, the audio was async. The tickers was not a good solution for that. I reworked it, made it to be synced to the audio on all machines. (Tested on I7, I5, old core2 duo and quad.)

Also implemented Pieros (Thank you!) Mac fullscreen solution, I just can't test it myself.
If any MAC user testing this, please tell me if there was any issues. It supposed to be fullscreen windowed without taskbar and title bar.
(Might be stretched if your desktop is not 16:9)

I updated the link in the first post. As it works great in my tests, I consider this as final.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 616
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by minimy »

Hey miso, after test over 6.02 and 6.21, no work, i got black screeen but no sound and no image, only black screen.
In pb6.21 i can see the text but is still in 0:00 not playng. (but only in 3D mode)
In pb6.02 only black screen.
Tested in 64bit windows 11. Sorry friend.
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

no work
Checking...
I only have win7 and 10, and I could not reproduce this on them (with the downloaded source of course). Must be a path problem on Win11 (as first guess.)
Sent you some debug code. Would you kindly test it when you have some time? Thanks in advance.
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by Bisonte »

minimy wrote: Fri Aug 08, 2025 11:03 am Hey miso, after test over 6.02 and 6.21, no work, i got black screeen but no sound and no image, only black screen.
In pb6.21 i can see the text but is still in 0:00 not playng. (but only in 3D mode)
In pb6.02 only black screen.
Tested in 64bit windows 11. Sorry friend.
On my w11 it works (pb6.21) with sound and images
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

Thanks Bisonte for the test. Just to be sure, you have the second, updated iteration of the code? The module version?
User avatar
Bisonte
Addict
Addict
Posts: 1313
Joined: Tue Oct 09, 2007 2:15 am

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by Bisonte »

yes. intro, ticker, sys and petski... An downloaded today at 7 a.m. in germany.
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
minimy
Enthusiast
Enthusiast
Posts: 616
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by minimy »

Yes, i got introPlayerModule the last version, i got sound, path is working right but the movie is in black in both 6.21 and 6.02 really weird.
I was looking your code and all is right, weird, weird :?
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

Code: Select all

UseJPEGImageDecoder()
  UsePNGImageDecoder()
  UseOGGSoundDecoder()
  UseZipPacker()
Maybe these should be outside the module intro in some cases... I don't have a clue.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 616
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by minimy »

With debugger enabled work. Really weird
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

Maybe you changed it to 3d, that way it requires a renderworld() also even if no 3d entitites present. (Cameras created automatically)
The second version works only together with audio, as the intro module perfectly syncs the animation directly to the audios play position. (The first version worked with or without it, but was badly asynced with the audio if presented in different machines.)
I'm puzzled though.
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

Now I ran into the same problem as Minimy on a different implementation, so I was able to test. I can't catch sprites, though I can catch images. (only if I specify the size. Catchsprite has no such option.) I can also save back the exact copy of the file to hdd from memorybuffer, so everything is there, but I can only catchsprite a white-empty jpg... Sometimes.... Thats the strangest in this, I don't know how to reproduce the behavior in a consistent way.
The problem occours with .jpg-s.
Last edited by miso on Mon Aug 11, 2025 11:08 pm, edited 1 time in total.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 616
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by minimy »

Phew! finally! I thought I was going crazy examining your code for the error.
I even thought for a moment that I could have a virus. :lol:
It's something super rare. I did the same thing of recording the frames to see if it was a memory problem, but they were correct. I'll keep researching hehe.
Thank you miso, the idea of your movie player is very good.
If translation=Error: reply="Sorry, Im Spanish": Endif
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [GAME INTRO PLAYER] Alternative Movie Player

Post by miso »

I can't be totally sure, but I belive I figured this out.
What happened :

- 1, The background sprite was catched from memory: check
It was a non transparent sprite.
- 2, text sprites had been drawn over it, they were transparent sprites with intensity and color parameters.
- 3. if the last colored sprite was not at color rgba(255,255,255,255), then the background sprite went full white.



What helped?
a, If the bg sprite is captured as transparent, then this is not a problem. (with transparency its slower though)
b, Don't draw transparent sprite over it with color parameter
c, draw a transparent sprite that has rgba color full white as last draw before flipbuffers. (Don't ask, but it helped)
d, use image for the bg and draw that to the screen. I did that, much faster and maybe cleaner. I can still draw sprites over it.

Edit: As I see, this problem was not presented when ogre was enabled. That requires renderworld calls too. The example provided is made for 2d.
Post Reply