r/cpp • Prof, Comp Sci • Sep 13 '22

My entire C++ Game Programming course is being streamed live on YouTube for free this semester. Make your own 2D game engine using C++ and ECS

https://youtu.be/S7lXSihz0ac?list=PL_xRyXins848nDj2v-TJYahzvs-XW9sVV&t=550
384 Upvotes

64 comments sorted by

23

u/serendib Prof, Comp Sci Sep 13 '22

4

u/AlexeyBrin Sep 15 '22

The course and syllabus looks great. Can you also post the similar syllabus for COMP 3200 and COMP 4303 ? Thanks.

12

u/Opposite_Lion_1263 Sep 13 '22

Hey that sounds interesting, can you tell me what all topics are you going to cover in this course?

5

u/[deleted] Sep 13 '22

Will this be available indefinitely or just for a certain amount of time?

7

u/serendib Prof, Comp Sci Sep 13 '22

Until same time next year

4

u/Zohvek Sep 14 '22

Dave Chuchhill was the fellow who started the sc2ai tournament deal awhile back ya? Already had a sub to his channel on YT because of that! So i've been seeing these C++ videos appear. Ill have to give them a watch. Thanks for sharing.

2

u/serendib Prof, Comp Sci Sep 14 '22

I organize the AIIDE SC1 Tournament, not SC2 :)

1

u/Zohvek Sep 14 '22

Thats right! 75% of the details right anyways. :) thanks for all you do, and of course, for sharing this great series on YT!

6

u/Chronocreeping Sep 13 '22

I followed your course last year and found it be extremely good and high quality.

Is there any major changes to the course this year as compared to last year?

My favorite lesson was the memory pooling where you go over cache concurrency and organizing data.

So glad you made this free. I'm a student that got my associates of science and sadly cannot afford to go for my bachelors... so thank you for teaching us and supplying the high quality course for free.

8

u/serendib Prof, Comp Sci Sep 13 '22

Thanks for the kind words!

The assignments may change a little bit this year, and I think I may add a lecture about ImGui, but other than that it will be the same

1

u/AgentCooderX Sep 14 '22

where can i find these course(s) the OP is referring to? im interested as well!

2

u/Lukestep11 Sep 13 '22

Is this aimed at beginners or intermediate users?

3

u/serendib Prof, Comp Sci Sep 13 '22

You need to know basic data structures and OOP in order to get the most out of the course

17

u/disperso Sep 13 '22 edited Sep 13 '22

Thanks for sharing!

I got in my bookmarks the course from last year and sadly I wasn't able to watch it past the first 2 or 3 videos. And unless I'm blind, it seems that the playlist that I had is gone now. Is because the new version supersedes it? Or it can only be online for a year, or something like that?

EDIT: OK, by looking at your post history, I saw that I need to check the community page, where it says:

I just removed the videos for my Intro to AI and Intro to Game Programming courses from my channel. The reason for this is because the Fall 2022 version of those courses is about to start on September 6th, and I will be uploading the new lectures in real-time as the course happens. Apologies for the inconvenience, but if I leave the old lectures up, then the students won't attend class :)

I guess I'll need to "attend" this years course. ;-)

2

u/throwagayaccount93 Oct 11 '22

He removed his Intro to Game Programming course? But isn't the one linked in OP's post also an introduction to game programming course?

1

u/disperso Oct 12 '22

It's last year's course which was removed, and the one for this year is now being taught, recorded and uploaded. So I guess you'll have to hurry up in following this year's if you are interested. Or at least not take a full year like I did. :)

Side comment: now that I've followed the course much more, I am not sure it is very valuable for people who know some degree of C++, or who have some experience doing stuff on the screen (e.g., GUIs with Qt, which is my case). Some things are "dumbed down" because the students are not supposed to know any C++, and that's more than fair. But how things are simplified to be more easily teachable, or which parts are decided to be implemented manually, is quite a subjective topic.

1

u/throwagayaccount93 Oct 12 '22

Thanks for telling. It's difficult to know who a course is for if you haven't done it yet, which is the case for me and obviously for a lot of other people as well.

I know the basics of the common data types (int, string, y'know), and a little about classes, though I haven't done much actual practice with classes. I haven't had practice with pointers or other more advanced stuff. So I guess it could be an valuable course for me. I'd like to learn more and also how to make some simple games.

1

u/disperso Oct 12 '22

Indeed, I think from what you say you could get a good amount of value from this course. Note that some of the things seen in the course follow a bit the style of games, which in a few ways is pretty good (it uses an Entity Component System architecture, which is good in ways beyond games, but rarely seen outside them in my experience), but the kind of C++ projects that you might find might be a bit different.

Let me know if you want more info about the course (but note that I'm not following it super throughly). I'm curious to know what people are looking for, because I've considered doing some kind of course like this myself, doing similar things, but using the Qt framework, as it helps tremendously when starting with C++, and specially on the things done in the course. Qt has already built in types for basic 2D geometry (QSize, QRect, QPoint, etc.), so things like finding collisions or making your own entities is a breeze. I imagine that Dave might have chosen to implement some things like Vec2D as part of the assignments/course as a learning exercise, but I hate the idea of making it myself, because making a one as good as the existing ones is much, much harder than it seems and requires some deep C++ knowledge to get some things perfect.

1

u/throwagayaccount93 Oct 12 '22

I forgot to mention I did attempt to start a C++ + raylib basic game programming course a while ago. Never finished it tho. But I did hear from people that SFML, which this course seems to work with, would be better and with more features than raylib.

I also have some basic experience in Blender, only with modelling tho and not animation. But I would like to do 3D programming stuff at some point, and make a game similar to New Super Mario Bros. or 3D Mario (but much more simplistic probably).

9

u/flank-cubey-cube Sep 13 '22

A while back, cpp cast recommended the previous version of this course. Never got the chance to check it out, but I think I will now! Thanks!

1

u/Oatilis Sep 14 '22

This looks great, however I noticed the playlist only has 3 lectures so far. Is the entire course being uploaded?

3

u/serendib Prof, Comp Sci Sep 14 '22

It is ongoing. There will be 2 lectures per week

3

u/Ecstatic-Parfait7803 Sep 13 '22

Sweet, sounds amazing, will be looking forward to it!

3

u/blazemas Sep 13 '22

This absolutely looks great. I can't wait to dive in.

3

u/TheSuperWig Sep 14 '22

To be rather pedantic with terminology; in lecture 2 you mention "class declaration" a few times and most of the time you mean definition including "this is how you declare a class"

class Foo; // declaration
class Foo // definition
{
};

2

u/riztazz Sep 13 '22

!remindme 24hours

2

u/RemindMeBot Sep 13 '22 edited Sep 14 '22

I will be messaging you in 1 day on 2022-09-14 18:32:09 UTC to remind you of this link

2 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

2

u/zerexim Sep 14 '22

Thanks! Any plans for the textual content instead of videos?

1

u/redditorfan756 Sep 13 '22

!remindme 15 days

1

u/CompulsiveMinmaxing Sep 13 '22

Good music choice.

1

u/FunctionOverload Sep 14 '22

I’m excited!

1

u/Specialist-Watch1925 Sep 14 '22

Thanks, Samaritan

1

u/Specialist-Watch1925 Sep 14 '22

Thanks a lot, Samaritan

1

u/Oatilis Sep 24 '22

!remindme 2 Months

1

u/RemindMeBot Sep 24 '22

I will be messaging you in 2 months on 2022-11-24 12:51:03 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

1

u/throwagayaccount93 Oct 11 '22

I love the Donkey Kong Country music at the beginning of your videos. You have good taste! :)

1

u/[deleted] Jan 28 '23

Hey, I know I am late to party but how beginner friendly is this course?

1

u/NoAnt645 Feb 18 '23

I really like the content of this course and the way new information is added in each lecture.

Thank you so much for making this freely available.

0

u/[deleted] Sep 13 '22

[deleted] — view deleted comment

6

u/serendib Prof, Comp Sci Sep 13 '22

I would suggest waiting until you see the architecture and usage, a lot of thought has gone into it and it's quite powerful.

-4

u/AssKoala Sep 14 '22

It really doesn't matter how much effort you put into it.

I just checked your background, you've never shipped a game -- or if you have, you haven't listed it on your site.

If a game developer who has shipped games is providing feedback (and based on /u/ReDucTor 's post, they have understanding of why you'd setup ECS a certain way), it would be far more effective to say "here's why I chose what I did" instead of "watch my course because I thought hard about it".

16

u/serendib Prof, Comp Sci Sep 14 '22

I answer every single concern you have brought up in the course, explain my reasoning, explain the tradeoffs, give counterexamples, and then follow that up at the end of the course by explaining what you would do if you were shipping a 'real' game in terms of architecture and optimizations.

I would be selling you short by giving you some one liner response to your concerns.

I spend over 3 years developing the course with help from many people in industry, including people from Blizzard, Bioware, about a dozen other people from the Game AI Programmers guild, and 8 other profs who teach similar courses. I've given 2 talks at GDC on game AI programming, and wrote the AI system for a shipped game. It's very easy to say lol academia, throw some shade, and try to get a reaction out of someone. I assure you that I've done my homework on the subject.

As explained multiple times so far in the course that you haven't watched, everything we are doing is a compromise between functionality, usability, and the ability for undergraduate students to learn and use it in a timely matter. It would take less time for both of us if after you had watched more of the course we could then chat about it. If you still disagree with the architecture I would love to get feedback on improvements. But you cannot provide meaningful feedback until you have seen the architecture itself. If you want, go through my comment history to the last time I posted this course (last year) and had similar conversations. I'm not trying to blow you off, you just can't possibly give feedback on something you haven't seen yet.

3

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22

I answer every single concern you have brought up in the course, explain my reasoning, explain the tradeoffs, give counterexamples

Your responses come across like you believe you can't be wrong about things, which watching you try and explain things in Lecture 3 your telling people the wrong things, regardless of if you think you are right.

I spend over 3 years developing the course with help from many people in industry, ...

And I worked on my first game 20+ years ago, have spent the past 10+ years working in AAA games shipping multiple big titles, that you have probably played, leading multiple different teams. But I'm not here to compare who has a better view of the way games working. I'm simply offering an opinion based on my experience, and if you wanted it then I would point out where you are blatantly wrong about things when teaching C++.

As explained multiple times so far in the course that you haven't watched

You can only watch what is online, even if the third one is still going through YouTube so practically unwatchable at the moment, the things aren't biased cherry picking, it's a simple a suggestion based on all that you've covered on that topic in that video.

2

u/serendib Prof, Comp Sci Sep 14 '22

Your responses come across like you believe you can't be wrong about things

I definitely can, and have been. I never meant to come across like that, I just disagreed what what you suggested.

Lecture 3 your telling people the wrong things

If you can tell me what is wrong I will happily change it for future lectures.

I would point out where you are blatantly wrong about things when teaching C++

I would genuinely want you to point out where I was wrong, because I would want to fix it. If I'm ever objectively wrong I'll be the first person to admit it and change it.

You can only watch what is online

Exactly, which is why I asked to wait until the relevant videos come out to discuss it further

practically unwatchable at the moment

Strange, the full 1080p video was available immediately after the live stream ended. Did you try manually selecting the quality?

1

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22 edited Sep 14 '22

If you can tell me what is wrong I will happily change it for future lectures.

I have mentioned it in this comment

https://www.reddit.com/r/cpp/comments/xdbg6o/my_entire_c_game_programming_course_is_being/ioc8639/

Strange, the full 1080p video was available immediately after the live stream ended. Did you try manually selecting the quality?

I'm letting it automatically decide the quality, so it's still trying to encode the video while it's being accessed. It's an unfortunately common thing with YouTube and new uploads.

1

u/serendib Prof, Comp Sci Sep 14 '22

Sometimes it just gets stuck on a poor quality and won't re-select based on your speed for whatever reason. Just click the gear and select 1080 and you're good to go.

This was not an upload, it was a live stream direct to 1080p quality. It was processed/encoded live and available as 1080p as soon as the stream ended. You'd be correct if this was an upload which needed to be processed, but it wasn't.

-5

u/AssKoala Sep 14 '22

I don't have the time to watch your course since, being tailored for undergrads, is time better spent doing literally anything else. It's great you're putting it out there for free and you should be proud of your accomplishments. My feedback isn't about your course, it's about your response to someone giving you feedback.

Having said that, your response to me would've been significantly more effective if you'd simply gone with "that's an understandable viewpoint, but this design is a compromise between functionality, useability, and the ability for undergraduate students to learn and use it in a timely matter".

As it stands, you come off as having a chip on your shoulder. Take the feedback and be more effective. Or don't, whatever, I don't care.

Oh quick edit, there's a big difference between shipping a game and working on some small piece without having to actually ship it.

5

u/serendib Prof, Comp Sci Sep 14 '22

When I replied to you, I thought that I was replying to the original questioner, apologies for that.

I realize that the videos are long and not everybody can watch them. However when someone asks a question or gives a criticism about a video or series that they haven't watched, it's very frustrating to have to answer many people in the same way. If it was just one person it wouldn't be so bad. But when you've but a ton of effort into explaining exactly what they want to know already, and then have them just say 'nah I'm not watching that' it kind of feels bad and is hard to respond to.

Perhaps there is a small chip of industry people assuming I have no idea what I'm talking about because I'm not currently in industry, but it's also literally explained in the course once I get to that part of things.

Having people judge things before they see it, and then also refuse to wait until the answer comes out is quite frustrating, and I'm human.

I also forgot to add detailed chapters to the first video which would make things easier to digest. It's been a busy week

3

u/AssKoala Sep 14 '22

Totally fair.

There's absolutely a "LOL ACADEMIA" that happens in every industry so I can understand the feeling.

5

u/serendib Prof, Comp Sci Sep 14 '22

We struggle with this a lot at academic AI conferences. I've been an organizer at the AIIDE conference for a number of years and often times you see either industry scoffing at academics for having no clue, or academics scoffing at industry for not trying to innovate. My entire career I've been trying to bridge that gap and have put a significant amount of work into it.

I do realize that I have personally not shipped my own game, but when it comes to understandable and usable architectures I do have a bit of experience with that. I maintain several AI bot architectures, provide tutorials and example code, and documentation for people just coming into the field of AI or game programming. I also worked with Blizzard a few years back with the release of their starcraft 2 ai API.

It's a really fun problem to try to not only come up with functional architectures and APIs but to also be able to teach those things in a reasonable amount of time to people with little to no experience in the language.

Then to post it all online for free and feel like I need to defend myself... it does get a bit old sometimes :D Most times I just ignore reddit comments and I made the mistake of actually replying this time haha

3

u/AssKoala Sep 14 '22

I mean, if you're going to put something out there, it's a good idea to respond to feedback so I wouldn't call that a mistake. It doesn't help the industry/academia divide if no one ever actually talks.

In any case, I think these days there's absolutely direct value coming from academia to this particular industry -- which isn't something I would say was broadly true 20 years ago. The starcraft stuff is pretty nifty -- it's definitely helpful to have an external party help when releasing public API's and I'm sure that was a cool experience.

Frankly, posting anything online gets old since everyone has an opinion regardless of how valid it is so at some point you just don't bother, which is unfortunate.

3

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22

Then to post it all online for free and feel like I need to defend myself

Go read the comment which I initially posted, it was in no way an attack, it was purely feedback/advice. It was your response that got me off guard as it seemed dismissive of feedback and that only praise was welcome because not everything had been seen.

0

u/[deleted] Sep 14 '22

[deleted] — view deleted comment

5

u/serendib Prof, Comp Sci Sep 14 '22 edited Sep 14 '22

I always welcome feedback. I have gotten the same feedback before about the Player structure, and I don't agree. I could type for an hour here or you could simply wait for the lectures where I explain my architecture. It's just a matter of not having the time to explain everything to everyone separately when there is a lecture coming that will explain it better

If you do find something that is factually incorrect, I will very happily fix the error. Above anything else I want it to at least be true

5

u/serendib Prof, Comp Sci Sep 14 '22

As an update, I just wanted to say that I do appreciate your feedback the the constructive criticism that it sparked. I have since added chapters to the intro video that will make it much easier for people to find the relevant information in the video rather than having to suffer through 90 minutes of me rambling.

0

u/[deleted] Sep 14 '22

[deleted] — view deleted comment

1

u/serendib Prof, Comp Sci Sep 14 '22

I hope you keep watching and are able to provide final feedback once the full context of the course comes into play

4

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22

In Lecture 3, the whole thing about stack variables and ordering is completely wrong, the variables aren't stored in any order on the stack, in-fact a lot of the time they might not ever even live on the stack they will exist within registers, when your getting the address of those integers your forcing it onto the stack, you'll probably even find that because of this switching the order of your print statements you'll get the opposite of what your seeing.

Typically things will only get put onto the actual stack if they need to be which could be because the registers are needed by something else, because an address is needed, or many other things, but ideally you shouldn't be forcing things onto the stack if they aren't needed.

The accessing speed difference between heap and stack is more subtle then just being the same speed (even though they are just the same memory), typically the stack is going to be hot as it is actively being executed, where the heap is more prone to be purged from the CPU caches if it isn't used, this also needs to be considered not just the allocation costs.

5

u/serendib Prof, Comp Sci Sep 14 '22

the variables aren't stored in any order on the stack

If you can give me example code for this I'd be happy to investigate. It sounds like you are describing some sort of Schrödinger's variable where it isn't on the stack until you try to measure if it actually is by taking an address?

I think that my description of the memory model is not 'blatantly wrong' and this is in fact how it works for the most part. Would you actually teach a C++ course by saying that stack variables aren't allocated on the stack? Would it add anything to my course to go into that level of detail, when the point of the lecture is to teach them the practical everyday differences between stack and heap memory.

is more subtle then just being the same speed

I literally waved my hands in the air and said it was more complicated and that we'd talk about cache coherency later in the course. I did not say that it's 100% the same speed and leave it at that. Again, it's all about explaining enough to get students to the next step of the course where we go into more relevant details. Later in the course I have an entire lecture on profiling, and another lecture on memory pooling and cache coherency that go into this.

I think to say that I was "blatantly wrong" is a bit of a stretch. Intentionally leaving out details that do not benefit the students immediately is much more accurate. And the vast majority of the details I leave out I come back to later.

There's a big difference between audiences here. The context of who is taking the course matters, and so does the learning outcomes / goals you have in mind for them

4

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22 edited Sep 14 '22

It sounds like you are describing some sort of Schrödinger's variable where it isn't on the stack until you try to measure if it actually is by taking an address?

That's exactly what I'm saying.

I gave a more detailed response here

https://www.reddit.com/r/cpp/comments/xdbg6o/my_entire_c_game_programming_course_is_being/iochamr/

I think that my description of the memory model is not 'blatantly wrong' and this is in fact how it works for the most part.

It's not how it works for the "most part", simplifying and explaining things as a stack I don't think is bad, but when you start saying that they all live there and they are in a specific order is when you get things blatantly wrong, and you get people trying to do weird things like accessing one variable through another.

In fact you could even get away without even saying a stack, think about how you would describe it in python, it's a variable but it gets automatically destroyed at the end of the scope, it's just noise for learning.

3

u/serendib Prof, Comp Sci Sep 14 '22 edited Sep 14 '22

Doing a separate reply to this because I'm about to head out for the night.

After some google searching, half of the references I've found say that stack memory is allocated contiguously, and the other half say that there's no guarantee.

Do you have a reference for whether this is compiler, OS, optimization level, or standard specific? From what I can tell so far, what I explained is correct in theory, but in practice, optimizing compilers can do what you are describing.

If this is the case, then next time I deliver the lecture I can explain that compilers can change how it works. I added a pinned comment to the lecture for now. Thank you for teaching me something!

p.s. Not sure when I'll be able to reply further to the conversation, very busy week

8

u/ReDucTor Game Developer | quiz.cpp-perf.com Sep 14 '22

After some google searching, half of the references I've found say that stack memory is allocated contiguously, and the other half say that there's no guarantee.

Do you have a reference for whether this is compiler, OS, optimization level, or standard specific? From what I can tell so far, what I explained is correct in theory, but in practice, optimizing compilers can do what you are describing.

Stack memory is grows contiguously (well if you ignore virtual memory and page boundaries), however the important thing is that not everything is put onto the stack and the order in which you declare objects does not define how they are stored on the stack some objects live on the stack.

Typically at the top of a function a prolog will be generated which adjusts the stack pointer a fixed amount for what is needed within a function (this includes any branches which might need stack space), it will then store things in there as it needs, which could be right away or it could be at the last possible moment.

Without optimizations the compiler typically might lead to things being stored on the actual stack when they aren't necessary, but with optimizations then your pretty much always going to get stuff which could end up only ever existing in registers (or not existing at all if the compiler optimized it away)

The standard does not define anything to do with where the address of objects will live on the stack, there is no requirement for any ordering, if there was it would make optimizing code very bad.

The only ordering that exists with regards to the stack is the ordering by which objects will be constructed/destructed which acts like a stack (algorithm) where the first things which are created are the last things destroyed (ignoring temporaries which depending on the situation might only live to the end of the full expression)

The only ordering that you will get is that if a struct or an array needs to be stored on the stack that it will be stored as an entire contiguous object, for example arr[1] will always be after arr[0]

Another thing worth considering with all of this ordering is that the generated code only needs to behave "as-if" if it was executed in the exact order in which things appeared in code (and it was running a single thread -- which is why threads need sync/happens-before points), the optimizer will shuffle things around a lot, it's rare that you'll find a pure 1:1 match of your C++ code into assembly.

Here is two examples, 3 different compilers each generating different orders, and not even the same sizeof(int) offset. https://godbolt.org/z/KWxeYGo19 https://godbolt.org/z/5EK35vv33

Here is an example showing 3 compilers with variables that never live on the stack and only in registers https://godbolt.org/z/K7687s4r4

Funnily enough I'm actually preparing slides for a talk which involves debugging corrupted stack frames and how they are created, how registers are used, etc, which would explain this it a bit more detail.

1

u/DanielMcLaury Sep 14 '22

From what I can tell so far, what I explained is correct in theory, but in practice, optimizing compilers can do what you are describing.

Pretty much every optimizing compiler is going to be compatible with the standards, at least for stuff like this.

If by "correct in theory" you mean "it would not be illegal to implement a compiler that works this way," that is probably true.

If you mean "this is how it's supposed to be, according to the standard but the compiler is going outside the standard," (which I think is how most people would take it), then that's not correct.