• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 04:31
CET 10:31
KST 18:31
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband Information Request Regarding Chinese Ladder
Tourneys
$5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
Which season is the best in ASL? [ASL20] Ask the mapmakers — Drop your questions BW General Discussion FlaSh's Valkyrie Copium BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread The Perfect Game Path of Exile Nintendo Switch Thread Should offensive tower rushing be viable in RTS games?
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine US Politics Mega-thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1020 users

Game Programming Primer - Page 2

Forum Index > General Forum
Post a Reply
Prev 1 2 3 4 5 6 7 Next All
PassiveAce
Profile Blog Joined February 2011
United States18076 Posts
Last Edited: 2012-11-17 17:37:25
November 17 2012 17:35 GMT
#21
many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games.

Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top.

once again, this guide is truly incredible, thanks for taking the time to writing it : )))
Call me Marge Simpson cuz I love you homie
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
November 17 2012 17:42 GMT
#22
On November 18 2012 02:35 PassiveAce wrote:
Show nested quote +
many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games.

Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top.

once again, this guide is truly incredible, thanks for taking the time to writing it : )))

Haha yes definitely a typo, thanks for pointing it out. Should say something like "many things in interpreted and other high level languages", not C and C++.
Gorlin
Profile Joined November 2010
United States2753 Posts
November 17 2012 17:50 GMT
#23
Sweet, thanks a ton for this!
akarin
Profile Joined February 2011
Ireland42 Posts
November 17 2012 19:43 GMT
#24
This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?

Thanks for writing this Cecil!
jca2 *
Profile Joined March 2006
France52 Posts
November 17 2012 19:56 GMT
#25
Very good article. I dont know if i missed it but I didnt see anything about "interfaces" which in C++ are based on abstract classes. It's a very powerfull mechanism that allows a binary to interact with another binary without any implementation knowledge, just a few abstract classes defined in .h files. Which in turn allows for real Component oriented design (infrastructures like COM, CORBA, ActiveX, etc).
APM? Never heard of it...
NeWeNiyaLord
Profile Blog Joined September 2010
Norway2474 Posts
November 17 2012 20:35 GMT
#26
As an aspiring Developer I really appreaciate the effort you've done into this post. When I get time to study it I surely will! Thx Cecil!
This is where we begin. Show your true self, Battosai.
DodgySmalls
Profile Joined June 2012
Canada158 Posts
Last Edited: 2012-11-17 22:12:45
November 17 2012 22:06 GMT
#27
I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem.

Pretty awesome amount of content in this, given that it's relatively short and covers so many topics.

edit:
I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? )

I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++.
Please remove nyx assassin
ibutoss
Profile Blog Joined June 2005
Australia341 Posts
November 17 2012 22:45 GMT
#28
I like this article. It is well written and even if I'm not that interested in writing a game I found it a useful refresh on many of the concepts I studied at uni but haven't really been exposed to since.

Thanks for writing it! I enjoyed reading it.
Nada got Yooned
Cyx.
Profile Joined November 2010
Canada806 Posts
November 17 2012 22:46 GMT
#29
As someone else who's in a software engineering program hoping to go into game programming, this is really awesome! A lot of the stuff I work in on my second-year courses is exactly the kind of stuff you're talking about which is really helpful.

One thing though - in your section about game engine architecture you use the Source engine as an example of an engine specific to first-person shooters, when in reality Dota 2 (and every other Valve game since HL2 I think) is built on the Source engine. I'm a bit of a Valve fanboy =P
Bombadil819
Profile Joined November 2011
United States45 Posts
November 17 2012 23:25 GMT
#30
Nice article. Also worth mentioning Panda3D and Torque3D as other options for prebuilt game engines. Especially now that T3D is MIT licensed and on Github.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
Last Edited: 2012-11-17 23:51:50
November 17 2012 23:49 GMT
#31
On November 18 2012 04:43 akarin wrote:
This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?

Thanks for writing this Cecil!

Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not.

On November 18 2012 07:06 DodgySmalls wrote:
I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem.

Pretty awesome amount of content in this, given that it's relatively short and covers so many topics.

edit:
I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? )

I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++.

I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization.

See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
cowsrule
Profile Joined February 2010
United States80 Posts
Last Edited: 2012-11-18 00:29:10
November 18 2012 00:25 GMT
#32
Nice article! Glad to see people documenting their learning progress and sharing their expreience with others.

Sidenote: '#pragma once' is awesome not those crazy header guards .

On November 18 2012 08:49 CecilSunkure wrote:
Show nested quote +
On November 18 2012 04:43 akarin wrote:
This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?

Thanks for writing this Cecil!

Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not.

Show nested quote +
On November 18 2012 07:06 DodgySmalls wrote:
I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem.

Pretty awesome amount of content in this, given that it's relatively short and covers so many topics.

edit:
I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? )

I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++.

I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization.

See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html


Learning java is great, just don't stop there. Once you learn one language (which you CAN use to make games, just possibly not super-awesome AAA titles), it becomes easier to learn a second language.

Android development is java, so there are at least some games written in java. I believe the ever-popular Runescape is also written in java. Most AAA titles for the PC are written in C++ however.
thedeadhaji *
Profile Blog Joined January 2006
39489 Posts
November 18 2012 00:35 GMT
#33
On November 18 2012 02:42 CecilSunkure wrote:
Show nested quote +
On November 18 2012 02:35 PassiveAce wrote:
many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games.

Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top.

once again, this guide is truly incredible, thanks for taking the time to writing it : )))

Haha yes definitely a typo, thanks for pointing it out. Should say something like "many things in interpreted and other high level languages", not C and C++.


C hides a lot of stuff away from the developer compared to assembly!
(just this week, we actually had to implement something in Assembly since C was too slow, lol -- this was for an embedded systems environment tho)
Bombadil819
Profile Joined November 2011
United States45 Posts
November 18 2012 00:45 GMT
#34
On November 18 2012 08:49 CecilSunkure wrote:
Show nested quote +
On November 18 2012 04:43 akarin wrote:
This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?

Thanks for writing this Cecil!

Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not.

Show nested quote +
On November 18 2012 07:06 DodgySmalls wrote:
I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem.

Pretty awesome amount of content in this, given that it's relatively short and covers so many topics.

edit:
I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? )

I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++.

I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization.

See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html


Java sees HEAVY use in certain industry, and is capable of being highly performant when the code is written by someone who knows what they're doing. That doesn't mean it's a good intro language, or that it's the right tool for every job. Or that the language design is particularly elegant. But Java-bashing is a popular hobby for not terribly good reasons.
Greem
Profile Blog Joined September 2010
730 Posts
November 18 2012 01:31 GMT
#35
On my to read list ! thx a lot for a such a good work!
youtube.com/N0rthernL1ght
RayzorFlash
Profile Joined December 2010
Canada253 Posts
November 18 2012 06:24 GMT
#36
Bookmarked and saved! The Quick Refresher stuff is SO IMPORTANT and so amazingly well put together. A lot of the fundamentals in there is what people in the industry REALLY look for when hiring and during interviews. This is an amazing review sheet to use before an interview. Thanks a lot!!! :D
jobebob
Profile Joined April 2011
30 Posts
November 18 2012 06:59 GMT
#37
Wow, so much info. This is a good overview of many important concepts in programming.

You should add some info about using revision control systems. These systems are the foundation to managing a project between a group of people, and every programmer needs to learn how to use them.

Git is pretty famous and a really nice system. Github is massive.

Valve uses a system called perforce, which is basically a rev system for more than just code. We used it to store textures, vertex files and all the other things the artists make.

Some more design patterns would be cool too. I find the "Strategy" pattern is really well suited for making a simple game.
Nightsz
Profile Blog Joined February 2011
Canada398 Posts
November 18 2012 07:39 GMT
#38
i will read this one day >.>

BLinD-RawR
Profile Blog Joined April 2010
ALLEYCAT BLUES50595 Posts
November 18 2012 11:10 GMT
#39
holy hell yes, This is so useful for me I will read,reread this a lot as I progress on my own.
Brood War EICWoo Jung Ho, never forget.| Twitter: @BLinDRawR
uZr
Profile Joined April 2011
20 Posts
November 18 2012 12:00 GMT
#40
That's some insane amount of work you put in there, congrats !

However some things are just bugging me.

Arrays cannot be passed around from one location to another directly. If attempted, the name of an array will be converted to a pointer to the first element in the array. This incurs a loss of information, as a pointer stores information about location and type, whereas an array stores location of first element, type of the elements and number of elements. This “feature” of C and C++ can actually be viewed as a “language bug”.

What do you mean by "name of an array will be converted to a pointer" ? Strictly speaking those two things are just the same: pointers. the name[idx] syntax is just some syntaxical sugar over doing *(name+idx). Furthermore the "size of the array" is never stored anywhere in C. You can write it explicitly when allocating on the stack, but it will eventually get lost when compiled, and the compiler won't give you any warning if you access out of bounds entries.
Here's an example:

#include <stdio.h>

int main()
{
int array[] = {1,2,3,4,5};

printf("array[3] = %d | *(array+3) = %d\n",
array[3], *(array+3));

return 0;
}

Running

test % gcc test.c -o test
test % ./test

then outputs

array[3] = 4 | *(array+3) = 4

When asking gcc to output it as assembly (gcc -S -m32 test.c) we get (some parts have been cut) :

_main:
pushl %ebp
movl %esp, %ebp
pushl %esi
subl $52, %esp
call L1$pb
L1$pb:
popl %eax
movl _C.0.1863-L1$pb(%eax), %ecx
movl %ecx, -32(%ebp)
movl (_C.0.1863-L1$pb)+4(%eax), %ecx
movl %ecx, -28(%ebp)
movl (_C.0.1863-L1$pb)+8(%eax), %ecx
movl %ecx, -24(%ebp)
movl (_C.0.1863-L1$pb)+12(%eax), %ecx
movl %ecx, -20(%ebp)
movl (_C.0.1863-L1$pb)+16(%eax), %ecx
movl %ecx, -16(%ebp)
movl -20(%ebp), %ecx
movl -20(%ebp), %edx
movl %esp, %esi
movl %ecx, 8(%esi)
movl %edx, 4(%esi)
leal L_.str-L1$pb(%eax), %eax
movl %eax, (%esi)
call _printf
movl $0, -12(%ebp)
movl -12(%ebp), %eax
movl %eax, -8(%ebp)
movl -8(%ebp), %eax
addl $52, %esp
popl %esi
popl %ebp
ret

Notice how our array entries get accessed:

movl -20(%ebp), %ecx
movl -20(%ebp), %edx
. (then get pushed on the stack later on etc).
As you can see there, both times it is accessed in the same way.

Arrays are just there to lighten up the syntax.

For example, you could want to iterate over a null-terminated char array this way:

void iterate_and_do_nothing(char *str)
{
int i;
while (str[i]) {
++i;
}
}

That's valid, yet on this one the interrest of using an array-type approach is limited ...
Prev 1 2 3 4 5 6 7 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 2h 29m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 200
ProTech114
StarCraft: Brood War
actioN 743
Shuttle 728
Larva 289
Mini 196
Pusan 174
Hyun 163
Killer 117
Zeus 97
PianO 97
Sharp 93
[ Show more ]
ZerO 68
Dewaltoss 68
Light 43
sorry 38
Rush 31
soO 22
NotJumperer 19
Hm[arnc] 7
ajuk12(nOOB) 3
Dota 2
XaKoH 576
XcaliburYe131
League of Legends
JimRising 464
C9.Mang0254
Counter-Strike
olofmeister594
shoxiejesuss553
Super Smash Bros
Westballz17
Other Games
summit1g11935
Happy405
ZerO(Twitch)1
Organizations
Other Games
gamesdonequick699
StarCraft: Brood War
UltimateBattle 73
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH264
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota245
League of Legends
• Lourlo1080
• Jankos985
• Stunt482
Upcoming Events
Wardi Open
2h 29m
StarCraft2.fi
7h 29m
Replay Cast
14h 29m
The PondCast
1d
OSC
1d 6h
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 14h
Korean StarCraft League
2 days
CranKy Ducklings
3 days
SC Evo League
3 days
BSL 21
3 days
Sziky vs OyAji
Gypsy vs eOnzErG
[ Show More ]
OSC
3 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
4 days
OSC
4 days
BSL 21
4 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
5 days
StarCraft2.fi
5 days
Replay Cast
5 days
StarCraft2.fi
6 days
PiGosaur Monday
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.