Problems with the editor
Blitz3D Forums/Blitz3D Programming/Problems with the editor
| ||
My program is over 10,000 lines now and I've recently experienced alot of errors with the editor, especially when I try to cut and paste. The screen fills with garble, large chunks of code disappear etc. Basically it seems that the editor can't handle large programs. Is there any update or an alternative editor for Blitz out there? |
| ||
Try splitting your program up, and using "include" to make it more manageable. |
| ||
I did that a while ago but it caused alot of problems (I posted a topic about it). I'll start working on that anyway, because I think there were solutions, so if I do it bit by bit it shouldn't be too bad. |
| ||
i do highly recommend an extended editor (IDE) i use protean but more to choose from here: http://www.blitzbasic.com/toolbox/toolbox.php?cat=11 |
| ||
I'd suggest either Project Studio IDE from Matt Smith or breaking up your code. I experienced exactly the same problems as you in the IDE whenever I got up to around 10k lines and another IDE and breaking it up are the only two "solutions" I ever found. Protean might be better now too, but it crashed the OS every time it ran the debugger when I was using it. I think it's been fixed since it became free 8-) |
| ||
FarFlame, do you know your system specs? Because it may just be that your PC is too slow. My PC (in my room, not the home computer) is old, old, OLD, and takes almost five minutes to open a 4,000-line file! Gabriel, if you need a working copy of Protean free, I've still got an installer - want an email? |
| ||
Thanks for the offer Adam, but I don't do much B3D coding any more. I really only have it installed so that I might be able to help on the odd question. |
| ||
I dont believe it has anything to do with his system... The blitz ide is flaky for me on multiple machines. It has weird little quarks, like holding shift and hitting the left arrow to select something will sometimes result in just the cursor moving left. Sometimes if the window is inactive and you drag text over the window slightly from another window it will flake out and select random chunks of code. It is REALLY good practice to have clean code separated into include files that all have similar functions. I honestly dont understand how you work with everything in one large file. Whatever you are coding should be able to be broken up into files that all have similar functions. Say a user interface, graphics, ai, rendering whatever youre doing should be split up. Its especially easy to reuse functions and having modular code this way aswell. Ive also had problems >10k lines... and im on a dell workstation with more than enough specs. Its the ide... if you refuse to sort your code... do as Devil or Gabriel suggested and use a different ide. |
| ||
The scariest problem I found with the editor was when it unexpectedly chopped my code in half. Luckily I spotted it before saving the file. My system is quite slow, but it also does it on this machine which is fairly fast. I'll work on breaking up my code because, as people are suggesting, it's good practice anyway. The problem I had last time (for some reason I can't find my old post now) is that the include files wouldn't work properly because variables weren't declared etc. I think somebody suggested that the includes have to be placed correctly to avoid this problem, but I can't remember how it works. Basically, if I have a global variable, should that be declared BEFORE the include line, if the included file needs access to that variable? |
| ||
You should separate and make logical splits in your project. If part of the code deals with a 3D engine, then make a 3D engine bitz basic source file. if the other portion deals with game logic, make a game blitz basic file. If part of your code deals with AI, make an AI bb code, etc... If your program is well written, you shouldn't have to worry about global and local variables, as everything will be self contained. It's good practice to define types and store your stuff logically in your type. Making a Game Type with your counters, your game status and all sorts of crap that refers to your game running should go in there and right after the type just initialize that type to a global, and that gloabl should only be used in your game.bb source. if you need to communicate stuff between game.bb and AI.bb, then you make functions. It's a question of how you program and how clean is your code. I suggest looking that seriously. |
| ||
I agree that it's time to look at my code and clean it up, but I can't avoid globals. I'm not sure if it was ever possible, but it certainly isn't now because the code is too large and relies very heavily on some globals (I've avoided them where possible but in some cases I couldn't actually think of another solution). I'll start chopping it up, but I suspect I'll need help with the include issue, because it caused headaches last time I tried. |