GML Array structs - GMWolf

GMWolf

aka fel666
GM Version: GameMaker studio and Studio 2
Target Platform: ALL
Download: N/A
Links: Video Link


Summary:
Structs allow you to group variables together under one variable. This is used to represent more complex data types such as vectors, or matrices.
In this short video I will show you how to best create structs using arrays in combination with enums, as well as pros and cons to other techniques.
Tutorial:
Check out my Channel on Youtube for more tutorials!
 
Last edited:

GMWolf

aka fel666
did u buy a new mic? great video by the way.
Its the same mic I have been using for a while now. But it is different from the one I used for my first videos (that was my webcam, actually).

Perhapsni sound a little different because I positioned myself closer to the mic this time.

And thanks, glad you liked the video. I feel like most people don't like these more theoretical videos, what they like is direct 'how to make this game' videos. So its always nice getting positive feedback :)
 
I do find your video's quite helpful - in bringing light upon techniques that other people haven't covered, and that I am unaware of. However, once alerted to these possibilities its not always the case that you give enough information for someone unfamiliar to see how they can be applied.

It's kind of like: "Fel666 knows his stuff, so this is worth listening to...but, um, having heard it I still don't really know how to apply it". The video about finite state machines was helpful for a beginner, but I feel the video above was not.

In the former video you explained what enums are, how they can be used, and then showed that in practice. Here you've skipped over that (presumably feeling it was redundant after explaining them in FSM) and not gone into much detail about arrays (presumably because you think viewers know all about them) and the application of enums to an array (ditto).......

The reason the 'How to make this game' video's are perhaps more popular is because they show step by step every part of the process. Sometimes excruciatingly slowly in the case of some heartbeast (?) tutorials, but you couldn't argue the guy hasn't given you all the information, and plenty of time to digest it, and seeing how it works in practice. That's just the kind of thing newbies, or less experienced / capable coders, need (which sums me up for example)

It seems often the case that people just follow those tutorials without trying to understand what the code is doing, but at least those presenting the video have fully gone through it. I feel that here you have not really shown a practical example, or explained in much detail what you're doing.

It's intermediate stuff, and maybe the majority of GM users who look for tutorials are beginners etc that you're not catering for, but could be if you went more indepth. Meanwhile I'm going to try your techniques above, as they are no doubt useful, and probably muddle my way through what it's doing......
 

GMWolf

aka fel666
I do find your video's quite helpful - in bringing light upon techniques that other people haven't covered, and that I am unaware of. However, once alerted to these possibilities its not always the case that you give enough information for someone unfamiliar to see how they can be applied.

It's kind of like: "Fel666 knows his stuff, so this is worth listening to...but, um, having heard it I still don't really know how to apply it". The video about finite state machines was helpful for a beginner, but I feel the video above was not.

In the former video you explained what enums are, how they can be used, and then showed that in practice. Here you've skipped over that (presumably feeling it was redundant after explaining them in FSM) and not gone into much detail about arrays (presumably because you think viewers know all about them) and the application of enums to an array (ditto).......

The reason the 'How to make this game' video's are perhaps more popular is because they show step by step every part of the process. Sometimes excruciatingly slowly in the case of some heartbeast (?) tutorials, but you couldn't argue the guy hasn't given you all the information, and plenty of time to digest it, and seeing how it works in practice. That's just the kind of thing newbies, or less experienced / capable coders, need (which sums me up for example)

It seems often the case that people just follow those tutorials without trying to understand what the code is doing, but at least those presenting the video have fully gone through it. I feel that here you have not really shown a practical example, or explained in much detail what you're doing.

It's intermediate stuff, and maybe the majority of GM users who look for tutorials are beginners etc that you're not catering for, but could be if you went more indepth. Meanwhile I'm going to try your techniques above, as they are no doubt useful, and probably muddle my way through what it's doing......
Thanks for the great review. Probably some of the best feedback I have had!

I agree, I could have gone into more detail both on each individual components, and also on what structs could be used for.
I will keep it in mind when working on my next video!

However, I still feel like the whole 'make an RPG in 50 videos' format isnt for me. Mainly because it tends to show a lot of code that is really only applicable to that one game.
Its true that my videos have been tending towards the intermediate level, and that not many people look for intermediate tutorials, but those are the kinds of videos I enjoy making :)

Nonetheless, I will be keeping all this in mind in the future.
 

Micah_DS

Member
Ah! Now this is the kind of GameMaker tutorial material that YouTube needs more of. Great presentation and the information is useful and fairly concise.
 

GMWolf

aka fel666
Ah! Now this is the kind of GameMaker tutorial material that YouTube needs more of. Great presentation and the information is useful and fairly concise.
Thanks! :) glad you liked it! I also agree that GM does not have enough of those more general programming techniques type tutorials, and am planning to make more in the future.
 

mdbussen

Member
Very nice video! You have a very pleasant narrating voice and quality production values.

There is another way to emulate structs that I learned about today but have never tried myself - you can use OBJECTS as structs, but you need to deactivate them to avoid the performance hits associated with using a lot of objects. See this thread on reddit for more details.
 

GMWolf

aka fel666
Very nice video! You have a very pleasant narrating voice and quality production values.

There is another way to emulate structs that I learned about today but have never tried myself - you can use OBJECTS as structs, but you need to deactivate them to avoid the performance hits associated with using a lot of objects. See this thread on reddit for more details.
Hi, glad you liked my video :)
I would not recommend using objects. Although they are easier to use, they use significantly more memory as they have a very large number of default variables.
They are also more expensive to create and destroy for that same reason.
 

mdbussen

Member
I dont undestand. Whats wrong with arrays?
Nothing! I just had already been using maps in my project and it's not worth it for me to go back and switch them all to arrays at this point :) will consider to use arrays in the future though.
 
G

GameDesignerJoe

Guest
Great stuff. As a newbie that's trying to learn more of how all these things work, I found it very useful. Please do more like this. Your presentation was very well done.
 

GMWolf

aka fel666
Great stuff. As a newbie that's trying to learn more of how all these things work, I found it very useful. Please do more like this. Your presentation was very well done.
Thanks. I will most certainly make more of these sorts of videos. Glad you like this kimd of presentation, as I find them far better than the traditional tutorial format.
 
S

Snayff

Guest
Another great piece of content, @Fel666! Really informative and I particularity enjoyed the explanation of alternatives as it helps provide much needed context. Thank you for sharing your knowledge!
 

Devant

Member
Wow. This tutorial just saved my sorry ass. I got a couple dozen arrays containg data structs, and I was going to use #macro for the dozens of labels needed. Enum makes the task look like a piece of cake compared to that.

So, big thank you.
 
Top