Should STL be used in game programming

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
dejai
Chaos Rift Junior
Chaos Rift Junior
Posts: 207
Joined: Fri Apr 11, 2008 8:44 pm

Should STL be used in game programming

Post by dejai »

An interesting question.... What are your thoughts?
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: Should STL be used in game programming

Post by K-Bal »

Why not? :shock: :lol:
User avatar
Netwatcher
Chaos Rift Junior
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

Post by Netwatcher »

well STL is in STD, and STD's are bad... I guess... no?

now really, I think sometimes you will just have to use at least a vector or a list somewhere along the way...
"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/
User avatar
Bakkon
Chaos Rift Junior
Chaos Rift Junior
Posts: 384
Joined: Wed May 20, 2009 2:38 pm
Programming Language of Choice: C++
Location: Indiana

Re: Should STL be used in game programming

Post by Bakkon »

vectors are my bff
User avatar
zodiac976
Chaos Rift Regular
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

Post by zodiac976 »

I use STL for just about everything. I find them extremely useful but I am no
expert so I am not sure if it is wise to use them all the time.
User avatar
Netwatcher
Chaos Rift Junior
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

Post by Netwatcher »

Bakkon wrote:vectors are my bff
vectors FTW!
"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/
User avatar
dejai
Chaos Rift Junior
Chaos Rift Junior
Posts: 207
Joined: Fri Apr 11, 2008 8:44 pm

Re: Should STL be used in game programming

Post by dejai »

I think its kinda lazy to use STL a lot. #include <algorithm> really? Thats just a slap in the face. Then again the whole C++ language is a bit...
User avatar
Netwatcher
Chaos Rift Junior
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

Post by Netwatcher »

are you talking about linking in general or the actual #include<algorithm>?
why is that bad? (it IS a time saver after all)
"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/
Panama
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 21
Joined: Fri Jun 05, 2009 12:37 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++ and C#
Location: Great Britain, although I don't understand what's so great about it

Re: Should STL be used in game programming

Post by Panama »

Absolutely, just about all my projects have need for STL (vectors baby!) and I don't think a single one of my projects is without it. It's just so damn useful for games :)
User avatar
Netwatcher
Chaos Rift Junior
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

Post by Netwatcher »

If you don't use STL, you'll have to make your own stuff, and that's not a bad thing.
It's just like eating Pancakes with shit; you can still eat it but it'll be really messy.
Last edited by Netwatcher on Sun Jun 21, 2009 11:37 pm, edited 1 time 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/
User avatar
Joeyotrevor
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 62
Joined: Thu Jan 22, 2009 6:24 pm
Programming Language of Choice: C++

Re: Should STL be used in game programming

Post by Joeyotrevor »

Netwatcher wrote: It's just like eating Pancakes with shit; you can still eat it but it's really messy.
Uh... what?

Code: Select all

eb 0c 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 31 d2 8e c2 30 ff b3 0a bd 02 7c b9 0b 00 b8 00 13 cd 10 eb fe
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Should STL be used in game programming

Post by dandymcgee »

Joeyotrevor wrote:
Netwatcher wrote: It's just like eating Pancakes with shit; you can still eat it but it's really messy.
Uh... what?
I think Netwatcher just told everyone who writes their own containers to eat shit.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Should STL be used in game programming

Post by MarauderIIC »

STL increases compilation times and executable size, but on PC, it doesn't really matter. Personally, I use STL all the time.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
Netwatcher
Chaos Rift Junior
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

Post by Netwatcher »

dandymcgee wrote:
Joeyotrevor wrote:
Netwatcher wrote: It's just like eating Pancakes with shit; you can still eat it but it's really messy.
Uh... what?
I think Netwatcher just told everyone who writes their own containers to eat shit.
you got it all wrong... :lol:
It's maybe not the best example :nono:
"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/
User avatar
Falco Girgis
Elysian Shadows Team
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

Post by Falco Girgis »

The only time that I would ever question the use of STL would be with console development because of what Marauder said:
MarauderIIC wrote:STL increases compilation times and executable size
That's very true. On Dreamcast, where you only have 16 megs of RAM, you are making your executable approximately a MEGABYTE larger just by linking to STL.

It's also pretty substantial on PSP.

While Elysian Shadows is using STL on both the PSP an DC builds currently, that will be one of the first things to go when we start running into bottlenecks.
Post Reply