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.

3 Dimensional Chat / Sync and FPS

Author
Message
Bona
21
Years of Service
User Offline
Joined: 22nd Oct 2004
Location:
Posted: 12th Dec 2004 23:16
I have a really big problem, an i'm not sure if it has to do with my computer or the way i code but anyway.

In my latest program i have make good progress but now the computer have to calculate so many things. After the program have runned for abut 1 and a half minuite teh FPS rate drops dramaticly. Is this a program based on the way i code or cos my computer maybe have problems with 3D acceletaion

The only way to get an intellegent conversasion is to have a monolog.
IanG
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 12th Dec 2004 23:37
could be both - could you upload the code so that we can see

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 13th Dec 2004 03:20
Quote: "program have runned for abut 1 and a half minuite teh FPS rate drops dramaticly. "


Yes, some sample code would help, as there are so many possibilities.

I had this problem on my current project (outer space solar-system type stuff). After about a minute I went from 110fps to 40fps.

Turns out one of my outer planets I'd accidentally added waaaay too many faces to the sphere it was textured on and it took about a minute for the planet to travel far enough in orbit that it was finally in my FOV. Even though it was so far away from the camera it wasn't much more than a dot, once it actually entered the view everything went KERCHUNK. I guess DBP didn't try to draw it until the first time it was visible.

Anyway, what I mean to say is it could be sooo many things causing your slowdown...
Bona
21
Years of Service
User Offline
Joined: 22nd Oct 2004
Location:
Posted: 13th Dec 2004 05:32
Cos you both have requested some samples i'll give it to you, as well as some more info.

The program does only include a few objects. All are primitives. I dont have an exakt number of objects cos i change that all the time. The also only have a simple texture.

Here are some pieces of coding. This is only some parts and therefore you might not understand everything.

Main Loop:


As you can see i use a lot of subroutines.
The most important for this purpose.(the ones i think cause problems)







Is might look like a lot of stuff to be done. For the moment i use a veru low FPS rate (only 50 FPS/s) No change

Is this to much codes between each SYNC

The only way to get an intellegent conversasion is to have a monolog.
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 13th Dec 2004 14:33
A couple of things come to mind right away.

It looks like you're doing a lot of 2D drawing to the screen (the line drawing), as well as 3D. Several things that I have read say that's a good way to kill your frame rate.

The other thing is the big loop using "for i = 1 to unit_max". Your collision detection is in that loop, and it's time-expensive if there are a whole lot of object (thus lots of checks).

Also do you know how many polys in your 3D models?

Lastly, please don't be offended if I ask the obvious question... I couldn't tell from your main prog source that you are disabling autocam and setting sync to manual. I'm sure you've done that but didn't see it so thought I'd mention it just in case.
Bona
21
Years of Service
User Offline
Joined: 22nd Oct 2004
Location:
Posted: 14th Dec 2004 05:07
Ok I have done some changes and so far they work, While the program run the FPs rate is as high as 83 and never drop (and i only set the sync rate to 75)

As an answer to the question about those obvious questions. No autocam, manual sync.

The changes ive done is that i made this bof loops about unitcollision to anly run while mouseclick()=1 or =2. Work

But i just wonder, Does really 2 sprites and drawing decrease the fps rate that much. Its neccesery for me to use both, and therefore i want to have a limit of what a standard computer can handle.

//bona

The only way to get an intellegent conversasion is to have a monolog.
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 14th Dec 2004 06:28
Hi Bona,

Quote: "But i just wonder, Does really 2 sprites and drawing decrease the fps rate that much. Its neccesery for me to use both, and therefore i want to have a limit of what a standard computer can handle. "


I'm still searching in vain for the source of the reference I made to intermixing 2D and 3D slowing things down. But if I followed the author's argument correctly, it wasn't so much how many 2D draw operations you did, it was that you were forcing DirectX to keep switching from some mode to some other mode, back and forth... and that was how you took a hit in performance.

I've seen sample apps that mix sprites and 3D objects with no problem. I was looking more at the 2D line drawing in your code when I came up with that thought. But from what you've done so far, it really sounds like the collision checking was the big cause of your slowdown (?)

Login to post a reply

Server time is: 2026-07-14 11:06:11
Your offset time is: 2026-07-14 11:06:11