Leaks
Post Reply
Quote
Re: Leaks
Posted by Gorbachev on Fri Feb 20th at 6:19am 2004


? posted by Yak_Fighter

I don't get leaks anymore. That's what a big box around the entire map is for.

That better be a joke, and if not, please don't teach that to people new to mapping...

[addsig]




Quote
Re: Leaks
Posted by Dr Brasso on Fri Feb 20th at 6:26am 2004


of course it was a joke gorby....hes a king in the realm of wiseass-dom....

Doc B...

[addsig]




Quote
Re: Leaks
Posted by Cassius on Fri Feb 20th at 6:30am 2004


Since with... yes, I guess almost every last map I've ever made, I've always attempted to mimic nature, invalid solid structures were like a plague for me for a year or so, but once you figure out why they occur they aren't no nothin's to fix and avoid.

What I found out about QERadiant that made me fall in love with it is that if you make a shape that Hammer would call an invalid, it just splits it into triangles. I was giggling like a schoolgirl (wow, that sounded gay) when I was able to make a room flooded with bumpy rubble in about ten minutes for a Hammer job of a few hours.

In general, I am likely to ditch a map straight off if it's structure is not very solid and clean... Fool's Paradise is the sole exception; those rocks are all over the place. Since then, my rockwork has gotten amazingly better.

[addsig]



Quote
Re: Leaks
Posted by Gorbachev on Fri Feb 20th at 6:31am 2004


? posted by Dr Brasso

of course it was a joke gorby....hes a king in the realm of wiseass-dom....

Doc B...

Just clarifying, we don't want to teach the young'uns the wrong ideology in the beginning, or else it could get ugly trying to rework 'em.

[addsig]




Quote
Re: Leaks
Posted by Crono on Fri Feb 20th at 9:26am 2004


? quote:

Well, I got a leaky fawcett... and I get memory leaks in my code sometimes because I forgot to free it up before the program was over...If I actually get back into mapping, I'm sure I'll create more leaks.


Yikes, I got into the habit a long time ago to write things like my destructors first (hopefully I'd also impliment copy constructors properly such that I wouldn't need a smart destructor) so that I wouldn't have to worry about most of my releasing later on.


This is sort of related I guess, but, for fun compile this and run it

//C++ code

//define some function in your program

void crash (char array[])
//array has 10,000,000 usable elements
{
char bye[10000001];

while(bye)
crash(bye);
}

(I couldn't think of something as damaging with as little code at the moment, such as a 20 million node tree. . . ).

. . . . As I realize not many people will realize what that code will do . . . [addsig]




Quote
Re: Leaks
Posted by Edge Damodred on Fri Feb 20th at 7:52pm 2004


you sick sick sick sick recursive bastard!!! But at least that'll crash, which is good thing. Here's worse

int main(void)

{

while(1);

return 0;

}

This won't crash but...

[addsig]




Quote
Re: Leaks
Posted by Crono on Sat Feb 21st at 1:36am 2004


...bye bye program stack.

Nice infinite loop there, buddy. However, yes that will crash, the program anyway. You'll get a stack dump when that thing overflows (everytime you loop you push on the program stack) oh man, if you were on Windows that'd probably crash it. Actually if you're running windows 95 it's sadly easy to get Mr. Blue screen . . . make an array of 10 ints . . .go to element 10 lol.

But that's pretty simple. However, if I were using dynamic memory in that function I could overflow the heap as well

AND! In that case, even if you killed my program the memory would never be freed (until it lost power of course) because it can't be accessed. I swear a lot of programmers do this, I don't know why, maybe they're Java programmers taking a stab at C++ . . .

However, Edge, the function I made would crash your system and mess it up pretty well. Running out of memory and using up all the VMM is never a good thing.

Anyway...

There's nothing wrong with recursion when used in a proper manner, however, what I wrote was anything but that lol.

I know there's only like three people here besides Edge and myself that will truely see how bad that function is.

Edge, have you ever written in Cg? When writting to the GPU, of course. [addsig]




Quote
Re: Leaks
Posted by Dr Brasso on Sat Feb 21st at 3:52am 2004


yeah, but can you do this??...

Doc Brass...





Quote
Re: Leaks
Posted by Wild Card on Sat Feb 21st at 4:05am 2004


Alright, enough with the coding, and back to the leaking.

I took a leak today...

[addsig]




Quote
Re: Leaks
Posted by Crono on Sat Feb 21st at 4:56am 2004


? quote:
yeah, but can you do this??...

Doc Brass...


Do what exactly? the code we've been putting up? If so, yeah you can. It will have the implications of what we've been saying lol.

And in regards to the leak topic of the thread as I said a few posts ago, I think you (doc) have the right idea. It's like anything else, procedurally go through and find the problem and if you spend enough concentration and time in one area making it work properly there's a better chance you won't have to go back and fix it later.

there it's on topic. [addsig]




Quote
Re: Leaks
Posted by Edge Damodred on Sat Feb 21st at 5:34am 2004


? posted by Crono

Edge, have you ever written in Cg? When writting to the GPU, of course.

Actually I just downloaded the stuff from the Nvidia developer site http://developer.nvidia.com/page/home.html (for those interested who haven't looked into it...) I haven't gotten around to working with it, but I will once I get through my final project.

And yes recursion is great, especially if you like to work with trees. It's just when you first learn about it, your brain kinda goes "guurp" and shuts down. Same thing happened when I first tried to understand function pointers....

[addsig]




Quote
Re: Leaks
Posted by Crono on Sat Feb 21st at 6:18am 2004


Yeah, I've never had much need for function pointers to be honest, it's like one of those things that you should learn so you can best others lol. I'm sure it has its own uses, but I've never really needed it. The stuff I'd like to do is overload useful operators. such as with a tree, it'd be real nice if the treenode class (I usually make them a struct and have no working functions on it) had some overloaded operators, like = . Then inside the tree class, overload all operators, oh man, people would love you lol. However, if you were smart (even though templates are bad) you would use a template and overload everything you can imagine and release some notes with it, meaning you can make a tree for almost anything and people will just have to say Tree += newtreenode or something like that, man that would kick ass . . . anyway. I was asking that because I saw a book on it and I was like "whaa" and I started reading some stuff about it. I'd go get the dev kit, but I personally don't even know the openGL libraries, so.

But I will . . . I will lol. [addsig]




Quote
Re: Leaks
Posted by Dr Brasso on Sat Feb 21st at 7:58am 2004


man, after trying to decipher the lingo you two are putting out, im gonna take a couple a aspirins and go back to the religion thread....sheeesh....

Doc Brass...





Quote
Re: Leaks
Posted by Orpheus on Sat Feb 21st at 9:06am 2004


? posted by Dr Brasso

man, after trying to decipher the lingo you two are putting out, im gonna take a couple a aspirins and go back to the religion thread....sheeesh....

Doc Brass...

how about, we call the doctor in the morning.. its Omaha guys, Omaha Ne

[addsig]




Quote
Re: Leaks
Posted by Crono on Sat Feb 21st at 9:50am 2004


? quote:
man, after trying to decipher the lingo you two are putting out, im gonna take a couple a aspirins and go back to the religion thread....sheeesh....

Doc Brass...


. . . sorry? lol [addsig]




Quote
Re: Leaks
Posted by ReNo on Sat Feb 21st at 1:04pm 2004


I've just come across function pointers this semester, and it seems like they could come in useful sometime. Recursion is something that everyone says is useful (or essential, and incredibly neat and tidy compared to the alternatives in many situations), but the only time I've used it is in trees, and I can't thik of many more practical uses. [addsig]



Quote
Re: Leaks
Posted by fraggard on Sat Feb 21st at 1:10pm 2004


Function pointers can be used very well in C++ (as pointers to member functions) to provide one interface to many different methods ,ergo Run Time Polymorphism. In C, I am yet to see a good use though.

BTW: anyone who wants to feel the power of recursion, attempt the Towers of Hanoi problem without recursion and then debate





Quote
Re: Leaks
Posted by ReNo on Sat Feb 21st at 1:16pm 2004


The use I will be making of them is to carry out the current state in a playstation game, written in C. Rather than having huge amounts of switch cases or else ifs, just set the function pointer based on user input or any other determinant on what state will be active (eg. splash screen, initialisation, level 1, etc...) and then call the function that the pointer is pointing to...or something.

Man I suck at programming.

[addsig]




Quote
Re: Leaks
Posted by Dr Brasso on Sat Feb 21st at 5:41pm 2004


this IS a nice town, friendly folks, good place to raise my kids.....

Doc B.....





Quote
Re: Leaks
Posted by Edge Damodred on Sat Feb 21st at 7:20pm 2004


? posted by Crono
Yeah, I've never had much need for function pointers to be honest, it's like one of those things that you should learn so you can best others lol. I'm sure it has its own uses, but I've never really needed it. The stuff I'd like to do is overload useful operators. such as with a tree, it'd be real nice if the treenode class (I usually make them a struct and have no working functions on it) had some overloaded operators, like = . Then inside the tree class, overload all operators, oh man, people would love you lol. However, if you were smart (even though templates are bad) you would use a template and overload everything you can imagine and release some notes with it, meaning you can make a tree for almost anything and people will just have to say Tree += newtreenode or something like that, man that would kick ass . . . anyway. I was asking that because I saw a book on it and I was like "whaa" and I started reading some stuff about it. I'd go get the dev kit, but I personally don't even know the openGL libraries, so.

But I will . . . I will lol.

Well, if you really didn't want template classes, you could just use a void pointer to keep track of the data. Granted now any type of data could be in the tree...but hey, there's probably some strange time when you'd want that, I've seen stranger things in game code before. Might have some trouble with the operator overloading though...

[addsig]





Post Reply