GML Knowing how to learn

S

Snayff

Guest
Evening all,

I am currently refining the foundations of my (2d side scroller) game and my current approach is to think of what I want to implement and then spend some time trying to research how that might be achieved, usually looking at the documentation if I have an inkling and online if I dont. This is pretty slow at times as it feels a bit like groping in the dark! Alternatively, where I have some basic understanding, I am taking a stab at it then trying to polish off the edges until it passes muster.

So, on to the question. Does anyone have any advice on an approach to progressing your learning and understanding? Or suggestions on where to go when there are more specific or nuanced issues/challenges? The forums are great but I am not a fan of coming here every time I am stumbling.

I look forward to hearing your thoughts!
 

NazGhuL

NazTaiL
There is nothing like experience! Create a lot of smaller project instead of a bigger one. Try a lot before asking for help. Never copy/paste code from others. You'll get speed and you'll be able to approach problems in differents ways. (But the forum is THE place when you're lost!)
 

MishMash

Member
The most important part of learning is actually putting in the hard work yourself. If there is something you are stuck on, you need to analyse what you are trying to achieve, break down the problem into smaller parts and try to understand exactly what is happening at each step. One thing that I see far too much on programming forums are "copy and paste" programmers. Whilst this can be a valid method of being able to create a project that you otherwise wouldn't know how to make, it often leads to problems when people hit brick walls because they don't understand the code they are working with, and have only gotten as far as they have by patching things in. I get the impression that a lot of people get by with just tweaking random values and adjusting/patching code to fix problems. Though, this style of programming doesn't actually resolve the underlying issue, it just ads a case to handle it, which will most likely conflict with something else later on. (This may not apply to you, but i'm just making a general comment on how important it is to understand your code.)

Improving learning and understanding is all about gaining confidence in the code base/systems you are working with. You want to try and cultivate an understanding of what is happening under the hood, and equally, reach a point where you can logically think about what you want to achieve, and then if you are un-aware of how to specifically do that, then that's the time to ask. (For example, if you needed to create a highscore table, you might know you would need some sort of list which stores scores and corresponding names, but you may not know what options exist to achieve this. The best thing to do in this scenario is to first establish what you think you would need, and then ask for help when it comes to knowing which ways are more appropriate to go about solving that issue in GM specifically -- This sounds like what you said you were doing in your first post, and this is a very good approach).

One thing that I repeatedly see done in clunky ways are collisions. To be honest, I was guilty of this when I started GM. It was years before I really started to think about what I was doing with collisions, before that, I just slapped in some boiler-plate code which I knew did what I needed it to do, but it never gave me full control over the thing i was working with, and as a result, trying to even comprehend doing things like wall running, or ledge jumps was way beyond me. Once I actually started to break it down, and think about how I would go about doing collision tests did I really start to see how some of these other things were possible. I started to break the problem down into motion and collision tests (Where the player would have a set speed in each direciton, and before moving to the new location, it would test that a location was collision free). Once I had done this, it all suddenly seemed simple to me, and then I could start thinking about similar features in similar ways.

Basically, what i'm getting at is that learning is hard. When you're stuck, you really do need to put the effort in to truly understand the problem you are dealing with. This is something that never changes, certain things will always be hard, no matter how much experience you have, however you do get better at learning, and you do get more efficient because you can cut corners by re-using old knowledge/techniques in new areas. A very interesting note to make is that Computer Science degree's for example don't teach you how to program in a specific language, they teach you how to learn and problem-solve more effectively.

If you want to get good quickly, it's all about putting in meaningful and hard work. Rather than wasting time on the "easy" parts of game development, constantly challenge yourself to achieve something that you weren't able to do before, but ensure that along the way, you understand what you are doing, and you understand each line of code you write and know what data it is moving around, how it might be affecting the overall state of your program, whether it is computationally expensive etc; The more things you get working, the better you become, and each time you learn something new, you'll remember it for next time you have a similar problem.

I don't know what your ability is, so it's a little hard for me to give you suggestions on what sort of things you could try working on, but the most important part is variety, and ensuring that you are forcing yourself to try and do things you don't already know how to do :)
 
S

Snayff

Guest
@NazGhuL You're absolutely right mate, experience is the key, it is just getting there! My concern with coming to the forums is that I have sort of implemented some features but have hit a wall with a really specific issue and after sometimes hours in the debug it seems unreasonable to ask someone else to put in that sort of leg work to help me figure out whats not right about it. Largely I would rather figure it out myself but I am sure everyone has hit a wall at some point and no matter how much hitting of the head there is it isnt budging!
 
S

Snayff

Guest
@MishMash Haha, I am guilty of the copy paste at times, but when I do I usually strip it out and refactor/redesign it to fit my needs. The one exception in my project is still haunting me (tile collisions) so I am reluctant to do it again! Largely, I am learning to write it all from scratch, with inspiration from online.

think about what you want to achieve, and then if you are un-aware of how to specifically do that, then that's the time to ask
By doing this the forums actually gave me a huge start, and for most of what I am currently working on I know the rough structure and functions I need. Where I am falling down, and not knowing how to proceed, is where the logic seems to make sense, to me at least, but the result isnt what I expect. I think I am typing
Code:
var _result =1 + 1
and when it comes time to put it in to practice I am getting 3!

It's interesting that you call out collisions as a common pitfall, I think I have continued the trend! I followed Fel666 tutorial so I know it will be sound in principal, it just might be the execution that's lacking. ;) And I have a year of a Software Development degree, but that was over a decade ago...

constantly challenge yourself
I like your thinking and wholeheartedly agree, I am trying to push to "perfect" each part before moving on, and make sure the rough edges arent ignored. This does make for some slow progress though, and a lot of stress when it just isnt right, as I am sure all devs know first hand.

Thank you for taking the time to put that together mate, I appreciate your thoughts on it.

P.S. The lighting on Vitality looks super impressive.
P.P.S The pathfinding looks awesome, too!
 

MishMash

Member
and when it comes time to put it in to practice I am getting 3!

It's interesting that you call out collisions as a common pitfall, I think I have continued the trend! I followed Fel666 tutorial so I know it will be sound in principal, it just might be the execution that's lacking. ;) And I have a year of a Software Development degree, but that was over a decade ago...
Haha yeah, the reason I did point out collisions is because its such a notorious example of something that's actually quite difficult to do right, but such a heavy requirement in every game that its just naturally something that gets bodged a lot. A lot of tutorials (haven't looked at Fel666's, which I imagine is good) teach you how to do collision in GM, with regards to things like the collision event, and apply common base rules like "in the collision event, set speed to 0", which aren't actually very useful. Then a lot of people get confused about the "solid" property, which is confusing in enough itself because it basically snaps the position back to where the object was before the collision with a solid object.

In a sense, collision events are actually quite bad when it comes to stopping collision with objects, as ideally, you want to test if a location is free before something gets moved into that position, rather than detecting when it has. (As once you have, its already too late to do things like wall-sliding which simply rely on altering the motion in the case where your desired direction of travel is blocked). Using collision events as sooo many GM programmers do is like trying to work backwards once something has already happened, when its far far easier to analyse the situation in advance and decide what to do based on the context. (Even experienced programmers make this mistake, and tbh, there is quite a large gap between being good at programming and being good at game development, in a sense, they are mutually exclusive and are both separate skills :) ). Let me note that the collision events do have their application. They are very good for when you want something to happen on a collision, i.e. walking over a button, collision with a spike or enemy/bullet, but are not so good for level geometry.

Either way, it sounds like you know what you are doing, perhaps you are just a bit too much of a perfectionist :D! I personally find that once I start spending too long on a given system, its a good time to switch, as i'll often power through and get loads done in the first few days, then the next few days will be spent basically achieving nothing but twiddling values. At that point, i decide that its good enough for the moment and move onto something else, as tbh, even if I did perfect it then, its almost inevitable that i'd have to re-visit it later on in the project for whatever reason, so I tend to find that its often more efficient to leave everything slightly unfinished until the very end. If your project is modular, then this shouldn't be an issue, as you should be able to replace whole systems in your game with a new one without it having too much impact on existing code :)

Good luck with your ventures anyway!
 
S

Snayff

Guest
Fel666's tutorial does exactly what you advocate (would you expect any less from Fel?!) so it is checking if you are about to hit the tile before you get there and then doing stuff. However, I haven't used the solid property at all, so that's a complete unknown to me. Time to dig out the documentation!

it sounds like you know what you are doing
That's very generous of you, but I am not sure it is quite true! I will be taking your advice on moving on to something else for the time being though, so I can get back to feeling like I have made some progress.

Thanks again, MishMash. Best of luck with Vitality.
 

Yal

šŸ§ *penguin noises*
GMC Elder
Does anyone have any advice on an approach to progressing your learning and understanding?
My goto method is something like this:
  • Try to do something using the knowledge I have.
  • If I fail, google the exact problem I'm having and see if there's any good solutions on StackOverflow (there usually are, but I guess the GMC is better for GM questions).
  • If I can't find a solution to the problem, change the approach.
  • While doing all of the above, read documentation and stuff that seems interesting. (the more you know, the better your educated guesses are... also, try to learn stuff with a "I need to know good keywords to google" mentality rather than a "I need to know all of this by heart" one, it's much more efficient)
 
S

Snayff

Guest
Thanks Yal, I think your last point is particularly pertinent as it is far too easy to get carried away trying to get a full understanding of a single concept.

And having seen your work clearly that approach is doing something for you! ;)
 
  • Like
Reactions: Yal
Top