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 / How mantainable is a DBpro program??

Author
Message
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 21st Feb 2003 07:25
Hi,

I come from a C/C++ background and I notice that the OOP concept in C++ helps me greatly in program mantainability. What I mean by mantainability is how well a program can scale in the future version without having much fuss or complication.

I am not saying that DBpro should implement OOP. DBpro is good of being a simple yet powerful programming language dedicated for creating games. As I am quite new to DBpro, I was hoping I can get some good advice and pointers from experienced DBpro programmer around here on how to develop a DBpro programs that are highly mantainable.

Thanks a lot!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 21st Feb 2003 08:08
wait...your question is what?
DARKGirl
22
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Right behind you....
Posted: 21st Feb 2003 08:40
OOP?

“I create games only to test my imagination’s limits” - MSB
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 21st Feb 2003 10:37
Erm...

My question seems a little bit vague and confusing. Sorry about that.

What I meant is, what are the guidelines and pointers on creating a DBPpro games/programs that is easy for future update, i.e. like when you want create a sequel of games, etc.

Don't get be wrong, this is nothing about OOP. I just use OOP as an example from my previous background in C++ to make my program more reusable. And I am wondering what would you guys do to make your DBpro games/program more reusable for future update.

Thanks!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
BackBONE
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 21st Feb 2003 11:10
Keep it Reedable!

And just follow the ordinary rules of Programming.

(setting ab a conzept, sink about wat you will have to implement, make some notes what variable for wat use and so on)

You can allso Put sections of your code to extrafiles and bind sem up with Include.
The Communist
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Cyberspace
Posted: 21st Feb 2003 13:14
put your functions in separate includefiles, comment your code, indent your code etc. also, types help alot, instead of using separate variables or arrays
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Feb 2003 13:27
I suggest making an overly advanced GUI system. Instead of pasting and image and checking collisions like 'If Mouseclick()=1 and Mousex>201 etc etc' make a GUI system that keeps track of the gui entities for you. I usually make a function for creating a button, then pass the position and size of the button, along with any rollover image or click image numbers it uses. So you would add all your gui bits by calling functions, the gui bits are then kept track off in an array, which is used to handle the GUI. I mean you have the size, position, and image set of each button, so handling them is easy - just make a click button function that draws the click image for the specified button - and a function that returns the gui part you clicked on.

You might think that concentrating on the GUI is not gonna help the actual program, well it helps everything, if you can add a feature, by simple calling a function to set the button up, then coding the feature is a helluva lot quicker.

In VANseam, I used a 2D array for the GUI, like each 16x16 square can be a little button or LED counter. I can even have duplicate buttons that run the same code - using a named entity system, where I pass the name of the entity into the gui adding function. The gui is not great looking, but I could add a button in about 3 seconds, If I hadn't spent so long on the GUI at the outset, it would'nt have been finished in time (does that make sense?).


Van-B
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 21st Feb 2003 13:38
Buleyes - use types, constants and globals to help keep your variables in track and logical. Use functions as much as possible so you can re-use code time and time again rather than reinvent the wheel every loop. Put grouped functions into files that are "included" into your main program so they can be abstracted for future games. Come up with your own file formats for storing data (like level maps, etc).

There are lots more but this should get you started!

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 21st Feb 2003 22:10
(^_^) i'd say both rich and van have good advice there ...
comming from C++ you can probably understand the modular development better than a newbie to programming.

Now whilst you can't persay create an actual object which you can link to something - the underlaying principals from creating an object and classes are already right there infront of you.

I'd suggest you take in the mind set of C++ ...
think of your primary program document as your primary CPP file, and anything which is to be program specific is placed within there rather than a seperate .h (thank god pro now allowed for your own include extensions) - however personally to keep things less cluttered within the main loop program mine oftenly consists of a standard template for timer based looping and that is basically as it. apart from the main program functions.

when working on larger projects you come to rely on function as external loops (especially as you can actually place do...loops within them )

so from this perspective you can consider the functions themselves as objects, within them you can local or global your types, arrays, constants for a very versitile use.
add this is memory pointers for handing data around locally and privately at the same time - this adds a large range of development tools which can then be customised to a more suited environment.

you use the designation CPP for your main source and H for your function include sources (basically the H's are as C++ and the reusable defintions) and you can then start to see how similar you can actually make the development processes

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2025-05-19 00:11:34
Your offset time is: 2025-05-19 00:11:34