Fullscreen mode doesn't work (DSB 0.55)

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
Stingm
Apprentice
Posts: 58
Joined: Wed Jan 26, 2011 7:36 pm

Fullscreen mode doesn't work (DSB 0.55)

Post by Stingm »

I have this new version and love it. But have one problem. It won't play full screen! It stops at loading objects and freezes there until I ctrl alt delete out. It runs windowed fine but can the full screen be fixed? I have an intel i5 with an hd graphics card and windows 7 if that helps.
Thanks for any help!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

It still works for me. :?
This is a bit of a mystery!

You could try to disable dynamic switching in dsb.ini (add "ModeSwitch = 0" to the [Settings] section) or enable triple buffering. However, I'm a little perplexed because if it gets to loading objects, the game has already done all of the graphics init and it seems like it's freezing up on something else entirely. I presume you never see "STARTING INTERFACE" which is the last thing before the game actually gets going, though...

What does log.txt say?
Stingm
Apprentice
Posts: 58
Joined: Wed Jan 26, 2011 7:36 pm

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Stingm »

Okay when I edit the config file it freezes. When I goto fullscreen in game it shows the menu screen but I can't move the mouse pointer! I never see the starting interface thing. Heres the log text:

Code: Select all

INIT: Parsing configuration file
INIT: Using gamedir C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon (base:0)
INIT: Starting windowed mode
INIT: Using color depth of 32
INIT: Starting FMOD
INIT: Triple buffering unavailable or disabled.
LUA: Lua initialized
Parsing base/global.lua
Parsing base/graphics.lua
Parsing base/gui_info.lua
Parsing base/inventory_info.lua
Parsing base/util.lua
Parsing base/triggers.lua
Parsing base/conditions.lua
Parsing base/monster.lua
Parsing base/monster_ai.lua
Parsing base/methods.lua
Parsing base/damage.lua
Parsing base/xp.lua
Parsing base/magic.lua
Parsing base/msg_handlers.lua
Parsing base/hooks.lua
Parsing base/system.lua
Parsing base/render.lua
Parsing base/startup.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/startup.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/graphics.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/new_magic.lua
Parsing base/objects.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/objects.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/moneybox.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/quiver.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/doublealcoves.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/throwtrolin.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/multivexirk.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/ruster.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/poisondart.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/monstercapture.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/psychic_demon.lua
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/dm2table.lua
OBJ: 426 total archs
DUNGEON: Attempting to load
Parsing C:\Games\Unzipped\DND Stuff\Dungeon Master\DSB Stuff\test_dungeon/dungeon.lua
SHUTDOWN: Shutting down...
 
I tried disabling the triple buffering and going to full screen in game. I get back to the menu and the mouse pointer disappears.

When I do modeswitch=0, the game loads but freezes after importing objects again. I copied and pasted your line to setup so I know it was right. It may be my intel hd graphics card. It has problems with a few other games too. Atleast it runs windowed so I can atleast play. If you have any other ideas please let me know! Thanks for all the help so far!
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Fullscreen causes issues on my computer too, although the engine does run without freezing.

I can confirm that the initial startup interface does not work properly in fullscreen: you can read the startup white text, but no blue background is drawn, so it appears over whatever your Windows screen is showing. If that happens to be a white file manager window, you can't read the startup text.

Once DSB has loaded, there are other problems: the original Windows mouse appears in the middle of the screen and can't be moved. And the Windows start button flashes in the left hand corner. I wonder if this is an Allegro problem, or if it might be fixed by using a Windows compatibility mode?

I have a reasonably powerful card, an AMD (ATI) HD6870 with the latest drivers.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Bit »

There really seem to be *several* problems with Allegro 4.2 and 64-bit computers.
Had to replace Allegro 4.2 by Allegro 5.0.8 for Sphenx when testing my DM2-stuff. The old lib won't work on his machine.
But then new problems arise when you close a notebook while the program stills runs.
Then D3D doesn't provide a locked bitmap anymore which results in a dead pointer when drawing on the backbuffer.
Sophia may take a look in the Allegro-forum, I recently started a topic there and still haven't solved the problem.
Because I also miss the MIDI-driver, I managed it now to use both libs simultaneously. That's really possible.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

Unfortunately, it's going to be difficult for me to recommend any fixes because nothing jumps out at me and I don't have any of these kinds of problems on my own computer.
Stingm
Apprentice
Posts: 58
Joined: Wed Jan 26, 2011 7:36 pm

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Stingm »

Glad to know I'm not the only one with the problem. I will wait patiently for an answer! Like I said the windowed mode works perfect and I am realy enjoying DSB! Thanks for all your hard work!
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Sophia, out of interest, what GFX card do you have?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

I have an Nvidia 8800 GT. Perhaps more relevant is that I'm still using DirectX 9 on Windows XP.

I'm quite certain that support for the very old software rendering approach taken by DSB has declined considerably in current Windows and/or DX releases. Something needed by DSB and/or Allegro 4 might have broken somewhere along the line.

I'm glad windowed mode still works and you can still enjoy DSB. :)
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Enjoy is not quite how I'd describe it. "Squint" would be better. ;-) (It's a tiny window in the middle of my massive screen.)

Really would love to get a fix for this as there's no "immersion" playing DSB in a tiny window. How could I help out here?
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

I've found a fix for my problem! :D

Right Click DSB.EXE, select Properties, choose the Compatibility tab and tick the box saying "Run in 640x480 resolution". The desktop does go nuts while it changes res, but it fixes the flashing start button and the immovable windows mouse. Now I can play full screen with no issues :-)

Perhaps this will also help Stingm?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

I'm glad you found a solution. :mrgreen:
Gambit37 wrote:Enjoy is not quite how I'd describe it. "Squint" would be better. ;-) (It's a tiny window in the middle of my massive screen.)
If you do end up wanting to play windowed, don't forget about DoubleWindow in dsb.ini. That will double the size of every pixel.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Yep, I tried that but it's slooooooooooooow and fairly unplayable. Though I remember you did warn about that, so I tend to leave it alone :-)
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Spoke too soon -- that compability setting only works randomly. I just tried it again 4 times in a row, and the problems came back for 3 of those 4 attempts. :(
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

:(
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Bit »

It's really serious Sophia! It's the death of Allegro 4.2! There's no one who regrets it more than me :/

See here: https://www.allegro.cc/forums/thread/61 ... 096#target

Go 5.0! No way around...
For fast speed, you can do a windowed mode in original size. Make the display(!) resizeable. If you then click the button Windows resizes the window to fullscreen (incl. bar in the top ofc) without delaying anything. This is acceptable.

You once said that you have a little experience with Allegro 5 - I surely don't have more, but whereever needed, I'm willing to help.

Here's my initialization sequence:

Code: Select all

  int gfxflags = 0;
  if (windowed)
  {
    gfxflags |= ALLEGRO_WINDOWED;
    gfxflags |= ALLEGRO_RESIZABLE;
  }
  else
    gfxflags |= ALLEGRO_FULLSCREEN; // _WINDOW;

  al_set_new_display_option(ALLEGRO_COLOR_SIZE, 32, ALLEGRO_REQUIRE);
  al_set_new_display_flags(gfxflags);
  al_set_new_display_refresh_rate(60);

  al5_display = al_create_display(new_swidth, new_sheight);
  if (al5_display == NULL)
    dmabort();

  al_init_acodec_addon();
  if (!al_install_audio()) dmabort();
  if (!al_reserve_samples(MAXSAMPLES)) dmabort();

  init_old_allegro();

  al_register_event_source(al5_equeue, al_get_keyboard_event_source());
//  al_register_event_source(al5_equeue, al_get_mouse_event_source());
//  al_register_event_source(al5_equeue, al_get_display_event_source(al5_display));
  al_register_event_source(al5_equeue, al_get_timer_event_source(al5_timer));
}
Here's a part of the event queue:

Code: Select all

  while (al_get_next_event(al5_equeue, &ev))
  {
    if (ev.type == ALLEGRO_EVENT_TIMER)
    {
      if (loops<5) // limit timerevents!
      {
        loops++;
        t25hz++;
        if (t25hz==4)
        {
          t25hz=0;
          b25hz=true;
        }
        driver_timerint();
      }
    }
    else if (ev.type == ALLEGRO_EVENT_KEY_CHAR)
    {
      driver_keyboardint(keytab[ev.keyboard.keycode & 0x7f]);
    }

    // ------------------------------

      ALLEGRO_MOUSE_STATE ret_state;

      al_get_mouse_state(&ret_state);

      int mx = ret_state.x;
      int my = ret_state.y;
      int mb = ret_state.buttons;

        mx = mx >> 1;
        my = my >> 1;

      if (mb != oldmb || mx != oldmx || my != oldmy)
        driver_mouseint(mb, mx, my);
      oldmb = mb; oldmx = mx; oldmy = my;

    if (b25hz)
    {
      stretchblit();
//  ALLEGRO_TEXTPRINTF(ALLEGRO_SCREEN,ALLEGRO_FONT,0,0,255,"%2d %d",sampleindex,frames);
      b25hz=false;
    }
  }

And that's the blitting part

Code: Select all

  i8* s = VGABASE;

  ALLEGRO_LOCKED_REGION* ar =
   al_lock_bitmap(al_get_backbuffer(al5_display), ALLEGRO_PIXEL_FORMAT_ANY, 0);
  if (ar==NULL)
    dmabort();

  for (int y=0; y<ORIG_SHEIGHT; y++)
  {
    i8* d1 = (i8*)ar->data + 2*y*ar->pitch;
    i8* d2 = (i8*)ar->data + (2*y+1)*ar->pitch;
    for (int x=0; x<ORIG_SWIDTH; x++)
    {
      ui8 c = *s++;
      *d1++ = mypal[c].b;
      *d1++ = mypal[c].g;
      *d1++ = mypal[c].r;
      *d1++ = 255; // ALPHA!
      *d1++ = mypal[c].b;
      *d1++ = mypal[c].g;
      *d1++ = mypal[c].r;
      *d1++ = 255;
      *d2++ = mypal[c].b;
      *d2++ = mypal[c].g;
      *d2++ = mypal[c].r;
      *d2++ = 255;
      *d2++ = mypal[c].b;
      *d2++ = mypal[c].g;
      *d2++ = mypal[c].r;
      *d2++ = 255;
    }
  }

  al_unlock_bitmap(al_get_backbuffer(al5_display));
  al_flip_display();
That's from a 320*200 8bit-palette-bitmap at VGABASE to truecolor+alpha 640*400.
The only way to have fast pixel operations.

That's how it comes out when the size button has been clicked. That's odd notebook format 1024*600. Pretty fine.
http://www.akluwi.de/dm2/Clipboard01.png
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Sophia »

Ugh. :(

Upgrading to Allegro 5 is not what I had in mind at all.

I'm worried that Allegro 5's attempt to use hardware acceleration and the amount that DSB modifies bitmaps in memory (like darkening the viewport when your torch is failing, for example) just won't resonate at all.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Bit »

Maybe there's a workaround with Allegro42. But that would need the help of Gambit to test.
Could be an idea if he tries Allegro's examples and reports problems.
Do you got an older computer running too to compare Gambit?

Could this all affect CSBwin too?
I worry about the day when pointers exceed 4 bytes.
The graphics system of DM and CSB (and DM2) uses pointers and datas at the same location...
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

I'm happy to test anything. I don't have an old machine, but I could install XP on a different partition. I do have XP running in a virtual box on win 7, but not sure that can use full screen mode.
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Bit »

To me the mode is available, it just kills the colors in palette mode...
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

As a temporary measure, I discovered that the windows key along with + and - will zoom in. I can now quickly "double-res" DSB by tapping Win + NUM PLUS and zoom out again with Win + NUM MINUS (in Windows 7)

Not ideal as you still get all the windows showing behind, but at least it gives more of a fullscreen feel. I guess if I made my desktop black, and had DSB over the desktop that would be close enough to a decent full screen immersive experience, although it still has all the window borders and buttons which does look... silly.

Then I remembered that the utility called Actual Window Manager (to manage my multiple screens) might help here. It offers lots of controls for handling windows.

After experimenting, I've got this as a temporary solution, using options provided by AWM which applies all these settings when you fire up DSB:

1) Remove all the borders and menubar/buttons from the DSB window
2) Force DSB to always be on top
3) Always force DSB to appear in centre of screen
2) Run a macro that sends two keypresses to the system: Win+D and Win+NUM PLUS - this minmises everything and zooms in 200%, and because DSB is "always on top" it's now the only thing showing :-)

And presto -- this leaves DSB running what looks like 1280x960 in the center of a black screen (I had to move my icons out of the way that were in the middle of the desktop).

It's fiddly but it works and is a reasonable solution until the issue can hopefully be fixed in DSB itself.
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by terkio »

To me, I have the full screen mode working as well as the double window mode.
However I am not fully happy.
The sreen, I am using is a 1680x1050.

1) In full screen, I have the trouble of the wide display giving obese stuff.
( I had a 1280 x 1024 screen but it recently went South :( )

2) In double window, the game is running slower.
it seems two time slower ( when entering the dungeon with the door going clunk clunk clunk....).
I feel lag in the mouse cursor tracking.
Is this normal ?
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Fullscreen mode doesn't work (DSB 0.55)

Post by Gambit37 »

Yes, it's normal: double window is an un-optimised feature and Sophia already stated that it probably would run very slowly.
Post Reply