Between 15:15 and 15:26 there is quite important bit at the bottom you never mentioned - a macro with overloads ENUM_CLASS_FLAGS(enum) missed it at first and took me way too long to figure out why nothig from the vid was working for me. Aside from that great vid, keep em coming!
@ggamedev Жыл бұрын
Yes, I probably should have hi-lighted that point. Its one of those things where working with this stuff after a while you become almost blind to it. Consider your comment 'pinned' for the benefit of others 😉
@patrickspencer1143 Жыл бұрын
This video is incredible! I've been recently diving into bitflags for an RTS and this has been such an amazing find. I really appreciate the pacing of covering so much from the general idea of enums, to how it applies to unreal in both BP and c++, to how they can be used for general problem solving. Your inclusion of explaining how the values of the enums can be set really helped me understand things so much better.
@ggamedev Жыл бұрын
Excellent. That's just...like... 'My work here is done' 😄
@Shrooblord Жыл бұрын
This is genius. Thank you for elucidating a small host of related concepts in a concise format while bringing it all home under the topic of "using bitflags". I'm just diving into bitflags and am losing my mind a little -- but this video is helping me a lot in getting to the bottom of HOW DO THEY WORK??
@ggamedev Жыл бұрын
Thanks a lot for the positive feedback. It's great you were searching for information on them, because they are one of those areas that people often consider to be 'optional', when in fact a reasonable knowledge of bitflags, and some basic binary in general are good foundations for all programmers to have, and will help you to optimize many data structures and a host of processes, and possibly even speed up your network comms traffic, etc.
@p30virus Жыл бұрын
This was so good, now is more clear how the character movement component handles the movement state.
@ggamedev Жыл бұрын
The engine uses them all over the place, and once you get used to it you probably will too. Very useful, can help keep your code cleaner and more organised, and save on memory too. And also quite nice if you expose stuff to blueprints. Kinda win-win proposition. ... And thanks for the positive feedback 😀
@karaczan583911 ай бұрын
I just want to say how good the quality of this video is, also you explained it very well, i have to say this video is very enjoyable. I just want to give you a tip: if you want more views i feel like your thumbnail should be more oriented around the topic, and i say not only the text but most importantly the image itself. I am no youtuber tho, so take it however you want. Great vid!
@blackivy0117 ай бұрын
Wow, what a bomb video. Literally had be understanding binary in ways I never have before. Thanks man.
@ggamedev7 ай бұрын
Awwww, shucks! 😊
@x3kj705 Жыл бұрын
thanks for your videos, i like the concise info and practical examples
@ggamedev Жыл бұрын
Nice to hear that, thanks for taking the time to drop a positive comment 🙂
@spike3627 Жыл бұрын
Thanks!
@ggamedev Жыл бұрын
You are welcome my friend 👍
@SuperJohnsmith Жыл бұрын
I'm trying to set it up so I can assign my flags through the editor, I'm using UPROPERTY(EditAnywhere, meta = (Bitmask, BitmaskEnum = "EDirection)) uint8 Directions with the enum set up how you show here, however when try and check it with the '&' symbol I have to cast it to uint8 and it doesn't seem to work properly at all. if(Direction & (uint8)EDirection::North) On your examples you don't show a cast at all so what is the variable type of "PlayerWounds"?
@ggamedev Жыл бұрын
You are needing to cast it because you defined the property as a uint8, not as the enum type. So as far as the code is concerned, its a uint8, not your enum. so you are trying to use the & operator on 2 different types (even though they are not actually different as the enum is based on a uint8) I'm not saying that's your fault or anything, it seems to be what you MUST do to make the property work in the editor, with the flags dropdown support. This seems to be an unfortunate situation really - if you are coding in C++ and not trying to expose the flags enum to a uproperty for editing in the editor, then everything is fine, and the code works as it should. If you really must expose it to the editor in a dropdown list, consider this; rather than casting the enum entry to an uint8, why not cast the property value to the enum type, and then test that? This subject can get a little wordy for YT comments, join the discord if you wanna follow up more about this.
@SuperJohnsmith Жыл бұрын
@@ggamedev Thanks I appreciate the reply! I think I've worked out the problem now, I was doing everything right, it was just a silly mistake when I call my function responsible for the flag check. A simple case of deleting a !, the results I was getting was reversed of what I actually wanted so I just thought it wasn't returning correct results. Force of habit of adding a ! in guard clauses. 🤣
@davy4842 Жыл бұрын
Hi man nice videos ! I would like to suggest more SQL content with Lyra …could be nice as a practical example!
@ggamedev Жыл бұрын
I'll consider that. When it was first released, there was a lot of interest immediately in Lyra, and I played around with it a bit, to see what the fuss was about... My main concern though, is that many (*MANY*) people have simply tried to 'asset flip' it, and pass it off as if they had actually made something themselves. I'm pretty sure that wasn't what Epic had in mind for it though 😉
@davy4842 Жыл бұрын
I thought that too but there is like 10 assets on the marketplace that do the same thing…I’m learning gas through it and now I’m interested in using with a database to load info between machines^^
@ggamedev Жыл бұрын
@@davy4842 That's why I really appreciate comments on the videos, or people chatting on the Discord... Especially regarding Unreal - its such a huge Engine in terms of what it encompasses and more eyes-on is always useful. 👍 I'll take another gander at it certainly. I have to say, I wasn't impressed with GAS, I really tried to like it, but honestly, it came across as a poorly documented 'hot mess', the only reasonable documentation being that provided by helpful users via basically reverse engineering and scouring the source code, rather than directly from Epic - not a great look really. Ultimately I felt that for my own projects it would just be much faster/cleaner to develop my own solution... But my 'jury' is still out on my final decision.