• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:41
CEST 13:41
KST 20:41
  • 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
TL.net Map Contest #21: Voting7[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)80Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
Ladder Impersonation (only maybe) Revisiting the game after10 years and wow it's bad 5.0.15 Patch Balance Hotfix (2025-10-8) TL.net Map Contest #21: Voting How to Block Australia, Brazil, Singapore Servers
Tourneys
RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Crank Gathers Season 2: SC II Pro Teams LiuLi Cup - September 2025 Tournaments Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
BW General Discussion Pros React To: BarrackS + FlaSh Coaching vs SnOw [Interview] Grrrr... 2024 Question regarding recent ASL Bisu vs Larva game BW caster Sayle
Tourneys
[ASL20] Semifinal B [Megathread] Daily Proleagues [ASL20] Semifinal A SC4ALL $1,500 Open Bracket LAN
Strategy
Current Meta Relatively freeroll strategies BW - ajfirecracker Strategy & Training Siegecraft - a new perspective
Other Games
General Games
Dawn of War IV Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
[Manga] One Piece Series you have seen recently... Anime Discussion Thread Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Rocket League: Traits, Abili…
TrAiDoS
Inbreeding: Why Do We Do It…
Peanutsc
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1387 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 BLUES50530 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
Wardi Open
11:00
WardiTV Mondays #56
WardiTV376
TKL 178
Rex62
IndyStarCraft 55
CranKy Ducklings50
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 178
Lowko154
SortOf 128
Rex 62
IndyStarCraft 55
BRAT_OK 52
StarCraft: Brood War
Britney 28084
Calm 5744
Rain 2921
Larva 2875
Bisu 1435
Horang2 1236
actioN 1135
Jaedong 1025
Soma 487
PianO 315
[ Show more ]
Zeus 285
Leta 273
firebathero 242
Light 203
Shuttle 168
Hyun 149
Mini 143
sSak 106
ZerO 90
ToSsGirL 82
Killer 76
Soulkey 63
Snow 59
Pusan 59
Mong 57
Rush 46
Aegong 41
Sharp 34
Sea.KH 28
sorry 24
Movie 22
Icarus 20
Free 18
Noble 14
sas.Sziky 6
Terrorterran 6
soO 1
Dota 2
XcaliburYe1319
League of Legends
JimRising 435
Counter-Strike
ScreaM1615
shoxiejesuss770
Other Games
summit1g10872
singsing1850
B2W.Neo414
DeMusliM277
crisheroes231
Fuzer 122
Mew2King68
oskar63
ZerO(Twitch)7
Organizations
Counter-Strike
PGL13841
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• LUISG 23
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1889
• Nemesis253
Upcoming Events
CranKy Ducklings
22h 19m
Safe House 2
1d 5h
Sparkling Tuna Cup
1d 22h
Safe House 2
2 days
Tenacious Turtle Tussle
5 days
The PondCast
5 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 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.