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 / Why does the DBC update run so slow compared to 113 enhanced?

Author
Message
Medusa
20
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 19th Dec 2010 21:31
I reverted back to the 113 enhanced update because the new update brought all my existing stuff almost to a standstill.
It looked like one frame a second.
There is no obvious improvement in graphics or audio and certainly not in speed with the new update.
So what does it actually do?
Does it have any merits?
Like most people I get used to downloading updates because usually update means improvement.
Now that I have went back to 113 enhanced I do not have any problems but I would be interested to know why the update is so slow.

mpc
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Dec 2010 04:42
You're talking about 1.20, right?

I haven't experienced the speed loss you are mentioning, but one factor is making sure you have a setup.ini file in the same directory as your executable. If it's a stand alone program, not source, then that directory is where the exe lives. If it is source, then that directory is where db.exe lives.

Open up the setup.ini file and change blipflipmode=1

Another possible speed factor is the use of static objects. I found that any more than around 1000 to 2000 polygons of static objects and thene performance starts to lag.

Quote: "There is no obvious improvement in graphics or audio and certainly not in speed with the new update.
So what does it actually do?"

2 main things:

1. A series of material settings are available to allow control over light reflectivity on an individual object level. In 1.13 and below, You could manage one setting SET AMBIENT LIGHT - and that would control the darkness or lightness of all objects in the scene. In 1.20, you can control 4 properties for the lighting of an individual object:
a. ambient
b. diffuse
c. specular
d. emissive

These settings allow things like reflectivity, hardness, emminence (glowing-self emitting light but no halos) response to surrounding light.

2. The temp directory that DBC uses was setup to (root where db.exe lives):\dbtemp . Previously in was root:\windows\temp . This was to account for permission problems that were occurring in Vista.

Misc:
There were a few miscellaneous changes:
-syncing when using Set Camera View
-a few built in primitives were changed in terms of the verts and normals
-there's a few extra commands that I think may have been included for the Star Wraith games that are undocumented that have something to do with camera refreshes and syncing
-Using SET TEXT FONT command requires the inclusion of the character set or text sizes are unpredictable:
set text font "arial",1

Quote: "Now that I have went back to 113 enhanced I do not have any problems but I would be interested to know why the update is so slow."

Don't know - I mentioned the Set Camera View thing above. Do you use that in your code? If so the placement of the sync or the absence of sync will effect your program.

Enjoy your day.
Medusa
20
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 20th Dec 2010 17:02
I get what you mean LATCH
So it does actually improve the engine
I am a very basic programmer and my only worry is always how it handles the polygons.
Any speed lost in polygons due to artistic or even technical advances is something I would not want.
I would rather have a big fast game with ambient lighting rather than a small slow game that looks beautiful.
I realise I am stating the extremes and a better programmer could find the middle ground.
I however am not a better programmer.
My programming has always been rough and ready
My ammended coding is always a nightmare for other coders as I leave no REMS for info.
Nice to get the info from you to satisfy my curiosity

mpc
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Dec 2010 17:52 Edited at: 20th Dec 2010 18:09
Quote: "Any speed lost in polygons due to artistic or even technical advances is something I would not want.
I would rather have a big fast game with ambient lighting rather than a small slow game that looks beautiful"

I know what you mean. I think there was a real big slow down when DBC went from version 1.08 to 1.13 . I think old DBC apps tended to run much faster. While the enhancements made for a lot of cool additions, their inclusion choked the engine a bit.

I never had 1.08 but I've read a lot of posts on here at different times that said it was faster than 1.13 . If you can get your hands on a copy, and you don't need any of the enhancements, you might be able to squeeze in a few more polygons to your programs.

Also, check out this link. It used to be a sticky on this board. It may have some helpful information:

How to speed up your game...

Enjoy your day.
Medusa
20
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 20th Dec 2010 21:38
Thanks for that piece of info LATCH about the slowdown from 1.08 to 1.13
I only visibly noticed the difference between 1.13 and the final update
Never thought to look back
I originally bought dbc on one disc original version
I later got a two disc update which I am sure is version 1.08
I will trawl through my treasure chest and try that version out.

mpc
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Dec 2010 01:03
It just hit me... I remember! HORRIBLE speed loss when switching to 1.20 from 1.13. At the time, I wasn't going to use 1.20 any more and go back to 1.13. I know what you are talking about. But I think there is a solution that will allow you to take advantage of the new material commands and still run your old code.

I remember running old code in 1.20 and the performance being cut in half - or even more! There was a solution... but I can only vaguely remember it - and stupidly, I didn't write it down - but I think I know what it is.

It had to do with the built in DBC collision. I think that if you have a lot of objects set up with

SET OBJECT COLLISION TO BOXES or SPHERES

and let's say your main player is using the test

if object collision(player,0)

where all objects are being tested, then the game runs less than half as fast in 1.20 as compared to 1.13.

Try the following snippet in 1.13 and 1.20 and note the speed difference:



Now there are a couple of easy fixes for this (depending on the complexity needed for your collision environment).

For the above code, if I replace SET OBJECT COLLISION TO BOXES with MAKE OBJECT COLLISION BOX, my performance is going to nearly QUADRUPLE for both 1.13 and 1.20. 1.20 and 1.13 will have the same performance.

Here's the adjusted code. Trying running it in both 1.13 and 1.20 and notice the marked performance increase:



If your environment is more complex, then combine as many objects as you can into 1 object. Set these groups collision to POLYGONS.

The fastest collision in DBC is STATIC COLLISION. You do not need static objects to use static collision. If you use the grouping I mentioned above, try and make some of the objects static. But make sure that the static objects only take up about 1000 to 2000 polygons or less otherwise your performance will go down.

So, I think it is how DBC 1.20 handles collision for those specific commands:
SET OBJECT COLLISION TO BOXES
and
SET OBJECT COLLISION TO SPHERES

Unless you have only a couple of objects, I would recommend never using either of those if you want to use 1.20 but instead use

MAKE OBJECT COLLISION BOX
MAKE STATIC OLLISION BOX
and
SET OBJECT COLLISION TO POLYGONS

I hope this helps. There are of course a few other optimizations:

*If an object doesn't need collision testing, turn it's collision off. All objects by default in dbc have their collision on, so after loading them or creating them, turn the collision off.

*Objects that aren't in view - hide them, and turn their collision off. If they are in and out of view constantly, then don't turn on and off the collision, that will slow things down.

*Instead of collision or in addition to collision, use a lookup table (an array) that defines areas that are passable or impassable. This is extremely fast and very useful for rectangular grid like areas.

For example, if you had a city, and it was impossible to pass through city blocks, but possible to pass through streets and such, you might make a grid where passable areas have a certain number (maybe 1) and impassable areas have a certain number (maybe 0). The array is set up relative to the world grid - maybe



And based on the entity's position, you figure out which grid square they are on or trying to go to, and you look up the value in the array. A visual of what values are stored in the array could be:



If the upper left hand corner is world(1,1), then the value returned is 1 which could be a road and therefore that position is passable. But just below it at world(1,2), the value is 0 so it's a city block or some other impassable thing.

*Use a collision DLL

Anyway, all of these things can be used to help performance - at the very least match what you experienced in 1.13 but still allow you to use the new commands available in 1.20.

Enjoy your day.
Medusa
20
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 26th Dec 2010 21:48
Thanks for the input
the slowdown makes sense from what you have said
excellent LATCH
I had a full city for my tank demo but no collision
Your idea above looks like the ideal solution for collision in my city.

mpc

Login to post a reply

Server time is: 2024-04-20 14:29:08
Your offset time is: 2024-04-20 14:29:08