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 / game slows down(rendering problem)

Author
Message
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 24th Mar 2003 12:42
i have a problem my speed drops alot when i walk towards certain objects theres this spaceship i have my speed is fine when im close to it but when away from it walking in that direction everything slows.how can i get around this.
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 24th Mar 2003 18:06
probably you've too many polygons in your scene

when you're close to an object (eg looking at a wall) there aren't many polygons to be rendered, so then its faster
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 24th Mar 2003 23:03
is there a way around this i want to use it in the game can i like check to see when im walking towards the object and fps drops make it increase
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 24th Mar 2003 23:59
Its because its too many polygons. Check what is being rendered and hide the objects that arent being rendered in the camera FOV and ROV.

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 25th Mar 2003 07:48
okay like if im far away from the object and the camera cant see it keep it hidden until i get within a certain distance then unhide it so it will be rendered but wont the scene look not real if im a couple of hundred feet away and it appears out of knowwhere but i do have fog at a distance of 1500 can i use that to my advantage.
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 25th Mar 2003 08:00
another thought guys my fog distance is set to 1500 which means i cant see anything more than 1500 feet in front of me so i could check my distance with these objects to see if there close enough to be seen and not hidden by the fog if they are close enough i would unhide object for rendering right.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 25th Mar 2003 14:12 Edited at: 26th Mar 2003 02:03
OK, first you find your camera (or player) position, then you find the object position. Then, you take their Z coords, and subtract them, so if your objects z coords - the other objects z coords > 1500 then hide object X

for x=1 to (however many objects you have)
z=Camera Position Z()
zo=Object Position Z(x)

if z-zo > 1500 then hide object x
else
show object x
next x

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 26th Mar 2003 01:18
okay i understand somewhat here what you said to do is all in that loop there.
its one to the number of objects thats causing the problem, in the loop how do you set the number of the object x?
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Mar 2003 02:04
Say you have 10 objects, 1 through 10,

for x=1 to 10
whatever
next x

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 26th Mar 2003 02:43
check this out:i did what you told me above in which my camera is linked to my player so i used my players positioni made variables for the player and object(ship) i put all of it in the main loop

playerzpos#=object position z(2)
shipzpos#=object position z(3)
if playerzpos#-shipzpos# > 1500 then (im getting a error in this first line)
hide object 3
else
show object 3
endif

if my players z position minus the objects z position is greater then 1500(being how far the fog will let me see)then hide the object(ship)or if it isnt then dont hide it.
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 26th Mar 2003 23:34
i actually got a working piece of code to do what i needed:

PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 26th Mar 2003 23:42
That's a real bad way RPGamer

Just set camera range 1,1500, so you won't render anything above 1500 units.

play around with camera range, It's great! especially for many objects!

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 28th Mar 2003 08:08
whos is bad you mean rpgamers loop example or my snipeet above because if thats not a good way let me know
GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 28th Mar 2003 16:19
try...

for a=1 to [number of objects]
if object visible(a)=0 and object in screen(a)=1 then show object a
if object visible(a)=1 and object in screen(a)=0 then hide object a
next a

this should up you fps[frames per second] by two to five depending how many objects you have in your game.

hope this helps...

Login to post a reply

Server time is: 2025-05-16 23:31:02
Your offset time is: 2025-05-16 23:31:02