PDA

View Full Version : windowed mode


StepS
11 Jul 2012, 12:47
NOTE: there's now a new D3D9Wnd (http://forum.team17.co.uk/showthread.php?t=62048) released, you may want to use it instead.


A quick presentation of what's possible after enabling the windowed mode (by VEG & Kawoosh).

youtube
WA (http://www.youtube.com/watch?v=1aDr3fQcNho), WA on Windows 8 (http://www.youtube.com/watch?v=UdXE3IwqrH8)
WWP (http://www.youtube.com/watch?v=WddnQ-6aTK4)

windoWs 8 users and/or wwp owners rejoice - full compatibility with the system
This also removes the need in virtual machines for streaming W:A.

Please stay notified that this windowed mode isn't proven to work flawlessly on all systems and drivers!
I strongly advise you to consult the README from the archive for the known problems&solutions, and tips. :)

Download (http://myfiles.my1.ru/wa/wk/windowmode.rar).
If you don't yet have WormKit, you will need either WormKitDS (http://worms2d.info/WormKitDS) or WormKit (http://worms2d.info/WormKit). (Steam version only supports WormKitDS)

Notice: possible lags on the videos are thanks to recording software :p

For WWP, check this (http://forum.team17.co.uk/showthread.php?p=776270#post776270) thread.

Pac-Man
11 Jul 2012, 13:00
Possible to modify the window to get its border back?
Does the compatibility option "Run in 640x480" force the frontend to fullscreen but still preserves higher resolutions in-game? Sounds stupid, but is meant for running WWP at all.

StepS
11 Jul 2012, 13:06
Possible to modify the window to get its border back?
the border sucks (except for px ingame), because Worms eats the cursor preventing you from moving the window, and also that compresses WA frontend. This requires to be coded separately, and, if so, with hacks.

Does the compatibility option "Run in 640x480" force the frontend to fullscreen but still preserves higher resolutions in-game? Sounds stupid, but is meant for running WWP at all.
I tested it on WA, and not, it's still 640x480 in-game :( if you specify a higher resolution, the image is going to be pixel-compressed. Probably Kawoosh can do a resolution change option for frontend.

PS: actually dude, instead of Alt+F4 in the WWP you had to HIDE (or minimize) that T17 overlaying window :D because it IS the ingame! lol. and it doesn't crash now

Pac-Man
11 Jul 2012, 16:11
the border sucks (except for px ingame), because Worms eats the cursor preventing you from moving the window, and also that compresses WA frontend. This requires to be coded separately, and, if so, with hacks.
Ah yes, it's somehow useless then. You'd need to recalculate the window size with AdjustWindowRect for fixing the pixelish compression...
However a window border would mess up 640x480 compatibility again. So better forget it.

Obn3g0n
12 Jul 2012, 04:56
this is awesomely cool, and a huge step forward for w:a. afaik this was always thought to be impossible/unfeasible with the current code, so huge props to kawoosh/steps/everyone involved.

are any of the following things possible/planned?

-standard window buttons (minimize, box, and X) with draggable bar (so you could move the game between monitors, scale the frontend up to fill the screen with the box button, drag the frontend around so it's not at top left all the time, etc)

-ability to unbind the mouse from the window by holding a key (so you could move the mouse independently of the game and be free to click the above-mentioned buttons or simply anywhere outside the worms window to 'minimize')? In my virtualbox VM of w:a the mouse binding/unbinding is very flaky with worms, usually causing a crash if i do too much multitasking, so this would be especially nice

-if not the above, how about alt-tab support?

if some of that stuff was implemented this would be 100% perfect in my book, as the performance is already very good. hope this doesn't sound rude/entitled/arrogant/ungrateful (pick your adjective) :p

thanks for all of your continued dedication to this game :)

StepS
12 Jul 2012, 07:05
-standard window buttons (minimize, box, and X) with draggable bar (so you could move the game between monitors, scale the frontend up to fill the screen with the box button, drag the frontend around so it's not at top left all the time, etc)

I explained it above. The thing is that it doesn't work. Why? The game eats the cursor, as you can see (anyone can enable this btw, but it sucks ;) )
Only with hacks this would be possible

-if not the above, how about alt-tab support?
alt-tab is already supported (and win-tab too if you checked the videos). In fact, the frontend has an enabled foreground control, so you will always have access to it.
anything concerning the ingame problems is solved by project x.

CyberShadow
12 Jul 2012, 15:19
The windowed mode (https://dl.dropbox.com/u/48532592/wa/wk/windowmode.rar) library by VEG

Is there more information regarding this library? Home page / source code / license?

StepS
12 Jul 2012, 15:28
Is there more information regarding this library? Home page / source code / license?

I find this (http://habrahabr.ru/post/133956/) as source. The article is mostly about "ddraw" hack, but it tells some information about wndmode.dll as well. It is a modified menopem's d3dhook, which was tweaked to have an ini file, as well as independency and some minor things. No source code for it, as it was done directly in the dll. (I have veg's contact if needed)

The current archive which I posted also contains a WA-specific fix for frontend to prevent the user from seeing white controls instead of input forms, dropdowns, etc. ("wkWndMode.dll")

Obn3g0n
13 Jul 2012, 05:45
Alt tab works you say? I will have to fiddle with it. Thanks for the info.

StepS
13 Jul 2012, 08:16
Alt tab works you say? I will have to fiddle with it. Thanks for the info.

Alt-tab works fine, although if it doesn't for you, use AntiKeyboardHook :)

jsgnext
15 Jul 2012, 18:31
For some reason my game gets stuck at the end of the loading screen...I can hear the BG music of the game, but the window stops refresing...
Im under Windows xp

EDIT:
Looks like PX was the problem....i removed it and it seems to be working now...
Once the game starts (Worms2d window) i cant do alt-tab anymore, i cant minimize the game (even using the vanilla option "minimize the game" from the ESC menu) and i cant move the cursor out of the window tho...
(Im already using AntiKeyboardHook)

Any suggestions? :(

StepS
15 Jul 2012, 19:30
For some reason my game gets stuck at the end of the loading screen...I can hear the BG music of the game, but the window stops refresing...
Im under Windows xp

EDIT:
Looks like PX was the problem....i removed it and it seems to be working now...
Once the game starts (Worms2d window) i cant do alt-tab anymore, i cant minimize the game (even using the vanilla option "minimize the game" from the ESC menu) and i cant move the cursor out of the window tho...
(Im already using AntiKeyboardHook)

Any suggestions? :(
you should have read the "readme" from the archive first. The problem you described has its solution there.

i cant minimize the game (even using the vanilla option "minimize the game" from the ESC menu)
the "minimize the game" option is just the same as Shift+Esc. It's an issue which is described in the readme.
For you, the solution would be Ctrl+Shift+Esc, then right click on "Worms Armageddon" and minimize.
But maybe this issue will be solved from the wndmode's side in future.

and the
Looks like PX was the problem
was an effect caused by a completely unrelated issue. But you could tell me more information about it in PM, including pxlog.txt, pxcrashlog.txt, px_errors.txt and PX.ini

kmustard
25 Jul 2012, 20:55
I am running this "hack", which works flawlessly.

However, it's 640x480 and stuck in the top-right of the monitor.

All I need to change is the resolution of the game/window to 1024x768.

Is this possible?

StepS
25 Jul 2012, 21:51
I am running this "hack", which works flawlessly.

However, it's 640x480 and stuck in the top-right of the monitor.

All I need to change is the resolution of the game/window to 1024x768.

Is this possible?

the in-game resolution is set in the Options screen.
the menu (frontend) resolution is always 640x480, and there's no way to extend it while keeping the pixel sizes. Centering the frontend window is also sort of a problem since frontend listens to the mouse on the top-left (where the window is), and centering the window will make the mouse appear from the other side of the screen when unfocused (and focusing in will also require moving the mouse over the top left). However the centering problems don't touch the in-game (during the match it's always centered or either fullscreen if the resolution is equal to your max)

StepS
5 Sep 2012, 20:11
The wndmode fixer/launcher companion ("wkWndMode.dll") has been updated.

Note: Project X users won't notice any significant changes :)

1. Now it is possible to start the match properly on non-Aero systems without PX. The non-Aero systems are Windows XP, 2000 and lower*, and also the Classic or Simplified vista/7 skin. (Windows 8 always has Aero enabled, so you won't see any changes)
2. Now it is possible to minimize during the match without PX. You can use Win+D or Win+M to minimize, however the traditional Shift+Esc and "Minimize game" still don't work.
3. Added support for 98/Me, but not tested.

* Windows 2000 (and most likely the lower versions) don't support a composited extended window style, required for some menus to work. As an example, Single Player menu doesn't work on 2000, while everything else does.

Obn3g0n
27 Sep 2012, 00:53
I must have changed some setting because the frontend no longer runs in windowed mode - it takes up the whole screen. The in-game stuff works just like it should, in a window. Any help would be most appreciated :) Thanks!

wndmode.ini
UseWindowMode=1
UseGDI=1
UseDirect3D=1
UseDirectInput=0
UseDirectDraw=0
UseDDrawColorEmulate=1
UseDDrawFlipBlt=0
UseDDrawColorConvert=1
UseDDrawPrimaryBlt=1
UseDDrawAutoBlt=0
UseDDrawEmulate=0
UseDDrawPrimaryLost=0
UseCursorMsg=0
UseCursorSet=0
UseCursorGet=0
UseSpeedHack=1
SpeedHackMultiple=10
UseBackgroundResize=0
UseForegroundControl=0
UseFGCGetActiveWindow=0
UseFGCGetForegroundWindow=0
UseFGCFixedWindowPosition=0
EnableExtraKey=0
ShowFps=0
UseCursorClip=0
UseBackgroundPriority=0
DDrawBltWait=-1
Border=1

wa.ini

[Options]
SkipIntro=1
FrontendPaletteFix=12
MapAreaWarnLimit=2147483647
ForceWineVirtualDesktop=1
FrontendUseDesktopWindow=1


px.ini

[PX]
GameLogging=1
Windowed=1
AAState=1
VSync=0
Framelimit=0
BackBuffers=0
SchemeName=

StepS
27 Sep 2012, 13:55
UseDirectDraw=0

this setting completely disables the windowed mode library (the "UseWindowMode" is invalid)
also don't enable border - it doesn't work and compresses the image. there's a way to make it work, but due to a huge bug with cursor deriving from WA limitations it is not done.

Obn3g0n
27 Sep 2012, 17:14
Thank you for the quick reply steps but that didn't work!

Muzer
27 Sep 2012, 17:56
Can't you just restore the original config file from the original download?

StepS
27 Sep 2012, 17:57
Thank you for the quick reply steps but that didn't work!

now please read this:
http://worms2d.info/Troubleshooting_FAQ#Attempting_to_minimize_the_gam e_seems_to_freeze_the_game
and never enable this ****ty option anymore.

RongYao
26 Dec 2012, 10:26
By the way this wrapper which is for Age Of Empires 2 written by VEG is just a fork of D3DWindower which was written by unknown japanese programmer and its not open sourced. The source were available partially. Somehow VEG either have the source or just succeed in patching it for higher compatibility with age of empires 2, but d3dwindower works faster and worms runs with it too.

As for wrappers, CyberShadow may will be interested into dxwnd, the newer version is http://sourceforge.net/p/dxwnd/ here, which is actively developed and source is opened. I reported to the developer of dxwnd that I can't run WA, he said the game seems pretty tricky and he will try to make it runs, but i didn't test the newer version to say if it runs or not.

I'm somehow hoping worms to get windowed mode with the option to move the window around the desktop and different resolutions available.

StepS
29 Dec 2012, 15:27
dxwnd is too bad for WA... it has some issues like the slowdown etc.
btw i know a way to move WA window with any wrapper. but the mouse position in frontend will be messed up

Searinox
1 Jan 2013, 14:16
Is there any way to make the windowed mode stretch to desktop resolution or make fullscreen mode do this? 640x480 keeps resizing and messing up all my windows.

StepS
1 Jan 2013, 16:38
yes, but you'll have to be careful with mouse (it can go too far away), and also it won't work with hardware cursor

Searinox
2 Jan 2013, 10:44
Me an a friend used to play WA and stopped because windows 7 was causing him serious issues. I was hoping that this wrapper would fix them. He's finally able to boot the game again thanks to it. But there's a problem. Whenever he starts the match he hears sound but doesn't see an image.

He has aero disabled and due to non-WDDM(onboard card) he can't enable it unless he buys another graphics card. I tried disabling aero on my side and I get the exact same symptoms. Is there any way to run the wrapper on win7 without aero enabled?

CyberShadow
2 Jan 2013, 11:26
What issues was your friend experiencing? Is he using the latest update?

Searinox
2 Jan 2013, 11:51
Yes we're both using 3.7.0.0. What happens is that everything that's on the screen when the match loading starts just stays there. The image simply doesn't move anymore. So if I had a top left corner image of the menu and the desktop, that's what's left. Sometimes the screen goes completely black but most of the time it stays that way. I have to use alt+f4. When aero is running everything's fine.

CyberShadow
2 Jan 2013, 11:57
Have you tried selecting a different graphics API from the Advanced Options screen, or by importing one of the Renderer_*.reg registry scripts?

Searinox
2 Jan 2013, 13:01
Have you tried selecting a different graphics API from the Advanced Options screen, or by importing one of the Renderer_*.reg registry scripts?

Didn't help. D3D9 completely bypasses the wrapper, bringing back the old issue. D3D7, DD8 and DD32 all produce the same black screen as I mentioned before.

CyberShadow
2 Jan 2013, 13:02
What is "the old issue"? I meant to ask what problems you ran into without any 3rd-party modifications.

Muzer
2 Jan 2013, 13:02
What exactly IS the old issue?

Searinox
2 Jan 2013, 13:46
The "old issue" is the issue he's had with WA that made him unable to run the game until recently when the wrapper appeared to have fixed it. When he launches the game he gets a few seconds worth of black screen then a popup that WA.exe has stopped working. The error details list the faulting module as WA.exe and error code is something like c000005. Tbh I think it's got to do with the 640x480 resolution. He has been unable to play WA ever since upgrading to win7, and the first breath of fresh air he's had was yesterday when I gave him the windowmode plugin. He can now navigate the menus but gets a black/dead image when matches start.

In other words, he needs to use window mode and doesn't have aero. He can't use fullscreen.

Again:

HIS comp no mods = black screen on launch, crash
HIS comp windowmode = menus work, black screen on playing match
MY comp no mods = the usual garbled colors, game works
MY comp in windowmode without aero = menus work, black screen on playing match

Btw I've gotten another person to try the wrapper after disabling aero, they too get a black screen. The main problem is: the plugin doesn't work properly if aero isn't enabled. That's what we need a fix for.

CyberShadow
2 Jan 2013, 13:47
Can you post the exact error message and any generated error logs?

CyberShadow
2 Jan 2013, 13:54
MY comp no mods = the usual garbled colors, game worksThere should be no palette problems when using 3.7.0.0 with any renderer except 8-bit DirectDraw. Please make sure that your W:A installation is not corrupted, that you are using the latest update, and that you are not using any 3rd-party modifications.

That's what we need a fix for.I can't help you with anything involving 3rd-party modifications, but I'd be interested in looking into the problems you're having with an unmodified W:A installation.

Searinox
2 Jan 2013, 14:00
I hadn't actually tested in 32bit mode DDraw. The colors are indeed fixed. I was still running 8bit mode and not noticing since the wrapper never has any color issues,so you're right there. I can't get him to test right now since he's not on, but how come there's no support for the mod? I mean... you released it. Do I need to ask in a different thread?

CyberShadow
2 Jan 2013, 14:19
From the readme file from the zip posted by StepS:
"`Windowed Mode library by menopem & VEG, frontend fix by Kawoosh.'"
I am neither of those people.

Muzer
2 Jan 2013, 14:36
Does your friend have the latest graphics drivers?

Searinox
2 Jan 2013, 14:42
Sorry cyber. I thought you meant there was some sort of legal binding not letting you give support. Should I contact any of them or wait for responses here?

@Muzer: I asked him that yesterday and he said he does. He has some sort of onboard Intel GMA that I forget. He's able to play games like Counter-Strike and other stuff fine. I even asked him to install the DX7 from the disc which didn't help.

StepS
2 Jan 2013, 21:06
lol. I was pretty sure I fixed that issue...
The issue is that for some reason the Worms2D window (why wasn't it merged entirely like "T17"?) is non-transparent while Aero is disabled, and fails to do a proper repainting. Therefore you see the image of any other windows behind it stuck in their position before that window appeared.
Maybe something changed in 3.7.0.0 which stopped my fix from working, but I'm pretty sure it was something simple with either transparency or resizing.
I can't reproduce it now because Windows 8 has Aero enforced (without glass, so it doesn't depend on your graphics card), will try later in a virtual machine.
Another funny thing: transparency issues appear to happen only on Vista and 7 without Aero; XP is fine even though it doesn't have DWM at all.

btw, forgot to ask: are you using the package from the first post? Because I saw some other appearings of wndmode in other distributions on this forum. Only my package includes the fix I mentioned

Searinox
3 Jan 2013, 19:33
lol. I was pretty sure I fixed that issue...
The issue is that for some reason the Worms2D window (why wasn't it merged entirely like "T17"?) is non-transparent while Aero is disabled, and fails to do a proper repainting. Therefore you see the image of any other windows behind it stuck in their position before that window appeared.
Maybe something changed in 3.7.0.0 which stopped my fix from working, but I'm pretty sure it was something simple with either transparency or resizing.
I can't reproduce it now because Windows 8 has Aero enforced (without glass, so it doesn't depend on your graphics card), will try later in a virtual machine.
Another funny thing: transparency issues appear to happen only on Vista and 7 without Aero; XP is fine even though it doesn't have DWM at all.

btw, forgot to ask: are you using the package from the first post? Because I saw some other appearings of wndmode in other distributions on this forum. Only my package includes the fix I mentioned

YES Steps you are entirely correct!! I was using the package from the WWP thread! Now with the proper wrapper version, it works without Aero! I shared it to my friend who immediately went into the game AND CAN NOW PLAY the game! THANK YOU!

StepS
9 Jan 2013, 00:01
The companion has been updated.
Improved Win+D/Win+M minimization in-game (Shift+Esc will not work) + Alt-tab
Experimental border support for in-game only (Border=1 in wndmode.ini), can also show FPS (ShowFps)
the white fields fix is now partially obsolete and now works only with 3.6.31.0 and lower
non-Aero users* should only use 32-bit DirectDraw
readme updated.

Soon:
ability to unstick mouse in-game (and probably manœuvre for Shift+Esc)
support for 3.6.29.0 and lower (WWP manœuvre)

*non-Aero users are: Windows XP and lower, Vista/7 Classic/Simplified theme or Disabled Desktop Composition. Windows 8 has enforced Aero (all Windows 8 users use enabled Aero)

Searinox
9 Jan 2013, 21:12
The companion has been updated.
Improved Win+D/Win+M minimization in-game (Shift+Esc will not work) + Alt-tab
Experimental border support for in-game only (Border=1 in wndmode.ini), can also show FPS (ShowFps)
the white fields fix is now partially obsolete and now works only with 3.6.31.0 and lower
non-Aero users* should only use 32-bit DirectDraw
readme updated.

Soon:
ability to unstick mouse in-game (and probably manœuvre for Shift+Esc)
support for 3.6.29.0 and lower (WWP manœuvre)

*non-Aero users are: Windows XP and lower, Vista/7 Classic/Simplified theme or Disabled Desktop Composition. Windows 8 has enforced Aero (all Windows 8 users use enabled Aero)

Going to try it out now.

Oh no, this update breaks windows aero again. I'm getting black screens again! And yes I am in DirectDraw32 mode.

Steps, could you add a stretch-to-desktop-resolution option? Like, stretching the whole window over the desktop while the game still thinks it's in a different resolution Resolutions like 1920x1080 are getting a bit excessive, and it would be nice if I could make it render at 1600x1200 and still having it cover the whole screen without resizing my desktop and messing up my icon placement. The "use desktop window" option from the game actually does this, but the mouse cursor ungrabs from the menu when it leaves the 640x480 window. Software cursor scales it properly, but again the mouse cursor is ungrabbed as soon as it leaves the lower/right area. Actually I think adding an option to lock the cursor within the window will solve the problem more easily.

StepS
10 Jan 2013, 09:49
Oh no, this update breaks windows aero again. I'm getting black screens again! And yes I am in DirectDraw32 mode.
i'm actually tired of writing endless crutches specially for users without DWM. get a proper aero and don't trouble others

Steps, could you add a stretch-to-desktop-resolution option?
no. hardware cursor will not work as needed, so no. also we cannot physically enlarge mouse perception area, we cannot move frontend properly AT ALL. impossible without highly qualified reverse engineering professionals. thanks to Team17 bad programming in 1999

Searinox
10 Jan 2013, 18:09
i'm actually tired of writing endless crutches specially for users without DWM. get a proper aero and don't trouble others


no. hardware cursor will not work as needed, so no. also we cannot physically enlarge mouse perception area, we cannot move frontend properly AT ALL. impossible without highly qualified reverse engineering professionals. thanks to Team17 bad programming in 1999

I'm not troubling anyone, the plugin troubled me and I just reported a bug. The DWM issue isn't mine, it's someone else's. I'm trying to help him, not myself. Well, since the old plugin works I'll just keep that.