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 / Level Loading Experiments

Author
Message
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 15:23
I have created a simple application that loads in an entire level, this code works (I have an EPR class that I created which is not posted as part of this code, it is very in depth and proprietary)

What I am posting is the code of the Main section of the game itself. What my continued problems are, is that I can not seem to get any good performance out of the resulting levels and I have read the threads of others having the same issues, I just wanted to point out by showing this code, that the game loop is extremely simple and forgiving, so I am still questioning why the FPS is dog.

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 16:13 Edited at: 15th Feb 2007 16:14
In your main loop, can you move this line:



[EDIT] I know you're using this for debugging to find out the position of your camera, but there may be alternative methods for speeding up debugging, i.e. use the output window of Visual Studio to log positioning etc.

outside of the loop. It should only need to be called once. This may impact speed quite considerably. Tell me if this helps as well, see if we can pin down the bottlenecks.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 17:12
That would make no difference in FPS (tried it to see, but then I loose my position, it has to be called every game loop so I can determine my current camera position)

Ran into a different snag through, the PositionObject isn't working on one of my objects anymore. Which is odd, since it works with all the other objects.

Here is a break point debug so you can see the X,Y and Z values.
(the definition of the structure is that the x,y,z are all singles)

Attachments

Login to view attachments
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 17:25
Well, the only other reason I can see why it's a low FPS rate, is that SyncRate is set at 30, and your calling ScanCode twice. You need to try to avoid calling functions unnecessarily. For example, CameraPositionX is being called twice, and the same for the other functions. This fires interop calls that can mount up very quickly when running within the game loop. If you call these functions once, and place the values into three local variables, see if this helps the speed increase.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 17:35
CamerapositionX Y and Z are all return values, so the value to the camerapositionx can change between the switch case and the final result which is displayed in the window title bar. (by 1.0)

So each value is different at that point.
Neither of these issues have anything to do with the FPS, they would only work against cpu cycles. On top of that, it is only called twice IF and only IF either the PageUp or PageDown key gets pressed.

Scancode looks to see what key is currently being pressed, if any and returns that value. I can take it out of my message for the window handle since it was there for debug, but even doing that in testing, I loose no FPS.

I set it to 30, since if I don't, I loose FPS if I let the system try to handle it, or set it over 40.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 17:41
It is an odd one at that. Can't think what else it could be... (ponders)

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 17:43
Well, I'll be a monkey uncle.
LoadObject accepts 0 as object ID, HOWEVER, Position Object starts at base 1, not base 0. RotateObject starts at base 0. So my rotate worked, my load worked, my hide worked, but the position didn't work because the start of that element can't be 0, when I switched my object number to start at 1 rather than 0, it worked.

Also, oDBImage works with an ID of 0 to load into, BUT, oDBSprite does not accept 0 as a sprite ID.
Learn something odd every day.

Once I fixed that, cleared my Sync(30), the game when into overdrive on speed.
It appears there are some base ID programatical errors in the core code.

I'll just stick with 1 as my start point on all items that make need ID's.
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 15th Feb 2007 17:56
I used SetWindowTitle may times for debug stuff rather than Console.WriteLine.

SetWindowTitle is actually twice as fast as Console.WriteLine from the tests i've gathered.

Using Dark GDK.NET
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 18:15
http://www.gamedevonline.com/subsite/video/dungeoncrawler.mpg

There is a link to a video I just did up using Framps then compressed it, not high quality compression, but the mpg file is 9 megs vs the avi that fraps makes is 320 megs

Anyway, That clip represents the load time of that town using DarkGDK.Net, this is being written obviously in vb.net 2003.

I agree, the window title is fast as all get out and gives immediate results. Now I need to figure out how to attach the camera to a character in perspective mode and have it follow the character around, add in some mesh picking routines, and some sprite menuing systems.

Not bad for only 4 hours work total.
More bugs to find and iron out along the way, I thank everyone for all there help as I fumble through my newbieness.
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 18:17
Am I allowed to upload the mgp file to the thread?
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 18:37
Might be too large, although I think the maximum attachment size is about 50mb. I can't say for sure mind.

Paul.

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th Feb 2007 18:39
Sounds like WIP, you could post it at the WIP forum...
Looks nice for those 4 hours.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 18:45
Yeah, does look rather good. Glad you got the performance issue sorted out, I was getting worried.

Paul.

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 18:59
Zumwalt, if you have Cartography Shop, you might be interested in this:

[href]null[/href]http://forum.thegamecreators.com/?m=forum_view&t=93030&b=13

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 20:05
*off topic* does that thing work with 3d world studio? I own the 3d world studio. The problem with it, is that those files have some messed up triangulation and don't save to other formats very well.

I'll take a gander at the WIP forum, will probably upload the mpg there and make a thread for the game. I have to figure out a few more things, like how to work with the sprites some more in this new thing. Really shouldn't be to hard, I know how to load/hide them, and I can make a hashtable where the key is unique to the sprite name I want to use, like key=BackPack1, etc.

Thanks for the comments and encouragement.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Feb 2007 20:54
Doing a 3DWS importer has been a debate for some time now, and I was in the process of doing one a while back but plans changed.

I may well get around to doing the 3DWS importer someday, but for the time being, it's not a priority. Plus, there's a long story behind this issue.

Paul.

Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 22:02
I have posted the video in the WIP thread, thanks again for the help on this, going to try to get a feel for boned based animation now.
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 15th Feb 2007 22:50
Quote: "I may well get around to doing the 3DWS importer someday, but for the time being, it's not a priority. Plus, there's a long story behind this issue."


* Trying my best to pretend I'm not curious *

I think the state of 3dws (which I own) is a bit sensitive... Josh seems to have well and truly moved development to his 3d engine rather than 3dws. Furthermore he has said that the next version of 3dws will "not be a an indy tool" and he has said that people are going to have to pay big bucks for it.

I don't know if this is the reason you don't quite see as much of a future in doing the conversion but if it is, I don't blame you.

Besides that and for all the qualities JoshK may have, he does come across as an exceedingly self conceited person on a lot of his posts. That just doesn't buy much love from people...

I have vague plans for World Domination
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 15th Feb 2007 23:17
Josh is intelligent, not really a conversation for this topic, he just choose a new path and left the owners of 3DWS in the dirt. I paid for his premium product to, and I am not happy, so I won't be moving forward with anything else he comes out with.

So back on topic, anyone got a link to some work using bones?
Something in .Net with the GDK?

Login to post a reply

Server time is: 2024-11-19 11:43:35
Your offset time is: 2024-11-19 11:43:35