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 / Best CPU programming with DBPro

Author
Message
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 14th May 2013 12:42
Hi dudes, I am trying to have some certainties about what is the best CPU if you programming using DarkBasic Pro+Dark Dynamix.

Some questions:


1) DBPro don't support multi core, ok.
knowing this fact it's better to have a quad-core 4.0ghz or a 6-core 3.5ghz?
I suppose DBPro although not directly take advantage of multi-core, can still take advantage of the calculation power of the sum of the cores!
So I can suppose,without too many problems, that 6 cores at 3.5ghz are a better choose than 4 core at 4.0ghz.. right??


2) From my AMD Athlon II X2 270 3.40ghz to a quad-core 3.8ghz can I suppose to get 50% more of pure calculation power?


3)Can really DBPro take advantage of a greater amount of L2 and L3 CPU Cache memory?


Thank you all in advance!
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th May 2013 14:26
try to make you programs able to work on all computers. this comes by using a good programming practice that comes with learning.

unless you want to use some advanced design software to create your environment then good computers will do a better job.

about multithreading. I believe that most 3D plugins are multithreaded internally and made to use most of the CPU power plus remember that most of the 3d is handled on the gpu where cpu multithreading wouldn't make much sense in such case
as well most of current physics engines rely on gpu pocessing power rather than cpu



Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 14th May 2013 15:11 Edited at: 14th May 2013 15:18
Quote: "plus remember that most of the 3d is handled on the gpu where cpu multithreading wouldn't make much sense in such case
as well most of current physics engines rely on gpu pocessing power rather than cpu"


Hi basjak, I am not totally agree with your words.

I change my video card from a Geforce450GTS to a Geforce590GTX and I see so and so a bit less or a bit more of double fps.
Considering my new video card is 3 or 4 times faster (in average benchmark tests) than my old video card so I suppose there is a lot of work made by CPU too (Using DBPro).

I am not too certain that GPU made the majority of the work about 3D graphics/Physics when you using DBPro.. Seems that DBPro is not optimized to take a total advantage of new video card or multi GPU videocard!

over everything above ,my new videocard is 2 GPU and when I set 1 GPU only to handle Physics so I don't get advantage in fps.
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 14th May 2013 22:44
Quote: "I change my video card from a Geforce450GTS to a Geforce590GTX and I see so and so a bit less or a bit more of double fps.
Considering my new video card is 3 or 4 times faster (in average benchmark tests) than my old video card so I suppose there is a lot of work made by CPU too (Using DBPro)."


This doesn't surprise me. I have seen the same thing. The benefit you get is you can use more detail with less slow down. Shaders will work a bit faster too.

However the real speed is gained in culling objects. Removing absolutely all the workload that you can without someone watching the screen being aware. Here you need to get creative. It pays off big time.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 00:46 Edited at: 15th May 2013 00:48
Hi Mage

my airplane is always in contact with thousand of dark dynamix objects. When these continuous collisions happen with a slow airplane speed so I got a real BIG fps improve but when my airplane start to go fast the things changing..
I start with my airplane stopped in the runway and I get over 80fps.. when my airplane is at 100 I already fall down to 40fps...
at 200 I get 28fps and when my airplane is at 300 the fps falling again to 19/20.. at 400kmh fps falling again and again to 12/13...

In other words, more fast the collision and the repositioning of the "air particles objects" in the airplane area so more my system take a lot of performance breakdown.

I am in a real "archimede mood" to find some ways to add speed to my project and with a lot of lucky and many tries I got so and so 7/8fps more thx to the code optimization. But I need an extra power!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th May 2013 01:50
Quote: "knowing this fact it's better to have a quad-core 4.0ghz or a 6-core 3.5ghz?"


I highly doubt my Pentium 4 2.8GHz would beat an i3 2.5HGHz, and it's got nothing to do with the i3 having more cores. It's just more efficient architecture.


The collision engine is going to use your CPU, not the GPU. To understand why it might slow down as you go faster you'll need to understand how the system works. Chances are, it's not checking collision against every object, only those within a certain range. The faster you go, the larger the area it has to check because it's likely doing swept collision.

If you're only getting 80fps in your game when it's not even doing anything, I'd suspect there's room for a lot of improvement in the code.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Mr Bigglesworth
18
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 15th May 2013 02:35
Quote: "I suppose DBPro although not directly take advantage of multi-core, can still take advantage of the calculation power of the sum of the cores!"


The "calculation power" of the cores is not "added", if you have a quad-core processor at 2.8GHz you essentially have four processors at 2.8GHz, their speed isn't added together.
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 15th May 2013 03:22
Quote: "If you're only getting 80fps in your game when it's not even doing anything, I'd suspect there's room for a lot of improvement in the code."

Exactly.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 10:41
@Mr Bigglesworth:
Quote: "The "calculation power" of the cores is not "added", if you have a quad-core processor at 2.8GHz you essentially have four processors at 2.8GHz, their speed isn't added together. "

Hi, I need to clarify at100% this point! Ok, so I DON'T HAVE the moltiplication of the ghz so I DON'T HAVE 11ghz (2.8ghz *4). Ok, but as you say I have 4 2.9ghz processors and each of these cores can work to help each other right?
I see when my project running that my 2 cores both working hard so I suppose each my core are working for my project! will not be as if they were "added" but sure they are working both! So,

1)is right if I say that is better to have 4 cores at 2.8ghz instead 2 cores at 2.8ghz? And is better to have 6 cores at 2.8ghz instead to have 4 cores at 2.8ghz?

2)and REALLY IMPORTANT QUESTION, is better to have 2 cores at 4.0ghz or to have 4 cores at 2.8ghz? I really would to understand perfectly this.


@Phaelax and mage:
Quote: "If you're only getting 80fps in your game when it's not even doing anything, I'd suspect there's room for a lot of improvement in the code."


Ehhh... I am totally over my programming skill in these days and I made giant forward steps.. but since I need to handle all these collision in a very little step (as my airplane is fast) so I think I do not have too many more ammo to shoot.. (but I like the idea about I could to improve a lot again my code.. just since now seems as a dream..)
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 15th May 2013 12:55
What happens with your 4 core CPU is that the game only uses one core. There's a few small exceptions for sound and some plugins. Your CPU will notice you are using basically one core at 100% So your CPU has a feature where it slows down the other cores and boosts the core you are using.

Your 2.9GHZ core will likely on the fly bump itself up to over 3GHZ. Probably no higher than 3.4 GHZ.

As far as your collisions go, you need to figure out creative ways of skipping as many collision checks as possible. Cheat with the checks as much as you can without the player noticing.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 13:12 Edited at: 15th May 2013 13:14
Quote: "So your CPU has a feature where it slows down the other cores and boosts the core you are using"


mmm are you trying to say to me that using a dual core at 3.4ghz or a quad core at 3.4ghz is the same thing about performances or I will have just a bit of more performance??? (using DBPro)

I hope I just don't understanding you..

Simply my pc have to use second core when the first is full and have to use third core when the second is full too...
I HOPE this is the way my pc handle my DBPro program...
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 15th May 2013 16:53
hmm, I have a core2quad(not a true quad core - 2 dual cores treated as 4) at 2.4GHz, which is 4 cores at 600MHz - which is what it says in the bios. So I fail to see how with dbp it only uses 1 of these cores, I`ve ran same program on this machine that I`ve ran in past on a 1.2GHz single core, it struggles on 1.2GHz and runs smooth on the core2quad, this pushes me to think that all 4 cores can be treated as a single core and that the cores are indeed added together, otherwise I`m gaining better performance on a 600MHz core than a 1.2GHz core which makes no sense to me at all
As for running your physics on your cpu - if dark dynamix is same as dark physics then it can use the gpu if set to do so in the code, I cant remember offhand if physx(which is what dark dynamix and dark physics are a wrapper for) has it but I know that newton physics does - continuous collision detection(CCD) mode - if your doin that part seperate to physx then yes your cpu will handle it but if not then gpu will handle it BUT its likely(as is case with newton physics) that CCD will show a BIG performance hit as many more calculations are done behind the scene, in which case only a better gpu will help you here, and thats not to say that with CCD on, that you can find a gpu good enough to handle the extra work as it all depends on the physics scene you have. For every object in dbp there is a cpu overhead that can kill framerate once the number of primitive draw calls gets to around 1000 if more are added(tested on ati x1300 and nvid 9600 with same resulting limit though more scene detail can be added to the better gpu - 9600 in terms of shaders, polycount per mesh and textures), when asking the gpu to do physics I think some of that overhead becomes negligable, I cant think of any other reason why it works so much faster on gpu other than scaling(a guess), but still has its limits, my guess would be that the gpu doing all that extra work plus CCD is too much for it to handle
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 17:15
Quote: "hmm, I have a core2quad(not a true quad core - 2 dual cores treated as 4) at 2.4GHz, which is 4 cores at 600MHz - which is what it says in the bios. So I fail to see how with dbp it only uses 1 of these cores, I`ve ran same program on this machine that I`ve ran in past on a 1.2GHz single core, it struggles on 1.2GHz and runs smooth on the core2quad, this pushes me to think that all 4 cores can be treated as a single core and that the cores are indeed added together, otherwise I`m gaining better performance on a 600MHz core than a 1.2GHz core which makes no sense to me at all"


James H, your words opening a hope in this grotesque thread.. (grotesque cause is just sad and weird to think you have not advantages to use cpu with more cores)

Quote: "As for running your physics on your cpu - if dark dynamix is same as dark physics then it can use the gpu if set to do so in the code"

This is REALLY interesting also because I never listen something about! sincerely I don't know how and what the GPU works with his calculations when you run a DBPro + DarkDynamix project.
I think also the discussion about is really complex..

Sure if there is a command to call in the code to "purely make the physic handled by GPU" so it's a GIANT new! but I repeat.. I never listen or read something in DarkDynamix docs or here in the forum..


Quote: " I cant remember offhand if physx(which is what dark dynamix and dark physics are a wrapper for) has it but I know that newton physics does - continuous collision detection(CCD) mode - if your doin that part seperate to physx then yes your cpu will handle it but if not then gpu will handle it BUT its likely(as is case with newton physics) that CCD will show a BIG performance hit as many more calculations are done behind the scene, in which case only a better gpu will help you here, and thats not to say that with CCD on, that you can find a gpu good enough to handle the extra work as it all depends on the physics scene you have."

DarkDynamix using CCD too. I think this "method" was designed to have a sure and precise way to have collisions in physX world.
I don't know if this is involving CPU or GPU.
But if currently my collision is handled by CPU (and I am not sure about) so maybe will be better if ONLY GPU can handle these collision (just cause my GTX590 has 2 FAST GPU - though I don't think DarkDynamix can take advantage about multi GPU..)


I hope somebody with more knowledges of me can help us to understand well all that.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th May 2013 17:16
Quote: "are you trying to say to me that using a dual core at 3.4ghz or a quad core at 3.4ghz is the same thing about performances"

As far as DBPro is concerned, yes. DBP will only ever use one core, but certain plugins will take advantage of multiple cores.

I suggest you buy the CPU with the highest core clock speed.

But My personal preference is to develop a game on a lower spec machine than your target to ensure that it runs correctly on the faster target machines. (This way is also better as it forces you to be more efficient with your coding, and to add CPU 'cost saving techniques' which makes you a better programmer in the long run.

Anyone can make a high FPS game on a top of the range CPU, but getting the same effect on a lower CPU is where the real skill lies!

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 18:01
Hi mobiiius, so here is the sad party

However I think the architecture of a 6/8 core cpu is pretty optimized than the architecture of a dual core so I think some type of advantage is present when you using a cpu with more cores..
Ah, without forget the cpu with more cores are with more chache memory too. So I think that 2 cpu with same ghz but with different number of cores, take advantage of their ghz in different way.. using their schemas to handle the frequency..
in other words 3.5ghz of a dual core cpu is "less fast" than 3.5ghz of a quad core cpu (comparing the work made by ONE core of these 2 cpu)

About to make a game that can go fast in all machine so.. haha I am a bit out of that.. my project simply CAN'T go fast in old or not gaming computers just for the start idea about..
I can tell just it's a "particular project" than a game.
And I think I never can reach really good levels at my programmation skills However, despite this, I make real big improvement in my "code optimization level" sure I trying ALL to find some more frames per second!
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 15th May 2013 18:23
Quote: "hmm, I have a core2quad(not a true quad core - 2 dual cores treated as 4) at 2.4GHz, which is 4 cores at 600MHz - which is what it says in the bios"

this is completely wrong. If it says 2.4GHz then all of the cores are 2.4Ghz

Using more cores won't make your program run faster.

More cores will make a difference in compile time, everything else uses only one core. Some plugins use more cores, but you have to be aware than most of stuff in game programming can't be paralelized so using 6 cores won't make your game run 6 times faster automaticaly.

To take advantage of multiple cores you have to create threads yourself and chop your algorithms in pieces that can be run at the same time. Most of stuff in game programming just...can't.

If you run GTA4 on quad core only first core runs at 100%, second on 30-40%, 3rd and 4th only 10%.

You are using dark dinamix which uses nvidia physics. To find out how mamy cores it supports you'll have to google a little bit.

Liquids, soft bodies and particles are simulated using gpu, everything else is using cpu.

Whats slows the running speed the most in dbpro is rendering. If you have lots of small object that means lots of draw calls. To optimize that you'll have to combine them in bigger objects if you can.

Since dbpro doesn't support multy threading you can't optimize your game for multiple cores, everything will run on 1 core only.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th May 2013 18:45
I really don't like all that

I think for DBPro programmers is not impossible to add this feature.. just something that when find first core full of work so start to use second core etc..

DBPro is a far evolved program and the multi core matter is really strange not implemented since today..
The performance boost will be amazing just making some stuff to trick the cpu work in more than 1 core..
DAMN!!
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 15th May 2013 19:00
Quote: "Quote: "hmm, I have a core2quad(not a true quad core - 2 dual cores treated as 4) at 2.4GHz, which is 4 cores at 600MHz - which is what it says in the bios"
this is completely wrong. If it says 2.4GHz then all of the cores are 2.4Ghz
"

odd, my fsb is 267MHz with 9xmultiplier(2.4GHz) yet the bios states 4 cores at 600MHz, perhaps the bios is "wrong" as this is post? I`ve read other users updated their bios in hope it would read different, but it didn`t make any difference. I`ll take your word for it that they are each 2.4GHz, just has me scratching my head why bios would be different lol

Quote: "opening a hope in this grotesque thread"

no real hope at all, it is as brendy states, dbp doesn`t support mulithreading(ie dbp commands not plugin commands, each plugin works seperately, some do like dark physics, dark dynamix, dark AI)
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 15th May 2013 23:27
DBP with only few exceptions pretty much uses only one CPU/core. Modern CPUs will slow down unused cores to provide a small boost to the core you are using. A 2.9 ghz CPU might get as high as 3.3 or 3.4 ghz in the very extreme.

Login to post a reply

Server time is: 2026-07-06 22:42:08
Your offset time is: 2026-07-06 22:42:08