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 / Make Game Run Smoother+Faster?

Author
Message
Bloder
19
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 22nd Sep 2010 00:49
Hi, I'm making a game with a very large city in it. I have made the model for part of the city but when I walk into it, the game goes very slowly. It hasn't got loads of polygons because it's just cubes and they have been merged. Please help.


If I were you, I'd make a game...
Eminent
16
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 22nd Sep 2010 01:43
Maybe your camera or walking speed is too slow? Look at the FPS. If youre makeing a model, dont merge cubes together, just make one large one.


Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 22nd Sep 2010 04:22
Hi, you could try increasing your sync rate.

A clever person solves a problem, a wise person avoids it - Albert Einstein
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Sep 2010 12:41
The problem is that all those cubes are merged, they are all drawn, all the time. If you broke the model into parts, ideally having individual buildings as a single mesh, then it should perform better.

DBPro can only decide to draw an object, or not, so even if it needs to draw just 1 polygon from your chunk, it'll go through the whole lot, and slow your game down. Break that building block into individual buildings, so at least then it's loading a single object but with lots of limbs.

Health, Ammo, and bacon and eggs!
Robert The Robot
19
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 22nd Sep 2010 13:46
Quote: " it's just cubes and they have been merged. "

Do you mean a CSG Union? That can really increas the poly count. To check how hard DBPro has to work, call
to see how many polygons are being drawn each Sync.

If the city is a .x file, it might be worth trying out the BSP-PVS Compiler tool that ships with DBPro. You could then load the city as a BSP object using the "World" command set.

As VanB says, DBPro objects normally draw every poly if even just one is visible on screen, but a BSP file quickly works out which polys are in screen and draws only them, ignoring eveyrthing else.

As another alternative, just make each building separately and create several lower-poly versions - you could then play with DBPro's LOD commands!

Hope this helps!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Sep 2010 15:57
Divide the city into sections or blocks. Each section/block should be considered one "object". If you make your city in DBP, simply make one of the original objects your limb 0 and attach each other object within the section/block as a limb to it.

Once you have divided you city, you should decide which "objects" to render/exclude from the loop when you are in each section/block area.... For instance, you are on the street of this city. You can only "see" a small section of the city from there. Exclude everything you can't see from the loop. When you move from one place to another, adjust the "exclude" on/off for the sections. DBP put that command in there for specifically that purpose. If you don't exclude objects in a HUGE scene, they will be tested for visibility each time regardless of where they are-- this is a reduced performance issue.

The fastest code is the code never written.
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Sep 2010 02:24
This might also be worth reading as a general tip:
Tutorial : Decouple the Display Loop for Better Performance.


Guns, cinematics, stealth, items and more!

Login to post a reply

Server time is: 2026-07-24 23:12:12
Your offset time is: 2026-07-24 23:12:12