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 / My program stutters initially.. help !

Author
Message
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 1st Dec 2002 00:34
Hi there, trying to solve something odd (DBP,Patch3).. basically every x amount of steps the player takes my program does a small calculation. The first time I walk along every x amount it stutters a bit, but if I then reset (in-game) to the beginning and go again, its a smooth as can be. Does DBP calc. as it goes along and store stuff into memory ? Not sure I can pre-calc my data (easily), any ideas/thoughts ?

Cheers
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 1st Dec 2002 01:49
Shit. Cut it down and it looks like intersect object is whats slowing things down.. thing is, I cut my level into chunks and I only do intersect object on the bit of the level my player is on, the theory being to optimize my code! Its just the initial pass. Once you repeat steps you've already done its ok (but the possibilities I guess are loads, I was just testing a-to-b straight line).. hmm, wonder if attempting to pre-calc the data would work.. thinking cap on. Urk.
DrakeX
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 1st Dec 2002 03:42
...don't say i'm here.

i noticed this too. to get around this, you need to loop through all the sectors just before the game loop and use INTERSECT OBJECT() on each one once. that way it does all the precalc (which it does on the fly normally) before the game starts.

now that i know a bit about DX i know why this is INTERSECT OBJECT is in fact an inbuilt directx function; there's just a little setup you have to do before you can use it, which is what's slowing the program down.

[poof]

i'm looking at yooooou!
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 2nd Dec 2002 11:12
Thanks DrakeX However, I found another way to solve it (in my case at least).. if I set object collision to polygon for all my .x's it doesn't jitter the first time through. Even more interesting is that before I start the main game loop, and I do "set global collision off", its still smooth first time! If I remove the polygon collision command its back to stuttering. Mind you, I found this out about 3am sat night so if you could confirm with you code that would be great For a moment there, I doubted intersect object, but it is a truly is a top command!

Cheers

Login to post a reply

Server time is: 2024-05-04 04:39:33
Your offset time is: 2024-05-04 04:39:33