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.

Newcomers DBPro Corner / Dim, varibles,laging?

Author
Message
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 10th Dec 2008 00:10
I have made it to my 1500 line of code in my fps but it is starting to lag I'm staying lowpoly with my objects though my map is very big i was wonderin about how i could set some dims for varibles of my objects i dont know if i could do that example

dim tree(1)
dim truck(1)
ect ect.... please help with the dim question
Not_Maindric
17
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 10th Dec 2008 00:59
Why are you making arrays with 1 dimension? You could just make them variables, can't you? And if you need them to be global, isn't there a global command?

OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 10th Dec 2008 01:41
Well it was just an example it would be for many trees

see im starting to have a lag problem and want to know if i can use arrays to allocate memory and so how can i do it with ojects.
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 10th Dec 2008 18:04
cna anyone help me with this? in my game i have set all things as varibles
PYR = 1 ` Player Object Value
MM_9 = 2 ` 9MM Object Value
C_45 = 3 ` 45C Object Value
MP_5 = 4 ` UMP40 Object Value
MAC_10 = 5 ` MAC 10 ObjeCT Value
DMC_10 = 6 ` Dual MC10 Object Value
JK_HR = 7 ` Jackhammer Object Value

palm_1 = 534
palm_1_2 = 535 -------\
palm_1_3 = 536 -------= these are clones of palm_1
palm_1_4 = 537 -------/

and i have much more i need to know is this wrong should it be global, constant,dim or what my program is starting to lag but there is only 16 objects in the game very low poly and when i add grass then im real screwed i feel there is a way to allocate memory for all this and im failing to do it i have over 1500 lines of code the game is looking good i need to fix this lag problem before i can continue,, i get as low as 11 fps

Attachments

Login to view attachments
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 11th Dec 2008 00:26
Its probably not your variables that are causing your code to run slowly.

If you show us some code, we could help you

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 11th Dec 2008 02:49 Edited at: 11th Dec 2008 16:49
edited
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 11th Dec 2008 06:28
This code references a lot of media that none of us have.

Without it, it makes it impossible for us to really mess around with the code...

The only thing that I can think of that would be slowing everything down in your main loop is the updating of the water. Of course, I can't really test that hypothesis...
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 11th Dec 2008 07:04
you were right thank you.It was the water my frame rate is now 45 - 50 hope i can keep it there.. is there any way to allocate memory or is that not needed in darkbasic?

Login to post a reply

Server time is: 2024-11-24 16:38:41
Your offset time is: 2024-11-24 16:38:41