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 / Slight Rendering Problem

Author
Message
Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Jan 2011 23:43
Hi. The game I'm working on at the moment seems to have a problem with the way it renders on screen. Whenever I run it, a few lines of pixels appear to be missing. The strange thing about this is that it always seems to be the same lines. I've attached a screenshot of the problem. The mistakes are quite subtle so I've highlighted them in red. It's mostly on my auto-generated text which I create by printing the text to a bitmap, grabbing it as an image and putting it into a sprite. However the problem is not with the text created algorithm as when the text moves, the errors no longer display. Rather, the problems appear to be linked to locations on the screen. For example, in the screenshot provided, The word wave appears to be standing alone but in fact, the text is "---Wave 1---". When the notifications all move up one line, using the same images, the --- appear as they should as they are no longer lined up with the 'missing pixel line'. I've tried to demonstrate this clearly by typing CAT in three times into the command box near the bottom. The middle one has the horizontal line on the A missing. The others don't but they do when they are moved to that location.

I'm not at all sure what is causing this error. I wondered if it might be some form of screen tearing but I'm not all that clear on it's causes and effects. Any thoughts on what mistake I may have made would be greatly appreciated.

Here is the source code for the main loop of the game. I update the screen myself having set sync on. I've also turned on vsync in the set display mode command.



Thanks in advance for your help.
Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 9th Jan 2011 23:51
Hi all. Well as is often the way, after a couple of weeks of puzzling over this one, I post it up here and immediately within minutes find a solution :p

I solved it by switching off windows mode. The problem seems to have been that I had it in windowed mode but I was setting the screen's resolution to desktop height() which appears to have had some slightly strange affects. Anyhow sorry about the pointless thread. Hopefully this solution will help someone in the far future though...
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 5th Mar 2011 22:25 Edited at: 5th Mar 2011 22:28
this is one peace of code I have been looking for

for one of my projects down the road

I tried to run your code

but it could not understand line 7
the error --> Could not determine parameter type of 'has focus()' at line 7.
"if not has focus()"

I should have just about every thing to make it work
what extras should I have to make it work ?

I'm using dbp 7.7 rc 6

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Mar 2011 22:40
HAS FOCUS - one of mine I believe. Link just under this...

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Mar 2011 03:44
I have that

it's then must be conflicting with anther plugin

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Mar 2011 04:00
ok it seems I moved the dll's out of the user folder
I put them back but got a new problem

Parameter for 'array count' do not match 'Array Name(0)' at line 23.
PARSER ERROR

if Objects(c).nType = WATERMINE or Objects(c).nType = RAMMINGSUB or Objects(c).nType = TORPEDOSUB or Objects(c).nType = RAMMINGBATTLESHIP or Objects(c).nType = FIRINGBATTLESHIP or Objects(c).nType = AIRCRAFTCARIER or Objects(c).nType = TRANSPORTSHIP

If a thought is Just a thought ~ so whats the main thought ?
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 6th Mar 2011 06:13
I've never seen that error, but it appears to be saying that in this line:

Objects(0) is not a valid 'Array Name'. That makes it an invalid parameter for 'array count'.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Mar 2011 15:22
Sounds like there must be an error somewhere else. Has the array been declared correctly? The following snippet works fine for me.

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 09:53
this is that I got back when I ran the example
Valued Member posted

2 5
0 0
0 0
20 50
0 0
0 0

please tell me if that what I should be getting

from what I am seeing it should be correct

Lucas Tiridath example that started this post
it seem like there should be data created before it's run

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 09:56
Lucas Tiridath after look at the pic you uploaded

it is possible that the box the code should be showing on top of
is not the right size ?

it looks like a layer problem

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 10:05
the new DBP has a error tracking window

I've attached the error page it generated

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 14:15
More code required. Show us:
1. The DIM statement for the Objects array
2. The for loop using the ARRAY COUNT function

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 20:54
IanM do you mean me ?

the errors was from the program "Lucas Tiridath" created
that started this post

If a thought is Just a thought ~ so whats the main thought ?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Mar 2011 21:04
Quote: "this is that I got back when I ran the example
Valued Member posted

2 5
0 0
0 0
20 50
0 0
0 0

please tell me if that what I should be getting

from what I am seeing it should be correct"


Yes, that is correct.

And we need more details from Lucas Tiridath.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 21:18
Quote: "IanM do you mean me ?"

Yup, it seems to be you that is having the problem compiling the code.

So it's Lucas' code you are using, unchanged? In that case, change it - there is no array named 'Objects' in that code and you need to add one.

Also, we have had a rash of not-properly-installed DBPro's lately, but as you can run GG's code, I'd guess my previous suggestion will fix your problem.

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 21:53
I'm still in the learning process
so I would not know what to exactly change

but I did add


dim objects(0)
nType as integer

at the beginning

it seems the word "nType" is not understood as what to do with it by DBP

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 21:55
the old quick basic had one thing going for it that DBP Dose not

if you wanted to find out what data was generated but was in memory
of the computer it had a second window you post a command to

and get it to display

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 22:20
from every thing I am looking at
I must be missing a add on

or one of the add on's have is conflicting
which would not be the first time or the last time

nun of these are high light if they are suppose too

.nType
.nSpriteNo
.bOn
.nX

and I have only seem some thing like in one other program
but I can not remember which one since I have seen soo many
files up to this point

the only dim I found was on line 137
dim nOldVals(array count(Objects(0)),1) as integer

I would have thought that should be at the start of this program
but I could see it being placed in a setup function

and from what see this looks closer to c++ coding
not that currently know much about it at this point ;oP

if I removed all ).###### then it seems like the program might work

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 22:24
Quote: "it seems the word "nType" is not understood as what to do with it by DBP"

Strange, as those two extra lines on their own compile Ok for me (as I expected).

As you are 'still in the learning process' by your own admission, then I wouldn't start here if I were you, as the fact that you only added those two lines means that you still have a way to go - there are many variables used in that code, which admittedly you can probably get away without defining, but there's no way you can get away with not defining the named constant values that Lucas is using.

You should take a look at the tutorials thread in the newcomers section of the forum, in particular look for TDK's tutorials, or Dan's video tutorials.

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 22:27
ok I think I have traced the problem to a missing

"The eXtends Expansion Pack"

I know I own it ;o)

but it's not installed ;oP

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 22:42
IanM

could I please get a list of the dll's in your dbp
registered and user folders

if I can figure out which one's I am missing then I get closer to
ware the problem is

"show message Objects(c).nX"

only the word "message" is highlighted

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 23:21
Quote: "show message"

Not one of mine, don't know who's it is.

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 10th Mar 2011 00:10
I installed 2D Plugin Kit

the only addition I do not have is "Box2D"
and is Enhancements not installed
because it conflicts with one or several of Matrix1Util dll's

all I can think is the dbp has changed soo much from what
"Lucas Tiridath" is using to what I am using
and some thing has been removed or changed

If a thought is Just a thought ~ so whats the main thought ?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Mar 2011 00:34
Quote: "Yup, it seems to be you that is having the problem compiling the code.

So it's Lucas' code you are using, unchanged? In that case, change it - there is no array named 'Objects' in that code and you need to add one."


Sorry. I seem to have added confusion in my earlier post. I thought the "array name" problem was raised by Lucas. It wasn't.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 10th Mar 2011 00:38 Edited at: 10th Mar 2011 00:51
based on all information collected

"Green Gandalf" array example

it seems the extra after "Objects(c)"
the .######

has not been connected to the main file

I would beleave there is one more file that has the break
downs for the extras

.nType
.nSpriteNo
.bOn
.nX

type myData
x
y
endtype

dim myArray(5) as myData

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 10th Mar 2011 00:40
I'm slowly getting to understand the complexity's of what was programed

or since I am a new be
not programed or provided

If a thought is Just a thought ~ so whats the main thought ?
Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 10th Mar 2011 10:35
Hi all. Really sorry for leaving this thread for so long but because I fixed the issue and posted, I thought the thread would just die. Right yeah the code I posted is the main loop of a game I'm working on atm but it doesn't have the initialization routines or anything else. The program is around 3k lines in total so I wan't really putting it here for compilation. I must admit I was hoping you might be able to see logic errors without having to compile it because it's quite a large program with lots of required media and so on but as I say, it turns out it wasn't the kind of error I thought it was.

To clarify some of the issues. show message is a command from the styx plugin. You're correct about the Objects array being a UDT.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Mar 2011 20:44
Quote: "I thought the thread would just die"


Threads have a habit of developing a life of their own - a bit like children.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 10th Mar 2011 20:59
and with it being a programing Forum

we all want to know more ;o)

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 17th Mar 2011 00:49
after looking at Lucas Tiridath example as what is posted here

I've been finding other programs that use something similar to ".nX"
it rile give more use to a single command

now after years of looking at "DBP" code

my understanding is getting to ware it should be
and giving me more options not not to move over to c++ or similar
and having to start to understand how to use it

If a thought is Just a thought ~ so whats the main thought ?

Login to post a reply

Server time is: 2026-07-17 13:58:58
Your offset time is: 2026-07-17 13:58:58