EACam
Warrior
154 Posts |
Posted - Jun 04 2004 : 9:28:27 PM
|
The point of my post was, mainly, to emphasize (i didn't do a good job) that to get a solid good old constant value DONT ACTUALLY USE A CONSTANT! Make a variable, set it at startup and whether or not it changes on different systems, you'll always get the right value, right? And to make sure you aren't causing yourself problems, don't check the size of the FVF in an array! Who knows what that's ACTAULLY giving you? My saying is, don't use something that MAY cause an error, use something that is solid and don't bother the study to see if it'll work. Basically, if some code is shifty, make it sturdy. Anyway, so just create a variable by the FVF type (no arrays, no nothing, just a plain old variable), and use that to get the size.
Just my 2c.
|
|
|
EACam
Warrior
154 Posts |
Posted - Jun 04 2004 : 9:29:28 PM
|
hey, we made it! |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - Jun 05 2004 : 08:10:06 AM
|
10 pages! yay!...
...
... |
Whatever. Who knows... |
|
|
masterbooda
Swordmaster
277 Posts |
Posted - Jun 05 2004 : 12:42:30 PM
|
To EACam,
I did that already a long time ago in the debug, and it produced the same result. I set up a variable to hold the value, and set the size of the fvf(not the array) into the variable... it produced the same result...
DaBooda out... |
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
EACam
Warrior
154 Posts |
Posted - Jun 05 2004 : 1:08:11 PM
|
OK...good. Thanks.
(Not necessarily to you, but I was trying also to emphasize the importance of avoiding bugs if you don't know EXACTLY what you're doing. ) |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - Jun 05 2004 : 2:39:12 PM
|
Yeah and I have one problem here, when my code starts to grow above something like 500 lines inside a module, it starts to get hard for me to find what I asm looking for because of my lack of organization... That's one of the reasons a program I started just a year ago is already at the 3.2 version... And the 1.x versions weren't even publicly distributed... And the 2.1 version (I think) was the first one to be distributed, only at the october of 2003 if I'm not mistaken. The 3.0 version also didn't come out of my PC but the 3.1 was published in this year march. The 3.2 version which I'm still working on a bit will be released yet this month. The reason I'm telling this is because this program code is a little big already and I'm thinking about re-writing it once again!
|
Whatever. Who knows... |
|
|
masterbooda
Swordmaster
277 Posts |
Posted - Jun 05 2004 : 4:58:45 PM
|
I understand where you are coming from, this engine code is huge and finding a bug on my end is hard enough, but then trying to find a bug on someone elses end is near impossible... I need to learn how to organize my code a little better, but when I am programming I am just zooming and not even thinking about how it is going to look, just run... Also I have a lot of stuff I have went back to after about a year, and had no idea what I was doing... commenting is a good thing...lol
DaBooda out.. |
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
EACam
Warrior
154 Posts |
Posted - Jun 05 2004 : 8:16:00 PM
|
Fortunately...over the years...I've learned that important concept pretty well. I mean, I still throw things together now and then when it isn't curcial; but when I'm making something potentially large and difficult to debug, I comment just about EVERY line, I place HUGE headings above different functions all for the same general purpose, like:
and then a bunch of functions/subs for rendering.
I am also a HUGE advocate of logging. You should see my log files, they are often HTML (meaning I can color errors red, etc.) and they usually exceed 16 KB. When reading the log, you could practically rewrite my program since, during initialization, i log after every crucial line of code (so that if it bugs up on one, i know EXACTLY where the bug occurred). At the end of the log file, i report performance and errors. I've even addad a feature where all errors are listed at the bottom with anchor links to to each error!
With all that, however, I don't use many modules (tho i have over 10 in my current project), and they usually end up being GARGANTUAN, which doesn't make finding functions any easier.
So, anyway, that's how i do it...it's probably overdoing it actually...but i'm a perfectionist when it comes to programming. |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
|
masterbooda
Swordmaster
277 Posts |
Posted - Jun 05 2004 : 8:41:54 PM
|
That is my problem too, is that I am self taught, I never learned the commenting or logging technique, because I know what is going on while programming it... and if I leave alone for over a year it is something i wasn't very interested in anyways... as for the bug in this engine... we knew what line caused it, we just didn't know why... all the commenting in the world wouldn't help you with that... Now a variable that has been set wrong I can easily trace, because I can see where the bug is, and trace it all the way back...
I think a lot of it depends on programming taste, and whether or not the code is even going to be seen by others... but I am not disputing that commenting is good, I feel it is a good thing and a good habit to be into... but one line comments are sufficient for me... and I split everything into subs and functions anyways, so it is easy to keep track of...
Dabooda out... |
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
2dcoder
Knave
83 Posts |
Posted - Jun 06 2004 : 06:00:44 AM
|
Good news and bad news. Your latest demos work. :) The bad news. Full screen mode fails. I get automation errors when Windows wants to pop anything up or when I manually alt-tab or press the windows start button. |
|
|
2dcoder
Knave
83 Posts |
Posted - Jun 06 2004 : 06:02:25 AM
|
I forgot to tell you how I did this.
'Initialize Display Engine.InitializeDisplay Main.hWnd, True, 640, 480
I changed the "True" to "False" for full screen running in your tutorials. |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - Jun 06 2004 : 07:20:48 AM
|
That probably is a device lost error. This is going to be attached to the engine soon, I think.
About the code organization... Now we must say that VB.NET really helps here, with the "+" and "-" in each function/class/module/everything and also with the "#Region" command. This really is very handy. |
Whatever. Who knows... |
|
|
sdw
Warrior
USA
160 Posts |
Posted - Jun 06 2004 : 09:13:36 AM
|
I never comment, except when I know I'm going to take a break or think of some more features then I'll make a TODO list. If you make relevent names for your subs, functions, and variables then you really shouldn't need to. I do however use hungarian notation, if that's something like commenting. |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - Jun 06 2004 : 09:27:50 AM
|
I use hungarian notation as well, but it can still be confusing when you have 500+ lines of random math commands with no empty lines/comments...
Also, 2dcoder, that is the classic device lost error. Whenever Windows takes over the computer, DX throws a fit. I think someone (masterbooda?) is/will be creating a little bit of code to catch the error... |
|
|