Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Easy way to squish the screen?

Author
Message
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 29th Jul 2022 13:40
People on Steam have been complaining about how stretched out the screen was on their resolution in Brigand: Oaxaca. I used to have an Exclusive EXE mode, but it would crash if it ever minimized, then I started using a DLL which made Exlusive mode not work at all. So currently I have to EXEs: Normal and Windowed. I would would to add a third EXE with everything in the camera/HUD squished and have black bars on the side, just to give the people the option.

I seem to remember a command like this from a long time ago, but I can't find it in the help files now. Thanks.

I posted this already, but I had to add more details. Sorry about that.
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 29th Jul 2022 15:04
It's the ultimate final thing I gotta fix for the last patch of Brigand, then moving on to my AppGameKit project.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th Aug 2022 07:11
Not sure it can help:
I use this to get the native screen resolution:



But you could force the Sw , Sh values (rem lines) avoiding the dll part, or have the players choose theirs at start.. Or allow several options based on most common screen resolutions .

Or calculate the correct aspect ratio : get the user screen resolution and adjust the width (for instance 1080/1920 =0.5626 ) like :


Just few ideas.
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 13th Aug 2022 18:00
Hopefully I'll be able to test this soon. Thanks for the reply.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 11th Oct 2022 06:56
You can prevent Full Screen Exclusive Mode from crashing. Most of the loaded media is deleted when you minimize the screen. You just need to detect when it happens and arrange for everything to be reloaded.

This is an example of how to design a program to do this.
https://forum.thegamecreators.com/thread/202959

You basically create or load a little image, and each time SYNC/draw the screen you need to immediately check if that image got deleted. If it did then create it again and reload all of your assets.

Keep in mind you might avoid Fullscreen Exclusive Mode so you don't have to do this and think Windowed Modes are better. This problem happens in Windowed Mode too. If the video card driver crashes and reloads, or if the user locks the screen, or if the laptop lid is shut, or if the computer is hibernated.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 19th Oct 2022 01:52
@Mage, thanks for the reply. Unfortunately I'm already using D3DFunc.dll to make drawing text in the HUD faster, and that plugin completely prevents Exclusive Mode to open (also using Sparky's Collision DLL, but I think that works fine).

There are also framerate issues already in Brigand, and this looks like it would be intensive.

Right now I'm just telling them to launch in Windowed mode and adjust the screen size. Then make a black screen on the desktop to fix that immersion problem.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 20th Oct 2022 04:14
I should mention several things that may help you. Your current solution does not sound good and I can see why you are seeking advice.

1. D3DFunc should not prevent FullScreen Exclusive mode. I have personally used this plugin and not had this issue.

2. You have mentioned my suggestion would be framerate intensive. No. However it would mean whenever the game comes back from screen loss instead of crashing, you'd have a loading screen before resuming the game. I'd recommend in that case transitioning to a pause screen. This would allow you to keep the presentation of the game high. The code does not run at all during regular operation of the program so there is no performance impact. Right now your program crashes instead of doing this. You can turn that crash into a load screen.

3. I was like you but I dumped D3DFunc. You need to make sure people have the correct windows font installed. Since when does a game launch like that? I made a bitmap font system that you can use. The "Modular Code" link is attached to each comment I make at the bottom. There is also a link in that post to a font import tool. So you can convert any font to the bitmap font system. However to get it to look nice (since sprite scaling in DB Pro is nearest neighbor only) you may need to carefully pick your font so it scales nice. This would eliminate your need to use D3DFunc.

It's no trivial task rewriting sections of a game. However these are options available that could help here.




Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 24th Oct 2022 23:05
Very nice! I'm gonna try out the MagesModular font thing soon. I'll let you know. But ya, whenever I use D3DFunc, Exclusive Mode won't launch on anybody's computer.

Login to post a reply

Server time is: 2024-04-19 02:25:19
Your offset time is: 2024-04-19 02:25:19