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.

Dark GDK .NET / some tips für quicker code

Author
Message
sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 28th Apr 2010 23:55 Edited at: 29th Apr 2010 01:03
hy out there

my actual project is an logistics game based on an isometric tile engine. but i have a real speed problem. the fps of my project ar above 5.

does any one have an idea how to make the code faster??

thx4hlp

sebi

P.S.: Please excuse my grammer

edit:
PPS: sorry i forget comments; complete source added
please try and post FPS

thanks a lot

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 29th Apr 2010 03:53 Edited at: 29th Apr 2010 03:55
sebi, are you using the main DarkGDK.* classes or are you using the interop library?

i.e. Advanced projects?

Paul.

[EDIT] Missed download, let me download and test for you.

sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 29th Apr 2010 10:59
hy apex

i am using the DarkGDK main libarys.
Are there problems with the download??
I'll make an RS.com download

greetz Sebi
sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 29th Apr 2010 19:22 Edited at: 29th Apr 2010 22:46
tested on my sisters box.

14 FPS.
coordinates flickers.
interface not shown.

tested on the box of my sisters boyfriend

12 FPS

coordinates flickers
interface not shown. (could be programing error ^^)

edit:
flickering fixed. (to much Core.Sync()
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 30th Apr 2010 15:21
sebi,

I've been looking at your sample, and I get an average of 10-20 fps on my system.

The problem I can see though appears to be not to do with the drawing, but of the calculations for your isometric map viewing.

I'm going to experiment with this a bit because I think that the co-ordinate calculations can be optimized by using a lookup table instead of calculating every frame. This will certainly improve the speed, but there may be other areas of the main routine that I've not yet determined where the bottle necks are.

Interesting concept though, I can see what you're trying to do.

Paul.

sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 30th Apr 2010 16:09
hey paul

hm perhaps i can implement two extra var at the clsTile to save the calculated coords. but what will be when the building height is changing?

at the moment i'm working on the storage build routine.
i will poste the new code when it works.

greetz

P.S.: Please excuse my english
sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 2nd May 2010 01:19 Edited at: 2nd May 2010 01:24
paul,

do you have an idea about an function to build streets?

greetz sebi

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2010 03:15
sebi

When you mean streets do you mean a method of creating a road and buildings etc? Not sure what you mean at the moment?

Paul.

P.S. I was gonna look more into the rendering speed tomorrow as I've been out today.

Hope that's ok

sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 2nd May 2010 13:08
thats what i mean, but the buildings are not the problem.
the streets and the automatic direction and the connection to other streets are my problem.
i have no idea how to implement this.

sure it's ok you are a normal human like others xD
it's not an emergency

nice weekend

sebi

P.S.: uploaded latest source at the last post
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2010 14:28
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd May 2010 20:38 Edited at: 2nd May 2010 20:41
Sebi,

Find attached an optimized version of your code.

Can you re-examine the clsMap and clsTile functions. You'll see that I've reduced the number of times that a call into the toolkit is required. Also, all values are precalculated in the class constructors so that no math is needed during the draw phase.

It's alot more speedier on my system now.

There are other places where this can be done as well, but I've given you a lead on what was causing your slowing down problem.

Paul.

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 6th May 2010 01:51
sebi,

Now you have me curious. No reply for a while, how are you getting on with your update?

Paul.

sebi
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 7th May 2010 23:53
hy paul,

your code is great, but funny things happend xD.

i've started to type your code into my project and it was
even slower than your code.
i've copied and pasted your code and changed the source file
but it was even slower.

funny.. xD

now i'am working with the uploaded project by you and the speed's
above 20 fps.

at the moment i'm working at the routine to build streets.

is there at this forum a topic to present projects???

wish you a nice weekend and thank you for your help =)

greetz sebi
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 8th May 2010 02:02
sebi,

How odd. I can only put the slower performance to the clsTile changes I made as well. Did you see the changes I made regarding your clsTile properties? These were slowing things down also.

There is a 'Work In Progress' forum here on the main board, but I will probably need to make sure that the DarkGDK.NET runtime is available for general download so that people may run your project as well.

Here is the link to the 'Work In Progress' forum.

http://forum.thegamecreators.com/?m=forum_read&i=8

Good luck with the project sebi, I look forward to seeing future releases

Paul.

Login to post a reply

Server time is: 2024-04-19 04:43:16
Your offset time is: 2024-04-19 04:43:16