Posted: 13th Jun 2007 20:30
At what point would you all advise me to start using include files because of lengthy code? 1000 lines? 2000? 3000? When does everyone else begin to convert to included code files. I usually avoid this because every time I use include files something bad happens. One of my code files will get overwritten by another code file. Or once I separate my code into a bunch of include files, the program won't work. Sometimes I will have problems with functions and subroutines. So I was just wondering when, or if, I should convert and start using include files.

Also, what is the difference between a file that has the .dbpro extension and a file that has the .dba file extension? When I save I usually just save project and save source, not knowing the difference so I just save both of them.
Posted: 13th Jun 2007 20:44
Hi, Delfir =)

From what I have learned from experience, I would start at 1000 =) Reason being, is because once you get past 1000 or so, you'll get really confused, BELIEVE ME! =)

Also, if it helps, you should start using include files around 500, as it will DEFINITELY cut down a HUGE work load on both you, and your code as well! =)

I hope this helps you, mate! =)

Good luck with your game, mate! =)

~M.W~
Posted: 13th Jun 2007 20:50
Unless it's a 20liner you should always use include files from the start, the line count shouldn't dictate the include count. I personally separate all my individual task groups into include files, like AI, Menu, Level creation etc in their own files so I never get confused about what's where.
Posted: 13th Jun 2007 20:56
@Mugen Wizardry: Ah, I see. Currently my game is 1281 lines long, so I guess I should begin using include files.

@dark coder: I separated my individual tasks into subroutines all under the main loop. Like this:

+ Code Snippet
do
   if Game_State = 5 then gosub End_Game
   if Game_State = 4 then gosub How_Many
   if Game_State = 3 then gosub Start_Menu
   if Game_State = 2 then gosub Character_Select
   if Game_State = 1 then gosub The_Board_Game

loop


And all the subroutines would be under the main loop. So would a good idea be to put each subroutine in it's own source file, include the source files in the main source file, and gosub in the loop?
Posted: 13th Jun 2007 20:59
@Everyone: Sometimes when I switch from source file to source file in my games, one source file will completely overwrite another one. Anyone have an explanation? It's happened to me many times, and I have quit projects because of it. This is why I am reluctant to switch to include files again.
Posted: 13th Jun 2007 21:10
Its a bug with the editor, just be carefull re-opening a file on the right you already opened.. Thats the same reason im not using multiple source files, i don't want my code to be eaten
I'm somewhere around 1400 lines with my project now and if you code it organized, you shouldn't have too much problems.
Posted: 13th Jun 2007 21:12
Hi, again, Delfir! =)

As far as I know, this has never happened to me, before, and I use Included files ALL the time! =)

Thanks again, all! =)

And again, good luck on your project, Delfir! =)

~M.W~
Posted: 13th Jun 2007 21:19
So true! I have about 2000 lines of code in the main source file of my shoot'em-up game, and that's quite a mess. Whenever you search for a particular code section, you end up scrolling up and down several times before you find what you're looking for...


at the bottom right corner are a couple of green boxes called FUNCTIONS and LABELS and these will let you jump straight to the correct section of code

There are some updates available for the IDE does anyone know if they fix the multi file glitch?
Posted: 13th Jun 2007 21:28
@Delfir - That happens on compile...the trashing of the source. My experience is that the first file on the file list will be trashed with the content of the main source.

I try to work on only the main source in the DBPro editor. Its when you start clicking in the Files pane to change windows that the editor loses its mind.

So, I make sure that the main file is the file that is displayed in the windows before compile. Also, Save All prior to compile. Finally, the last good compile will contain a non-trashed version of the trashed file in the FullSourceDump.dba file in the TEMP directory.

No, the bug has not been fixed. I have been told that it will not be fixed in that editor ever.
Posted: 13th Jun 2007 21:36
I don't have any labels in my code.


Labels tend to be used for the Gosub command (bad practice) but you can also use them for labeling sections in a large function so they are easier to find.

Can anyone recommend a different IDE? And what fuctionality will we gain or loose? Can Eclipse be used? I'm using it for Java and it seems ok.
Posted: 13th Jun 2007 21:41
Try out Synergy Editor

http://forum.thegamecreators.com/?m=forum_view&t=105348&b=29
Posted: 13th Jun 2007 21:43
Can anyone recommend a different IDE? And what fuctionality will we gain or lose? Can Eclipse be used? I'm using it for Java and it seems ok.


I COMPLETELY recommend DBUser2006+'s WinGUI, it's free, open source, and he updates it QUITE alot! =)

As far as I know, Eclipse will work, as this GUI is a simple one! =) Also, as far as I know, you will gain a great GUI, and lose absolutely nothing! =)

*EDIT* : I also recommend DarkSide's File Requester GUI, if you are looking for a File Requester GUI! =)

I hope this helps you, Delfir! ^_^

Best of luck w/ the game, Delfir! =)

~M.W~
Posted: 13th Jun 2007 21:48
I'm confused about Synergy is it free or do you have to pay for it?
Posted: 13th Jun 2007 21:51
I'm confused about Synergy is it free or do you have to pay for it?


I do believe that you must pay for it... =/

~M.W~
Posted: 13th Jun 2007 21:51
I'm confused about Synergy is it free or do you have to pay for it?


Free until you come to write a commercial application, then you must buy a licence.
Posted: 13th Jun 2007 21:53
Free until you come to write a commercial application, then you must buy a licence.


Thanks for the heads up, John Y! ^_^

~M.W~
Posted: 13th Jun 2007 21:53
one of my old projects got to 4000 lines before i discovered includes. I now use them from the start. It's handy and I have been slowly creating my own library of commands (functions) so makes it easier to transfer those between projects.

So my answer is I use includes from line 1 onwards
Posted: 13th Jun 2007 21:54
I don't know about Synergy, but I use CodeSurge and that is free.

It's stickied in the WIP board.
Posted: 13th Jun 2007 22:05
Wow guys, thanks for all the input! That answered a lot of my questions. I think I understand the bug now. If I want to toy with different source files, I shouldn't open them on the right side of the IDE but should just open them normally.

Also, from now on I'm going to have multiple copies of my game. So if one blows up, I'll have back up.

However, since this game is almost finished, I think I'm going to keep it one source file all the way through.

Thanks again,
-Delfir
Posted: 13th Jun 2007 22:12
Wow guys, thanks for all the input! That answered a lot of my questions. I think I understand the bug now. If I want to toy with different source files, I shouldn't open them on the right side of the IDE but should just open them normally.

Also, from now on I'm going to have multiple copies of my game. So if one blows up, I'll have back up.

However, since this game is almost finished, I think I'm going to keep it one source file all the way through.

Thanks again,
-Delfir


Hey, sure thing, Delfir! ^_^

I know how it feels not to be helped on this kind of stuff! =)

Glad we could help! ^_^

And good luck with your game, mate! ^_^

~M.W~