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 / Sonic! Perfect collision scrolling FPS test Please, 0.5Mb :)

Author
Message
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 03:16 Edited at: 21st Jul 2003 03:21
Please download this and test it for me, on my 1800, 512Mb, GForce4MX, WinXP machine I get around 1500fps !

Here's a screenshot:


Here's the download, its only about 0.5Mb Zipped
http://www.quikly.com/sonicdemo/sonicdemo.zip

Basically its Sonic, and you control with the arrow keys, hopefully he runs up and down a very hilly level with perfect collision and 2 layers of paralax.

The reason I expected this to run far worse than it does is because the level isn't a tile based system, its simply one big picture, so therfore should eat memory and I am worried that on a slower machine or less powerful graphics card it will run jerkily or at the wrong speed, otherwise it seems to good to be true, as its a very simple method, and practically no code...

Anyways, all feedback appreciated, a big Thank You in advance Oh and no I'm not making a Sonic game I just ripped the graphics quickly to test my collision method

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 03:40
Sonic here to test your sonic game!

Well that was a waste of time! sonic just falls straight through the floor as soon as level appears never to be seen again!!!!!

Also confused as to how you get more than capped 60fps in full screen exclusive mode as fps is linked to monitor refresh rate which is 60 on my pc.

R Tape loading error
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 21st Jul 2003 03:46
He just falls straight through the floor here too

UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 21st Jul 2003 03:55
works fine 4 me 800 fps 1.7 ghz 512 ram ge4ce 4 mxb 128mb(ithink)
i edited the level but he wont stop at walls

Life is a terminal disease.
You never survive it.
Ocean Runner
23
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 21st Jul 2003 04:02
I fell through

JetRace coming. Watch out!
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 21st Jul 2003 04:19
Nice Demo all works well (except it ends too soon) do any controls work except the left right arrows?

Exclusive mode 650 to 800 fps
Window Mode 340 to 350 fps

at 350 it is too slow!!
you could change the increment of movement in inverse proportion to the framerate

see signature for machine specs

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Jul 2003 04:32 Edited at: 21st Jul 2003 04:32
Works fine for me.
He walks too slow! Where's his jump!

I get only 204 FSEM, 121 WDM.

And are you gonna tell us how you did it?

"All programmers are playwrites and all computers are lousy actors" -Anon
Rpg Cyco
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Australia
Posted: 21st Jul 2003 04:34 Edited at: 21st Jul 2003 04:35
Works fine here as well! I get 1115 FPS in Fullscreen exclusive mode!
Athlon XP 2000+
512MB DDR333 RAM
128MB GeForce 4 MX440SE
Windows XP Pro - SP1
DirectX 9.0a

l8ter

Rpg Cyco

andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Jul 2003 04:42 Edited at: 21st Jul 2003 04:46
Oh.. I know how you did it! You used a certain color as "Ground" color and checked if he hit it. But how did you get the image data. Point? Memblocks?

I did notice though (after I edited the level), that if he hits the ground color at two parts of his body, he gets stuck. It can't be too hilly.

"All programmers are playwrites and all computers are lousy actors" -Anon
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 05:16 Edited at: 21st Jul 2003 05:29
Wow thanks guys, fast response

Hmmm ok thats 5 people it worked for and 3 people it didn't

Yes it is based on color, using the point() command. However you should find that the levels can be as steep as you want, he'll climb a vertical wall!! Only the green and yellow colors used in the grass are collision colours tho, strictly those exact colours, any other yellow or green won't work, like those in the trees And he only collides with the middle of his feet for the purpose of this demo.

I'm seriously confused as to why the collision detection doesn't work for some people - Sonic, Rob K and Intermidiate Newbie, (the guys who he fell through the floor for ) Would you please tell me your specs? Especially your graphics cards? I have a feeling it may be because it checks for collisions before syncing and for some reason thats making it read incorrectly - other than that I have NO idea

I'll try making a new exe file with the syncing before the collision detection and see whether that helps. Really hope I can fix this to work properly as its so speedy

[edit] I just tried changing the sync command to after drawing the background and sprite but before checking collisions, and now he falls straight through the floor for me! so thats no good, Would perhaps locking the pixels before checking do any good? I'm open to suggestions as I'd really like this to work for everybody

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
Coop
23
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 21st Jul 2003 05:21
Hrmmmm. I am new to DB....can you tell me how you made the collision so he don't fall through?

keeblerElf
23
Years of Service
User Offline
Joined: 11th Jun 2003
Location: United States
Posted: 21st Jul 2003 05:29
Pentium 3
128MB SDRAM
8MB nVidia TNT Vanta AGB
Windows 98
DirectX 9

I noticed most of the fast comps worked fine so I tested it on my slow one...I got 85 fps...a little laggy thought

andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Jul 2003 05:37
Point???
Wouldn't it be much faster with memblocks?

And when I said he gets stuck, that's when there is a "V" shaped valley.

"All programmers are playwrites and all computers are lousy actors" -Anon
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 05:45 Edited at: 21st Jul 2003 05:46
Yes it would, especially for multiple points BUT this demo took me all of an hour, just too test my theory (its less than 20 lines of code ). If it worked well I was gong to write a proper routine

Maybe it's a problem with the point command, and saving the screen as a memblock and then getting the data from that would eliminate the problem, I should look into it. Obviously that would take longer than just an hour fiddling around though, and I originally just wanted to see if it was viable.

However the fact that it doesn't work at all for some people is kinda worrying

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Jul 2003 06:06 Edited at: 21st Jul 2003 06:07
I'm doing one now using memblocks. I'm trying to get it at least 2/3's faster as yours.

"All programmers are playwrites and all computers are lousy actors" -Anon
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 21st Jul 2003 07:20 Edited at: 21st Jul 2003 07:22
Kangaroo
I also wrote a routine that was based on the point(x,y) command. It worked great on about a dozen different machines but then tried it on an IBM machine and got some very strange readings. Even though I set the video mode the IBM I got diferent values.

I would suggest you read the value at two known points and then compare the values you are looking for aginst these variables this should eliminate the variations

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 07:53
Thank you, thats a great idea! Infact for the purpose of my ultimate excerise if that works, it'll make things a whole lot easier. Simple ideas are oftn the best My only hope is that the problem isn't a rendering one and that point() is actually returning a 0 as the screen hasn't rendered in time on some cards But thank you, I shall try that tomorrow and post a new exe which will hopefully work for everybody

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
MiniMark
23
Years of Service
User Offline
Joined: 21st Mar 2003
Location: Australia
Posted: 21st Jul 2003 13:37
Ok just ran it and I had the problem of falling through the floor, Frame rates on full screen exclusive were 2400 and on windowed 512. For machine specs check below. Also wondering what patches everyone was running for the test. I think this machine is patch 4, have to check with the resident geeek.... umm I mean mr_Flibble

There's no u in TEAM, so bugger off!!!
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 21st Jul 2003 13:57
Kangaroo2,

Same problem with falling hoglet, but on Exclusive mode, 395fps, in windowed mode, 90fps.

Spec for testing machine is:-

Intel Celeron 1200Mhz, Windows XP, Intel(R) 82810E Graphics Adaptor (Onboard), 128MB Ram.

I will also test it on the machine spec'd on my signature

MSI/AMD Athlon 1300, 256Mb, 60GbHD, SoundBlaster Live!, GeForce 4 MX440-64Mb, Win2K, DX9, DarkBASIC Pro(PUv4.1)
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 13:59 Edited at: 21st Jul 2003 14:00
Works fine in Window mode (the 777 FPS seems way to much - are you calling SCREEN FPS multiple times !?). FSEX is around 312 and works fine too...

Its with my GeForce4MX 2.2Ghz P4 works machine (DX9.0a). I'll try my home computers later.


Its better than a poke in the eye...
MiniMark
23
Years of Service
User Offline
Joined: 21st Mar 2003
Location: Australia
Posted: 21st Jul 2003 14:15
Ok my bad.... I asked what patches duh...wasnt thinking straight earlier. Of course patches dont come into it, already compiled.... Think I will have to pay more attention in future.

There's no u in TEAM, so bugger off!!!
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 21st Jul 2003 14:39
on mine I got 335 fps in fullscreen exclusive mode, though sonic just falls rght down out of the screen.

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 14:44
My desktop is always in 32-bit mode - is that the answer/problem ?


Its better than a poke in the eye...
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 21st Jul 2003 14:45
and the graphics look nowt like your picture, unless that's from the real sonic

Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 14:53 Edited at: 21st Jul 2003 14:56
Thanks everyone.

Toady, glad it works for you, and no the fps rate really is that high, its only called once a loop The reason it might not look it is because I have the Sonic animation and the scroll speed moving at intervals of so many frames per second, hopefully to make it run at a sensible speed on most systems - I I just set it without this restriction it moves so fast on mine I can hardly even see it!

It may be to do with forced screen depth modes or refresh rates, that may effect the result of the point command I can try again with the new suggestion as before, unfortunately I'm out most of today, but I'll try it on later tonight

[Edit} Shady, you said the graphics don't look like the screenshot, which is seriously strange, as the shot was taken directly from the demo, and you can see yourself from the media included what the sprites and background should look like What do they look like for you? Can you email me a screen shot? (If you have Win XP just press 'Print Screen' key then paste it into a paint package )

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 21st Jul 2003 14:55
Sam, here are my specs:

Windows XP
ATI Radeon 9700 Pro (Catalyst 3.5)
32bit Colour dekstop
DirectX 9

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 14:59
K2 - You might have found a bug that Lee must know about...


Its better than a poke in the eye...
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 21st Jul 2003 15:48
Rob - Thanks

Toady - you might be right - unless there's a simple explanation this might be a relatively serious bug. I'll contact Lee with my source code if my next exe doesn't clear up the problem.

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 16:26
I changed to 16-bit graphics mode, and poor ol' Sonic fell through the land...


Its better than a poke in the eye...
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 21st Jul 2003 16:43 Edited at: 21st Jul 2003 16:45
Pentium 400Mhz
Radeon 7000 Pro
312MB RAM
DX9.0a, XP

Straight through the floor. 80-85 FPS Windowed. 145-150 FPS Exclusive.

Interestingly enough I created a similar collision system for my very first game (2D RPG in VB), although it used BitBlt and two images - One was the visible map the user saw, the other was a colour coded collision map, black would be impassable, you'd walk behind blue and other colours resembled items that you could pickup. It used the GetPixel() command and was fairly fast (40 FPS on a P166) for BitBlt. Both systems have their advantages, yours obviously because there isn't the hassle of 2 images (i.e. less design time, memory used, HD space used) but mine means less programming goes into defining every colour you can't walk over.

"Computers are useless they can only give you answers."
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 21st Jul 2003 16:49
I don't think it is a bug - more a tech issue. Run it in 16 and then 32 bit mode - maybe you need to check for a range of colours rather than a specific one.

Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 21st Jul 2003 16:51
I just moved the ground down in the bmp so when it loads the level you see him start in midair and then fall through the ground so I'm pretty sure it hasn't got something to do with checking before sync. To double check this I filled the whole map in the exact same yellow and yet again he falls through so I think Rob has got the right idea, it can't match the exact colour.

"Computers are useless they can only give you answers."
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 17:57 Edited at: 21st Jul 2003 17:58
Laptop specs where he falls thru (tried all sorts of resolutions):
P4 2.53G, 256MB, ATI Mobility Radeon 9000 (64mb - catalyst 3.5), xp home

When I get home from work I shall try on 2 different desktop pc's.

I think your problem is possibly with point command. Rob K and I had similar problems doing a flood-fill thingy for Spectre's paintpot proggy (http://www.darkbasicpro.com/apollo/view.php?b=1&t=9985&p=0).

Remember point's have to be stored in a DWORD for accurate results.

R Tape loading error
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 21st Jul 2003 18:32
I think I see a pattern.
Program works with NVidia
Falls through with Radeon

Question : Kangaroo2 did you write it on an NVidia machine
Question : Did you set the mode, its possible that NVid and Rad default to different Modes

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Mussi
23
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 21st Jul 2003 18:58
i get a FPS of 2450 in full-screenmode and 850 in window mode.

Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 10GB HD, Geforce 4 Ti4400 128mb ddr sdram
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 19:19
Oh - it can fail on Nvidia machines, Codger - it seems to be the desktop resolution that does it.


Its better than a poke in the eye...
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st Jul 2003 20:27 Edited at: 21st Jul 2003 20:29
Or maybe not - my 2Ghz P4 Ti4800 in FSEX mode caused Sonic to fall through - and I'm using 32-bit graphics mode...

Interesting problem...


Its better than a poke in the eye...
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Jul 2003 21:05
I have Nvidia

"All programmers are playwrites and all computers are lousy actors" -Anon
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 21st Jul 2003 21:12
Are you moving him multiple pixels per frame? If so, he may be skipping entirely the pixels you're checking for collision against... This would vary based on the speed of the machine...

A better solution is to figure out how much you want to move him, then trace a line along that vector to make sure it wont hit anything solid... Then move him... If while tracing you hit something solid, move him only that far....

It's kinda like walking in a dark room... You could just run, or you could put you're hand out in front of you and detect the collision before it happens!

Tony

King Weeble
23
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 21st Jul 2003 21:48
1700-1725 FPS
Pentium 4 1.7Gig
1 Gig Memory
Geforce 3 Ti200 (64meg)

really needs more speed. Its SONIC!

jeffmosesuk
23
Years of Service
User Offline
Joined: 7th Jun 2003
Location: United Kingdom
Posted: 22nd Jul 2003 00:03
560-580 ish in Full-Screen Mode (No Sonic just scrolls background)
0-7ish FPS in Window Mode (Sonic appears then falls down of screen)

P4 2.53Gig
512Mb Memeory
Radeon 7500

Have probs on my game with FPS too that im working on. Using a BSP made level (collision sorted and is perfect :o) but when I first load after switching pc on get a good 60FPS but after a few compiles goes down to around 7 FPS !!! :o( O well its all fun ;oP

"Time to play."
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 22nd Jul 2003 02:05
after quitting the program flush video memory. that will stop your prob

Life is a terminal disease.
You never survive it.
jeffmosesuk
23
Years of Service
User Offline
Joined: 7th Jun 2003
Location: United Kingdom
Posted: 22nd Jul 2003 02:07
cheers darkfluff much appriciated

"Time to play."
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 22nd Jul 2003 02:56
It's harder than I thought. I was trying to read the level from the bottom up, and find the hightst point of a certain color, and save it in an array (Groundheight(levelwidth)). For some reason, it dosen't want to read the memblock data right.

"All programmers are playwrites and all computers are lousy actors" -Anon
Dr DooMer
23
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 22nd Jul 2003 03:56 Edited at: 22nd Jul 2003 03:57
1200fps in fullscreen, 560fps windowed. Unfortunately, Sonic falls through the floor with me, too! Shouldn't he go "Duh-Duuuuh!" and do his little death animation when that happens?

Anyway, specs: Pentium 4 2.4ghz, 512mb RAM, Radeon 9000 Pro 128mb, 32-bit display mode.

Such a shame, I'd love to see a DB Sonic game! But, is Sonic as cool as Knuckles? Tough one, that...

keeblerElf
23
Years of Service
User Offline
Joined: 11th Jun 2003
Location: United States
Posted: 22nd Jul 2003 06:55
FPS doubled when I had my desktop in 16-bit mode but sonic fell through the floor

Eric T
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: My location is where I am at this time.
Posted: 22nd Jul 2003 09:49
i had another faller
fps average of 478 in Full and a 209 in windowed

p3 933
matrox millenium g450 dualhead
XP home
and a buncha other tid bit crap...

i'll test it on my laptop tomorrow

Opinions are like a$$holes, Everybody has one.
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 22nd Jul 2003 10:03
Quote: "Are you moving him multiple pixels per frame? If so, he may be skipping entirely the pixels you're checking for collision against"

I tried filling the whole map in the collision colour and he falls through so that can't be the problem.

Quote: "Such a shame, I'd love to see a DB Sonic game! But, is Sonic as cool as Knuckles? Tough one, that..."

He's not making a sonic game, he just ripped the graphics to test his collision

"Computers are useless they can only give you answers."
Kensupen
23
Years of Service
User Offline
Joined: 19th Sep 2002
Location: United States
Posted: 22nd Jul 2003 10:36
Well, he just fell through the ground, but....

In Windowed mode I got 534FPS
In Full screen exclusive mode I got 2399FPS (That isn't a typo. I was surprised too)

-Kensupen

Nerdsoft Creations - Lead Programmer
System Specs: AMD XP 1700+, WinXP Home, 1GB PC133 ram and Radeon 9500 using DX9
Ralen
23
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 22nd Jul 2003 12:20
It works fine in 32bit mode, in 16bit mode he falls through. Did this both on exclusive, and windowed.


Specs
Athlon 1700+
Geforce 3 TI 500
1gb ram

Was getting 1200 exclusive, 350 Windowed

My theory is since you do it based on color the color has a different numerical value in 16bit mode, than it does in 32bit mode.

Login to post a reply

Server time is: 2026-07-23 02:36:36
Your offset time is: 2026-07-23 02:36:36