• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 03:42
CEST 09:42
KST 16:42
  • 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
Maestros of the Game: Week 1/Play-in Preview6[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9
Community News
Weekly Cups (August 25-31): Clem's Last Straw?0Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris43Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6
StarCraft 2
General
Maestros of the Game: Week 1/Play-in Preview Weekly Cups (August 25-31): Clem's Last Straw? 2024/25 Off-Season Roster Moves #2: Serral - Greatest Players of All Time #1: Maru - Greatest Players of All Time
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris LiuLi Cup - September 2025 Tournaments $5,100+ SEL Season 2 Championship (SC: Evo) Kirktown Chat Brawl #8 - 4.6K max Tonight LiuLi Cup - August 2025 Tournaments
Strategy
Custom Maps
External Content
Mutation # 489 Bannable Offense Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies
Brood War
General
GTL Season 2 – StarCraft II Team League Post ASL20 Ro24 discussion. Starcraft at lower levels TvP BGH Auto Balance -> http://bghmmr.eu/ Easiest luckies way to get out of Asl groups
Tourneys
[ASL20] Ro24 Group F [IPSL] CSLAN Review and CSLPRO Reimagined! Small VOD Thread 2.0 Cosmonarchy Pro Showmatches
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Path of Exile Warcraft III: The Frozen Throne Mechabellum
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread YouTube Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s) Gtx660 graphics card replacement
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
How Culture and Conflict Imp…
TrAiDoS
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 784 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 BLUES50239 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
TL+ Member
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 18m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 230
StarCraft: Brood War
sSak 320
Hyuk 314
Tasteless 301
PianO 141
Zeus 74
ggaemo 40
Sacsri 32
Noble 19
Bale 12
HiyA 9
League of Legends
JimRising 631
Counter-Strike
Stewie2K1290
shoxiejesuss323
Other Games
summit1g8847
WinterStarcraft541
ViBE82
ceh98
Organizations
Other Games
gamesdonequick1300
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 11 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV130
Upcoming Events
Afreeca Starleague
2h 18m
Wardi Open
3h 18m
Monday Night Weeklies
8h 18m
Replay Cast
16h 18m
Sparkling Tuna Cup
1d 2h
PiGosaur Monday
1d 16h
LiuLi Cup
2 days
Replay Cast
2 days
The PondCast
3 days
RSL Revival
3 days
Maru vs SHIN
MaNa vs MaxPax
[ Show More ]
RSL Revival
4 days
Reynor vs Astrea
Classic vs sOs
BSL Team Wars
4 days
Team Bonyth vs Team Dewalt
CranKy Ducklings
5 days
RSL Revival
5 days
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
5 days
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
[BSL 2025] Weekly
5 days
RSL Revival
6 days
Cure vs Bunny
Creator vs Zoun
BSL Team Wars
6 days
Team Hawk vs Team Sziky
Liquipedia Results

Completed

Acropolis #4 - TS1
SEL Season 2 Championship
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
Maestros of the Game
Sisters' Call Cup
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

LASL Season 20
2025 Chongqing Offline CUP
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
EC S1
BLAST Rivals Fall 2025
Skyesports Masters 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 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.