Тёмный
Game Gems
Game Gems
Game Gems
Подписаться
Game Gems features unique game development tutorials using both the Unity and Godot game engines.
Комментарии
@alexxander7289
@alexxander7289 9 часов назад
much appreciated. head is still spinning🥴 but you showing the getDirection()/getVelocity() solidified the whole vector in my head.👍
@Kio_Kurashi
@Kio_Kurashi 3 дня назад
Can't you just use the and operator without doing a comparison to 0 as a value of 0 would be interpreted as false?
@gamegems7658
@gamegems7658 2 дня назад
Yes, it's basically the same thing.
@richbuilds_com
@richbuilds_com 5 дней назад
Mark the node as unique and you can preface it with % instead of $ - it keeps the path even if you move the node - so long as the name remains unique
@gamegems7658
@gamegems7658 5 дней назад
Yep, unique nodes are definitely a more modern solution to this issue. I can't remember whether or not they existed when I recorded this video. Technology marches on!
@shanefoster5305
@shanefoster5305 6 дней назад
Wow that is so complex for such a simple concept. What if you create all the images instead of textures that then have to be rendered as an image? Seems like this adds a step by having a texture have to render and then be assigned. Not sure if this optimizes anything but it seems like it removes a step and removes having to render after the fact. I'm fairly new to this so I could be way off here... just seemed like an extra unnecessary step.
@gamegems7658
@gamegems7658 6 дней назад
Tell me you didn't watch Part I without telling me you didn't watch Part I.
@shanefoster5305
@shanefoster5305 6 дней назад
@@gamegems7658 i did watch part 1 but it was with viewports and it seems like you could accomplish this without viewports but closer related to this. I was looking into decals for instance. I am trying to find a better way to accomplish this.
@shanefoster5305
@shanefoster5305 6 дней назад
@@gamegems7658 also might not be the best growth strategy on youtube to assume things about your viewers…
@gamegems7658
@gamegems7658 5 дней назад
I assume(d) you didn't watch Part I because I literally spend the first *half* of that video explaining why I'm using the architecture that I'm using and the *first* thing you did was ask me why I'm doing it. It's very common for people to skip around my videos, miss something crucial, and then complain in the comments that I didn't cover it. So, apologies for being terse. I do, however, suggest that you watch Part I again and if you still don't understand the goal of this experiment, then post your questions and I will answer them. In short, though, I am using Viewports to generate textures because I am using Godot's UI nodes to create the card layouts instead of Photoshop or the like, and I'm doing *that* because I want to be able to dynamically render the card data from Resource files without having to bake that data into images.
@shanefoster5305
@shanefoster5305 5 дней назад
@@gamegems7658 yes. That is literally the same thing i am trying to do but i wanted a mire resource friendly solution than viewports. Im considering writing my own.
@shanefoster5305
@shanefoster5305 6 дней назад
Seems like viewports may be too resource intensive. What are the alternatives?
@gamegems7658
@gamegems7658 6 дней назад
The obvious alternative is to simply generate all of the card images in Photoshop or to go 2D, but depending on what you're trying to accomplish, that may or may not be ideal, either. All workflows have tradeoffs.
@shanefoster5305
@shanefoster5305 5 дней назад
@@gamegems7658 it has to be 3D and I can generate all of them. But there are so many cards in the database it would take forever to load them all, so I’m trying to load them as the cards are drawn from the deck. And have the database update which card was drawn and what its effects are. I’m also pretty new to Godot. I used JavaScript mostly before.
@gamegems7658
@gamegems7658 5 дней назад
I agree, and although it's not super-clear here my prototype is also generating the textures on the fly as the cards are spawned from the deck, because viewports can't "pre-render" textures. This has the added benefit, as you pointed out, of a card only being rendered and cached if it's actually being used in the current game. You *never* want to try and load/render every card in your database at once.
@shanefoster5305
@shanefoster5305 5 дней назад
@@gamegems7658 yes I just feel like there has to be a way to make it more efficient.
@LouDev111
@LouDev111 8 дней назад
can i use this code inside of Unity?
@gamegems7658
@gamegems7658 8 дней назад
Not without heavy reworking, given that it's... for Godot and relies on Godot-specific features. But yes, you could probably cache Unity Viewport textures in a similar fashion and communicate their updating with delegates.
@LouDev111
@LouDev111 8 дней назад
can i use the code for my unity game?
@gamegems7658
@gamegems7658 8 дней назад
You could probably rig a similar setup using ViewportTextures, but I don't know enough about how Unity renders its UI to say for sure.
@nostu9426
@nostu9426 23 дня назад
NICE VIDEO, im really interested in a second part!
@gamegems7658
@gamegems7658 23 дня назад
Script is done, expect it sometime next week!
@xyprohero
@xyprohero Месяц назад
u explained very well i love this channel from now on i've learn alot. 🥰🥰wut the hill
@xyprohero
@xyprohero Месяц назад
can u make inventory system ?
@gamegems7658
@gamegems7658 Месяц назад
That's a pretty broad topic, what kind of inventory system were you thinking of?
@xyprohero
@xyprohero Месяц назад
@@gamegems7658 a simple 2d platformer inventory u can drag and drop just want to understand it very well. Thanks alot 🥰
@xyprohero
@xyprohero Месяц назад
very useful thanks alot❤
@gamegems7658
@gamegems7658 Месяц назад
Glad it was helpful!
@modularcuriosity
@modularcuriosity Месяц назад
I fully agree with the documentation. I'm trying to implement a top down map in a viewport where I can also change scenes to get a different type of view, and the docs have been no help at all.
@gamegems7658
@gamegems7658 Месяц назад
It's gotten better. Actually makes sense now, although I do prefer Unity's "tell this camera to render to this texture" functionality. Anyway what you're trying to do is pretty simple, just put the scenes you want to render into the viewport and use a ViewportContainer if you're trying to put it on your UI.
@jupitersky
@jupitersky Месяц назад
Fantastic tutorial. It conveys the bare minimum of information for understanding, then leaves. Nothing about syntax, or any of the detailed stuff I can find in the documentation, just the raw structure, basic workflow, and general design pointers. Thank you so much for making this!
@gamegems7658
@gamegems7658 Месяц назад
You're very welcome!
@hjaller7626
@hjaller7626 Месяц назад
i know this is an old video, but i get an indentifier error at 07:00 in the video at line 9 (identifier "sfxVolumeSlider" not declared in current scope.) and for the life of me i cant solve it edit and fix: turns out im just ad idiot, at the very start of the video (00:25) it shows how the sliders are connected to the script
@gamegems7658
@gamegems7658 Месяц назад
Also it's a good idea to download and read through the github projects, they're often easier to parse whereas the videos are just an overview of the solution.
@Uhfgood
@Uhfgood 2 месяца назад
I only understood about 50% of the video, and I've been programming for a while -- (Not with Godot though)
@gamegems7658
@gamegems7658 2 месяца назад
Check out the code at the github link, I'm sure you'll get it if you study it a bit more.
@Uhfgood
@Uhfgood Месяц назад
@@gamegems7658 - Cool, I will
@sunnysatellites8989
@sunnysatellites8989 2 месяца назад
Thank you for this video, I went through the documentation and didn't quite grasp the explanation but this helped me figure out what I was misunderstanding right away. I'm writing a visible checkpoint system where the on-body contact is supposed to update all other nodes of the same type to not be the primary one. A message bus is the perfect solution for getting them to all acknowledge their status without talking to each other.
@gamegems7658
@gamegems7658 2 месяца назад
Glad it helped!
@JohnSmith-he5xg
@JohnSmith-he5xg 2 месяца назад
Great stuff, really like your channel. The special treatment of Button0 really bothers me. Why did you do it this way? Why not just clear/instantiate/wire everything all at once?
@gamegems7658
@gamegems7658 2 месяца назад
For the purposes of a tutorial, it's slightly easier than having to deal with creating and loading an external prefab, although I have seen it done in at least one professional project. It's not really something I do anymore myself.
@CCLawhon
@CCLawhon 2 месяца назад
Feels more complicated than necessary? I am grateful for this bc I learned a lot, however, couldn't actually get this working? I gave up after 400th error on the set_value. But learned a lot and now have a great math lesson for my students!
@gamegems7658
@gamegems7658 2 месяца назад
If you're talking about the volume calculations, yes; Godot actually encapsulates this in a pair of methods called linear_to_db and db_to_linear, which I didn't know about when I wrote the code featured in this video.
@yusarimahubara
@yusarimahubara 2 месяца назад
On my experience, I tried to program my automated tool for this with the hearbeast technique but creating the map world using csg premade shapes and then merge into one mesh it's way performant that using that mesh blocks where you hide the faces based on the block tile location, I was even using the SurfaceTool to merge the map block meshes into one. Actually I don't know why the steps csg -> single mesh (optional collisions) way is much faster, especially in the editor as a tool. I have a low-mid range pc, so I can easily notice it.
@gamegems7658
@gamegems7658 2 месяца назад
It's because CSG meshes have a load of extra functionality to facilitate the whole CSG-ness of it all. They're meant for rough prototyping of levels and quick, temporary mesh generation, which is why I use standard MeshInstance nodes instead. And while I didn't want to criticize his approach, one thing Heartbeast definitely does wrong in his video is to hide the overlapping faces rather than delete them with queue_free(). They'll never be seen, so why include the overhead of processing them? I'm guessing that when you merge the CSG nodes they turn into a MeshInstance, so the overhead of monitoring for mesh overlap no longer applies, hence the performance increase. I've never benchmarked it myself, though.
@Ocdib
@Ocdib 2 месяца назад
Will I be able to access a node's properties as if I've exported it normally? Or does this only provide the path to the node? e.g.: @export some_label_node: NodePath func _ready() -> void: some_label_node.text = "subscribe to Game Gems" Would that work? I'm trying to see the difference between @export some_label_node: NodePath and @export some_label_node: Label
@gamegems7658
@gamegems7658 2 месяца назад
You'd still need to call get_node() on the exported node path in order to access the node. In Godot 4, the vast majority of the time you'll probably want to export the node directly, but there are times when the path is preferred. You'll most likely know them when you see them.
@starvr
@starvr 2 месяца назад
@GameGems "Can't beat that with a stick!" Me: "Depends on how good you are with a stick!"
@dueddel
@dueddel 2 месяца назад
I once extended the `GridMap` node to add some auto-tiling functionality to it comparable to that from the `TileMap` node. I never published it anywhere because I wanted to polish it a bit before doing so. As of writing this is about two years ago and I never really continued working on it, although I'd like to. … What a shame. 😅 However, it worked pretty good already (not perfectly though). But I'd never ever say this is the best solution for building things like 3D mazes because as you said, there's not **the** solution for a given problem. "Many roads lead to Rome", as we say in Germany. Good video. 😘👍
@gamegems7658
@gamegems7658 2 месяца назад
I wrote this algorithm back when I was learning Unity in like 2015 just to see if it would work, and then ported it to Godot once I switched to that engine full-time. I didn't know about GridMesh nodes back then, which I would definitely use for a more detailed map.
@permanentgrin9356
@permanentgrin9356 2 месяца назад
Thank you so much for this. It was exactly what I needed and perfectly explained at a great pace. Immediate subscribe! Do you happen to know if this can be used in HTML5 exports?
@gamegems7658
@gamegems7658 2 месяца назад
As far as I know, the only issues with asynchronous functionality in Godot 4's HTML5 export are audio related. This should work fine!
@backalleysurgeon
@backalleysurgeon 3 месяца назад
that intro volume gives me diseases like no other otherwise great videos ser
@Solanaar
@Solanaar 3 месяца назад
Quick question: Amateur here, but could you then add a normal map to it to give it depth akin to hearthstone's cards?
@gamegems7658
@gamegems7658 3 месяца назад
Technically yes, but since the texture is dynamically generated, the normal map would need to be as well. Pre-generated normal maps would require pre-generated textures, which defeats the purpose of this process.
@EidoEndy
@EidoEndy 3 месяца назад
I defintely see the usefulness of this, but I'm also having difficulty wrapping my head around where the implementation, and where the functions go ^^; . Time for ore research.
@gamegems7658
@gamegems7658 2 месяца назад
The Message Bus itself is literally just an autoloaded Godot script, and you connect to its signals just as you would any other. It's done this way so that it doesn't *matter* where the functions go.
@gamekanstudios
@gamekanstudios 3 месяца назад
Thank you so much it works
@cornballdangernoodle
@cornballdangernoodle 3 месяца назад
Thank you for making this tutorial! It’s easy to understand and follow. Keep up the good work! : D
@squarepris1m203
@squarepris1m203 3 месяца назад
the section to fill the map with solid tiles is telling me "unexpected "for" in class body", do you know how to fix it?
@squarepris1m203
@squarepris1m203 3 месяца назад
nevermind, im dumb and figured it out, but now im getting a message that says variable w is not defined in the durrent scope even though im pretty sure it is
@gamegems7658
@gamegems7658 3 месяца назад
Check again.
@jayroi1814
@jayroi1814 Месяц назад
Buddy if you don't know how to program or even understand the basics of a programming or scripting language, don't just try to hack together some shit from a bunch of tutorials. You're asking questions any twelve-year-old who spent 10 hours learning could answer.
@squarepris1m203
@squarepris1m203 Месяц назад
@jayroi1814 brother chill out, not only was it my first time ever using godot but also I figured it out incredibly fast, you ever think to not just hate on everything you see?
@squarepris1m203
@squarepris1m203 3 месяца назад
Hell yeah dude, you just made the exact video i needed
@crazyspaces91
@crazyspaces91 3 месяца назад
I'm trying to hold out and figure this out cause it seems like some simple mistake on my end but i compared the text from my scripts to yours and they are completely identical but i cant get choicesDialog.choices = ["Do the thing", "Do the other thing"] to show up in the container. Zero error codes. A single button with nothing in it shows up and disappears when i click on it and that's it.
@gamegems7658
@gamegems7658 3 месяца назад
Double-check your code against the Github project, and failing that, put a breakpoint in the choices' setter function and/or the function that initializes the dialog and see what it's doing.
@Barti777es
@Barti777es 3 месяца назад
Great tutorial with everything explained, without wasting time, love it
@grzegorzpedrycz2630
@grzegorzpedrycz2630 3 месяца назад
Awasome stuff!
@Paruthi.618
@Paruthi.618 3 месяца назад
Many cards = many viewport.. does having many viewports affect the performance? I'm not sure though.. Good tutorial, will give it a try
@gamegems7658
@gamegems7658 3 месяца назад
Watch the full video next time. I cover this in my closing thoughts.
@timarlow8007
@timarlow8007 3 месяца назад
Any particular reason you don't add the story node to the scene? Add as child to root node?
@gamegems7658
@gamegems7658 3 месяца назад
Yes, it makes more sense conceptually to keep it separate. The scene is primarily for managing the UI so I didn't want to add a very complex set of nodes to it. You could easily attach the story to the scene and not have any ill effects. It might even work out better for you since you can then access the root of the tree with get_tree().get_root() if you need to.
@alphabravo3481
@alphabravo3481 3 месяца назад
This is an great explanation. I thought signals were like radio broadcasts but I assume they are more like telephone wires connecting things.
@gamegems7658
@gamegems7658 3 месяца назад
Signals are like radio broadcasts, but you have to "tune in" (IE, connect) to them for it to matter. Either analogy works. Just know that signals will only be processed by nodes that are connected and listening for them.
@Low_Fidelity_3D
@Low_Fidelity_3D 3 месяца назад
Woah thats one of the older versions of windows, isn't it? I can tell because the window borders look like... well, windows. That was back when the UI design for the OS was actually good.
@gamegems7658
@gamegems7658 3 месяца назад
Yes, my desktop PC still runs Windows 7.
@Low_Fidelity_3D
@Low_Fidelity_3D 3 месяца назад
@@gamegems7658 that is so sick
@StrangerInAStrangeLand1999
@StrangerInAStrangeLand1999 3 месяца назад
Definitely would like the performance/alternatives one!
@gamegems7658
@gamegems7658 3 месяца назад
It's in the queue and will be done after my next video on 3D dungeon generation.
@NightCrydeFM
@NightCrydeFM 4 месяца назад
Keep this up man! Doing great!
@mkjyt1
@mkjyt1 4 месяца назад
Epic channel! Subscribed.
@kimonosantaras8979
@kimonosantaras8979 5 месяцев назад
nice tutorial ! do you know how to make a "map" so you can choose where in the novel to start simiral to henry the stickman game?
@gamegems7658
@gamegems7658 5 месяцев назад
Yes, all you need to do is create a UI scene that manually defines and invokes the jumpToNode method with the correct node.
@triplestandart7613
@triplestandart7613 5 месяцев назад
Sorry, complete beginner here. I'm using 4.2.1 and when I try to update the text and textures in the set function (I've assigned the resource via the editor), I get an error: "Invalid get index "card_name" (on base: 'Nil')." Probably it has something to do with load order. My script works, when I put it in the _ready() function.
@gamegems7658
@gamegems7658 5 месяцев назад
Hard to say without looking at your code. Two things I can think of would be that if you're copying my code directly, I'm using camel case, not snake case, to define and access the variables in the resource. IE, "cardData", not "card_data". Also, you may have forgotten to assign the loaded resource to the local variable data prior to attempting to access it. Finally, note that I'm using get_node directly within the setter; if you're using the dollar sign notation (eg. $node_name assigned with the @onready annotation), then yes, it will fail in the setter because the nodes haven't been initialized yet. That setter runs before the node has been added to the tree, so you have to manually access the nodes.
@triplestandart7613
@triplestandart7613 4 месяца назад
@@gamegems7658 Thanks for the elaborate answer. Sadly, none of that was causing the error. I can't tell you exactly what it was, but I think it's just trying to load the @onready vars for name, text and texture before they are assigned. I've added code to wait for them and now it just works: if not cardName: await self.ready
@triplestandart7613
@triplestandart7613 4 месяца назад
@@gamegems7658 Thank you for the elaborate answer. I don't know what it was. Changing the case didn't work. What do you mean by "assign the lodad resource to the local variable prior to attempting to access it"? Currently, I grab the art for example like this: @onready var cardArt: TextureRect = $Front/SubViewport/Card_Template/CardArt I haven't tried manually accessing the node but I might. For now, I just put "await self.ready" in the setter function and that worked. It's probably not the best solution but for now it works.
@gamegems7658
@gamegems7658 4 месяца назад
That's your problem. The setter for the cardData variable runs before _ready()/@onready is called, which means that when the setter attempts to put the relevant data into those nodes, they haven't been assigned yet. Waiting until _ready is... ready is one way to solve the problem, but I think it would be better if you learned the order of operations for node initialization so that this, and other errors like it, don't come up in the future.
@triplestandart7613
@triplestandart7613 4 месяца назад
@@gamegems7658 That's very sensible. Thank you so much, I appreciate the help.
@paintmeteor3834
@paintmeteor3834 5 месяцев назад
One quick suggestion, make the event bus with signals using a custom resource; singletons/autoloads introduce tight coupling and cohesion.
@gamegems7658
@gamegems7658 5 месяцев назад
The odds of that ever actually being an issue in a commercial project is basically zero. Don't over-engineer for the sake of being clever.
@Haavenstadt
@Haavenstadt 5 месяцев назад
What a breath of fresh air this is, compared to Unity's subscene loading... Thank you for taking the time to make this!
@gamegems7658
@gamegems7658 5 месяцев назад
The whole "scenes versus objects" nonsense in Unity is why I prefer Godot's flattened Node structure, TBH.
@beidero
@beidero 5 месяцев назад
I am actually doing this exact thing for a 2d card game, reason being i need to run full card shaders on my cards so I need to turn the entire card into a single texture. As far as I know only possible with viewports. The main worry is performance since I have worked with viewports in 3.x and it did have performance issues. I assume having say 20 of them active at the same time would not work, but since the cards are somewhat static you could just render it once and store the result as an image. Then just refresh whenever something on the card changes. One downside here is that you can no longer have shaders just on the card art which is within the viewport, but was thinking it might be possible to get around that with a SDF in the shader that defines the area of the art and only letting your shader run on that area. Either way, would be very interested in hearing if you did any performance research on this and had any results?
@gamegems7658
@gamegems7658 5 месяцев назад
That's about right, once I hit around twenty viewports onscreen my framerate took a nosedive. As you noted, the trick is to render the viewport to a texture and use that image as the card instead. Some mild tradeoffs, but usually necessary.
@TheRokyando
@TheRokyando 5 месяцев назад
Thanks you, this is really cool! I'm a beginner so this was really helpful, but I have a question: is there a way to make it so that certain options are only available under certain circumstances? Say if you're making a text adventure and you want to make it so you can only choose the "use torch" choice if you picked up the torch many storynodes prior, for example. Or, since you mentioned a visual novel, having small sections of text in a storynode print out or not based on external variables such as affection points with the character, without having to make completely separate storynodes that share 99% of the text. I'm new to Godot and coding in general so apologies if these are stupid questions. Cheers, loving all your tutorials!
@gamegems7658
@gamegems7658 5 месяцев назад
Yes, these things are all possible, I've done most of them in my expanded engine. I'll be doing a deep dive on it once I post the two videos on dungeon generation that I've got in the queue, stay tuned!
@TheRokyando
@TheRokyando 5 месяцев назад
@@gamegems7658 Thank you very much for the response! I'll wait patiently.
@danielrandall1548
@danielrandall1548 5 месяцев назад
Very interesting. I think there would be wider usage of there were more "real world" examples
@gamegems7658
@gamegems7658 5 месяцев назад
You're right, I'll do a followup video exploring some actual usages in the near future.
@danielrandall1548
@danielrandall1548 5 месяцев назад
@@gamegems7658 I really like the idea for settings you have one int for a whole group of settings on / off
@drdeus-u8s
@drdeus-u8s 4 дня назад
one real use case off the top of my head is used by the Godot engine itself for collision and visibility layers, the layers you set are stored as bit flags and you need to do bitwise operations to check specific layers in code
@Dark_Kevlarian
@Dark_Kevlarian 5 месяцев назад
Thank you so much for this, take my sub!