• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:53
CET 14:53
KST 22:53
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (March 9-15): herO, Clem, ByuN win12026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12Blizzard Classic Cup - Tastosis announced as captains18Weekly Cups (March 2-8): ByuN overcomes PvT block5
StarCraft 2
General
Weekly Cups (August 25-31): Clem's Last Straw? Blizzard Classic Cup - Tastosis announced as captains Weekly Cups (March 9-15): herO, Clem, ByuN win Potential Updates Coming to the SC2 CN Server Weekly Cups (March 2-8): ByuN overcomes PvT block
Tourneys
2026 KungFu Cup Announcement [GSL CK] #2: Team Classic vs. Team Solar [GSL CK] #1: Team Maru vs. Team herO RSL Season 4 announced for March-April PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 517 Distant Threat Mutation # 516 Specter of Death Mutation # 515 Together Forever
Brood War
General
ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Gypsy to Korea BW General Discussion BSL 22 Map Contest — Submissions OPEN to March 10
Tourneys
[Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours IPSL Spring 2026 is here! ASL Season 21 Qualifiers March 7-8
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Zealot bombing is no longer popular?
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Stormgate/Frost Giant Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
FTM 2019 new update 24.2.2
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Need some new stuff (electronics) ~ Mexico's Drug War Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations Cricket [SPORT]
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2100 users

Game Programming: Part Two - Page 4

Blogs > CecilSunkure
Post a Reply
Prev 1 2 3 4 All
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
March 09 2012 20:41 GMT
#61
On March 08 2012 19:17 e-Goh wrote:
Hi ShadowWolf,

I'd pretty much agree with you. For those starting out, it doesn't matter what language you pick, be it C, C++, C#, Java, Python or whatever. You can write, object-oriented C, or non-object-oriented C++. It's up to the programmer how he executes his algorithms. Much like how exact build orders don't matter all that much to bronze leaguers, if the code is bad enough, the nuances of language architecture don't matter.

However, that being said, it's pretty obvious you're not a beginner, but are nevertheless looking for something more to chew on. Game programming, as opposed to application programming, largely focuses on how much performance you can eke out, oftentimes at the cost of convenience for the programmer or elegance of the code. The way modern computer architecture has been progressing, the main bottlenecks we generally face are not the speed in executing algorithms (cpus are quite fast), but memory accesses and management.

If you are writing for the PC, it doesn't really matter because gamers have humungous amounts of memory and caches the size of whales. It only becomes more of a concern when dealing with consoles, or mobile devices where the hardware is much more limited.

The reason why game developers are not the biggest fan of STL is because it does a huge amount of alloc/deallocs on the heap during runtime. I've seen a single std::string initialization make 20 small allocations at once! This causes memory to fragment and results in less memory being available. Imagine memory pockmarked with 16kB holes while trying to allocate 4MB. All that memory in the holes aren't available because they aren't big enough to accomodate the new allocation. We much prefer pre-allocated fixed-size memory pools/containers when possible.

Lately, there's also been a movement against inheritance in general. The strength of C++ has always been that it naturally causes data that gets used together (i.e. in an object) be located close together in memory. However, when working repetitive operations on a set of many objects (e.g. updating the x, y, z position of all game objects), it thrashes the cache with all the superfluous data. Instead of one memory fetch retrieving 16 sets of useful coordinates, it now only retrieves one, simply because of the way memory is arranged.

The name of this new movement is dubbed data-oriented programming (as opposed to object-oriented though they are not mutually exclusive), and is by and large championed by a fellow called Mike Acton. Google him to find out more, but just be warned he can be a wee bit overzealous. It just so happens that straight C lends itself more to this style of programming, though there's no compelling reason why it can't be accomplished in C++ as well. It is a non-intuitive approach though, which can be unsettling for a generation of programmers brought up on pure OOP, myself included.

I hope that gave you some food for thought. Programming is like a never-ending learning adventure!

Pretty interesting post, thanks for taking the time to write this!
ShadowWolf
Profile Joined March 2010
United States197 Posts
March 10 2012 00:15 GMT
#62
Sorry, I lost track of this thread - if CecilSunkure hadn't responded I probably wouldn't have remembered to reply.

Interesting thoughts e-Goh. While (ignoring VC6 cuz it's terrible) I'm not specifically familiar with an implementation of STL that would allocate 20 small 4kb pieces for a string, I know that some consoles, my understanding is that especially the PS3, don't really handle heap allocations very well and you have to be super-careful and micro-manage every single access to the heap regardless of how big or small it tends to be.

There was an interesting push for data-oriented programming when I was in college, too. It really was lead by people whose ideas were terrible, so I had some natural bias against it but I did look around a little bit and I see some areas where it could be of great assistance. I read this PDF, which really seemed to do a good job: http://www.rti.com/whitepapers/Data-Oriented_Architecture.pdf.

To be honest, I think this is where a multi-paradigm language such as C++ really shines because you can have segments of your application using a more traditional OOP style mixed with areas of your application that focus on the data-driven design and then use more of the functional/template driven design patterns as the glue to bring the worlds together in a generic way without either having to be exposed to the nasty bits of the other. For example, I really like how DDP aligns better with parallelism and alleviates some of the nastiness and slowness that constantly handling concurrency can cause you but I would be apprehensive to say that it's a superior overall architectural design. However, the nature of C++ allows you to use the best parts of each from a pure point of view and really put together a strong architecture.

Your point about inheritance is interesting to me because I find it hilarious how often (especially games) misuse or overuse inheritance where even basic composition would make things so much easier to understand. For whatever reason, application and game developers seem absolutely obsessed with enormous inheritance chains that accomplish little beyond making things almost impossible to understand and removing any semblance of type safety. The Half-Life SDK is a great example of this phenomenon. I've always chatted with coworkers and discussed their use of inheritance and whether they consider other techniques to build what they're trying to build that would reduce those chains and possibly even provide opportunities for further growth. It's almost ironic that inheritance chains seem to end up a funny way that code becomes coupled.

At any rate, yeah - I always love learning new things. I've built a few games in the past, but never been happy with them. It's one of those things I've always been interested in doing but something I've never been interested in completing I guess. After I kinda build up the core systems I seem to lose interest really fast for whatever reason.

But I mean, the code I work on has either dealt with huge data structures or had very narrow windows in which action was possible. I've always enjoyed trying to squeeze every bit of performance out of something and try to make it fit in a tiny window, which is why I'm looking forward to hopefully receiving my raspberry pi sometime in the near future. I wrote a horrible shell of an OS a long time ago, so I was thinking about giving that another go just on a hobby level :-D
Prev 1 2 3 4 All
Please log in or register to reply.
Live Events Refresh
Kung Fu Cup
11:00
2026 Weekly #1
WardiTV813
TKL 224
Rex140
IndyStarCraft 130
EnkiAlexander 23
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko372
TKL 224
Rex 140
IndyStarCraft 130
ProTech28
Trikslyr25
elazer 14
RushiSC 6
StarCraft: Brood War
Britney 39805
firebathero 9191
Calm 8916
Bisu 3012
Horang2 1968
Jaedong 1423
Mini 506
BeSt 465
Soma 357
EffOrt 328
[ Show more ]
Light 292
actioN 242
Snow 229
Pusan 228
Zeus 224
Rush 210
Last 107
Soulkey 99
hero 82
Aegong 65
Backho 55
ToSsGirL 53
Hyun 47
JYJ 42
sorry 33
[sc1f]eonzerg 30
sSak 28
Barracks 28
Hm[arnc] 27
JulyZerg 26
GoRush 18
Bale 18
IntoTheRainbow 17
soO 17
HiyA 16
ajuk12(nOOB) 13
Noble 11
zelot 11
SilentControl 11
Terrorterran 11
Sacsri 9
Dota 2
Gorgc2922
canceldota153
League of Legends
JimRising 184
Counter-Strike
fl0m2656
pashabiceps1431
x6flipin510
oskar55
kRYSTAL_29
Super Smash Bros
Mew2King60
Heroes of the Storm
Khaldor125
Other Games
singsing2242
B2W.Neo680
shoxiejesuss282
Happy239
DeMusliM211
Fuzer 204
mouzStarbuck127
XaKoH 119
Hui .109
Organizations
Dota 2
PGL Dota 2 - Main Stream178
StarCraft: Brood War
lovetv 14
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1848
• Stunt575
Other Games
• WagamamaTV116
Upcoming Events
OSC
10h 7m
The PondCast
20h 7m
KCM Race Survival
20h 7m
WardiTV Team League
22h 7m
OSC
23h 7m
Replay Cast
1d 10h
KCM Race Survival
1d 20h
WardiTV Team League
1d 22h
Korean StarCraft League
2 days
RSL Revival
2 days
Maru vs Zoun
Cure vs ByuN
[ Show More ]
uThermal 2v2 Circuit
3 days
BSL
3 days
RSL Revival
3 days
herO vs MaxPax
Rogue vs TriGGeR
BSL
4 days
Replay Cast
4 days
Replay Cast
4 days
Afreeca Starleague
4 days
Sharp vs Scan
Rain vs Mong
Wardi Open
4 days
Monday Night Weeklies
5 days
Sparkling Tuna Cup
5 days
Afreeca Starleague
5 days
Soulkey vs Ample
JyJ vs sSak
Afreeca Starleague
6 days
hero vs YSC
Larva vs Shine
Liquipedia Results

Completed

Proleague 2026-03-16
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
CSL Elite League 2026
RSL Revival: Season 4
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
NationLESS Cup
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.