Game Dev Secrets: Camera Smoothing! #indiegamedev #gamedev

preview_player
Показать описание

(obviously the Ushroot just represents an arbitrary "follow point" that the camera tracks against. also Godot has camera smoothing built-in, so you can use that for most stuff, it's more of a general explanation of smoothing. also the ushroot is lerping towards Isadora, but I'm sure you already figured that one out lmao)

The game that I'm developing as an indie game dev is called Isadora's Edge! A 2D Pixel Art platformer game, that I'm developing in the Godot Game Engine! If you're new to Godot or have any questions about Godot or game dev in general, feel free to ask me! #indiegame #gamedesign #godot #godotengine #gaming #gamedevelopment #pixelart #gameengine
Рекомендации по теме
Комментарии
Автор

Add the friendly ushroom as an actual character in the game

yadfud
Автор

Instead of having the camera following behind the character, having the camera ahead can help the player make faster decisions. This is VERY important for platforming.

taoboyce
Автор

I've got something for you : Exponential smoothing. Instead of making the shroom guy's speed a constant, make it proportional to the distance between it and the player, clipped at some small speed so it actually converges. This removes pretty much every problem you mentioned, and makes the camera movement feel natural : The more it lags behind, the faster it should be.

The article "My favourite animation trick: exponential smoothing" by Lisyarus is absolutely great if you want to know more.

givrally
Автор

If Friendly Ushroom doesn’t end up in the game as an NPC we riot

Tempo_The_Cat
Автор

This solution is simple but not perfect. It makes the camera lag behind the player too much especially in faster games which makes it harder to see ahead. A better solution imo is:
1. having a deadzone. basically the camera doesn’t follow the player until they leave the dead zone, and when they do the camera moves to an offset that allows the player to see farther ahead. (Check Super Mario World’s camera for example).
2. The camera should also change its elevation if the player lands on a different height of elevation. I’d recommend using a ease-in and ease-out function for camera movement as it moves from one offset to the next.

With this setup, the camera doesn’t jitter or make sudden moments while always panning a bit ahead of the player instead of a bit behind them, which allows the player more useful screen space.

bscotch_pie
Автор

Godot has a camera2D property for this now. It's called position smoothing

Mrsneaki
Автор

As someone who gets motion sick quite easily, I am eternally grateful to Devs who let you toggle camera smoothing off. XD

Siegmernes
Автор

A good way to do the speed is to have there be more speed to the camera, the further away it is. So if for whatever reason the player gets unintentionally flying, it still looks good

modlich_
Автор

Tbh, as a player, i hate camera smoothing. I need to know what ahead of me NOW, not 3 sec after i moved.

garguleumbra
Автор

THE CUTE LITTLE USHROOM BETTER BE A CHARACTER IN THE GAME!!!!

endnes.m
Автор

It's crazy that I was just about to code something this an hour ago, and how this short popped up lol

FrostyFeet
Автор

So sad to make him invisible his bow was so cute !

romaindurand
Автор

Unity has a helpful camera system that allows you to do this as well and it's so nice

MythicBeanProductions
Автор

the cute bow 100% neccesary for this to work

robertdemare
Автор

We need Bowshroom as a character in the game.
Maybe an NPC you can talk to or as a hidden from for the player.

IvysChannel-kbsn
Автор

In the godot game engine, there is a box in the camera object that says "position smoothing". This is really useful and its just really easy to use.

OliverChristianDOLMANS
Автор

Creating the asset of the friendly ushroom to then make it invisible sounds like a funny thing to do just to mess with people

AaronL
Автор

We better get the friendly ushroom as an actual NPC in the game

goodnerwusanimations
Автор

Fun fact: all camera development higher than "follow this directly" is pain

itsybutsy
Автор

Alternatively you can make camera follow the laws of acceleration/deceleration. That also fixes the problem of 0->max camera speed changes as to move to some point it needs to accelerate to gain speed.

I've implemented it in a way that there is a target point for the camera and current camera position. Then you can calculate the distance between those 2 points. And then you can also define the curve for the maximum camera speed depending on that distance + have some constant acceleration. Even though I've implemented it for 1D case (one camera parameter) you can easily extend it for 2d or 3d case.

vladyslav
visit shbcf.ru