[THPS2] Windowed mode

General/other thps modding discussion
Demo
Posts: 488
Joined: Mon Aug 15, 2011 2:20 pm
Contact:

[THPS2] Windowed mode

Postby Demo » Tue Aug 09, 2016 12:40 am

This is how you can force THPS2 to be rendered in windowed mode. This was a thing since at least 2012-02-28 using tinyddraw, which is a fork of D3DWindower (i guess). Courtesy of Evgeny Vrublevsky. I only edited ini file here, so mouse works correctly. just extract it to your thps2 folder and it should work with both vanilla and patched game. You can't move your window though.

Download:
th2windowed.7z
(257.59 KiB) Downloaded 1033 times

Instructions:
- download the attachment
- extract the archive to your game folder
- launch the game

Notice: this dll ONLY forces THPS2 to be rendered in a window and it uses game's internal resolution. You can change resolution in Cumulative Patch launcher.

Original links:
https://bitbucket.org/veg/tinyddraw/src
https://bitbucket.org/veg/tinyddraw/dow ... ndmode.zip
Last edited by Demo on Sun Feb 09, 2020 10:43 pm, edited 3 times in total.
Hinkii
Posts: 3
Joined: Mon Apr 02, 2018 4:30 am
Contact:

Re: [THPS2] Windowed mode

Postby Hinkii » Mon Apr 02, 2018 8:31 pm

How to change the resolution?
barfpony
Posts: 3
Joined: Thu Jan 02, 2020 10:56 pm
Contact:

Re: [THPS2] Windowed mode

Postby barfpony » Thu Jan 02, 2020 11:00 pm

Thanks for doing this work, Demo.

I have everything working, but I've noticed a couple of issues. I can't get THPS2 to launch without a border, even with the window fix, because my resolution is 2560 x 1440. The game won't launch at that resolution, so either I can use the window fix and be stuck with a window, or I can launch it without the window fix and get a border. The game won't launch above 1920 x 1080.

I've noticed a sound issue (note that I've only launched the Hanger level) where an odd buzzing starts after 10-20 seconds. It's not in the music, only in the game sounds. Turning them down disables them. Perhaps I have a corrupt file...?

Thanks!

Barfpony
Demo
Posts: 488
Joined: Mon Aug 15, 2011 2:20 pm
Contact:

Re: [THPS2] Windowed mode

Postby Demo » Tue Jan 07, 2020 10:13 pm

this the original game limitation. it uses directdraw, and afaik it has screen buffer limitation of 2047x2047 pixels. means you can't even create larger screen surface. since your display is 2560 pixels wide, the game simply can't handle that. you may try 3dfx alternatives with widescreen patch by thirteenag, but i don't know if it'll work.

as of the buzzing, is it on the other levels? maybe it's just the normal lamp buzzing?
what's your display refresh rate? mind that the game is originally locked at 30fps, so most scripts will run twice faster at 60fps, 4 times faster at 120fps etc.
barfpony
Posts: 3
Joined: Thu Jan 02, 2020 10:56 pm
Contact:

Re: [THPS2] Windowed mode

Postby barfpony » Mon Jan 20, 2020 5:30 pm

You're probably right about the buzzing, it's just been a really long time since I played the game, and it struck me as odd. So let's forget about that one, my bad :/

Here's how I dealt with the resolution issue so I could play the game in a high, widescreen resolution, with absolutely no window borders, on my 1440p monitor.

I set your launcher to run the game at 1920 x 1080, then I set up the Windowed Mode mod. Then I used NirCmd (http://www.nirsoft.net/utils/nircmd.html) and a batch file to automate changing my system resolution before and after the game executes. This was a little tricky since your launcher spawns the THawk2.exe process, so I couldn't just wait for it to end. Here's the code for my batch file:

Code: Select all

@echo off
nircmdc.exe setdisplay 1920 1080 32
start th2patchlauncher.exe -F
timeout /t 5 /nobreak>nul
:waitloop
tasklist /FI "IMAGENAME eq Thawk2.exe" 2>NUL | find /I /N "THawk2.exe" >NUL
IF "%ERRORLEVEL%"=="0" (
  timeout /t 1 /nobreak>nul
  GOTO waitloop
)
nircmdc.exe setdisplay 2560 1440 32


For the folks at home, it runs nircmdc.exe (the command-line version of nircmd, which I just put in my Tony Hawk 2 directory, since I probably won't use it for anything else) and sets the screen resolution to 1920 x 1080, 32 bits. Then, it starts Demo's TH2 launcher in quiet mode (-F). Things are a little tricky here, because, at least on my system, Windows 10 UAC will ask for approval before it launches. I put in a 5 second timer in the batch file so you have a chance to authorize it (if you don't do it in time, the batch file will move on and change the resolution, and THPS2 will quit). After that, there's a wait loop that keeps checking the task manager to see if THawk2 is running. If it detects that it isn't, it runs nircmdc again and resets your resolution (in my case, back to 2560 x 1440, 32 bits).

I've got THPS2 set up in Launchbox this way, pointing to my .bat. I had to override startup settings in LB and turn on the aggressive window minimizing option to stop the command prompt from messing with Big Box, but it works. I just have to make sure I hit yes in time!

Cheers!
barfpony
Posts: 3
Joined: Thu Jan 02, 2020 10:56 pm
Contact:

Re: [THPS2] Windowed mode

Postby barfpony » Mon Jan 20, 2020 9:04 pm

Looking as this again, I realized that the first timeout isn't necessary, since th2patchlauncher.exe is generating the UAC request, not THawk2.exe. So, the batch can just wait:

Code: Select all

@echo off
nircmdc.exe setdisplay 1920 1080 32
start /wait th2patchlauncher.exe -F
:waitloop
tasklist /FI "IMAGENAME eq Thawk2.exe" 2>NUL | find /I /N "THawk2.exe" >NUL
IF "%ERRORLEVEL%"=="0" (
  timeout /t 1 /nobreak>nul
  GOTO waitloop
)
nircmdc.exe setdisplay 2560 1440 32

Return to “Other THPS games modding”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests