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 / Noob question: loading and Rendering terrain efficiently and framerate timer

Author
Message
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 9th Jan 2009 08:52
Hey all!

Working on a 3d adventure/rpg and am quickly running into performance problems. It runs great on my Core2Duo with x1950 graphics but as soon as I throw a lower-end video card at the game, it's unplayable, even in 640x480.

My goal, however, is to make it accessible and playable, say, 10-20 *steady* fps, on a P4 3.00Ghz with integrated graphics in the lowest detail settings.

I have a 256x256 .dbo file I made in 3DWS to be my terrain. I'm loading it with dbLoadObject and placing it directly in the world that way. It's about 8MB. I have a few images and whatnot, totalling less than 1MB.
While my game is running, I'm eating up over 125MB of memory.

My main concern isn't so much the memory usage but the inconsistant performance of the game. I do have a timer which regulates the code execution speed, drawing the GUI on every loop (preventing flicker) and the game code every 60th of a second.

On my main machine (the Core2Duo), as well as my P4 with a Radeon 9550 pro (256 MB), no matter the FPS I get, the game's speed is consistant. I get 30FPS or so on my P4, which feels like a normal 30 FPS found in a normal game. Not jerky or jumpy, just a nicely-flowing 30 fps. What I don't understand exactly, is when I run the game on any computer with 128MB or less of video RAM (coincidence or not, I don't know yet), the video just isn't consistant. 30FPS feels like a rapid succession of 2Fps and 40Fps, feeling extremely jerky and awkward.

I have another P4 3.00Ghz with integrated video (128 shared) which runs at only 10 fps in 640x480 PLUS it suffers from the "feels like 1fps, 20fps, 1fps, 20fps" inconsistancy.

On my laptop, a Turion 64 x 2 (1.88Ghz) with a GeForce 6150 Go (128MB shared VRAM), I get about 35-40FPS in 800x600 res but I get that exact same awkward jerkiness that my integrated video desktop suffers from. My old 9550 with 256MB of dedicated video RAM doesn't get a great FPS but it's solid and feels perfectly normal.

I'll paste up my timer code which I found elsewhere on the forum, as timers always scared me.





So I have two goals:
1) To eliminate this jerkiness and produce a smooth FPS, no matter the system and no matter how low the FPS.

2) To improve the performance of the terrain, improve FPS and reduce system requirements.

I see there are commands such as dbMakeObjectTerrain() for converting heightmaps into terrains, but I don't understand how you're supposed to get the correct textures on them. I only see a place to plug in one detail texture and I really don't see how I could draw a landscape that has more than 2 different textures on it this way. I have the program working nicely right now but it's just too clunky on machines other than those that have 256MB video cards (or maybe it's just Shared memory GPUs in general).

I'll be happy to post up more information for anyone who's interested. Thank you.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Jan 2009 04:34
You still stuck on this? That timer code looks sorta icky. Terrains/ The built in terrain allows heightmap, 1 texture, 1 detail map - which is basically "mixed" over the based texture but tiled usually at a higher scale (e.g. repeats alot) to make it look like bumps etc on the ground. The "built in terrain" is pretty slick, it's fast - and you can enhance it - with shaders etc.

I wrote my own meshes and stuff... for speed I wrote a whole frustrum culling system etc but that's going to the n'th degree. There is a new jack running around who claims the DarkGDK frustrum culling that's built in works fine - but myself and others have found many situations where it simply doesn't... namely models with limbs... but...

I recently tapped into the multi-media timer and the query performance timer... those are't really complex or anything but to get the benefit of them - you need to write a little extra... not much... but you can do well with the dbTimer() if you just have code that "ignores" it until at least 1 millisecond goes by, and that TONS of time hasn't gone by - e.g. user paused, then unpause and game goes bonkers...

Welll good luck.

--Jason

Login to post a reply

Server time is: 2024-09-30 15:33:21
Your offset time is: 2024-09-30 15:33:21