Do you actually use dynamic memory?
Looks to me it's quite difficult and not really important in most games...
Do you use it?
Do you use it?
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
What kind of question is this?
I'm assuming you mean new/malloc/+alloc? In which case, what answers did you expect other that "yes, always"?
I'm assuming you mean new/malloc/+alloc? In which case, what answers did you expect other that "yes, always"?
Yeah I mean new and delete.
Couldnt you just make arrays "big enough"? I mean, rarely games have memory problems, much more often performance problems.
Couldnt you just make arrays "big enough"? I mean, rarely games have memory problems, much more often performance problems.
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
There's no reason dynamic memory need be any more performance-problematic than making lots of global arrays "big enough"...
There's no way to use inheritance in C++, or any Objective C without using dynamic memory, so that alone will swing most people.
Making lots of global arrays "big enough" has its own problems. Karl Berg's .obj loader took that approach, and it liked to make about 50MB per object. Then when you made a global array of "enough" objects (say, 20) then all of a sudden you're using more than a GB of RAM....
There's no way to use inheritance in C++, or any Objective C without using dynamic memory, so that alone will swing most people.
Making lots of global arrays "big enough" has its own problems. Karl Berg's .obj loader took that approach, and it liked to make about 50MB per object. Then when you made a global array of "enough" objects (say, 20) then all of a sudden you're using more than a GB of RAM....
hmmm... ok...
looks like my games are way too simple for me to appreciate this stuff.
looks like my games are way too simple for me to appreciate this stuff.
©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
I'm voting "often" since I use arrays and stack objects when it's advantuous to do so (like I know that I'm going to need only 3 values for a vector, or I have an object that I won't be moving around), but I use heap memory otherwise.
OneSadCookie Wrote:There's no way to use inheritance in C++, or any Objective C without using dynamic memory, so that alone will swing most people.I have C++ objects that use inheritance and virtual functions that are created on the stack rather than the heap. You use Type object(parameters) to create such object, and they work fine. Objective C, however, doesn't let you create such objects.
oh, inheritance will "work", you just can't use dynamic polymorphism without at least taking the address of the object, and taking the address of objects on the stack is asking for pain

Najdorf Wrote:Looks to me it's quite difficult and not really important in most games...
Do you use it?
Uh, actually, I use it a lot in whatever project I'm working on, be it a simple game, a tool, or a commercial level game.
The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
OneSadCookie Wrote:oh, inheritance will "work", you just can't use dynamic polymorphism without at least taking the address of the object, and taking the address of objects on the stack is asking for painAs in you store a bunch of subclasses as superclasses (for a container or what-not)? For that, pointers are definitely best. I usually only use stack/data objects for temporary objects or instance variables that are initialized only on the initialization of the class they are in.
I only use behemoth switch statements in my programming. Maybe one unsigned long long to track the state, and that's it.
-Jon
-Jon
That must have been One Clever Switch , and One Very Well Packed Int 
-> http://otee.dk/forum/viewtopic.php?t=510
How many man-hours did actually go into it?
d.

-> http://otee.dk/forum/viewtopic.php?t=510
How many man-hours did actually go into it?
d.
aarku Wrote:I only use behemoth switch statements in my programming. Maybe one unsigned long long to track the state, and that's it.Yeah, that's how REAL programmers do it.
-Jon
davidhelgason Wrote:That must have been One Clever Switch , and One Very Well Packed Int
-> http://otee.dk/forum/viewtopic.php?t=510
How many man-hours did actually go into it?
d.
I'd estimate 100.
-Jon
GIgantic switch statements have their place, but I try to avoid them unless I think it's necessary (such as with data streams)
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Troubles With Dynamic Memory | Nick | 1 | 3,731 |
Sep 7, 2005 08:56 PM Last Post: Nick |