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 / Dark Clouds major fps problem!

Author
Message
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 4th Jan 2015 21:40
Hello community,

I just bought Dark Clouds i am pushing up to 60 fps but when i am rendering objects or a terrain it drops down to 42 32 or even 25. Please help me with some information on how to fix this!

Thank You!

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Jan 2015 23:08
Post your code, There is a way to make the rendering faster, something to do with the random seeding or dynamic rendering, but it leaves the clouds in a fixed pattern instead of being varied...

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jan 2015 10:09
You can set the update rate of the clouds to improve FPS, this has come up before, but quite a while ago. Look for the command to set the update frequency of your clouds. I think that making that less frequent and going for a slower (realistic) cloud effect is the way to go.

I am the one who knocks...
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 10:33
This is the code. I didn't find any set update for the clouds and btw i am using the old version of dark clouds because the new one is even slower. Is that command in the new version?


Thank You!



Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jan 2015 10:38
Quote: "Global time# = 17.0
dc update time#
"


Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jan 2015 11:11
Thanks MrV, can never remember that command name.

If you experiment with that time# variable Mateisoft, then you should be able to get it using far less FPS - experiment with different values (low and high) and see what affect it has.

I am the one who knocks...
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 11:20
Well, that variable tells Dark Clouds to set the actual time, in my engine i let the user choose whatever time he wants. I really doubt that that is the problem Interesting

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 11:28
If i set the wind speed will affect the fps? just a though

Alex Matei CEO
www.alexmatei.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jan 2015 12:43 Edited at: 5th Jan 2015 18:51
Edit: Just tested DC and I am talking rubbish.

It seems that all you can really do is reduce the density of clouds, like from 0.5 down to 0.3 or something like that - not ideal. If you set that too low then you end up with whispy little pointless clouds. Only updating the clouds by a tiny amount does help too, but it just seems slow regardless on the laptop I'm using, so it's hard to tell.

I'm not sure darkclouds is fast enough really, by the time you add in your terrain etc, animated characters... heck DBPro will struggle I'm afraid. I'd be tempted to try a skysphere and cloud textures - it won't look as nice but it won't kill your FPS either :/

I am the one who knocks...
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 19:45
Hm... well dc update just changes the time... thats all no fps improvement to dc update its linked the time# value

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jan 2015 21:40
There is something missing in your code, will look at the sample code later and let you know, you just need to remove 1 line of code for an improvement...

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 22:29
i think its the set cloud height or something because its a double in my code right?

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jan 2015 22:52 Edited at: 5th Jan 2015 22:56
Yeah it was time#!

Original code:



Inside your loop you need to increment time# at a rate suitable to you

I used time#=time#+0.0001 and got over 100 FPS more...

So tweak this equation "time#=time#+20.0/(24.0*60.0*60.0)" to get a balance of FPS and time of day...

You can run a subroutine which adjusts the 1.0 value of time# every hour...

EDIT

No idea why I wrote Time# instead of time#

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 23:09 Edited at: 5th Jan 2015 23:13
So the equation was the problem for the first version of Dark Clouds but if i am updating to the latest update june 15 2010 i think it was i get 30 FPS lol...

EDIT:

I see that the new update also doesn't like terrain that much from 60 fps i get 45 after placing object 30 or 20

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jan 2015 23:47
Try reordering your render sequence...

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Jan 2015 23:58
I reordered DC's rendering order. In my engine the user can create the terrain as its needs so it doesnt appear instantly when i am oppening my engine so i can't really reorder the rendering sequence or at least if you meant this way

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2015 01:45 Edited at: 6th Jan 2015 01:50
Quote: "first version of Dark Clouds "


No, the updated version I patch mine, first version has height issues...

EDIT

Move DC Update around

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 12:02 Edited at: 6th Jan 2015 12:02
I did this and i also used your equation with 0.0001 but still giving 30 fps at terrain or a fair amount of objects in the scene. I want to mention that i have i7, 8GB of ram 2GB in video so i dont think that is the problem here.

EDIT:

i7 Quad

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2015 12:07
How large is your terrain?

I don't think you are being conservative with your tools...

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 12:28 Edited at: 6th Jan 2015 12:29
Its 100 by 100 by 100

EDIT:

Thats the maximum that i am testing on. Users can change from 5 to 100

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 12:32
But not difference if i am making it smaller

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2015 13:09
You are on an i7 right?

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 13:13
yes

Alex Matei CEO
www.alexmatei.com
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Jan 2015 13:19
I think for the time being you should cut away the Dark Clouds code until you perfect your Physics...

Will the users see the clouds a lot or do you intend to use it just for reflections?

MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 13:23
The users can set their number of cloud density from the interface

Alex Matei CEO
www.alexmatei.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jan 2015 14:03
I would include an option to have a simple skybox as well as the dynamic clouds. I don't know if it's a big issue for you, but dark clouds takes a whack of time to even start up on my laptop, adding an option to disable it might improve your workflow, and definitely improve the start up speed. As MrV says, try not to dwell on the parts that aren't working great that you can't really control - get to work on other things instead, otherwise projects can get very stale and not fun to work on anymore.

I am the one who knocks...
MateiSoft Romania
12
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Jan 2015 14:43 Edited at: 6th Jan 2015 14:43
Alright so you say that i must make a simple box with blue background like sky and then render the clouds separetly?

My question is how can i do that?

Alex Matei CEO
www.alexmatei.com
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jan 2015 16:34 Edited at: 6th Jan 2015 16:40
Well you can't I'm afraid - DarkClouds is weird, it renders to an image based on the camera angles and doesn't offer very much render control. I didn't explain myself very well, but basically I'm talking about having something instead of darkclouds for PC's that just won't run it fast enough - something you can use instead, like a skysphere, or even layers of skyspheres to give a reasonable, albeit not as nice looking as dark clouds sky system. You could make a sphere map from a static cloud backdrop - I have a snippet for this somewhere - the option between animated and static clouds if you know what I mean. You'd have a static version of the clouded sky to use on lower spec PC's - as the overhead of DC would be removed completely.

If you want to be able to capture the clouds as a skysphere that you can save and load later without DC enabled, then I could post a function snippet that does that - it just uses the camera X and Y angle in relation to a spheremap texture, and renders it using the pixel colour - so you get a snapshot of the clouds in as high a resolution as you want that can be used without relying on DC, rather it would act as a substitute for PC's that aren't cut out for DC.
A skysphere has some benefits over a skybox/skycube - mainly it only needs a single texture (compared to 6 on a skycube), it can be created in code, different sky textures can be layered and scrolled to give a reasonable cloud effect. One big benefit with using a skysphere over a skybox, is that the draw range of the camera can be optimised - with a skybox you really have to extend the drawing range just to fit the skybox in - even though you might not see, or want to see the polygons you still have to render them - as the camera range is specified as a radius from the camera, it's a sphere anyway. I guess you could say it's better to fill a round hole with a round shape, instead of jamming a brick into it. Anyway, if you want a skysphere capture function then that's no trouble. Actually, the skysphere capture function also acts as a spherical screen shot grabber as well - so people can actually see screenshots from your game but be able to turn the camera any which way - looking around your screenshot as if it was a static 3D scene instead of just an image.

I am the one who knocks...
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Jan 2015 14:09 Edited at: 7th Jan 2015 14:25


Unfortunately this only gives you 256x256 images

dc make cubemap 256,2,3,4,5,6,7 <-- This only creates at most 256 nothing above will work

Add this code to the loop of the default Dark Clouds example code to see the images created in the same folder...

These images later become images 2,3,4,5,6,7 in this code

set cube mapping on 1,2,3,4,5,6,7

Obviously depending on their actual image ID numbers in your program

So load them into a new test project, map them to a cube and invert that cube by setting its size to a negative number for a simple skybox... [Will require some testing and rotating the images] been a while since I played with that sort of thing but it sounds about right...

GL.

EDIT

Something I put together for you



Ideally you create 6 planes, and texture each of them with the image for a skybox...

But the effect here is just sweet to look at

Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 8th Jan 2015 06:17 Edited at: 8th Jan 2015 06:19
One other method you can use In place of dark clouds, is a couple of planes with cloud textures. Place them slightly apart on the y axis in the sky, set them semi transparent and scroll the textures on them at slightly different speed. This will make a reasonable dynamic cloudy effect. just set their x and z co-ordinates to match the players and it will always be above you.


I had a lot of issues with dark clouds and in the end moved away from it. There is no support for it either which is a pain.

1: very little control over rain and no variable for rain state -eg if you want to add noise for the rain then it is impossible for the program to know that it is definitely raining.
2: issues with rain textures flashing in and out of visibility.
3: inability to use fog and still see the sky. the fog just obscures it. I like to use fog to aid depth perception.
4: as you have noticed, massive FPS hit. It adds about 30 seconds to your level loading time and chews the fps.

I don't bother with it anymore as once I start adding in a few other systems, I need to start looking at cutting some processes. Dark clouds is always the first to go.

To Err is Human...
To Arr is Pirate!

Login to post a reply

Server time is: 2026-07-06 20:13:20
Your offset time is: 2026-07-06 20:13:20