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 / need advice on making level and a possible lag issue

Author
Message
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 17th May 2013 17:19
Hi!

I have written some code that sets up 'boundaries' for my level.
Here is the code:



As you can see I set the posX and posY varibles with different values before it enters each for loop. This is necessary otherwise all loops would start at the same 'spot'

Here's question one: The setting of these values is also to adjust the object so that it falls in the right position due to world coordinates 0,0,0 is in the center of the mass of each object. Positioning two wall objects with different angles in the same position would just show up like a big + sign.
I belive this can be changed using the offset limb command, so that the walls can be more easily placed, think of segments from fpsc.

Would this be a method I should consider or should I stick with mine?

Question 2 is about the possible lag issue:

When I run the program I experience som lagging every now and then and I suspect that my code for updating every level object in the main loop can have something to do with it. I'm Using sparky's collision and in the end of the loop I update every single object in the scene in a foor loop. This is many object.

Maybe if I make one large mesh of the level and only updates that one, or If I split up the level in larger meshes, but yet fewer than every level object so that the program does not have to update so many objects?

BEST!

www.memblockgames.com
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th May 2013 17:37
Quote: " my code for updating every level object in the main loop "


Why do you want to do that in the main loop? Only dynamic objects like people, cars, missiles, etc, need to be updated. Also, you shouldn't be re-texturing anything in the main loop unless you want to change the texture. The general rule is to change only things which have changed .
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 17th May 2013 18:11
ok, thanks. I thought that I needed to update both static and dynamic objects. But now that you're saying it, it sounds very wrong and unnessesary to update static objects

www.memblockgames.com

Login to post a reply

Server time is: 2026-07-07 18:21:33
Your offset time is: 2026-07-07 18:21:33