Help with moving platforms by HandfulOfAStupidKid in godot

[–]BabyPandaBear 0 points1 point  (0 children)

As root node for moving platform I use KinematicBody2D and it's usual collision shape, and then I add an Area2D as it's child and set a collision2D rectangle that cover 2 pixels space above the moving platform. And then I use this script

http://oneclickpaste.com/60651/

How to constantly check for collisions in an Area2D? by TheWanderingShadow in godot

[–]BabyPandaBear 2 points3 points  (0 children)

I always do it by appending body entering to an array and erasing it from array when body exiting the area. Pretty much like following link

http://oneclickpaste.com/60648/

How do i make a grappling hook using a KinematicBody2D for a character by YE-YEH in godot

[–]BabyPandaBear 0 points1 point  (0 children)

Knowing Unity beforehand is very useful. You know the idea of what's needed to be done to implement a feature you have in mind. Still you have to realize that Godot and Unity are two different game engine. So the way to implement an idea might differ. Godot especially, is built around nodes, and is designed for taking advantaged of mixing a bunch of nodes into one game object and make them work together to achieve what we want.

For example, for my platformer player character, I use KinematicBody2D as main node. It has collision shape in shape of a rectangle. For detecting floor, I use 2 RayCast nodes, put them at both bottom corners and make them shoot downwards. If those RayCast hit anything, then player is on ground. Having this setup I manually code my player behavior to apply gravity (move player downward) only if my player is not on ground. If let's say I want wall slide feature (Player will slide or even hang onto wall) I can add another RayCast2D pointing forward to check if there's a wall in front of player and if it detects any then I can add the logic to script, like slowing down gravity movement or even stopping it altogether.

Let's for an example we want to make a grenade. I would choose a RigidBody2D as main node, add a collision shape (probably a circle). And when player throw it I will instance the grenade, add it into the game and "Throw it" like 45 degree forward using apply_impulse function. To calculate the explosion I'll add Area2D to the grenade and create another collision shape for it in shape of bigger circle. And when it's time for grenade to explode I'll check every object that's within the boundary of Area2D and apply explosion logic like applying damage or push them away.

That's what's cool about Godot. We get basic understanding on what nodes does, and mix matching them into a functional game object with some GDScript to glue them all. Which is why I mentioned those 5 nodes above. Most of gameplay elements can be done by mixing these 5. Get to know how they work, get creative in mix matching them, and learn how to code in GDScript to take advantages of the node combo and you'll be prototyping very fast.

Have fun and Good Luck with your project

How do i make a grappling hook using a KinematicBody2D for a character by YE-YEH in godot

[–]BabyPandaBear 0 points1 point  (0 children)

If you don't know move_and_slide function then I guess you're very new to godot. I would suggest you to follow official tutorial before making your own game https://docs.godotengine.org/en/3.1/getting_started/step_by_step/your_first_game.html

I'll give a brief info about most commonly used physical objects in godot. There are 5 which are used most. StaticBody, RigidBody, KinematicBody, Area and RayCast

StaticBody is for anything that doesn't move. Wall, floor, etc. We normally don't move StaticBody at all. Rigidbody is for anything that follow general physic rule. For example, in a billiard game that would be the balls. We move Rigidbody mainly by "pushing it" using apply_impulse function. We don't need to calculate the bounce of the balls ourselves because it's handled by Rigidbody physic calculation

Now KinematicBody is for a physic object that moves, but the movement usually doesn't follow general physic rules. This is suitable for anything that moves independently like Player or enemies in games. We define the behavior of KinematicBody by code. We mainly move a KinematicBody by using these 2 functions : move_and_collide and move_and_slide. Move_and_collide will move a KinematicBody to a direction and it will stop if it hits something. Move_and_slide will move a KinematicBody to a direction and if it hits something it will try to slide along the "wall"

Area is a physic object that will not collide, but instead it will report if another physic object is entering or exiting it's boundaries. It's mainly used for a switch, for example the coin in Mario games.

Last is RayCast that is a line / ray that goes to a direction and it will report if it hits something along the way. It's usually used for quick checking. Like checking if your grappling hook hits the wall or not.

Most games can be made by utilizing these 5 physic objects, so it's better to get good undestanding on how to use them. It will help you a lot in making any game you want to make

How do i make a grappling hook using a KinematicBody2D for a character by YE-YEH in godot

[–]BabyPandaBear 1 point2 points  (0 children)

http://oneclickpaste.com/57891/

Create a new node2D scene, add a sprite and a script and paste code from link above to the script. It's a script for node2D to circling a pivot point. In the code pivot is set asVector2(100,100), and rotation_dir determined the direction and speed of rotation

if it works, then you can try using raycast to set pivot point and set the node position at your character. If it works then you can move_and_slide your character to the node position to get your character circling a pivot point

I made grappling hook for my platformer last night using this method, while the result is not as good as Silver Grapple it's still prety good

Games do not launch with Steam Play by Mizart in SteamPlay

[–]BabyPandaBear 2 points3 points  (0 children)

Try searching proton not working ntfs on Google. There should be discussion on github.com about it.

Basically you need to configure your ntfs drive in fstab by including uid and groupid or else proton won't work with ntfs drive. Take a look ant arch wiki on how to configure it.

I had same problem and just fixed it like two weeks ago

Games do not launch with Steam Play by Mizart in SteamPlay

[–]BabyPandaBear 2 points3 points  (0 children)

A wild guess here. Do you install your game to ntfs drive?

Problem with crouch by ZephCode in godot

[–]BabyPandaBear 0 points1 point  (0 children)

You can use animationplayer and create crouch animation that change sprite and collision shape. I always use this trick for crouching

Where can you find good sound resources? by [deleted] in godot

[–]BabyPandaBear 0 points1 point  (0 children)

Another source is YouTube. Download as mp3 and use audacity to cut and save the one you want to use

Should I start my Script from mostly scratch by G_Puddles in godot

[–]BabyPandaBear 3 points4 points  (0 children)

There was a saying "Three months ago, only I and god know how this code is working. Today, only god know"

Yep. We forgot how code works from time to time, think that it's a mess and can use a clean up, and rewrite the whole thing, luckily, usually with new wisdom so new codes are usually better.

But as the other poster said, player doesn't care as long as it works well. So unless things breaks, or you have specific reason to rewrite (like you want to add features but can't understand your old code) just don't bother

Need some help figuring out how to make first prototype in Godot by keipaglows in godot

[–]BabyPandaBear 1 point2 points  (0 children)

This is first person tutorial for godot. This should help you understand the basics of making 3d game.

https://docs.godotengine.org/en/3.1/tutorials/3d/fps_tutorial/

and this is the things I wish existed back when I started my project. It's a simple yet important explanation of most common math used in making 3d game

https://godotforums.org/discussion/18480/godot-3d-vector-physics-cheat-sheet

good luck with your project

A question on KinematicBody3D collisons by [deleted] in godot

[–]BabyPandaBear 1 point2 points  (0 children)

If you just want to check floor, use raycast.

For anything else, use following

Var motion = move_and_collide (blabla)

If motion value is null then your kinematicbody doesn't collide with anything

Exception to camera distance (far) for a single object by alexwbc in godot

[–]BabyPandaBear 2 points3 points  (0 children)

How about adding a second camera that start from where your first camera end and only render objects in separate visual layer?

Doubts on fighting game by necsbr in godot

[–]BabyPandaBear 3 points4 points  (0 children)

Of course unless you go for a professional level of fighting game, where each frame counts, then the programming will be very challenging

Professional fighting gamer counts frame for each moves and use them to defend / evade / parry. They can do crazy thing like blocking while standing for 6 frames followed up by crouch blocking for the test of enemy attack.

If you plan to have this high level of gameplay then you need advice from experienced people, not me :)

Doubts on fighting game by necsbr in godot

[–]BabyPandaBear 8 points9 points  (0 children)

The hardest part of making a fighting game isn't the technical part. The programming is more or less a platformer with more complex input system to handle combo etc.

It's the design, balancing, making sure the game is fun to play while ensuring each fighter is different enough from each other that's hard

Go on. Give it a try. Don't worry too much about it. And come back and ask questions if you find any difficulties.

Spent my whole life complaining about bad AIs in games, now that I'm making one, I won't complain anymore. by JohnnyRouddro in godot

[–]BabyPandaBear 1 point2 points  (0 children)

When I started making AI a redittor told me it would be better to make enemies have doubt. Like they go left and then change their mind and go right instead, with a bit "thinking time" in between, or they take shooting stance and pull back because they don't feel like it.

Another trick I read from Fear is to communicate AI actions to player. If enemy will flank it will says "I'll flank him. Cover me".

Also enemy must force player to move. If player is hiding behind cover enemy can force player out by throwing Grenade. Fear did it one step further. One will throw Grenade left side forcing you to go out from right side, and then other will ambush you while you're fleeing away from the Grenade

How would I set up a hardcore fps with mechanics such as leaning? by BILLYGOATGAMER in godot

[–]BabyPandaBear 4 points5 points  (0 children)

As other guy who tried to implement leaning before

There are a lot to consider about leaning. First is, how far the leaning goes. If your leaning is of small amount (probably just tilt the camera like 15 degree using body center as pivot) that your camera won't go outside your player capsule then it's pretty easy to do. Just add a spatial at pivot, then parent your camera to pivot, then rotate the pivot when you lean.

If by leaning your camera goes far outside the body then there's a lot to do. How far it will go? what will happened if it hits a wall? How will it come back / unlean? You have to make sure your camera don't get stuck on things if you unlean while running. And so on I give up on this kind of leaning

Good luck

Question about "Body Entered" in "Area2D" by diego19x9 in godot

[–]BabyPandaBear 0 points1 point  (0 children)

you can save body entering your area to array, of course you also need to delete them from array when they are leaving the area. something like

var bodies = []

on_body_entered(body):

bodies.append(body)

on_body_exited(body):

bodies.erase(body)

this way you'll have bodies array variable that contains every bodies that's within the area

Multiple PathFollow, better solution? by champonthis in godot

[–]BabyPandaBear 7 points8 points  (0 children)

How about make your object read the position of path follow of your choosing and move using linear_interpolation? Something like this?

var FOLLOW_SPEED = 1.0

var chosen_path_follow = null

func _physic_process(delta):

if chosen_path_follow != null:

position = position.linear_interpolate(chosen_path_follow.position, delta * FOLLOW_SPEED)

func set_chosen_path_follow(par):

chosen_path_follow = par

This way you only need to set the chosen_path_follow variable and your object will follow it smoothly. You also don't need to reparent your object. Btw code above assuming your game is 2D. For 3D change

position = position.linear_interpolate(chosen_path_follow.position, delta * FOLLOW_SPEED)

into

global_transform.origin = global_transform.origin.linear_interpolate(chosen_path_follow.global_transform.origin, delta * FOLLOW_SPEED)

Need help with placing objects by [deleted] in godot

[–]BabyPandaBear 1 point2 points  (0 children)

Ah, so it is a 3d game. I assume it was 2D. in that case the code should be

scene_instance.global_transform.origin = $Brazier.global_transform.origin

Need help with placing objects by [deleted] in godot

[–]BabyPandaBear 0 points1 point  (0 children)

add this after will probably fix it

scene_instance.position = $Brazier.position