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 / DBP Tips in less than 10 words .... or so

Author
Message
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Feb 2013 19:54 Edited at: 23rd Mar 2013 13:08
Please take 5 minutes to read a number of DarkBASIC Professional tips written in 10 or less words a piece, 10 words or so. Only a few minutes, it might save you hours. After 5 minutes, you will be a better man/woman.

If you have experience, feel free to share some of it. Post up 10 or so words per tip; don't hide it in pile of sentances.

I'll start it off.

Quoting my self

Quote: "How to fail creating your project"

*Do skip reading these tips.. '''Happy programming!'''
*Do create a game you do not want to play
*Do start another new project before finishing the last 100
*Do create something that is not interesting to develop
*Do create that nice feature that wouldn't benefit your players
*Do not concentrate on what you are doing
*Do spend all week making that which is not part of the project
*Do spend more time watching people make money on TV
*Do spend all day figuring out a problem that isn't one
*Do start programming it before installing Matrix1 utilities
*Do everything yourself. Do reinvent the wheel.
*Do backup your work; only on your hard drive, on the same PC


Quote: "Get good!"

*Read source code. Have you written more than you've read?
*All pros practice, and practice again, and again
*Focus on the benefits; benefits first, features last


Quote: "Bugs"

*Know thy self. Watch for it!
*Use UDTS to catch typing mistakes
*Read twice, compile once.
*Log it. How else will you know what's going on?
*Log it. How else will you know what crashed it?
*Log it. How can you be so sure that the variables are what they should be?
*Everything lies on a foundation. What constitutes such an error?
*Think, how can I make errors more likely to happen; don't do it!
*Use Matrix1 Console And/Or Logs. Its just not always what it seems


Quote: "Performance"

*Time it! Bottlenecks often appear in unlikely places.
*Use limbs where you can. Objects can be expensive.
*Use multiple-shapes in limbs where you can. (A bit like static limbs in limbs)
*In 3D games, avoid 2D where possible. Consider BBB GUI, or Styx Flash for UI. If you really must, then use Advanced2D, ImageKit and sprites, nothing else. (Use search to find plugins).
*Use Matrix1 Nice Wait/Sleep. Give windows messages room to breath, save some battery life on the laptop...

Quote: "How to fail with DBP"

*Don't read the help files to see what's available
*Don't try any plugins to see what's already been done for you
*Don't indent your code. Make it harder to find the issue.
*Don't comment your code whatsoever. Try to forget how things work in 2 months time.
*Don't ask for help when stuck, just keep trying to waste time
*Don't backup your source code at least once a day
*Don't comment your code when making a 'help me' thread. Put us off.
*Don't post your code when making a 'help me' thread. Put us off.
*Don't indent your code when making a 'help me' thread. Put us off.
*Don't code it in easy to understand language. Make sure you can't understand it!


Quote: "If you said one of these things recently; you could be wrong"

*"I can't figure out how to do it": it's been done, look
*"I can't figure out how to do it": someone else can, ask
*"Nobody will like it": How come you're playing it then?
*"I need a faster PC": It will still take long
*"Nothing works": You're not reading code properly
*"This should work": You're not reading code properly
*"That should've worked": You're not reading code properly
*"I am 100% sure this should've worked": Why?
*"DBP can't do this, DBP can't do that": Possibly it is you who can't do it?
*"I need this feature", Do you? Do your players need it?


Quote: "Favourite tricks"

*Call Function Name "Action_" + KEYBOARD_BINDING(Scancode()){Matrix1} - Bind keys to actions

*CONSTANT# _new Array Insert At Bottom : Easy add array

*CONSTANT# _del Array Delete Element : Easy delete array

*Offset Limb ObjectId, 0, x#, y#, z# Change origin, keep position

*ToggleValue = 1-ToggleValue Toggle value as it says on the tin

*Time = Timer() : Print (Timer() - Time) * 0.001 - Time events in milliseconds to precise seconds

*Place Object In Group | CALL FUNCTION FOR OBJECT GROUP {Matrix1} - Do things with groups of objects

*Select RND(RandomChoice) : Case N ... Case Default Random select actions

MAMMAL = 2^0 (or 1): ANIMAL = 2^1 (or 2) : TWO_LEGGED 2^2 (or 4)
*I_AM_HUMAN = MAMMAL || ANIMAL || TWO_LEGGED[/b]
*I_AM_HUMAN && MAMMAL <> 0[/b] Is true Store options in one value. Binary stuff


Quote: "Get on with it!"

You cannot create what you don't start
The easiest way to fail is to not try
The hardest way to fail is to prepare well
It's not a plan, its a game, just build it

From the last point; that doesn't mean don't plan; if you do not plan to succeed, then what have you planned for? However, a plan alone will not entertain players.

seppgirty
FPSC Developer
15
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 9th Feb 2013 01:14
some great words of wisdom chris. was a good read.

gamer, lover, filmmaker
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 9th Feb 2013 02:47 Edited at: 9th Feb 2013 02:59
Wise words:
Quote: "You cannot create what you don't start
The easiest way to fail is to not try"


Another wise man said something pretty close:
Quote: "Do or do not. There is no try."



Excellent list!

Quick debug:
Temporarily PRINT values in a loop! Ahhh.... it's not a float!

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 9th Feb 2013 11:37
Nice words and from a noobie perspective very helpful.
I especially like "*Know thy self. Watch for it!" As i know exactly what this means. I often make the SAME mistakes again and again so when something does not work i automatically check these same things i keep doing before anything else, i think this is what it means.
I have a hint for people helping noobs so they dont pull their hair out going over a problem with someone and thats to never forget that no matter how dumb a problem a noob is having may seem and how obvious its solution may appear to you, its as daunting and out of their league for them as it may have been for yourself as a three year old So please bare with us, you are our only hope*
(*While we are carrying on the star wars theme )
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Feb 2013 22:39
Quote: "Another wise man said something pretty close:
Quote: "Do or do not. There is no try.""




Yes indeed

Quote: "how obvious its solution may appear to you, its as daunting and out of their league for them as it may have been for yourself as a three year old"


Very true, I remember my first crack at DBPRO, I must of spent all day trying to get my character (cylinder and sphere) to load up with its facial texture to show in the correct place...

You get better, but you are always debugging or trying to figure out something no matter how good you get.

Login to post a reply

Server time is: 2024-11-23 17:37:38
Your offset time is: 2024-11-23 17:37:38