Тёмный

Fast GRASS Tutorial -- GameMaker Studio 2 (Vertex Buffers for Beginners) 

GameMakerStation - Matharoo
Подписаться 11 тыс.
Просмотров 31 тыс.
50% 1

Make grass that is fast AND looks beautiful! We're gonna use Vertex Buffers for the grass, which results in an effect that is easily modifiable via shaders, and super performant.
📃 Download project: matharoo.net/pr...
🌿 Depth-Grass Asset: marketplace.yo...
🤝 Join our Discord for free help: / discord
🐤 Follow me on Twitter to stay updated: / itsmatharoo

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 103   
@GameMakerStation
@GameMakerStation 4 года назад
If you wanted to Google a "How to..." question related to GameMaker/GML, what would it be?
@saidnep_5433
@saidnep_5433 4 года назад
How to make a looping world. Where you walk in one direction and after a while you walk back to your starting point, like in starbound
@lozaramon1126
@lozaramon1126 4 года назад
Inventory sistem with puckup objects and drop
@wilwiewam9109
@wilwiewam9109 4 года назад
How to make a top down boss fight.
@nasser_404
@nasser_404 4 года назад
How to make a pause system in gms2
@p3hwn1e
@p3hwn1e 4 года назад
randomly generated worlds using chunks.
@p3hwn1e
@p3hwn1e 4 года назад
This channel is a godsend for dense people like myself.
@gentoogames
@gentoogames 4 года назад
Great Video! Just wanted to point out that you never disable ztestenable nor alphatestenable, so if you end up doing any other gpu operations in the same room as the grass, those operations will most likely be messed up. To anyone reading this, i moved the set ztest and set alphatest to true in the draw event, before submitting the vertex buffer, and then set it to false immediately after submitting the vertex buffer. And then any objects that need to interact with the grass should enable ztest and alpha test whenever they move through the grass, and then set it to false again when youre done using it.
@un-genius9753
@un-genius9753 4 года назад
Thanks for pointing that out. I was totally having trouble with the depth sorting and all that. After messing around with ztest and alphatest I was able to fix it.
@xotmatrix
@xotmatrix 4 года назад
Very well done. Vertex buffers seem to intimidate people but this is clearly explained with great illustrations and editing. This should help a lot of people get started.
@johnjackson3885
@johnjackson3885 4 года назад
I really like the tutorials you make. These are great. Thanks for making them. So many of your videos were made just for people like me with intermediate skills.
@LachlanKearney
@LachlanKearney 4 года назад
How has it taken me this long to find this account. Amazing content man
@sebastiancantor5683
@sebastiancantor5683 Год назад
that's incredible, so functional and fast
@survival_man7746
@survival_man7746 8 месяцев назад
Amazing to see such knowledge and learn from it
@WilliamGarrisonArts
@WilliamGarrisonArts 4 года назад
is there any way to animate this grass when passing through it?
@NeverduskX
@NeverduskX 7 месяцев назад
Since this works with the old depth = -y trick, I wonder how this would work with Layers. I tend to avoid depth nowadays since layers just make everything neater, but I'd still like to figure out how to sort vertex buffer-based grass with other instances like the player.
@TanukiGaming
@TanukiGaming 4 года назад
really well done tutorial my dood! outstanding work!
@ikonhero
@ikonhero 3 года назад
Awesome tutorial man!
@rrrrrjjjjj
@rrrrrjjjjj 4 года назад
Matharoo hitting us with great tutorials as per
@GrrrVahrrr
@GrrrVahrrr 4 года назад
Great explanation! Thank you!
@lilbigman5880
@lilbigman5880 4 года назад
This channel is a goldmine.
@pingunootus2629
@pingunootus2629 Год назад
i took a look at the depth grass asset and works beautifully and then i saw the scrapped player collision code. i really wished that was a thing
@mrlauro9150
@mrlauro9150 4 дня назад
Ty this was great
@PixelatedPope
@PixelatedPope 16 дней назад
FYI, math, the link to the project is broken
@makeitsogames
@makeitsogames Год назад
Hey Mr. Matharoo, hope you're well. If you don't mind me asking... what do you use to screen record? I use the built in QuickTime on my MacBook, but for some reason the quality of the GameMaker IDE (specifically the code editor) is poor. Not sure why, but the color of the code looks dull with low anti-alias. I'm making a tutorial and want the code to look crisp like it does when I'm working in the IDE.
@Rain_Vision
@Rain_Vision Год назад
Hi i've copied the code and done as directed , but i seem to get a error when i run my game '" it says vertex builder must use vertex_begin() before writing to buffer at gml_object_Obj_GrassArea_create_0 "i have no idea what this means ? i double checked and i coped the code the same and included vertex_format_begin(); i didnt skip it , could it be that code from another object is interrupting this ? Or could it be that i am filling my room with the grass area? i am unsure of what to do.
@aternixgame
@aternixgame 4 года назад
I'm using a camera using camera_create() and every time I use it the grass is drawn only in a horizontal line and doesnt fill the screen. I can't see any view_xview or yview settings so I'm not sure how to go about fixing this?
@highjindev1155
@highjindev1155 3 года назад
Pls make “3d fps game making” video...ur lecture is easy to understand.
@BunnyChannel918
@BunnyChannel918 Год назад
How can you sort depth properly for other objects to be fully on top or behind?
@yurtonturtlegames188
@yurtonturtlegames188 Год назад
How do you make the grass draw below a tileset? please and thank you.
@omniferousswan593
@omniferousswan593 4 года назад
So you can only use this to make grass at 90 degree angles? If i rotate the grass area object in the room, the grass wont render at a 45 degree angle.
@saidnep_5433
@saidnep_5433 4 года назад
hey, quick question, do you by any chance know if there is a way to enable borderless window with code instaid of going to settings?
@GameMakerStation
@GameMakerStation 4 года назад
Hey! I'm not aware of any way to do that, but I'm sure you'll get a good answer if you post to the forums (forum.yoyogames.com/index.php).
@anixias
@anixias 4 года назад
I know this is late but check out yellowafterlife's borderless toggle DLL.
@kn-ki4637
@kn-ki4637 7 месяцев назад
Thank you
@mrorange159
@mrorange159 Год назад
fantastic as usual :)
@badwrong
@badwrong 3 года назад
Looks good, but I'm curious why you don't use a triangle strip?
@GameMakerStation
@GameMakerStation 3 года назад
Because the grass blades are not connected to each other. A strip creates a continuous sequence of connected points to form a series of triangles, so it's not what we need here.
@badwrong
@badwrong 3 года назад
@@GameMakerStation ah lol. I sorta realized that afterwards.
@Spliffurt
@Spliffurt Год назад
It's interesting how your game doesn't come to a halt in 30 minutes; I've had a rough time dealing with buffers in gms2 - I've spent countless hours checking for memory leaks, cleaned up the code entirely several times and still had issues beyond chunking out literally any line of code that could be an issue. Have you or anyone else had trouble with this? I feel like it may be a Windows thing; I've had similar issues when using GM8.1 years back; using buffers or not aside, any game I ran compiled by 8.1 slowly turned into 3 fps for legit no reason.
@lannpi
@lannpi 5 месяцев назад
Se colocar um Beat de fundo e aumentar a velocidade do vídeo em 3x da um rap bem top
@tiagomateus8034
@tiagomateus8034 Год назад
eu escrevi o código todo certo mas quando vou iniciar o jogo não acontece nada o que pode ser?
@mayathemaster
@mayathemaster 4 года назад
Absolutely awesome
@samcook6250
@samcook6250 4 года назад
Helpful as always! :D
@DisappointingRooster
@DisappointingRooster 3 года назад
Hi, I bought your asset, it works great and was easy to tweak! Except for one bug that only happens sometimes where the grass uses other object's sprites instead of the grass sprites.
@MaxSkaw
@MaxSkaw 4 года назад
Very helpful video. I only have one question: How can I adjust this system to fit my pixel grid/base resolution? Currently the grass is drawn everywhere, even on sub-pixels (which doesn't look good), is there a way to avoid that?
@GameMakerStation
@GameMakerStation 4 года назад
Are your sprites scaled up? Then you could try scaling up the grass as well. If not, you might want to set a specific application surface size, using "surface_resize(application_surface, w, h)".
@prowokator
@prowokator 3 года назад
Hey, I have question about the asset again: Do you know if there is a "easy" way to mask out some of the grass with paths/tiles/some other way of masking? What kind of approach would you take to have more manual way to affect large patch of grass? What I'm looking for is a way to mask out some of the grass with a road/path that goes through it. I know I could just use shapes or squares to draw around the road, but it would be more efficient if I could have a large area of grass, and then draw a road on top of it (with tiles, path or a sprite) that would "delete" the grass that lies beneath it. Do you think this would be doable?
@GameMakerStation
@GameMakerStation 3 года назад
You can't delete grass from a vertex buffer once it's created, so you should create the road first and then use that to control where grass can spawn and where it can't.
@prowokator
@prowokator 3 года назад
@@GameMakerStation Hey again! I sort of got it working now, but there is one problem. Here is a link to a video I made that explains what is going on: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-J8RnphHrg2c.html When loading the room with grass in it, gamemaker gives an error about vertices, but it doesn't crash the game. Basically I'm blocking grass from being created on top of a tileset that lies under it, but so far I haven't been able to get rid of that error message :/ Any chance you have tips how to solve it?
@prowokator
@prowokator 3 года назад
Hah.. I got it working now.. I had to rearrange the code slightly to "interrupt" the repeat block before some vars are being set. Thanks for the help! :D I learned a lot from buthering your code! Working with shaders and vertices is something I have very little experience with.. I'm actually a senior 3D modeler in a game studio, so the concepts I'm familiar with but we have technical artists to do the actual work :D
@GameMakerStation
@GameMakerStation 3 года назад
@@prowokator Hey, can you join the Discord server linked in the desc. and ask there? I'm not able to help much through RU-vid comments.
@Svensky
@Svensky 4 года назад
its awesomeee you are very good thank you
@DanielBurkeMakesGames
@DanielBurkeMakesGames 2 года назад
Hi Matharoo. Thanks a lot for this. I purchased the asset as well because I want wind to move the grass, but it seems the asset is a bit older than the code in this video. I like how the code in the video lets you draw out the object in the room view. Very useful for large complex spaces where I will have a lot of grass growing around the place. I've tried to incorporate the movement code from the asset, but it simply wont draw. ;-( Any ideas?
@DanielBurkeMakesGames
@DanielBurkeMakesGames 2 года назад
Not to worry, I figured it out by starting fresh and looking more carefully. Thanks for sharing this!
@prowokator
@prowokator 3 года назад
I noticed that the asset you have at the marketplace doesn't seem to work with multiple subimages in the sprite. It always chooses one. If I add randomize(); to the code I can see it chooses different one, but all the grass will use the one same subimage.
@prowokator
@prowokator 3 года назад
Unless that is the way it is supposed to work.. I was expecting all subimages get used for one instance of vertexgrass, not one subimage be chosen for one instance of vertexgrass. If this is the case the random is rather pointless. Am I misunderstanding something or is the asset actually not functioning correctly?
@prowokator
@prowokator 3 года назад
I got it working. I had the sprite set to be on separate texture page and that seems to have caused the issue.
@prevnn
@prevnn 3 года назад
Is there a tutorial before this showing how you made your character/movement and the level itself?
@GameMakerStation
@GameMakerStation 3 года назад
It's in my Udemy courses: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aUq4xBsruHI.html Here are some free parts: ru-vid.com/group/PLUEcBPiXnlBwNjhLWzJAQJ78deyXRIIZl
@david32133
@david32133 4 года назад
Would it be possible to use the depth with GMS2 if you use a different means of depth sorting, I use mirthcastles layer depth sorting system, and i've tried numerous ideas to no avail as far as setting the grasses "depth" to the what the appropriate layers depth would be etc, No luck thus far. I did buy your asset though to mess around with your shader for animating the grass, great work! thanks!
@GameMakerStation
@GameMakerStation 4 года назад
Hey! You can't use GM's depth system with your own. When you sort your instances manually using a grid and draw them in a single event, it's all rendered at a specific depth level - so in the 3D world, it's completely flat. That's why you can't use the vertex buffer trick to create grass.
@hoseinbardestani1096
@hoseinbardestani1096 4 года назад
hello, i have a question " I cannot find any gpu_set_ztest_enable code for gms1 " how can i give write this code without this function in gms1.
@GameMakerStation
@GameMakerStation 4 года назад
I'm not sure. I suggest posting on the forums forum.yoyogames.com/index.php
@brandoncrampton7511
@brandoncrampton7511 3 года назад
did you have any luck?
@tejaswithme3713
@tejaswithme3713 Год назад
Wait!!! Are you Indian... So good to see an Indian out in random game dev video...!
@GameMakerStation
@GameMakerStation Год назад
Yup! I'm from Delhi and I actually work at GameMaker now. You can find my recent work on the GameMaker channel. :)
@tejaswithme3713
@tejaswithme3713 Год назад
@@GameMakerStation wooh... That's nice.
@tejaswithme3713
@tejaswithme3713 Год назад
@@GameMakerStation You work IN Gamemaker or WITH Gamemaker?
@GameMakerStation
@GameMakerStation Год назад
In. I’m the Lead Tech Writer in charge of the GM manual and beginner tutorials.
@tejaswithme3713
@tejaswithme3713 Год назад
@@GameMakerStation OMG... So inspiring to see an Indian in GDev world... If in near future if I make a podcast, I'll like to have you their... Thank for replying Sir...
@marcooola
@marcooola 2 года назад
The link for download does not work. I click it, and nothing happens... A new tab opens actually, but no file is downloaded.
@thomasrebicki8834
@thomasrebicki8834 2 года назад
fodas?
@marcooola
@marcooola 2 года назад
@@thomasrebicki8834 affs
@olavman88
@olavman88 4 года назад
when i try to add a shader, then the gpu_set_alphatestenable(true); doesnt seem to work anymore. How can i fix that? Amazing tutorial btw :)
@GameMakerStation
@GameMakerStation 4 года назад
Try doing basic alpha testing in the shader itself. So you could do this at the end of the main() function: if (gl_FragColor.a
@olavman88
@olavman88 4 года назад
@@GameMakerStation it worked! thanks :D
@j0shua50
@j0shua50 4 года назад
Is there anyway "chopping" the grass once it's been drawn?
@GameMakerStation
@GameMakerStation 4 года назад
Sadly, no. 😕 It's a static vertex buffer.
@MaxSkaw
@MaxSkaw 4 года назад
@@GameMakerStation But couldn't you use a shader to not draw the grass that is chopped?
@reksie7816
@reksie7816 4 года назад
This is cool, but why not just spam assets on the map? They're just sprites right?
@GameMakerStation
@GameMakerStation 4 года назад
There won't be any depth then.
@dimusikus
@dimusikus 2 года назад
про EndStep и -bbox_bottom не совсем понятно. А так всё рассказано очень доходчиво.
@svenjorgensen5
@svenjorgensen5 4 года назад
This is great but now all of my "draw end" events draw underneath this now for some reason.
@GameMakerStation
@GameMakerStation 4 года назад
Try disabling ztesting and alphatesting for that event.
@user-sc4od9zx1q
@user-sc4od9zx1q 3 года назад
Thank you! Привет из России
@ariessuggs3819
@ariessuggs3819 Год назад
I know this is an older vid but this leaves an empty box around my player when he walks into the grass lololol oof
@justcore
@justcore 4 года назад
code pls
@ArtsieFrog
@ArtsieFrog 2 года назад
Your a smart person. But god dang dude!! You talk like Mr Makey from South park
@hipxel
@hipxel 2 года назад
this guy sounds 20% english and 80% japanese lol
Далее
RPG Textbox in GameMaker Studio 2 | Tutorial
9:17
Просмотров 29 тыс.
Shadows Tutorial: Game Maker Studio 2
28:34
Просмотров 36 тыс.
Какой звук фальшивый?
00:32
Просмотров 184 тыс.
Passing Vars Between GameMaker Objects (3 Strategies)
17:20
Why This Video Took 8 Months
12:53
Просмотров 541 тыс.
5 Useful Scripts for GameMaker Studio 2 (and 1!)
9:34
Tierlisting the BEST (and worst) GAME ENGINES
33:51
Просмотров 222 тыс.
Introduction to Buffers - GameMaker Tutorial
21:18
Просмотров 4,8 тыс.
I Spent 2,000 Hours Using Scratch
13:59
Просмотров 589 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4,1 млн
How do non-euclidean games work? | Bitwise
14:19
Просмотров 2,4 млн