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 / Weird problem with setting resolution.

Author
Message
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Feb 2010 19:33
I'm adding some final details and enhancements to my breakout-clone, and one of them is setting the resolution of the game to 1024, 768, 32 if that resolution is available.
My resolution is currently set to 1024, 768, 32 and everything runs fine, untill I add the command:



at the top of my program. And then I get these little transparent holes in my models, as if there are chunks or bits of the models missing.
So, my question is, is it just because my resolution's already set to 1024, 768, 32 that I'm getting these holes?

Thanx for helping.

Cheers

Slayer rules!!! Yeaaah, man!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Feb 2010 19:42
Not sure why that would happen.... Give a screen shot and more code. Is the resolution change ONLY at the beginning of your program and is never changed during it? Your desktop resolution SHOULD have nothing to do with the game's resolution.... Are you doing SET WINDOW OFF (I think that's the command to go "full screen")?

Give a screen shot and more code.

The fastest code is the code never written.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Feb 2010 20:28
A better question would be: Do you change the resolution after you've loaded objects or textures?

If you do, then that's very likely to be the reason you have a problem - just load that kind of thing after the resolution change.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Feb 2010 20:59
Well, I think he would have other problems if he changed after a loaded tex/obj.... Like he would get an error saying that an object/texture was not present.

The fastest code is the code never written.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Feb 2010 21:09
Quote: "Is the resolution change ONLY at the beginning of your program and is never changed during it?"


I don't set or change the resolution by code. It is done in the properties panel of the IDE (set to screentype: fullscreen, and window resolution: 1024, 768, and Fullscreen resolution: 1024, 768, 32)

Quote: "Are you doing SET WINDOW OFF "

No.
Quote: "Do you change the resolution after you've loaded objects or textures?"

No, I don't change anything related to setting screen or resolution parameters after the models are loaded.

Here's some code related to screen settings at the beginning of the program:



And here's a screenie (look at the bricks in the green circle closely. BTW, I get that same unwanted effect on the paddle, but here on this screenie, you can't see it.):


Cheers

Slayer rules!!! Yeaaah, man!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Feb 2010 21:23
Try doing ALL of this just after changing the display:


See if that gives you any chage.

I'm not on my home pc right now, so I can't even see the screen shot you posted.... My work computers suck!!!

The fastest code is the code never written.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Feb 2010 22:16
@Hawkblood

I can't do that, because then the intro.avi does'nt show up, and the holes still remain.
The funny thing about all of this, is that when I rem out the SET DISPLAY MODE command, then the holes dissapear after restarting the game twice.

Slayer rules!!! Yeaaah, man!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Feb 2010 23:05
Hmh, I think I've solved the problem. I'm not completely sure yet, but up untill now, I no longer have those missing chunks or holes in my models.
I've added the command RELOAD DISPLAY POINTER just after the HIDE MOUSE command, and I deleted the command SET DISPLAY MODE.
I don't know what that command (RELOAD DISPLAY POINTER) does exactly, or if there are some parameters that could be set, but it does work for some reason.

Any thoughts?

Cheers

Slayer rules!!! Yeaaah, man!
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 23rd Feb 2010 23:29
Reload display pointer is related to the undocumented commands for dark shader introduced in one of the upgrades. Have you tried hiding the mouse after changing resolution?
Jane Doe
19
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 24th Feb 2010 09:22
This is going to sound crazy (it sounds crazy to me), but we've just had a very similar problem - possibly the same problem. After changing the screen resolution through an options screen, our scene didn't render correctly. Sprites were predominately effected and it looks from your screen shot that you're using sprites.

The solution that we came up with was to put the following two lines of code in after the resolution change:

MAKE OBJECT PLAIN ObjectNumber, 0.0, 0.0
DELETE OBJECT ObjectNumber

I have no explanation as to why this would fix it, but it worked for us.

Good luck.

- Jane
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 24th Feb 2010 13:27
Quote: " Have you tried hiding the mouse after changing resolution?"

Yep, I've tried that, but it does'nt solve the problem.

Quote: "it looks from your screen shot that you're using sprites."

Actually, they're not sprites, they're all 3D models.

Apparently, the only command that solves my problem, is RELOAD DISPLAY POINTER. Maybe it's because my background image is BLEND MAPPED, so it's like working with a shader effect, and maybe that's the reason I have to reload the display pointer?

Anyways, it works for now, so I'm happy.

Thanx, everyone!

Cheers

Slayer rules!!! Yeaaah, man!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 24th Feb 2010 21:10
Man, man, man, this is so weird and annoying! I thought the problem was gone, but it's not.
That same problem always occurs when I've restarted my computer and upon running the game every first time I launch it. And upon quiting the game and restarting it the second time (and every restart thereafter) the problem is gone.
And the weirdest part of all is, that whenever I change something in my code, the holes reappear when launching the game thereafter.

I'm so unhappy!

Slayer rules!!! Yeaaah, man!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Feb 2010 21:20
There MUST be something going on that you aren't accounting for.... Duh.... Are you running any outside apps that have anything to do with graphics? If DBP is not/unable to (for some strange reason) unload the textures, it could explain the problem....??

Have you tried doing the SET DISPLAY MODE again after the DELETE ANIMATION?...?

When in doubt, try everything.....

The fastest code is the code never written.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 25th Feb 2010 01:06
Quote: "That same problem always occurs when I've restarted my computer and upon running the game every first time I launch it. And upon quiting the game and restarting it the second time (and every restart thereafter) the problem is gone.
And the weirdest part of all is, that whenever I change something in my code, the holes reappear when launching the game thereafter."




Sounds like a horrible bug! Don't have any help on figuring out the problem, but does it start when you LAUNCH the game the second time, or COMPILE it the second time?


Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Feb 2010 03:40
Now that I'm at my pc, I can view the pic from the first post..... It seems to me that the "holes" are concentrated on the edges of the blocks. Is that the only place you have that problem?

If so, did you notice that it's only on the ones near the fire effect? Have you changed the fire effect's location to just a white background to see if it's the effect or the blocks?

You said that the blocks are 3D objects, right? Check the texture's alpha to be sure it's not "holey".

All of these questions/suggestions I made are in full knowlege about how it seems to go away after the first time you enter the game..... So, good luck!

The fastest code is the code never written.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 25th Feb 2010 19:04
Quote: "Have you tried doing the SET DISPLAY MODE again after the DELETE ANIMATION?"

Yes, I've tried that too, and it did'nt work either.
Quote: "When in doubt, try everything....."

I already tried everything I can think of.


Quote: "does it start when you LAUNCH the game the second time, or COMPILE it the second time?"

Those holes only appear the first time I launch or compile the game. So, if I launch it now, then they're there, but not if I relaunch it a second time. But if I change anything in the code thereafter and relaunch, then they reappear again.

Quote: "It seems to me that the "holes" are concentrated on the edges of the blocks. Is that the only place you have that problem? "

I have those holes on all the blocks, the paddle and the laser-thing at the bottom of the picture.
Quote: "did you notice that it's only on the ones near the fire effect?"

Well, actually they are always visible on all of the models I just mentioned, but they only are visible best when there's a bright texture behind them.
Quote: "Check the texture's alpha to be sure it's not "holey"."

What do you mean exactly?

I was also wondering, my textures for my models are png's. Could it be that that's the reason I get these holes, since png's also contain a transparent layer? Maybe just converting them to bmp's or dds, could solve the problem?
I'll try that out and see if it fixes my problem.

Thanx again!

Cheers

Slayer rules!!! Yeaaah, man!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Feb 2010 19:19
Let us know how that turns out....

The fastest code is the code never written.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 25th Feb 2010 21:08
Well, converting the textures did'nt make those holes disappear (which is normal), but I did something else, and that seems to solve the problem. The backdrop is a BLEND MAPPED plain, and I used the command SET OBJECT DIFFUSE to get the look I wanted on that plain. So, I removed that command, and so far the problem is solved. I even rebooted my computer to check if the problem would re-occur, and it did'nt. Even after changing some code in my program, the holes stayed away. Phewww, I'm so relieved!

I can finally finish that long awaited demo, and more importantly, the game!

I still find it very weird that SET OBJECT DIFFUSE could cause those holes in objects.

Any thoughts on why that would happen?

Thanx!

Slayer rules!!! Yeaaah, man!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 25th Feb 2010 23:27
So,.......here I'm back again.

...I thought that I've got rid of that annoying 'hole' problem, but I was'nt.
So, I've kept on trying and trying different things to get that horrible bug out of the way, and so I finally changed the resolution of the game to 1024, 768, 16, instead of 1024, 768, 32 (see screenie).

And for some strange reason, the holes are gone. At least I hope!
I'll do some serious checking and checking to see if the bug is REALLY gone this time, and report back when I'm absolutely sure.
By lowering the resolution, I loose a bit of the finer details of the textures and stuff, but rather that, then having those annoying peepholes in the blocks, don't you agree?

The only question that really bothers me know is: WHY did those peepholes show up with the resolution set to 1024, 768, 32 ???

Any thoughts?

Slayer rules!!! Yeaaah, man!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Feb 2010 08:36
Do you use any code based alpha on your blocks at all? (I.E. NOT images based alpha) As I know that transparencies over shader effected objects fail to show correctly. (Well they did for me once when using ghost image for a shadow in a game I'm working on.)

My signature is NOT a moderator plaything! Stop changing it!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 26th Feb 2010 14:44
Quote: "Do you use any code based alpha on your blocks at all?"

On my blocks I don't have anything related to alpha or transparency or ghosting.
I do have the lazer object ghosted, but even when setting that off, it did'nt solve the problem.
The only thing that helps is setting the resolution to 1024, 768, 16.
I've cheked and rechecked, and those peepholes stay away. I'm relieved those naughty peepholes have gone elsewhere (maybe they're visiting my neighbour now? ), but on the other hand I loose a bit of the actual effect I was looking for.
I'm still confused why I had to change the resolution, but the game still looks as nice as before, and I can finally finish it (if those peepholes from Mars stay away).

Thanx to you too, Mobiius.

Cheers

Slayer rules!!! Yeaaah, man!
Jane Doe
19
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 27th Feb 2010 09:05
Object rendering imperfections can be caused by the distance from the camera. You might try moving the camera closer to the objects just to see if this is what's causing the holes. Even if the holes don’t go away, a closer look might be helpful.

The relationship between the camera's near and far distances can cause problems as well. If you find that moving the camera closer gets rid of the holes, you might want to experiment with that.

- Jane
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 27th Feb 2010 12:09
Quote: "Object rendering imperfections can be caused by the distance from the camera."

Yes, I know. I even had to adjust the FOV to get the best graphical quality. I also did a thorough check by moving the camera as close enough to get those unwanted peepholes (I still don't know from which planet they came, could be Mars or Saturne ) out of the way, but now it seems that the problem I had, had nothing to do with the screen resolution, transparency settings or camera settings.
When I loaded one of the brickmodels in the directx-viewer, it did'nt show up, while the other models did show up. So, I reloaded that model back in Truespace, and saved it again (checking every setting), and those peepholes dissappeared completely, even with setting the resolution to 1024, 768, 32.
Appearently that one model had some bad data in it, and corrupted the others, which caused those naughty holes (I still have nightmares about them )
Finally I have the settings that I wanted for my game, without 'them'.

Thanx Jane for helping, and eh,...thanx a lot for that very SWEET kiss! I shall cherish that! Mmh, I'm still blushing!

Cheers

Slayer rules!!! Yeaaah, man!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Feb 2010 14:38
Just bear in mind that 16 bit colour depth is not supported by all graphics cards. (And is a poor way to solve it. )

My signature is NOT a moderator plaything! Stop changing it!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 27th Feb 2010 15:07
Quote: "And is a poor way to solve it. "

That's why I've kept looking where or what the problem could be, and so it appears that it was just one brick-model that had some bad data in it, and corrupted all the others with it.
So, now the resolution is reset to 32 bit colour depth, like it was intended. And, it's not always possible to achieve what you really want. Sometimes you'll have to settle with a bit less, due to circumstances.

Cheers

Slayer rules!!! Yeaaah, man!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Feb 2010 22:59
Quote: "Sometimes you'll have to settle with a bit less,"

And that gets you Windows ME! lol

My signature is NOT a moderator plaything! Stop changing it!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 27th Feb 2010 23:26
Quote: "that gets you Windows ME"


I never had ME.

Slayer rules!!! Yeaaah, man!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2010 00:27
I did. I think I'm the only person in the world who liked it!

My signature is NOT a moderator plaything! Stop changing it!
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 27th Mar 2010 18:12
I have a similar problem just with text. I have tested the following scenarios to display the problem:
A) My default screen resolution is set to its highest and I use "set display mode" also to this same high resolution.
B) My default screen resolution is not at the highest but i use "set display mode" to the highest value possible for my screen.

In scenario A) text is very clear and sharp.
In scenario B) text is part missing, blurred, and unclear.

The bigger the difference between the screen set default resolution and the highest resolution values inserted in the DBpro editor, the worse the text graphics.

Anyone explain or counter this bad effect.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 18:31
Give some code.
I think what your experiencing is that you are trying to make a window larger than your desktop size. When I try to do that, it scales the window to match my desktop. Try SET WINDOW OFF.

The fastest code is the code never written.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 27th Mar 2010 19:09
Magic, thanks Hawkblood, SET WINDOW OFF cures my problem.
I had just written a small function that checks for a users maximum possible screen resolution and this then sets the resolution to this max. I am finding not everyone sets their default to the max possible so your solution really helps. Cheers

Login to post a reply

Server time is: 2026-07-26 21:11:48
Your offset time is: 2026-07-26 21:11:48