Пікірлер
@godotlegend757
@godotlegend757 Ай бұрын
Grreat tutorial bue please tet the source !!! Thank you very much !!!
@PollyCot
@PollyCot Ай бұрын
Loved the vid. This is probably a dumb question but how do you get the Audioplayer to play with the basic godot movement script? I tried many variations of the method at 13:40 however it's very janky for me. I'd like to just stream/play it through the code when I use inputs rather than on a skeleton.
@Alexey_Pe
@Alexey_Pe 3 ай бұрын
What I noticed: This does not work with projectiles, with arrows, you will have to create a camera for each arrow. What am I doing: It's pretty simple, I add metadata for CollisionShape3D and check with raycast, but I have simple tile models for dungeons, they are mostly rectangular in themselves, I do not know what to do for a curved landscape, in theory the landscape already has collision polygons, perhaps they can be cut into pieces and this will be the simplest
@elilentiart8025
@elilentiart8025 4 ай бұрын
Your tutorials are excellent, thanks so much for sharing!
@ravenmonroe_
@ravenmonroe_ 8 ай бұрын
Hi, can you please make an updated version of this tutorial or maybe share the source code? I have been looking for swimming tutorials everywhere but I could not find any. :(
@maciejz4765
@maciejz4765 10 ай бұрын
Very cool tutorial man, really helpful stuff :)
@batartpictures
@batartpictures 10 ай бұрын
I need a hero to translate this to Godot 4, because lean collisions are hell
@YiğitDarcan
@YiğitDarcan 11 ай бұрын
The start of the video is fantastic, thank you very much!
@RegenerationOfficial
@RegenerationOfficial Жыл бұрын
you don't know how long I've searched for 13:36. There is a good tutorial for a unity footstep system (Unity Audio: Suntemple), that selects a random sound and checks texture space (UV) for the sound.
@46HertzOfficial
@46HertzOfficial Жыл бұрын
Sooo... since Godot 4 is out, things have changed when it comes to Linear Interpolation. You can't use linear_interpolate() anymore, you have to rely on lerp() for transforming a Vector3. Also I'm struggeling to get the camera rotation to work, since I can't use lerp() there, for some reason. If I comment the rotation part out, the camera still won't even move
@46HertzOfficial
@46HertzOfficial Жыл бұрын
Edit: You can't use camera.rotation_degrees.z you have to use camera.rotation.z Also got the rotation to work but not the sideways movement of the camera
@r2d2meuleu
@r2d2meuleu 11 ай бұрын
I just dit it with this code. Mind you, I'm clearly not an expert, so your mileage may vary. Also, my code is modular so it's just an "ability" you see here. My tree is Character>Head(node3D)> SpringArm3D>Camera3D Finally, by having the SprintArm3D I don't have to implement the raycast to check for wall collision. It's setup to the 2nd mask, and my environment is setup on 1 and 2. (1 to collide with the player) Thanks Garbaj for the idea ! Here is "my" code, from this tutorial. const LEAN_LERP = 5 const RETURN_LEAN_LERP = 11 var camera_base_position : Vector3 @export var Rotation_Angle = 4.0 @export var camera_lean_pos : Vector3 func _ready(): call_deferred("do_setup") func do_setup(): entity = get_parent() camera_base_position = entity.head.position camera_lean_pos += camera_base_position func _process(delta:float): var lean_limit = camera_lean_pos.x var action_strength action_strength = (Input.get_action_strength("right")) - Input.get_action_strength("left") if action_strength and entity.is_on_floor(): print ("leaning") entity.head.transform.origin = entity.head.transform.origin.lerp(Vector3(lean_limit * action_strength, camera_lean_pos.y, camera_lean_pos.z), LEAN_LERP * delta) entity.head.rotation_degrees.z = lerp(entity.head.rotation_degrees.z,(Rotation_Angle * (lean_limit+0.25)* -action_strength),LEAN_LERP * delta) if !action_strength: print ("not leaning") entity.head.transform.origin = entity.head.transform.origin.lerp(camera_base_position, RETURN_LEAN_LERP * delta) entity.head.rotation_degrees.z = lerp(entity.head.rotation_degrees.z,0.0, RETURN_LEAN_LERP * delta)
@skaruts
@skaruts Жыл бұрын
This reminded me of an interview I just watched recently with two of the Thief 1 developers, where they mentioned they used "the snowman" approach to collisions, as they called it. Which means Garret's collisions were two spheres, and the upper sphere did the collisions for the leaning and stuff. I think I'm going to experiment with that. I suppose I'll have to alter the hierarchy of the camera a little bit. :)
@skaruts
@skaruts Жыл бұрын
I suppose you could precompute and cache mesh information at level startup, to make the material lookups quicker and less expensive during gameplay. I'm not sure exactly how, though. I'm only gonna start implementing this later. But it seems to me that it could be done. Thanks for sharing this, it's really helpful. 🍻
@RadJordy
@RadJordy Жыл бұрын
I know this is a bit of an older video buuuuut... Could you go over using raycasts to step up onto small ledges? Like a sidewalk or stairs for example? Otherwise, I'd have to put invisible ramps everywhere and that could end up presenting more issues.
@Arisilde
@Arisilde 11 ай бұрын
kzbin.info/www/bejne/f325hpaVrrtlask
@Ceisriel
@Ceisriel Жыл бұрын
My system works better and it also works with stairs: func _physics_process(delta): #Raycast to detect obstacles in front of the character var ray_length = 2 # Adjust this value based on the desired length of the ray var ray_direction = direction.normalized() # Use the same direction as the character's movement var ray_start = translation + Vector3(0,0.01, 0) # Adjust the starting position of the ray based on your character's position var ray_end = ray_start + ray_direction * ray_length var climb_speed = 1.5 var is_climbing = false var ray_cast = get_world().direct_space_state.intersect_ray(ray_start, ray_end, [self]) if ray_cast: #If the ray hits something, enable vertical movement when pressing the "forward" button if Input.is_action_pressed("forward"): vertical_velocity = Vector3.UP * climb_speed is_climbing = true else: is_climbing = false
@Ceisriel
@Ceisriel Жыл бұрын
@@pdaw101 the variable translation is the position of ray, where it starts from. Full code on my GitHub if you need it.
@Sp1cyP3pp3r
@Sp1cyP3pp3r Жыл бұрын
WTF IS TWEEEN????
@alexlokanin3312
@alexlokanin3312 Жыл бұрын
hey bro this is a really interesting project you're working on, just by the headbob I can tell what it's inspired by. I hope you continue working on it and make your dream come true
@uselessheartinbox1711
@uselessheartinbox1711 Жыл бұрын
alot of games have headbob, real life has headbob, you cant tell what its inspired by
@kirillmenshikov8344
@kirillmenshikov8344 Жыл бұрын
Thanks a lot for the tutorial it was really inforamtive. I tried this and it worked well but becouse the upward movement always stays the same it may feel weird in some cases. For example if the player activates climb just when the raycast starts hitting the ledge it will move him to far up in the air and then the player will fall slightly. Maybe you know a solution for dynamically changing the Vector3 value so it won't move the player further than the object it tries to climb?
@unfa00
@unfa00 Жыл бұрын
Thank you. This is a common problem that I've never seen a passable solution for outside of this one video. I guess the performance can be maintained by ensuring meshes aren't overly dense. I wonder if part of the logic could be offloaded to the GPU using compute shaders in Godot 4...
@skaruts
@skaruts Жыл бұрын
I presume you could precompute and cache mesh information at the level loading phase, to make the mesh lookups quicker and less expensive. There are also some good suggestions for improvement in other comments. Btw, I stumbled on your channel just a few days ago, while watching someone else's video about sound related stuff. Small world! 😃🍻
@chrisxdeboy
@chrisxdeboy Жыл бұрын
What if you used this to precompute a datatree at runtime of the level? You could, say create a BSP, or perhaps a 3D array of arrays of polygons that intersect with various "chunks" of space, like "what polygons are in this X by X by X unit of space?" as a way of optimizing it? Like, it wouldn't help for that heavily subdivided mesh, but it would make checking footsteps for a whole level easier. You could also separate the level geometry into meshes for each footstep material, use them as trimesh colliders, and put them on a different physics layer and have the raycast intersect with that. So there'd be a physics layer with 1 staticbody for each footstep material. EDIT: I implemented such a script, and it works!
@off-griddev6597
@off-griddev6597 Жыл бұрын
Yep! That’s actually exactly what I ended up doing. I make my levels in Blender and assign them specific materials there, then an import script creates trimesh colliders for every surface and names them appropriately; ROCK_SURFACE, WOOD_SURFACE, etc. Works great. Clearly great minds think alike!
@chrisxdeboy
@chrisxdeboy Жыл бұрын
@@off-griddev6597 nice! I made it a node that can run in-editor or at runtime to generate these meshes.
@CaptainMagni
@CaptainMagni Жыл бұрын
Great tutorial man, very few people covering advanced 3D stuff in Godot, love the triage of imsim videos
@off-griddev6597
@off-griddev6597 Жыл бұрын
Thanks! More to come hopefully very soon, had a few roadblocks in terms of time lately but I should hopefully get back into the swing of things this month.
@CarpathianWasteGroup
@CarpathianWasteGroup Жыл бұрын
these visual explanations help A LOT. I just got into game developing just for myself and my gf and these really helping out thanks
@off-griddev6597
@off-griddev6597 Жыл бұрын
That's awesome! Glad I could help!
@mohamedmoh5789
@mohamedmoh5789 Жыл бұрын
yout tutorials are great thank you ver much , i would love if you could make how to walk up stairs tutorial so the player dont slide
@off-griddev6597
@off-griddev6597 Жыл бұрын
Good to know, I might do that. There are a few tutorials online that explain it but it can be a bit fiddly.
@owenlloyd2528
@owenlloyd2528 Жыл бұрын
It was helpful :) Really informative.
@off-griddev6597
@off-griddev6597 Жыл бұрын
Glad I could help!
@crow_ty3892
@crow_ty3892 Жыл бұрын
Hello! I'm trying to follow this tutorial but some of the code is cut off in the swim_process() function. Would it be possible if you could share the code of that function?
@off-griddev6597
@off-griddev6597 Жыл бұрын
Sorry, didn’t notice your comment. I’m going to redo this video soon so if you still need help it’ll be coming.
@apathypeace
@apathypeace 2 жыл бұрын
I dont understand lerp in godot I've rewritten this out so many times thinking I've made a mistake but time and time again the delta is effecting the camera position and the transition isn't smooth at all between leans
@off-griddev6597
@off-griddev6597 2 жыл бұрын
That could be due to a number of factors. What’s your FPS like? Because if it’s low, then lerp can be a bit jerky.
@1Mitch1904
@1Mitch1904 2 жыл бұрын
Hey, I'm looking to make a ship based moba, can you give me any advice on how you would create that water?
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Are you talking about water like Sea of Thieves or Assassin’s Creed? Because if so, I’m not totally sure how that’s done, but I think there are GDC talks and similar videos that you could look into.
@1Mitch1904
@1Mitch1904 2 жыл бұрын
@@off-griddev6597 no like imagine League of legends but your characters are ships and the lanes are water.
@zarthera6063
@zarthera6063 2 жыл бұрын
You're the best man, have my lean implemented for when I move left and right similar to how Dusk does it. Thank you!!
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Awesome! Glad I could help!
@CreatingRiot
@CreatingRiot 2 жыл бұрын
could be possible to do the same with a moving platform, either horizontally or vertically?
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Yes. Though you would have to account for the movement of the platform and make sure the player is tracked to that movement during the climb. Otherwise it’s not going to work for obvious reasons.
@ishi...
@ishi... 2 жыл бұрын
today I learned... there is a fullscreen button on the script editor
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Hahaha! You’re welcome.
@JasonLothamer
@JasonLothamer 2 жыл бұрын
Very nice video on this topic! At first I thought this would not perform well enough, but turns out it performs rather well in many situations I've tested so far. I've incorporated this technique into my first person controller I'm developing and will continue to refine things as I encounter new issues/situations. One thing I noticed from the video is that the vertices of the MeshDataTool are looped through, and then every face attached to those vertices. It seem like this would lead to faces being processed multiple times. So, in my implementation loops through the faces instead. This improved performance by 40% in my tests. Another refinement I added was keeping track of the last face to collide with the ray cast. This is checked first since there's a good chance that the player hasn't moved that much yet. And, failing that check, I actually do check the faces associated with the vertices in that last face as they are next to where the player was last frame. This helps when there are lots of faces in the mesh - but it only helps so much. If the mesh is subdivided to the point where players routinely move to 'distant' faces between frames, then things slow down again. I was thinking about continuing to "spider" out from the last face vertices, but decided that if I run into such a situation in a real game, I'll probably look for a different solution instead. One last thing. I had to switch to checking if a line segment intersected with the faces rather than a ray. In one of my test levels I'm using a CSGCombiner, which results in an ArrayMesh mesh. What was happening is that the floor mesh was being processed first. But since it was under the cubes my character was walking on, my code always detected the base floor's mesh/material and so footsteps never changed sound. Limiting to a line segment fixed this. - This doesn't mean the video code is incorrect of course. I mention it here only in case someone else runs into the same situation and my insight could help them out. So, thanks for making this video! Hopefully you'll find time to make more of them.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
I’m glad it was helpful! And yes, I’m making new videos soon, working on it right now in fact. I actually ended up not using this system in my own project ultimately, because it just wasn’t performant enough for what I needed it to do, since it had to apply to potentially dozens of NPC actors as well. Since I make all of my levels in Blender, I ended up creating a system where I can assign surface materials manually in blender, just base “ROCK,” “TILE,” “GRASS,” placeholders, and then those all get read by an import script when I bring the level into Godot and it generates StaticBodies that can be checked using a simple raycast at the player’s, or actor’s, feet, which has almost no overhead.
@joshkgw9504
@joshkgw9504 2 ай бұрын
@@off-griddev6597 Hey man, hope you're well! Would love to see an update to this if you are able :)
@swizzler
@swizzler 2 жыл бұрын
I think you left a few explanations out. You never fully explain how you set up the water volume, you show that area node, but don't explain it. I see it's on another layer, so I assume you're using some sort of layer collision check, but you never showed that or explained it. It'd be nice to see in a clean project where you're telling us to ignore parts of the code that aren't relevant, but also not pointing out all the code.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Fair point, this was my first video so I admittedly wasn’t all that good at explaining everything, but I figured even an imperfect tutorial can at least give people a starting point.
@chrisxdeboy
@chrisxdeboy 2 жыл бұрын
Another option would to run a test move_and_collide() or two to make sure it's possible to climb that before running the climbing part. That's basically how I implemented auto-stepping, move_and_collide() up by the maximum step value, move_and_slide_with_snap() forward with the normal movement velocity, and finally a move_and_collide() down by the max step value.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Yeah, this is a viable solution. I may update this video at some point, since my climbing is somewhat more advanced with several months of development since this video.
@evangaamer7031
@evangaamer7031 2 жыл бұрын
hey Le move_vec me dit qu'elle est pas déclaré !
@boerbol9422
@boerbol9422 2 жыл бұрын
hi, thanks so much, just getting started with water!
@off-griddev6597
@off-griddev6597 2 жыл бұрын
No problem, glad I could help!
@NON_Navi
@NON_Navi 2 жыл бұрын
I like this approach and the camera weigth based detection someone recomended in the comments, what I did in order to know what sounds to use(not the material detection) was making a Dictionary of all the footsteps sound effects, containing an array of them, as well impact sounds when landing, and make it an autoload script, so I can access the data when I need to using a simple function to return the array of sounds.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Yeah I do something similar for loading all of my footstep sounds as well, since all of my NPCs and stuff have to use the same sound effects when they’re wandering around.
@AdredenGaming
@AdredenGaming 2 жыл бұрын
Ill have to look at what you have for videos. I like that water shader you have there at the end hopefully I can find a video on that. trying to find a much better water shader atm
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Yeah water can be tricky to get right stylistically, in my game I’ve gone through several iterations beyond the one in this video.
@AdredenGaming
@AdredenGaming 2 жыл бұрын
@@off-griddev6597 I have done 2 iterations at this point but there are a number of things I have to figure out more. like the lensing at the surface and better images for the waves.
@Boildroid
@Boildroid 2 жыл бұрын
Man, thank you. Your tutorial pure gold.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
No problem mate.
@TheDarkfire9251
@TheDarkfire9251 2 жыл бұрын
Dude... Disregarding the main purpose of the vid, I thought that you CAN'T get the material of the thing the character collides with. I wish I knew this before creating my own workaround solution
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Yeah have to admit it took me longer than I should have to realize there was a function to do that. Turns out it helps to search the documentation once in a while.
@hexen93
@hexen93 2 жыл бұрын
@@off-griddev6597 Especially of recent! The improvements and fixes in the last 6 months have actually solved problems that I created complicated (and unmaintainable) solutions for 8 - 10 months ago. Definitely teething pains of a developing engine but it has never been a better time to skim the docs and just make sure that solutions to old problems haven't been added!
@unfa00
@unfa00 2 жыл бұрын
@@off-griddev6597 Do you mean the solution you presented in the video, or is there something else?
@wandering_wolf_dev
@wandering_wolf_dev 2 жыл бұрын
Hello, I'm also in the process of making a Thief-like game. I banged my head on the keyboard for the past two weeks and came up with solutions that sorta work, regarding footstep materials, leaning etc. and now I came across your channel lol... Anyway, I wanted to ask what do you think about placing areas beneath player's feet, these areas just hold a value (0, 1, 2...) that raycast detects and then audio gets chosen accordingly? It's a very simple solution, but maybe as game world grows it will become too cumbersome to place areas all around the map? Also from your leaning video I tried the exact same solution with rays, couldn't make it to work so I just placed a spherical collision shape around the camera (which gets displaced during leaning). If the sphere collides, lerp stops and camera translation locks at last position. Surprisingly it works like a charm... Oh, I also wanted to point out that someone already made a thief-like player controller just for godot, it's on github. Controller is based on information that was reverse engineered from original thief games by the modding community. Maybe it can help you with your project.. Subbed and gl with your project :D
@off-griddev6597
@off-griddev6597 2 жыл бұрын
I think I’ve seen that character controller you’re talking about, it’s a good one but my game has more modes of movement than Thief, which necessitated a custom controller I’ve iteratively developed myself. It is a good starting base though. As for your suggestion regarding Areas for this problem. Since this video I’ve implemented a solution similar to what you’re describing. Instead of Areas I make use of StaticBody nodes which are generated via a custom import script when I bring my levels in from blender. It reads a template material using the SurfaceTool node for every surface of every mesh, and then generates StaticBody trimesh colliders for every material surface in the environment. It names each of these with a specific tag based on the template material. Eg; rock, dirt, grass, tile etc. All of these StaticBodies exist on their own “surfaces” physics layer, which a raycast at the player’s feet can detect. The tag of the StaticBody is read, which gets then parsed into the appropriate footstep sound essentially the same way as in this video, just a string match. This approach is the only reasonable way I’ve found to do such a solution. Placing Areas or StaticBodies manually isn’t a maintainable solution long-term. Every time you change a material, you have to change your Areas too, way too much fiddly work. Thanks for the sub and well-wishes. I intend to make a series of videos soon, once I have my demo close to completion. I hope to cover everything from how I build levels, to AI design, the portal occlusion culling system which I’ve found to be essential for optimisation, and more.
@wandering_wolf_dev
@wandering_wolf_dev 2 жыл бұрын
@@off-griddev6597 Yeeeah... I abandoned my surface detection idea in the end, it scales horribly. I resorted to reading albedo texture name data from raycast get_collider() :P
@shrippie-4214
@shrippie-4214 2 жыл бұрын
How the project going bro
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Good, should have a playable demo soon, been busy with it which is why I haven't made a video in a while.
@TheToradoralove
@TheToradoralove 2 жыл бұрын
Τhanks for this tutorial, it has very clear explanation.However, I i have still a problem with my working game and i would like to ask you. I put the two rays as you mention to grab ledges and for better experience i have done my platform collisions one way (the player collides only as moves up to down). When the condition of the 2 rays is true and i pressed G button, he grabs. But if i press the button when jumps up through a platform and through collision it grabs in the middle of the platform and also he slides across the edge of collision.
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Not sure if I understand your issue correctly, but I think what you’re saying is it doesn’t work right when you’re midway through a platform, as in inside it? If that’s the case, then trying to use this method while inside a collider is probably going to have weird behaviour. I’m not sure exactly how your project works, but maybe you could use an Area node to detect if your player is inside a collider like that, and then decide what you want to happen with climbing based on that?
@TheToradoralove
@TheToradoralove 2 жыл бұрын
@@off-griddev6597 Yes,it doesn’t work right when you’re ascending midway through a platform and you press the grab button because he grabs midway the platform. I want the player to grab only at the corners of platform. I put a third ray if it collides not let player to grab, above his head facing up, and is better but not quite fixed. I will try your suggestion to add an area2d. I am relatively new to godot. I am trying to make a nice realistic 2d platformer with story and dialogues and it is quite difficult for a single person. It would be better if i had some help in case someone finds my project interesting. Thanks very much for your answer.
@shrippie-4214
@shrippie-4214 2 жыл бұрын
Thanks bro
@paolocaradonna1570
@paolocaradonna1570 2 жыл бұрын
How can i get the transform of the camera?
@off-griddev6597
@off-griddev6597 2 жыл бұрын
Easiest way is to simply do “camera.transform” or “camera.global_transform”, but I think there’s also a “get_camera_transform” function that you can call on any camera node as well.
@UsaraDark
@UsaraDark 2 жыл бұрын
Would this method work under the context of 2D?
@off-griddev6597
@off-griddev6597 2 жыл бұрын
It would largely depend on how you’re creating your floors in 2D. So for example if your game used a tilemap, you could just get whatever tile is beneath the player with something like the world_to_map() function, and then figure out what the sound should be based on that. Since tile textures are typically predefined, you could just have a list of say TILE_0 = DIRT_SOUND, TILE_1 = GRASS_SOUND and so on. If you were using raw sprites to draw floors, it would probably still be simple provided each sprite only had one ground texture. If you had a sprite with multiple, I’m not so sure it would be applicable. 3D geometry is automatically sectioned into tris, faces, verts and so on, because the renderer needs that information anyway. My understanding of 2D texture drawing in OpenGL is pretty much that it defines a rect, and then draws that rect with a given image texture based on a series of parameters. I’m not sure how you would find the definitions between two textures in a single image, since it’s just a set of pixels to draw. However if it was just one ground texture on one sprite, you could either add an Area2D node to the sprite that tells the game what sound it should be, or you could probably get the coordinates of the sprite and use a function to figure out if the player is standing inside that square, which I think Godot does have a function for somewhere, but not totally sure.
@sablesanctum
@sablesanctum 3 жыл бұрын
These are great man. Keep it up. My dream is to make a Thief clone some day.
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Awesome! That's exactly what I'm trying to do right now, with a bit of Dishonoured sprinkled in. It's harder than it seems at face value but definitely possible for one person.
@sablesanctum
@sablesanctum 3 жыл бұрын
@@off-griddev6597 Good luck on your project. You seem to be on the right track. Let me know if you need any ambient "music" or anything like that. I'd be glad to lend a hand.
@off-griddev6597
@off-griddev6597 3 жыл бұрын
@Animae Wow yeah! I'd absolutely like some help on ambient music/environments. It's something I've been trying to do on my own but it's not my strong point.
@sablesanctum
@sablesanctum 3 жыл бұрын
Hey! Off-grid and game development... My two favorite things combined. Subbed.
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Ha! Thanks, I haven’t really mentioned it yet but it’s literal. My home is powered totally by solar panels!
@tiaoraitbg2347
@tiaoraitbg2347 3 жыл бұрын
Thanks for the video! Makes me wonder though, if it might be worth adding 3 more raycasts to the head that are the exact same but just smaller, sort of to gauge if the player could climb if they went into a crouching position, thanks!
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Yeah, I haven’t yet figured out how I want to handle climbing while crouching, since jumping while crouching has always felt a bit weird to me in games. I know in some games trying to do that just makes you stand up, but I’m not totally happy with that either. Something to think about a bit more.
@AdredenGaming
@AdredenGaming 2 жыл бұрын
Maybe its like a burpee, one could be pretty much prone then jump up as high as they can. But really its more how you want your game to feel eh
@Visleaf
@Visleaf 3 жыл бұрын
11:20 You seem to only care about which material/surface you're on, not which triangle. I suggest making a separate collisionshape for each material/surface, and doing a raycast on those. You can split them whenever; with an import script (EditorScenePostImport), when the level loads, reacting to a load trigger (on a thread), etc. You can put them on a separate layer to make sure the seams won't mess with stability. Finding the particular triangle is useful for barycentric coordinate things, like smoothing normals or mixing dirt and grass sounds.
@off-griddev6597
@off-griddev6597 3 жыл бұрын
That does sound like it would be a good solution. I’m admittedly not familiar with import scripts, but I’ll read up on the subject. You’re right though, the triangle is more a means to an end than what I’m actually looking for. I wrote an addon for blender to automatically generate collision meshes, since I make levels in that. I considered doing the same for each material, but there’s the issue of seams to be considered like you said. If I could generate a seperate layer of meshes for materials while keeping the actual collision meshes contiguous, that’d be ideal. Thanks for commenting!
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Okay yeah I just coded up an import script that chops the mesh into individual surfaces and adds them as StaticBodies on their own layer. Works flawlessly, and obviously performs better regardless of mesh complexity. I'll make an follow-up video on this at some point. Thanks for the great suggestion!
@Visleaf
@Visleaf 3 жыл бұрын
​@@off-griddev6597 Glad I could help! Please also check out this clever approach involving a second camera: kzbin.info/www/bejne/bnjFkqGhqLNqqNE
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Oh wow yeah I took a look, that's a great solution. I'll mention that when I do a follow-up.
@unfa00
@unfa00 2 жыл бұрын
For walking on terrain driven by a splatmap, I guess it could be best to sample the splatmap beneath the player to determine what material types and in what proportions should be made audible?
@cytoscript
@cytoscript 3 жыл бұрын
Hey, can you make a more simple swimming tutorial! The one you have is too hard
@off-griddev6597
@off-griddev6597 3 жыл бұрын
I’m not sure if I could make the way it works simpler, it’s already a pretty minimal system compared to a lot of games. If you can describe what you’re having trouble with, I’ll do my best to help, and maybe make a follow up video if needed.
@cytoscript
@cytoscript 3 жыл бұрын
@@off-griddev6597 if you can explain a system from scratch that'll be great
@itsfatum
@itsfatum 3 жыл бұрын
sound is so much better! :O amazing vid as always <3
@off-griddev6597
@off-griddev6597 3 жыл бұрын
Ha! Glad you noticed. I changed my recording setup quite a bit which eliminated all the fan noise issues. I’m still tweaking but I’m a lot happier with it. Thanks for the kind words!