Should STL be used in game programming
Moderator: Coders of Rage
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Should STL be used in game programming
Rolling your own, by the way, decreases that overhead. Even if you use templates, too.
I think.
I think.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- Netwatcher
- Chaos Rift Junior
- Posts: 378
- Joined: Sun Jun 07, 2009 2:49 am
- Current Project: The Awesome Game (Actual title)
- Favorite Gaming Platforms: Cabbage, Ground beef
- Programming Language of Choice: C++
- Location: Rehovot, Israel
Re: Should STL be used in game programming
Interesting, if ur going to "roll your own" I really want to see this.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
If u haven't thought about that you wouldn't have written it!
and if you're wrong someone will correct you anyway.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
If u haven't thought about that you wouldn't have written it!
and if you're wrong someone will correct you anyway.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
- programmerinprogress
- Chaos Rift Devotee
- Posts: 632
- Joined: Wed Oct 29, 2008 7:31 am
- Current Project: some crazy stuff, i'll tell soon :-)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++!
- Location: The UK
- Contact:
Re: Should STL be used in game programming
He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slackNetwatcher wrote:Interesting, if ur going to "roll your own" I really want to see this.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
.
As for "rolling your own", logically you could make your own templates with a much lower overhead, as you would only implement the methods which you know you're going to use, therefore the size of the template, and it's footprint would decrease (but this of course depends on the number of methods, and how they're implemented of course, you could end up adding MORE, if you could think of any!)
also, making your own container templates isn't exactly "out there", it can be done, you just need to get your head around dynamic memory and data structures, i'm not saying I could implement one right now, but it's plausible with a little bit of research...
I think
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D
I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D
I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
- Netwatcher
- Chaos Rift Junior
- Posts: 378
- Joined: Sun Jun 07, 2009 2:49 am
- Current Project: The Awesome Game (Actual title)
- Favorite Gaming Platforms: Cabbage, Ground beef
- Programming Language of Choice: C++
- Location: Rehovot, Israel
Re: Should STL be used in game programming
I agree,it's going to increase deving time by a hell lot .programmerinprogress wrote:He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slackNetwatcher wrote:Interesting, if ur going to "roll your own" I really want to see this.
To Marauder:
Stop saying "I think", it makes your claim uncertain.
.
As for "rolling your own", logically you could make your own templates with a much lower overhead, as you would only implement the methods which you know you're going to use, therefore the size of the template, and it's footprint would decrease (but this of course depends on the number of methods, and how they're implemented of course, you could end up adding MORE, if you could think of any!)
also, making your own container templates isn't exactly "out there", it can be done, you just need to get your head around dynamic memory and data structures, i'm not saying I could implement one right now, but it's plausible with a little bit of research...
I think
Edit: The following line was Deleted by the author due to temporal stupidity ...
Last edited by Netwatcher on Mon Jun 22, 2009 10:56 pm, edited 4 times in total.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
- Innerscope
- Chaos Rift Junior
- Posts: 200
- Joined: Mon May 04, 2009 5:15 pm
- Current Project: Gridbug
- Favorite Gaming Platforms: NES, SNES
- Programming Language of Choice: Obj-C, C++
- Location: Emeryville, CA
- Contact:
Re: Should STL be used in game programming
You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.I agree,it's going to increase deving time by a hell lot .
Current Project: Gridbug
Website (under construction) : http://www.timcool.me
Website (under construction) : http://www.timcool.me
- Netwatcher
- Chaos Rift Junior
- Posts: 378
- Joined: Sun Jun 07, 2009 2:49 am
- Current Project: The Awesome Game (Actual title)
- Favorite Gaming Platforms: Cabbage, Ground beef
- Programming Language of Choice: C++
- Location: Rehovot, Israel
Re: Should STL be used in game programming
I actually (and I bet everyone does) like writing my own stuff.Innerscope wrote:You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.I agree,it's going to increase deving time by a hell lot .
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Should STL be used in game programming
Netwatcher wrote:I also have no idea how to write templates.
Code: Select all
template <typename T>
class myTemplate {
T myTemplateVar;
public:
template<typename T2>
T2 myTemplateFunctionInsideTemplateClass(T param); // lol long function name
T myNormalFunctionInsideTemplateClass(); // lol another long function name
};
T2 myTemplateFunctionInsideTemplateClass(T param)
{
return (T2)param;
}
T myNormalFunctionInsideTemplateClass()
{
return myTemplateVar;
}
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Should STL be used in game programming
Correct.programmerinprogress wrote:He's not sure, but he's pretty certain from his experience, so he's saying "I think" because he's trying not to be a know-it-all who might have his facts wrong, so cut the man some slack ;)Netwatcher wrote:To Marauder:
Stop saying "I think", it makes your claim uncertain.
Saying "I think" changes the tone of the response, and also invites others to correct me or back me up. It also keeps me from looking like an idiot. Further, not saying "I think" or equivalent when I am unsure opens the possibility of presenting incorrect facts that inexperienced users -- who don't know that what I've stated is wrong -- will take at face value without verification, producing bad habits and decreasing their value to later employers.Netwatcher wrote:nobody will kill u if ur wrong
Thanks for the vote of confidence :)Netwatcher wrote:I also think that Marauder is just experienced enough, and even when u say something ur not sure about you need to say it at the tops of your lungs, :roll:...
Rolling my own template classes is not something I've needed to do on a large scale, yet, hence, I was unsure.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- zodiac976
- Chaos Rift Regular
- Posts: 156
- Joined: Thu Jun 18, 2009 10:03 am
- Current Project: Booklet & Text RPG
- Favorite Gaming Platforms: PC, PS3, PSP
- Programming Language of Choice: C++
- Location: AL
- Contact:
Re: Should STL be used in game programming
I am still learning templates and I have yet to use them but I doNetwatcher wrote:I actually (and I bet everyone does) like writing my own stuff.Innerscope wrote:You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.I agree,it's going to increase deving time by a hell lot .
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.
- Netwatcher
- Chaos Rift Junior
- Posts: 378
- Joined: Sun Jun 07, 2009 2:49 am
- Current Project: The Awesome Game (Actual title)
- Favorite Gaming Platforms: Cabbage, Ground beef
- Programming Language of Choice: C++
- Location: Rehovot, Israel
Re: Should STL be used in game programming
What about creating a struct in an existing class instead of writing a new class(when possible).zodiac976 wrote:I am still learning templates and I have yet to use them but I doNetwatcher wrote:I actually (and I bet everyone does) like writing my own stuff.Innerscope wrote:You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.I agree,it's going to increase deving time by a hell lot .
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
- zodiac976
- Chaos Rift Regular
- Posts: 156
- Joined: Thu Jun 18, 2009 10:03 am
- Current Project: Booklet & Text RPG
- Favorite Gaming Platforms: PC, PS3, PSP
- Programming Language of Choice: C++
- Location: AL
- Contact:
Re: Should STL be used in game programming
Ever since I learned classes I don't see a use for structures butNetwatcher wrote:What about creating a struct in an existing class instead of writing a new class(when possible).zodiac976 wrote:I am still learning templates and I have yet to use them but I doNetwatcher wrote:I actually (and I bet everyone does) like writing my own stuff.Innerscope wrote:You should be writing you're own templates though, it's a lot better than writing multiple classes that use the same implementation or including STL. So I wouldn't consider it a bad thing.I agree,it's going to increase deving time by a hell lot .
I also have no idea how to write templates(that and AI).
So I write one huge class instead of a little template.
there's much for me to learn, grasshopper.
hope I start finding a use for them soon. I usually split my stuff
into multiple classes and use inheritance and friends if needed.
you never know I may end up eating my words .
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Should STL be used in game programming
I don't think you're ever experienced enough to say something (that you don't know for sure) as fact. That's called being an arrogant douche bag.Netwatcher wrote:I also think that Marauder is just experienced enough, and even when u say something ur not sure about you need to say it at the tops of your lungs, nobody will kill u if ur wrong ...
- Netwatcher
- Chaos Rift Junior
- Posts: 378
- Joined: Sun Jun 07, 2009 2:49 am
- Current Project: The Awesome Game (Actual title)
- Favorite Gaming Platforms: Cabbage, Ground beef
- Programming Language of Choice: C++
- Location: Rehovot, Israel
Re: Should STL be used in game programming
You are partially right.
There's a difference between a personal opinion (i.e. "We're making the best indie game ever") and a professional opinion.
There's a difference between a personal opinion (i.e. "We're making the best indie game ever") and a professional opinion.
Last edited by Netwatcher on Mon Jun 22, 2009 11:22 pm, edited 3 times in total.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
-Derek Powazek, http://powazek.com/posts/1655
blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
- rolland
- Chaos Rift Regular
- Posts: 127
- Joined: Fri Dec 21, 2007 2:27 pm
- Current Project: Starting an Android app soon
- Favorite Gaming Platforms: PS1, N64
- Programming Language of Choice: C++
- Location: Michigan, US
Re: Should STL be used in game programming
Elegantly put.GyroVorbis wrote:That's called being an arrogant douche bag.
I'll write a signature once I get some creativity and inspiration...
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Should STL be used in game programming
So what is consistent with the two? Opinion. Neither is confirmed fact, and neither should be advertised or treated as such.Netwatcher wrote:You are partially right.
There's a difference between a personal opinion (i.e. "We're making the best indie game ever") and a professional opinion.