Public Group

# Learning Can only create games with game engines.

## Recommended Posts

I've been dabbling in programming for quite a while nothing professional, and the reason for that is cause I've always wanted to create games, so while learning I decided a game engine would be the better option and learned unity and I'm able to create some pretty cool stuff like an inventory system the code might not be the best but it works exactly how I visioned it too, but lately I've been wanting to learn how to create everything that makes up a game, like Collisions,Entity system we if go that route, Input system and things like that in Monogame since u basically have to implement all that stuff yourself but what I've realized is that I honestly don't know how to do ANYTHING I almost feel like I don't even know how to program it makes me super demotivated/depressed, I tried to create an Input system Idek where to start its like  im staring at the screen for 4 hours and realized I didnt do anything cause Im lost, I wanna learn how to create good systems too like for input being able to remap to different keys, having multiple keys for an input so keyboard a and keyboard o and gamepad a would be all on the same action things like that, does anyone have tips / book recommendations or anything of the sort for these kinds of things? and how did you learn how to do these things if u can?

##### Share on other sites
Posted (edited)

I've been a self taught programmer from day one, so I think I'm a little qualified to help with this answer.

The first advice I would give you is TAKE BABY STEPS!! Don't go make a game... make all the tiny pieces as they come to you.

Start from scratch.

What's the first thing you want to do?

Learn what you need to take that step, Check YouTube, forums, ask questions etc.

Once that step is done, take the next one. I'll give you a bit of a run through of all I've learned about Game Dev in the little time I've spent on it.

1: As a solo developer it is critical that you make a plan! Sit down, think about what you actually want to do, weigh the pros and cons, and get advice from the developer world around you.

"How long will it take", "Is this realistic", "Do I even really want to do this", "Do I have all the tools in place to build what I want"

2: TAKE BABY STEPS! Don't do everything... Want to have a good character? Sit down and teach yourself how to do that, until you have a passable sprite. Want the sprite to move with WASD? Google that until your character moves. NEVER take on too many things at once or you'll get loaded down, and stressed out and you'll just quit. Keep your eyes on the small stuff and ignore the big picture. (That of course means you have to make sure you did #1 very well though)

3: Keep in touch with the community and with what your making. You only have 1 opinion, so if you want to have a great game it's critical that you get other opinions, and if the community says to change something that you may not necessarily want to. LISTEN TO THEM. They're the ones who are using your product, and you want to make it as pleasing an experience for them as possible.

4: FINISH IT! if #1 is done correctly you should be able to finish your goal. If you don't finish what you set out to do it will hurt you in a lot more areas then just you making a game again someday. It's like a race, you'll never have the fullness of actually finishing it if you never finish it. You may be happy from passing all the checkpoints, but the real test is that last mile. Even if it's just a beta at the start, don't give up until your over that hill!

That's most of the beginner advice I got for today . Set a goal, put your nose to the grinding wheel and hopefully one day finish it.. That is, if you make it past #1 which sometimes, it's the right choice if you won't Good luck!

Also @Rutin is usually pretty good with this kinda stuff so I'll get him over here

Edited by SIr Pep
Rutin

##### Share on other sites

Oh, And I'll add one more thing since I didn't actually answer your question about how to learn to do all the things you want to.
From what I can tell you want to learn how to build a game engine and then build your own game that way?

I personally don't know everything you'll need to know about doing that, but When I did start learning from scratch, I started with a Youtube series and then switched to a book. A comprehensive book is really nice tool to have because it can offer answers on demand a lot of the time, so I would suggest you do some research on good books on C++ and Game engines. Check out reviews and all that stuff for at least a day, and also don't skimp on research because you might order a book, and then realize later it's not exactly what you needed (I wouldn't know anything about that 😇)

Also, like I said above don't order books for the entire project. That's an easy way to waste money because you don't know exactly what you'll need when you start out. Just order them as you go for the demand you have.

As far as videos go, they're actually really good, but unless you implement the code they teach you in the moment, they're usually much to temporary and you end up wasting a lot of time for the 20% of the information you'll be remembering and using, whereas like I said a book is much more "usable" as you actually have to use your brain to piece together the code, so you end up retaining it much better!

Hopefully I was able to help! Sorry if this is an overload of information! 😂

##### Share on other sites
17 minutes ago, SIr Pep said:

Oh, And I'll add one more thing since I didn't actually answer your question about how to learn to do all the things you want to.
From what I can tell you want to learn how to build a game engine and then build your own game that way?

I personally don't know everything you'll need to know about doing that, but When I did start learning from scratch, I started with a Youtube series and then switched to a book. A comprehensive book is really nice tool to have because it can offer answers on demand a lot of the time, so I would suggest you do some research on good books on C++ and Game engines. Check out reviews and all that stuff for at least a day, and also don't skimp on research because you might order a book, and then realize later it's not exactly what you needed (I wouldn't know anything about that 😇)

Also, like I said above don't order books for the entire project. That's an easy way to waste money because you don't know exactly what you'll need when you start out. Just order them as you go for the demand you have.

As far as videos go, they're actually really good, but unless you implement the code they teach you in the moment, they're usually much to temporary and you end up wasting a lot of time for the 20% of the information you'll be remembering and using, whereas like I said a book is much more "usable" as you actually have to use your brain to piece together the code, so you end up retaining it much better!

Hopefully I was able to help! Sorry if this is an overload of information! 😂

yeh im trying to build an engine ontop of  monogame to learn how stuff is done under the hood like Input,UI stuff like that to build my game ontop of, I just dont wanna be trapped inside an engine and be able to implement stuff myself,I tend to find videos to be a waste of time most of the time if its to implement something cause you basically just monkey see monkey do, and if u where to re write it the next day you couldn't even remember 5% of it  , and no worries the more information the better which books have you read up on?

##### Share on other sites

I started in HTML, JavScript land so that's probably not much help to you... I started with the Jon Duckett books and they were awesome!

C# was one area I made a mistake with ordering the wrong book. 😛
Shoulda ordered the WPF and .Net but I accidentally ordered just a straight C# book, which is fine, but very little help...

I'm currently learning WPF software development in C#, and honestly I'm exactly where you are with that as I don't know what exactly to learn... I know what I need to do, but I can't make myself spend another \$60 on a book when I just ordered the wrong one! 😛

As far as game development I'm the artist of my project, not the programmer.

##### Share on other sites

There are some really good tutorials available from various places. Not sure if I should put plugs in here for anything. I am new to this site. Message me if youd like any suggestions. I hope and wish you the best along your paths.

##### Share on other sites

Its great you are trying to learn what is going on under the hood, yet consider focusing on one aspect - two at the most.

Personally, before moving on to Unity, it was graphics and input. In both areas it began with DirectX and C++ and ended with writting demos for the Megadrive and ZX Spectrum using C and Assembly. That programming journey is its own reward, yet for the end result you find yourself with a game engine like Unity or Godot.  I'm now doing VR with Unity with C# and while I'm glad things are far easier, its only because I spent those previous years sharpening my programming skills.

Unable to comment on the systems you mentioned, but what helped in my journey was to start with the very basic building blocks, create simple demos focusing on a single task and to also constantly be revising the code to be the best it could be.  Your current code should be the foundation of projects to follow, and naturally you'll move onto increasingly complex programs.

Please do not get down about it - just start with the most basic thing you can do and do it well.  Then take the next step.

##### Share on other sites
1 hour ago, Anri said:

Its great you are trying to learn what is going on under the hood, yet consider focusing on one aspect - two at the most.

Personally, before moving on to Unity, it was graphics and input. In both areas it began with DirectX and C++ and ended with writting demos for the Megadrive and ZX Spectrum using C and Assembly. That programming journey is its own reward, yet for the end result you find yourself with a game engine like Unity or Godot.  I'm now doing VR with Unity with C# and while I'm glad things are far easier, its only because I spent those previous years sharpening my programming skills.

Unable to comment on the systems you mentioned, but what helped in my journey was to start with the very basic building blocks, create simple demos focusing on a single task and to also constantly be revising the code to be the best it could be.  Your current code should be the foundation of projects to follow, and naturally you'll move onto increasingly complex programs.

Please do not get down about it - just start with the most basic thing you can do and do it well.  Then take the next step.

that's awesome, I cant even begin imagining what writing graphic demos in assembly would look like, thats super impressive, did you learn directx/c++ via chillitomato? and I really like that idea of creating simple demos focusing on a single thing, thats really smart ty and ill try to not get down about it

##### Share on other sites
11 hours ago, Accelor said:

I've been dabbling in programming for quite a while nothing professional, and the reason for that is cause I've always wanted to create games, so while learning I decided a game engine would be the better option and learned unity and I'm able to create some pretty cool stuff like an inventory system the code might not be the best but it works exactly how I visioned it too, but lately I've been wanting to learn how to create everything that makes up a game, like Collisions,Entity system we if go that route, Input system and things like that in Monogame since u basically have to implement all that stuff yourself but what I've realized is that I honestly don't know how to do ANYTHING I almost feel like I don't even know how to program it makes me super demotivated/depressed, I tried to create an Input system Idek where to start its like  im staring at the screen for 4 hours and realized I didnt do anything cause Im lost, I wanna learn how to create good systems too like for input being able to remap to different keys, having multiple keys for an input so keyboard a and keyboard o and gamepad a would be all on the same action things like that, does anyone have tips / book recommendations or anything of the sort for these kinds of things? and how did you learn how to do these things if u can?

It is perfectly normal to struggle on this because it's new to you. I really cannot get into massive amounts of detail without writing an entire guide, but you'll want to break everything down into smaller and manageable steps but with purpose. Regarding input binding this is a very useful feature to have! You'll want to think as logical as possible and what makes sense for your overall design.

Just a small example for you.

If I have a game that moves the player using WASD and I want to change W to T in order to move forward I can do something like this:

(I'm using SFML as an example but you can use anything that gives you access to keycodes)

For my playerObject I just have a very simple class:

class playerObject {

public:

// X - Y Position
int x = 0;
int y = 0;

// Initial Keys
sf::Keyboard::Key moveForwardKey = sf::Keyboard::Key::W;
sf::Keyboard::Key moveBackwardKey = sf::Keyboard::Key::S;
sf::Keyboard::Key moveLeftKey = sf::Keyboard::Key::A;
sf::Keyboard::Key moveRightKey = sf::Keyboard::Key::D;

// Setup starting position
void setup(int tX, int tY)
{
x = tX;
y = tY;
}

// Move by passed amount ( Up, Down, Left, Right)
void moveForward(int tAmount)
{
y -= tAmount;
}

void moveBackward(int tAmount)
{
y += tAmount;
}

void moveLeft(int tAmount)
{
x -= tAmount;
}

void moveRight(int tAmount)
{
x += tAmount;
}

// Bind New Keys
void bindMoveForwardKey(sf::Keyboard::Key tKeyCode)
{
moveForwardKey = tKeyCode;
}

void bindMoveBackwardKey(sf::Keyboard::Key tKeyCode)
{
moveBackwardKey = tKeyCode;
}

void bindMoveLeftKey(sf::Keyboard::Key tKeyCode)
{
moveLeftKey = tKeyCode;
}

void bindMoveRightKey(sf::Keyboard::Key tKeyCode)
{
moveRightKey = tKeyCode;
}
};

In your logic step you'll have something like this:

// Move Block
if (sf::Keyboard::isKeyPressed(greenBoxPlayer->moveForwardKey))
{
greenBoxPlayer->moveForward(5);
}

if (sf::Keyboard::isKeyPressed(greenBoxPlayer->moveBackwardKey))
{
greenBoxPlayer->moveBackward(5);
}

if (sf::Keyboard::isKeyPressed(greenBoxPlayer->moveLeftKey))
{
greenBoxPlayer->moveLeft(5);
}

if (sf::Keyboard::isKeyPressed(greenBoxPlayer->moveRightKey))
{
greenBoxPlayer->moveRight(5);
}

Notice how we're not checking for W to move up? We're checking if the keycode assigned to moveForwardKey is pressed and doing the action required, it doesn't matter if that keycode returns as O or P, if it is pressed it will call our moveForward function.

You'll have to program a class to handle input binding. I simply made a class that works on 3 steps. You press F1 then Step 1 starts which waits for your to hit the first key:

myKeyBinder.setKeySelectionOne(tSelectedKey);


, then toggles Step 2. Step 2 waits for you to select the new key:

myKeyBinder.setKeySelectionTwo(tSelectedKey);

then applies the change like this:

myKeyBinder.changeKeyBind(*greenBoxPlayer);


which looks for the first selection to see if it is a set key to begin with, then if it is found, it will just swap it with your second selection.

I know this is a pretty rough example, you'll most likely want to make controller classes which work with your player objects, and so forth.

(GIF) - Key Swapping in Action:

##### Share on other sites
Posted (edited)
19 hours ago, Accelor said:

I wanna learn how to create good systems too like for input being able to remap to different keys

I like the Input system that described in this book:

Quote

Build your own 2D Game Engine and Create Great Web Games Using HTML5, JavaScript, and WebGL

Authors: Sung, K., Pavleas, J., Arnez, F., Pace, J.

Edited by 8Observer8

• 17
• 9
• 15
• 60
• 84