Layout for multiple sessions

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
gus
GamingTools Subscriber
Posts: 46
Joined: Fri Jul 09, 2004 12:08 am

Layout for multiple sessions

Post by gus » Fri Jun 17, 2005 10:43 am

What're the chances of IS/WinEQ ever supporting a layout like the following for multiple sessions with the PIP swapping behaviour:

1 1280x960 session in the upper left.
5 320x240 sessions down the left side.
1 1280x240 strip across the bottom for whatever (perhaps perma IS HUD).

I've tried standard PIP, but I've some issues. It takes 5+ seconds for a swap to occur, far too long compared to non-PIP session swapping. The PIP windows overlap with content in the primary session, reducing visibility. I have limited ability in the game to modify the location where content is render to avoid the overlap.

This is with multple EQ2 sessions. I will try playing around with the widescreen options in EQ2 see if I can get something I like. Unfortunately, that places equal sized bars at the top and bottoms of the screen, in the dimension with the least resolution. If it had left/right and single sided clipping, I'd be much happier. A 1600x1200 with 5 320x240 at the top becomes effectively 1600x720, a 40% reduction.

Anyway, keep up the good work Lax. Customer for life here. ;)

--gus

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Fri Jun 17, 2005 11:21 am

WinEQ, never (limitations in the program). IS, immediately.

5+ seconds for swapping seems pretty bad. And, I'll tell you why it happens. With EQ2 (and even WoW, probably many other games as well), when you resize the window, you cause the game to reset the Direct3D device so it can set the resolution to the size of the visible portion of the window. This is in contrast to EQ1, where resizing simply scales the picture, not involving setting the resolution or resetting Direct3D. When the reset happens, all Direct3D resources have to be loaded again. Every texture, etc. That's why it will take so long at present.

Now for what you're looking for.

You may or may not have discovered with IS that PiP.iss is just a script that runs on a single session when it becomes foreground.

Here's the part you would want to customize:

Code: Select all

;Do not remove or change this line.  --IS0.94
; Picture-in-Picture

; This is the upper left corner, given in pixels, of where Picture windows will start.  They will
; be lined up in a single direction from this point.  The direction is chosen below
#define LEFT   20
#define TOP    20

; Height and width by default are calculated to 1/4 of the height and width of the active window
#define HEIGHT ${Math.Calc[${Display.ViewableHeight}/4]}
#define WIDTH  ${Math.Calc[${Display.ViewableWidth}/4]}
; They can be numbers, as below
;#define HEIGHT 320
;#define WIDTH  240


; Select one direction by changing the line below to one of the four possibilities
#define DIRECTION    DIRECTION_DOWN

; Don't change these four lines
#define DIRECTION_DOWN  y:Inc[${cy}]
#define DIRECTION_UP    y:Dec[${cy}]
#define DIRECTION_RIGHT x:Inc[${cx}]
#define DIRECTION_LEFT  x:Dec[${cx}]
It's fairly simple. If you want 5 320x240 sessions, uncomment the 320 and 240 lines, and comment the 2 lines above it with calculations. By default, the PIP windows start at 20,20, you can set that too. And if you want them across the top, you can do that by changing DIRECTION_DOWN in the #define DIRECTION to DIRECTION_LEFT. Etc. Then, if you want to change the size of the main window, you can simply change the "normal" size in PreInit.iss here:

Code: Select all

function NormalSession()
{
; customize this part for other games
  alias normalsize WindowSize -viewable [color=red]1024x768[/color]
  alias tinysize WindowSize -viewable 256x192
  noparse alias normalposition WindowPos -viewable ${Display.DesktopX},${Display.DesktopY}
  noparse alias tinyposition WindowPos ${Math.Calc[${Display.DesktopX}+10].Int},${Math.Calc[${Display.DesktopY}+10].Int}
  alias fullscreenmouse
  alias normalmouse
  alias tinymouse
  alias pipforeground normal

  bind fullscreenkey SHIFT+ALT+f fullscreen
  bind normalkey SHIFT+ALT+n normal
  bind tinykey SHIFT+ALT+t tiny
  bind next CTRL+ALT+x "uplink focus -next"
  bind previous CTRL+ALT+z "uplink focus -previous"
}
The only thing difficult from the above at this point is a strip across the bottom, if it needs to be part of a session (for displaying a HUD, etc). Though you could have a dummy Direct3D process and have sessions relay info to it to display.

gus
GamingTools Subscriber
Posts: 46
Joined: Fri Jul 09, 2004 12:08 am

Post by gus » Fri Jun 17, 2005 3:47 pm

I wasn't aware I could use this -viewable option so that the main window and the PIP windows would not overlap visually! I'll try it out when I get home tonight.

Yes, the strip on the bottom is a bit strange. But, perhaps I could set a non-4:3 aspect ratio of 1280x1200 on the main window? This dummy D3D process you mention, is this something that exists already, or an IS customization you're suggesting via the SDK?

Is there anything I can do about this D3D reset behaviour? Sounds like you're saying it's an issue with the applications and their response to a window resize event. Are there workable alternative means of IS implementing PIP behaviour that would not require letting the applications be aware of the window resize event?

Thanks.

--gus

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Fri Jun 17, 2005 3:54 pm

The dummy program I mention doesn't technically exist at this point (at least as far as IS is concerned), but is something I can whip up quite easily and distribute with the ISXDK. It *is* distributed with the DirectX SDK though.

For the D3D reset behavior, I'm going to implement a way for the window sizing commands to prevent it.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Fri Jun 17, 2005 4:11 pm

Ok. I've done this for next build. If you give -rescale (must be absolutely first) to WindowSize or WindowScale, it will make the window simply scale the image rather than allow D3D reset.

gus
GamingTools Subscriber
Posts: 46
Joined: Fri Jul 09, 2004 12:08 am

Post by gus » Fri Jun 17, 2005 6:38 pm

I will test it next time IS updates. --gus

gus
GamingTools Subscriber
Posts: 46
Joined: Fri Jul 09, 2004 12:08 am

Post by gus » Sat Jun 18, 2005 10:26 pm

Hmm, trying out the -rescale option with PIP, but I was getting confused pretty quickly. So, I'm using the following simplified senario to test:

AutoExec.ice

Code: Select all

Events -set "On Activate" run OnActivate
Events -set "On Deactivate" run OnDeactivate
OnActivate.iss

Code: Select all

function main()
{
	WindowSize 1024x768
}

OnDeactivate.iss

Code: Select all

function main()
{
	WindowSize -rescale 640x480
}
Then, as I move my mouse in and out with a click it resizes. Now, when I Deactivate (shrink), it does indeed shrink. However, it scales down rather oddly, the right and bottom sides of the window are all black, but the upper left appears to have scaled correctly. Further, mouse events seem to be working on the original size and not on the scaled size, evidenced by my mouse having to be quite visuall far from a graphic that has a mouse-over effect for it to behave as if the mouse was truly over it.

The mouse thing isn't a huge deal, but it could make Activating via mouse click a bit hit or miss as to whether you'll land on a GUI element that does something. The visual thing is more important IMO.

I've got some SS of this, but I'm clueless as to how to upload images on posts, and I've no external hosting. Can email them if you like.

--gus

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 19, 2005 9:31 am

Yes, rescaling is going to mess with the mouse and the behavior you describe with that is what I would expect. I could possibly work around that, but it may not be worth it in the end ;)

As far as the black parts, I'll have to rescale EQ2 and see what's going on I guess. It's probably something weird the game does.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 19, 2005 10:34 am

Yeah. Definitely something weird the game does. World of Warcraft performs 100% correctly, but EQ2 is actually only displaying the portion of the image equal to the scale % of the window, in each direction. Example.. if I do "windowscale -rescale 90", EQ2 is showing 90% of the image in each direction (or, 90% * 90% = 81% of the image). If I do "windowscale -rescale 50", EQ2 is showing 50% of the image in each direction (or, 25%).

I will have to do some research on this one.

Post Reply