Advanced C++/Graphics Tutorial 45: Finished IMainGame + IGameScreen

preview_player
Показать описание
In this episode we correct a few things from the previous tutorial as well as finish implementing IMainGame and IGameScreen! In the next video we will use them to start our Ninja Platformer!

Рекомендации по теме
Комментарии
Автор

Hey Ben! You are the best! This tutorial has given me so much knowledge, and I've finally got to learn C++ in a really fun series! Somehow you do it perfect, not to slow, not to fast, not to advanced nor simple. But I think the best part is that you actually show us line by line. I personally easily get thrown off when a tutorial keeps doing work in between videos and eventually I lose track of what's going on. Thank you! :D

MrDritten
Автор

ATTENTION: I am going on a spring break trip tomorrow that will take me out of development for a week, so when I get back I will need to catch up on Seed of Andromeda as well as school and my senior design project. Going to be pretty busy all around until I graduate in May, but after graduation I should have a lot more time to devote to tutorials, since about half of my time goes to school related stuff right now. Though, if you guys have gotten this far, you are officially competent graphics programmers and I am sure you can keep working and researching further on your own! (Good job!)


Only got about 5-7 more tutorials in this series, more good stuff coming after!

makinggameswithben
Автор

Ive just come across your channel the other day and just want to thank you  for sitting down and sharing your knowledge on youtube.  Ive looked at books on programming and while they do a good job explaining syntax and stuff, ive been still confused how to put it all together and make a program actually do something.
Not only are your tutorials helping me put things together but your also teaching about the logic behind some things and how to think through writing a program, which is what ive been looking for!
 i hope you stick with it and keep making these videos because your a good teacher.

ziprock
Автор

Hey Ben, just wanted to thank you for this great tutorial! Thanks to you I was able to make my first LudumDare entry! I used the engine developed here and a lot of the concepts in ZombieGame and BallGame! Hope you have a great graduation and success in SoA! See you in the next episode! So many exclamation marks!

NihilAleph
Автор

I am a complete beginner to c++, and programming in general.
Your videos have taught me so much!  Thursty for more.  Thanks and enjoy your vacation!

kylesorg
Автор

+Daniel Haugland Thanks Daniel! Good to hear that :)

makinggameswithben
Автор

Aaaand done!
This was without a doubt the best tutorial series i have ever followed,  the amount of thing i learned is huge!
On top of that, before the beginning i never touched c++, though i was already a c - c# - java developer, so i even learned a new language along the way!
Thanks for everything, i'll continue to follow your new videos, i'll go back and watch the c++ ones, and in the meanwhile i'll read the huge Game Engine Architecture and try to get into 3d stuff.
One last question, just plain curiosity...how old are you? :) 

DarkDrakman
Автор

Im really excited about this "NinjaPlatformer" project
Will you use Box2d for the collision handling?
Thanks for your AMAZING tutorials, and have fun!

PaulMetalhero
Автор

Hey Ben, I was wondering if you could help me figure out this error. I just started a new project an copied over some code. Now I'm getting "Invalid application of 'sizeof' to an incomplete type ScreenList". Did I miss something?

earlbalaijr
Автор

MakingGamesWithBen I have followed your tutorials with great interest, and have learned a lot (understatement), but I desperately need some basic info about 3D programming. I have the McKesson tutorial (excellent) and the OpenGL Redbook (weird), but I'm still stuck at how I should create a basic game board in 3D (for 4onarow). I have searched the internet for some resources about something simple like that, but I haven't found anything (beyond the basics mentioned above). Could you help me (or other people) in the right direction? Thanks in advance.

pierrefranckx
Автор

Finally amde it to the last tutorial of this series so far.

Just followed the tutorials and typed the code with the video.

Great tutorials, would love to see more. I think for now I'll try to get one or two little games working with this Engine and get more firmiliar with it.

Hope you have/had a nice spring break trip ;)

But I found a bug (for me at least) when I exit the "NinjaPlatformer" by the regular way (pressing the X on the render window). I get a access violation because the Deconstructor of the GameplayScreen is called before the Deconstructor of IMainGame is called, so the GameplayScreen is deleted before the m_screenList is being deleted (deconstructor is called).

For now I fixed it by calling m_screenList->destroy() in the deconstructor of App.

Took me a while to trace all that back, glad that Visual Studio has a Callstack Map so you can look up which methods get called first.

Spartan
Автор

Nice series! Are you going to go over a Entity Component System?

Murderface
Автор

i skipped skipped forward until i saw that this tutorial is from last few weeks. :| TIME TRAVEL

parsarahimi
Автор

Yay!! I finally found a good 32bit MinGW that compiles C++14 with those blasted uique_ptr's with no problem. I downloaded the TDM version of MinGW 5.1.0 and all compiled no problems. No more re-coding around unique pointers. Yay! ;)

I almost switched to Visual Studio over this, but I hate how convoluted that compiler is in it's setup (or perhaps I am just not used to it). But I was determined to get this working with Code::Blocks and maintain my cross-platform independence! ;)

I had a problem with:

std::unique_ptr<ScreenList> m_screenList = nullptr;

I have to change it to:

std::unique_ptr<ScreenList> m_screenList;

NeilRoy
Автор

The game is crashing, if you close it whit the the "normal" X. That caused trought the unique_ptr<GamePlayScreen> in the app class. It gets destroyed, but the pointers to it in IMainGame + ScreenList aren't set to nullptr/don't get removed. So you get some acces violiation at IMainGame::exitGame() and also in ScreenList::destroy(). I already fixed it for myself, if you want the fix for it, just tell me and I'll upload the fix/code.
btw: that bug is nasty to figure it out

okmiim
Автор

Hej Ben,
Are you also going to eventually teach us to write custom file formats? I.e. how to write container files that contain images, sound etc. in binary (compressed) format?
Because I am curious to do that, specifically I was also thinking about having a sort of database containing all objects eventually with animation data and all. Then it would possibly not be too difficult to create a level in i.e. Blender and export it to a custom file type.
I know I'm usually thinking too big already though  : (

Mal_
Автор

Ben when will be the videos again? Myself tommorow is the last day, so later i'll have a lot of free time, and i still have to watch 40+ episodes of this playist, but knowing me i could watch them in less than a week ;) so anyways, any new videos coming?

DR-vxxq
Автор

Hi ben!
I'm trying to go ahead with the engine on my own, and the first thing i want to do is to remove the draw method from the App.
To do so, i created a gameobject class, and each instance can point to the desired shader. Then IMainGame automatically draws every sprite associated with each shader...
With this method i end up rendering N batches, one for each shader used by the sprites.
Is this an acceptable way to go in your opinion or there are better ways?

DarkDrakman
Автор

A note for anyone else who has this error:
When including IMainGame.h I got the error "unrecognized type SDL_Window" in my "Window.h" file when compiling the ninja game. I had properly included sdl and linked everything as before. The zombie game in the same environment compiled fine, it seemed to be an issue in compiling while including "IMainGame.h" (the problems were in compile stage not linking). I ended up fixing this by adding "#include <SDL/SDL.h> to my "GameplayScreen.cpp" file. All the problems went away and I couldn't tell you why.

Renmusxd
Автор

Strange, I needed to: #include <cstddef> at the top of screenlist.cpp in order to be able to use size_t. Didn't need to do that before. <scratches head>

NeilRoy