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 Discussion / Unexplainable Lagging

Author
Message
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 11th Mar 2004 16:40 Edited at: 11th Mar 2004 16:42
I've just converted my Spaceman game from DBP to DBC, and i managed to get it to run with a rough frame rate. But something's gone horribly wrong. I've 'remmed' a lot of the code, no reammed jokes please, so that the only thing running is the spaceship and the shooting. This means that there is 1 sprite on screen, and up to 30 bullet sprites when the guns are being used. But i can only get a framerate of 33 FPS! That's my highest, not the average. I can't get my code right now and i probably won't be able to get it till tommorow. Does anyone know of a reason why this could possibly be happening? Another thing, if you could please be so kind: does the Sync command clear things that have been printed, or is it the paste command overwritting my text? I'm currently using CLS to clear the text from my screen, but i want to know if i can do it without refreshing everything. It works well in another program i wrote but i don't know if it's the SYNC command that's doing it or if it's the Paste image command. If anyone has any idea about the mysterious lag i'd be very happy. The Spec's shouldn't be the problem, it's a 2400+ XP-M with 256 MB of RAM. N-videa graphics chipset. It should be running at 100 FPS at least, any ideas on what could possibly cause such a lag? (there are quite a few arrays with the shooting commands. I'll post the code as soon as i can, or the solution if i can figgure it out myself.)

I'm using 2 functions in the code but both are currently REM'd around.

Someone please tell me there's a simple solution to this problem.

-Dave

PS: Sorry bout the sig, i'm tryig to find the old sig so i can put it on a server after my dude stopped hosting my stuff...probably get a brinkster account again...Thanks, Dave

Your soul...it tastes like chicken

Official Website Coming Soon
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 12th Mar 2004 00:27
Oh come on, i really need help with this. Can't someone come up with something?

-Dave

PS: Will post code first thing tommorow

Your soul...it tastes like chicken

Official Website Coming Soon
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 12th Mar 2004 01:35
Yes code would be nice, may not get all you need without it.

And I think that if you use a 3d backdrop the text automatically refreshes.

-Vash the Stampede

"This world is LOVE and PEACE!" -Vash the Stampede

Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 12th Mar 2004 01:54
without the code, just make sure that there is no 3d space when you have sprites, that lags.
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 12th Mar 2004 11:46
Ok, i got the code right now. I think i've narrowed it down to the background sprites. They were BMP's but i made them into PNG's to see if that would speed it up-but no luck. Anyway, have a look please and see if you can figue it out-it's got me stumped and i need the code fixed as soon as possible. Thanks - Dave

Your soul...it tastes like chicken

Official Website Coming Soon
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 13th Mar 2004 02:05
Can't someone out there figure it out? Can't someone please have a look and see what's going on with it?
This has really got me stuck, is it possible that the overlapping of all the transparent sprites is causing it? Someone must have some idea...


-Dave




Your soul...it tastes like chicken

Official Website Coming Soon
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 13th Mar 2004 20:19
Gaaah! It's been up for 2 days now and no-one has any idea? This is really important, can't someone come up with something please?

-Dave

Your soul...it tastes like chicken

Official Website Coming Soon
Doomwad
21
Years of Service
User Offline
Joined: 29th Dec 2003
Location:
Posted: 14th Mar 2004 18:33
Did you set the sync rate?
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 15th Mar 2004 12:16
...Yes...Look at the code...run it on your system...and see if it works...Look, i've posted the code twice and it's been 4 Days and out of the 69 veiws it's hard to beleive that nobody has any idea what's wrong. Please just give me a break here, I need to have this code fixed as soon as possible (Wed at the latest). I have narrowed it down to the actual Sprites. Is there no way anyone can throw me a hint here? I could use images and the Paste Image command, but that's sloppy and i need to get Transparency. I've tried as much as i can think off. I'll post the most recent code here later on. Someone must know how to fix this, so please post if you do.

-David

Your soul...it tastes like chicken

Official Website Coming Soon
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 15th Mar 2004 12:23
Fixed my images at last. Couldn't get them off the server. Please, any help is appreciated here.

-Dave

Your soul...it tastes like chicken

Official Website Postponed
Code Ninja
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: AZ, U.S.
Posted: 15th Mar 2004 20:40 Edited at: 15th Mar 2004 20:41
Y'know Div, you might as well go through your code yerself cuz, from the looks of this thread, doing that'll be faster than waiting for someone to post... I'm sorry i can't help but the most ive made is a simple paint program... that doesn't even save properly... so, yeah, i think you should try and trouble-shoot yerself, man...

DragnBreth
of
Dragael Software
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 16th Mar 2004 03:14
hey DivW

rite where do i start?
1st do not move the background by creating a sprite and moving it (a huge one as well 800 by 600 presume u were using which causes massive slow down)
2nd do not use the print command use text command instead as it automatically gets updated/cleared unlike print.
3rd remove the cls command as basically your telling the computer to clear the screen when sync will do it for you unless u want the whole screen to be cleared completely
4th sync on command shud go before the sync rate command and also the sync on command only has to be called once during your whole program

heres a few suggestions also
if u want to make a background move u can do it by sprites not recommended but if u split the image into lots of small tiles u can then move them the way u have- it will be faster but its not the fastest way to do it
also try not to use any standard drawing commands (i dont think u have) as it can slow down your program

note: the reason why your having trouble with the sprites is because dbc handles sprites differently to dbp as dbp use plains as sprites where dbc does not

anyways i think this shud help
pizzaman
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 16th Mar 2004 04:05
DBC is just plain slow with sprites. I was going to make a space game a long time ago, but when it only went 10-20 fps with just my ship and a solar system, I gave up.

Why would you want to convert from Pro to Classic anyway?

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Code Ninja
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: AZ, U.S.
Posted: 16th Mar 2004 21:20
he was probably using the demo of dbp and when his time ran out..

DragnBreth
of
Dragael Software
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 16th Mar 2004 22:00
another way to speed it up would be to use textured plains that are locked to the screen instead of sprites.
(a 2d illusion. it looks 2d but it's really 3d )


Programs for programmers.
DivW
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: Scotland
Posted: 19th Mar 2004 14:44
Quote: "
1st do not move the background by creating a sprite and moving it (a huge one as well 800 by 600 presume u were using which causes massive slow down)
2nd do not use the print command use text command instead as it automatically gets updated/cleared unlike print.
3rd remove the cls command as basically your telling the computer to clear the screen when sync will do it for you unless u want the whole screen to be cleared completely
4th sync on command shud go before the sync rate command and also the sync on command only has to be called once during your whole program
"


Ok...thanks for some replies Guys, i appreciate it. In reply to your posts:
1) The image is a 2 colour black and white test bitmap saved as a png. It's just a black background with white dots on it, so that really shouldn't be causing the problem...should it?
2) I'm using the Print Command for testing, as most of the info i'm printing is numerical it seems pointless to convert everything to string before i print it. So i left it in Print for testing.
3) CLS is a pain in the ass but when i take it out it doesn't clear the text. For that i'd have to convert everything to Text instead of using the Print command, and that's a pain. But you're right i should be using the Text command, so i'll perform that conversion tonight.
4) Thanks for that. The reason the Sync On is in there more than once is because i was wandering if the computer was missing the Sync On Command-in case that was what caused the slow-down.

Thanks Pizzaman.

The reason i had to do a DBP to DBC switchover pronto style was that i've lost the DBP CD and it won't let me compile. My project was Due in today but i've managed to stretch it to Monday. I had to perform a super-fast conversion in order to make sure that i had something to hand in (appart from what is currently 50+ pages of write up.)

I considered using Textured Plains...and it might be worth changing the backround into a textured plain before i hand it in...

Just how bad is DBP for sprites? Is there any funny things i should know about them? Does it go slowly when they overlap, for example? I allready know about the Bobs-sprites error message thing, but anything else? How many sprites on-screen should i limit myself to?

-Dave

PS: Going REALLY slowly at the mo. Will try and post the latest code later on if anyone wants to have a look, ok? Could use a hand speeding it up.

Your soul...it tastes like chicken

Official Website Postponed

Login to post a reply

Server time is: 2025-05-23 00:15:25
Your offset time is: 2025-05-23 00:15:25