Page 2 of 2

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Nov 12, 2015 10:58 am
by Victor Delacroix
Can these movies be converted to something futureproof like .bik format and the script/classes updated accordingly? It'd help a great deal as it would essentially remove the need for separate codecs.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Nov 12, 2015 1:01 pm
by han
Basically converting them to anything DirectShow compatible (while keeping the filename) should work.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Nov 12, 2015 2:41 pm
by Victor Delacroix
Basically converting them to anything DirectShow compatible (while keeping the filename) should work.
But thing is, BINK isn't directshow compatible out of the box (I think playing binks in WMP would require some codec too) whereas changing stuff to bik support in the game would permanently fix the problem as the game would play it using binkw32.dll and not use directshow.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Nov 12, 2015 10:44 pm
by han
Video playback is handled by WinDrv native code, although it is started by uc code. But if you do make some kind of video playback implementation the ViewportManager would probably the best spot to put it. So you could port over SDL2Drv, add bing video playback support to it and fix the annoying some window remains after video playback issue (along a long list of deficiences this old WinDrv package has).

Or you convert the videos to sth. DirectShow supports, MPEG1 or sth and it should work without any need for additional codecs or much work.

But if you port SDL2Drv over I would suggest giving [url=http://icculus.org/smpeg/]SMPEG[/url] a try. But well, then you have MPEG1 again, no preferences or log window, but at least a useable ViewportManager.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Sun Nov 15, 2015 3:40 am
by han
To abuse these thread even further for my own stuff:

Looks like i have found a way to get rid of that annoying black window on top after playing videos. But to be honest, I have no idea if that if that OpenGLDrv is based on the same source as the release above, but I should get some proper codebase for KHG going anyway...

http://coding.hanfling.de/launch/release/OpenGLDrv-Klingons-11-20151115.zip

For those interessted in details:
Just some SetWindowPos( Viewport->GetWindow(), HWND_TOPMOST, ... ) at the end of SetRes().

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Fri Dec 18, 2015 12:02 am
by MusicallyInspired
Interesting developments! Thanks for your work!

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Wed Feb 24, 2016 4:41 pm
by chockimon
I've tried everything under Windows 7 & Windows XP, including the KHG_v11_DriverPack and the movies will not play at all. I have the retail version and the music plays from the CD, but I can't get the movies to play at all. I installed the video codecs and registered them, but the movies still won't work. Apart from the movies, using Glide the game runs great. Any other ideas on how to get the movies working?

Thanks :)

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Wed Feb 24, 2016 7:32 pm
by chockimon
It turns out the reason it wasn't working was because I had the Media Player Codecs software installed. After uninstalling them it's now working. :)

I can't believe I just wasted 2 days trying to get this game to work and it was the codecs package stopping the game from working all along. >:(


Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Sat Oct 14, 2017 6:12 pm
by SireErec
For me the Cutscenes are working partially (Windows 10)

The buildup / down video is running but the Video itself is just a centered image on a grey background.

Have to test tough if the possible 2nd cutscenes are being played too (like the flight to Thress.)

Which are "DirectShow" Codecs & how can i convert the cutscenes into them so that they´re working properly again?

Also thx for the OpenGL Files. It feels now more stable & with the bigger resoultion it looks better too.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Mon Oct 16, 2017 12:46 pm
by SireErec
Now the Game Crash on me when i try to start even cutscenes. lately it worked so i dont know what the error might be.

I use the OGL Drivers from here & edited the kgh.ini with the additions of the ini from the zip.
To abuse these thread even further for my own stuff:

Looks like i have found a way to get rid of that annoying black window on top after playing videos. But to be honest, I have no idea if that if that OpenGLDrv is based on the same source as the release above, but I should get some proper codebase for KHG going anyway...

http://coding.hanfling.de/launch/release/OpenGLDrv-Klingons-11-20151115.zip

For those interessted in details:
Just some SetWindowPos( Viewport->GetWindow(), HWND_TOPMOST, ... ) at the end of SetRes().
So when the game tries to switch from OGL to SoftDrv Engine i get a "General Protection Fault"


ScriptLog: Console entering Menuing
ScriptLog: AVI Index: 15
ScriptLog: AVIToPlayBrief10.avi Y None N
Log: Cmd: Brief10.avi Y None N None N None N None N
Log: **************** PLAYAVI START *************************
Log: Viewport WindowsViewport0: WM_DisplayChange
Log: Bound to SoftDrv.dll
DevAudio: Galaxy SetViewport: NULL
Log: Setting 640x480x16
Log: DirectDraw Failed 640x480x16: DDERR_UNSUPPORTED
Log: DirectDraw was unable to set the requested video mode
Log: 3d hardware initialization failed
DevAudio: Galaxy SetViewport: WindowsViewport0
Critical: UWindowsViewport::Exec
Critical: APlayerPawn::execConsoleCommand
Critical: UObject::ProcessEvent
Critical: (Console Transient.Console0, Function Engine.Console.Menuing.KeyEvent)
Critical: UEngine::InputEvent
Critical: UWindowsViewport::CauseInputEvent
Critical: WM_KEYDOWN
Critical: UWindowsViewport::WndProc
Critical: WWindow::StaticProc
Critical: DispatchMessage
Critical: 0003086A 256
Critical: MessagePump
Critical: MainLoop
Exit: Executing UObject::StaticShutdownAfterError
Exit: UGalaxyAudioSubsystem::ShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Log: DirectDraw End Mode
Exit: appExit
Uninitialized: Name subsystem shut down
Uninitialized: Log file closed, 10/16/17 14:37:42

Or should i make a new Tread for this?

EDIT1:

Now it works perfectly after:
- Removing the K-Lite Codec Pack
- Reinstall the Indeo Codec
- by using a ddraw.dll from a dgvoodoo wrapper i used for another game.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Wed Jun 12, 2019 4:47 pm
by Res1s7
Hi. Wow, what a job to get this game working. Thanks so much for these files ! I can report that the updated OpenGL renderer (linked in the previous post) does work and there is no longer the black box problem after a video plays.

I added a section to the relevant PcGamingWiki page. The problem for me (I assume for everyone else) is not being able to get the game installer to work, but the PcGamingWiki guide gives a solution. There is another driver pack which is linked from the guide I reference ( https://fdossena.com/?p=khg/index.frag ) but this only allowed low resolutions on my machine.

The only issue I've seen so far is that the background planet in the skybox is missing at the very beginning of the game.

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Mon Aug 05, 2019 7:56 pm
by Knight_KenF
Hi. Wow, what a job to get this game working. Thanks so much for these files ! I can report that the updated OpenGL renderer (linked in the previous post) does work and there is no longer the black box problem after a video plays.

I added a section to the relevant PcGamingWiki page. The problem for me (I assume for everyone else) is not being able to get the game installer to work, but the PcGamingWiki guide gives a solution. There is another driver pack which is linked from the guide I reference ( https://fdossena.com/?p=khg/index.frag ) but this only allowed low resolutions on my machine.

The only issue I've seen so far is that the background planet in the skybox is missing at the very beginning of the game.
Thank you i will read that but i need to complete Rune first and since KHG was crashing i almost lost hope, and surprisingly you made another fix.
Thanks again!

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Aug 22, 2019 11:32 am
by Akyra
Hi, regarding the dark screen of the video, I dealt with the Bink player, where Sebastian had a bug in the OpenGL driver code. I don't remember it anymore, it was something in the glColor4f setup or RGBA...
I'm sending the right code:
(perhaps it will help, anyway it's not windows.dll or windrv.dll error)

Code: Select all

// Called for each Bink frame. RenDev is NOT locked at this point.
            else if( ParseCommand(&Cmd,TEXT("DoBinkFrame")) )
            {
                  // Emulate Lock and SetSceneNode.
                  check(Viewport);
                  glClearColor( 1.0f, 1.0f, 1.0f, 1.0f);
                  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT );
                  glViewport( 0, 0, Viewport->SizeX, Viewport->SizeY );
                  glMatrixMode( GL_PROJECTION );
                  glLoadIdentity();
                  glOrtho( -Viewport->SizeX/2.f, Viewport->SizeX/2.f, -Viewport->SizeY/2.f, Viewport->SizeY/2.f, -1.f, 1.f );

                  // Grab Bink frame.
                  DWORD BinkFrameSize = 960*540*8;
                  BYTE* BinkFrame = (BYTE*)appMalloc( BinkFrameSize, TEXT("BinkFrame") );
                  appMemzero( BinkFrame, BinkFrameSize );
                  BinkCopyToBuffer( Viewport->BinkHandle, BinkFrame, 960*4, 540, 0, 0, BINKSURFACE32R|BINKCOPYALL );
                  SetBinkTexture( 0, BinkFrame, 960, 540, GL_RGBA, GL_UNSIGNED_BYTE);
                  appFree( BinkFrame );

                  SetBlend( 0.0 );
                  glColor4f (1.0f, 1.0f, 1.0f, 1.0f);

                  FLOAT S;
                  FBox Box;
                  switch ( BinkScaling )
                  {
                        case BS_Full:
                              Box = FBox( FVector(-Viewport->SizeX/2.f,-Viewport->SizeY/2.f,0.f), FVector(Viewport->SizeX/2.f,Viewport->SizeY/2.f,0.f) );
                              break;
                        case BS_Inside:
                              S = Min(Viewport->SizeX/960,Viewport->SizeY/540);
                              Box = FBox( FVector(-320*S,-240*S,0.f), FVector(+320*S,+240*S,0.f) );
                              break;
                        case BS_Outside:
                              S = Max(Viewport->SizeX/960,Viewport->SizeY/540);
                              Box = FBox( FVector(-320*S,-240*S,0.f), FVector(+320*S,+240*S,0.f) );
                              break;
                        case BS_Off:
                        default:
                              Box = FBox( FVector(-320,-240,0.f), FVector(+320,+240,0.f) );
                              break;
                  }

                  glBegin( GL_TRIANGLE_FAN );
                        glTexCoord2f( 0.f, 0.f ); glVertex3f( Box.Min.X, Box.Min.Y, 0.f );
                        glTexCoord2f( 1.f, 0.f ); glVertex3f( Box.Max.X, Box.Min.Y, 0.f );
                        glTexCoord2f( 1.f, 1.f ); glVertex3f( Box.Max.X, Box.Max.Y, 0.f );
                        glTexCoord2f( 0.f, 1.f ); glVertex3f( Box.Min.X, Box.Max.Y, 0.f );
                  glEnd();

                  // Emulate Unlock.
#ifdef __LINUX__
                  SDL_GL_SwapBuffers();
#else
                  verify(SwapBuffers( hDC ));
#endif
                  return 1;
            }

Re: Klingon Honor Guard v1.1 Driver Pack (OpenGL/Glide, IV50 Codec)

Posted: Thu Aug 22, 2019 11:34 am
by Akyra
All search in opengl.cpp

Addition:

Code: Select all

void Unlock( UBOOL Blit )
      {
            guard(UOpenGLRenderDevice::Unlock);
            EndBuffering();

            // Fallback for Bink rendering if UseDirectDraw=True.
            if ( Viewport && (Viewport->RenderFlags&LOCKR_Bink) && BinkMem )
            {
                  glViewport( 0, 0, Viewport->SizeX, Viewport->SizeY );
                  glMatrixMode( GL_PROJECTION );
                  glLoadIdentity();
                  glOrtho( -1.f, 1.f, -1.f, 1.f, -1.f, 1.f );

                  SetBlend( 0 );
                  SetBinkTexture( 0, BinkMem, Viewport->SizeX, Viewport->SizeY, GL_RGBA, GL_UNSIGNED_BYTE );
                  glColor4f( 1.f, 1.f, 1.f, 1.f);

                  FLOAT DU = 0.5f-(320.f/Viewport->SizeX);
                  FLOAT DV = 0.5f-(240.f/Viewport->SizeY);
                  FLOAT D;
                  FBox Box;
                  switch ( BinkScaling )
                  {
                        case BS_Full:
                              Box = FBox( FVector(DU,DV,0.f), FVector(1.f-DU,1.f-DV,0.f) );
                              break;
                        case BS_Inside:
                              D = Min(DU,DV);
                              Box = FBox( FVector(D,D,0.f), FVector(1.f-D,1.f-D,0.f) );
                              break;
                        case BS_Outside:
                              D = Max(DU,DV);
                              Box = FBox( FVector(D,D,0.f), FVector(1.f-D,1.f-D,0.f) );
                              break;
                        case BS_Off:
                        default:
                              Box = FBox( FVector(0.f,0.f,0.f), FVector(1.f,1.f,0.f) );
                              break;
                  }

                  glBegin( GL_TRIANGLE_FAN );
                        glTexCoord2f( Box.Min.X, Box.Min.Y ); glVertex3f( -1.f, -1.f, 0.f );
                        glTexCoord2f( Box.Max.X, Box.Min.Y ); glVertex3f( +1.f, -1.f, 0.f );
                        glTexCoord2f( Box.Max.X, Box.Max.Y ); glVertex3f( +1.f, +1.f, 0.f );
                        glTexCoord2f( Box.Min.X, Box.Max.Y ); glVertex3f( -1.f, +1.f, 0.f );
                  glEnd();

                  Viewport->ScreenPointer = NULL;
                  appFree( BinkMem );
                  BinkMem = NULL;
            }

            // Unlock and render.
            check(LockCount==1);
            //glFlush();
            if( Blit )
            {
                  //Check( TEXT("Please report this bug") );
#ifdef __LINUX__
                  SDL_GL_SwapBuffers();
#else
                  verify(SwapBuffers( hDC ));
#endif
            }