#Weird camera movement in 2d, flickering maybe? Not sure.

182 messages · Page 1 of 1 (latest)

lost socket
#

Hi, I'm new to godot coming from unity, I'm following a tutorial but I didn't want to go the pixel perfect route and I tried to make my camera smooth and not have neither the camera nor the player/enemies toggled to snap to pixels which I think might be where my problem comes from.

I can't exactly put my finger on what is wrong, but I'm feeling the camera feels weird when I'm moving around, as if things are flickering, maybe sort of bad antialiasing.

I thought it was fps issues at first but I put a counter on the timer at the top and it seems to be holding at 60 just fine... Any ideas on what it could be? Or shouldl I just give up on my smooth camera and snap everything to pixel and hope for the best?

Thanks,
Dan.

naive topaz
#

camera settings - smoothing.
By default the smooth speed is about 5 pixels per second i think. double or triple that
sorry its an long time since i was working on my project. AND
Turn on pixel snap in project settings

lost socket
#

It is 5 indeed, will try your suggestion thank you ^^

naive topaz
#

no problem

lost socket
#

So... it fixed the flickering issue, but now the movement specially when I go diagonally is very jaggedy, not sure what word to use hahahha

naive topaz
lost socket
#

ohhhhh thank you!!

#

I'll test that out later but I'll change it to solved, thank you ^^

naive topaz
#

i am bad at coding but good at research

#

no prob

#

When moving a CharacterBody2D, you should not set its position property directly. Instead, you use the move_and_collide() or move_and_slide() methods. These methods move the body along a given vector and detect collisions.

lost socket
#

Oh yeah the tutorial I'm following has me using move_and_slide

naive topaz
#

👍

lost socket
#
extends CharacterBody2D

@onready var animation_player: AnimatedSprite2D = $AnimatedSprite2D
@export var max_speed: float = 100
@export var acceleration_speed: float = 25

# Called when the node enters the scene tree for the first time.
func _ready():
    animation_player.play("Idle_Down")

var moving_animation: bool
var looking_up: bool

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
    var target_velocity: Vector2 =  get_movement_vector().normalized() * max_speed
    velocity = velocity.lerp(target_velocity,1.0 - exp(-delta * acceleration_speed))
    
    looking_up = true if velocity.y < -0.2 else false
        
    if (velocity.x > 0.1 and not animation_player.flip_h):
        animation_player.flip_h = true
    if (velocity.x < -0.1 and animation_player.flip_h):
        animation_player.flip_h = false
        
    var is_moving: bool = abs(velocity.length_squared()) > 0.05
    if (is_moving):
        moving_animation = true
        animation_player.play("Walk_Up" if looking_up else "Walk_Down")
    elif (moving_animation):
        animation_player.play("Idle_Down")
        
    move_and_slide()

func get_movement_vector():
    var x_movement: float = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
    var y_movement: float = Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
    return Vector2(x_movement,y_movement)
#

Got this at the moment, will implement the solution on the reddit thread

naive topaz
#

do you test out how fast the player is moving in diagonal directions ?

#

and i found an secound solution when you scroll down here he talks about Camera Jitter in Godot http://saint11.org/blog/consistency/

#

thats all i found

#

ah and someone said

Limit the player character to a set of directions, specifically 8, some diagonals will just look chunky if not a perfect diagonal or straight.

Create another vector, when you go to apply input apply it to the accumulator, when the accumulator on either axis is >= 1.0 add the integer to the players velocity or position without the fraction. And then subtract the integer from the accumulator.

On changing directions or stopping set the accumulator to 0. This will ensure the player only moves to exact pixel positions (be wary of diagonal walls that aren’t aligned to a pixel grid)

When wanting to move at a sub pixel speed apply it to the accumulator NOT directly to the player.
lost socket
#

Ohhh that makes sense, I definitely didn’t do that

#

Also didn’t see that, yay ^^ thanks

#

I had to run out of the house for something, excited to try these things later ^^ thanks again, super appreciated. Loving that the community here is super supportive

naive topaz
#

someone make it and showed everyone that was from unity

#

no problem

#

i am not an coder

#

more an problem solver and game designer

#

i am afk now and watch twitch and play holocure

#

when you need something just ask

lost socket
#

I think it's good xD

#

thanks again \o

naive topaz
#

ok when you make an game with masses of enemies it would be an good idea to center the camera on the the player but when the player moves in any direction the camera should be a little ahead of the position of the player so he can see where he is going. and when he stops the camera should center again , so i am afk at work

naive topaz
#

so i am back

#

finally i have weekend

naive topaz
#

by the way when you have FPS problems, just deactivate VSync this can push the FPS by 500% or even more........ i dont know why

#

and that it dont fuck up your fps you can set your own limit Check in project settings -> debug -> settings -> force fps (0 is uncapped, any other number is the max fps)

naive topaz
naive topaz
#

@lost socket

lost socket
#

I got it working perfectly already, this is a more recent gif ^^ thanks though

lost socket
lost socket
naive topaz
#

always aim for 120

naive topaz
#

because when you game gets more complex

#

you can get minim 60

lost socket
#

Yep makes sense ^^

#

I’m pretty excited, gonna try doing a grid inventory today

naive topaz
#

and have you seen what i wrote about camera aim ?

lost socket
#

Kind of a zero siervet one

#

Yeah I have

#

It makes sense

#

Will probably do that later

naive topaz
#

not only it helps player see visually where the small player character is looking it also gives you an better aim at distend enemys

#

do you use godot 4.x or 3.x ?

#

@lost socket

lost socket
#

4.1

naive topaz
#

Hi and welcome to this tutorial series, where I will show you how to make a 2D ARPG in Godot 4.1.

https://youtube.com/playlist?list=PLMQtM2GgbPEVuTgD4Ln17ombTg6EahSLr - How to Make an ARPG in Godot 4 playlist

In this and the next few episodes, we will look at how to create a simple inventory system.
First we create the visuals and look at how ...

▶ Play video
lost socket
#

Ohh perfect!!! That will sure be helpful ^^

#

Thanks ^^

naive topaz
#

problem is there are so much good tutorials in different forms but because there are not so much godot games that are aaa you didnt find godot specific thing in the top 10 of gamedev search

#

do you want an single box inventory where every item uses the same space or an loot-tetris like inventory like in diablo or path of exile ?

lost socket
#

Loot-Tetris like but I already planned how I’m achieving it, the tutorial you linked is perfect, shows me what I need to know about Godot so I can achieve my plan

naive topaz
lost socket
#

I’ve already made the inventory in Unity, I’m going to remake it in Godot essentially the same way, just needed to know how to setup the UI and get the right signals out of it xD

lost socket
naive topaz
#

as i said there are solutions for nearly everything in godot but they are bad archived

lost socket
#

Hahahah makes sense

#

They’re all over the place xD

naive topaz
#

yes what it makes hard for totally new beginners in gamedev field

#

i made never an game only hundred of concepts on the other hand i am good in problem solving so i help gamedevs

#

i know you an person with alot of knowlage of the gamedev field

#

but no one knows everything so i help anyway

#

so dont misunderstand my help efforts that i assume you dont know an specific thing

lost socket
#

I appreciate it ^^

#

No worries, it’s appreciated xD

naive topaz
#

same gamedevs get angry fast and write something like "you think i dont know that ? do you even made something like XYZ before ?"

#

ok

#

some gamedevs are in an buggle where they dont play anymore and miss some new trends and even advances that would help thier game

#

so i think the angry attitude comes a little by this situation

lost socket
#

I think it’s a big ego

naive topaz
#

and this is not an add when you work on an complex project maybe with more people use something like an shared mindmap or trello https://trello.com

naive topaz
lost socket
#

I try my best to be humble and aknowledge there’s a ton I don’t know, I feel I don’t have a big ego 😂

naive topaz
#

dude no problem i mostly work at high logic ......... i cant do what you have done in the last 7 days

lost socket
#

I’ve tried trello and other solutions before, this is the one I love the most ^^

naive topaz
#

i save every pearl from the internet in specific folders in my browser favorites......... so i can use them in the future i guess ?

lost socket
#

My favourites are a big mess 😂 I tried using pocket to organize things a bit better but also became a mess

#

I end up making a little note on my phone with the link when I really want to remember a link, that way I can at least search in notes

naive topaz
#

i always also have over 50 tabs open in installed an side tab tree extention so i see all of them at the left and not on the top

#

this goes nice with an wide screen monitor

lost socket
#

That’s interesting 😮

#

I always have a ton of tabs open, drives my girlfriend crazy for some reason 😂

naive topaz
#

i use firefox since the last 20 years i think

#

extension is called "tree style tab"

lost socket
# naive topaz i use firefox since the last 20 years i think

https://github.com/DanielSnd/godot-gspreadsheet-importer/
Working on my inventory I converted my old google spreadsheets importer I made for unity to use with godot, decided to make it available for free on github to give back to the community ^^

GitHub

Godot Importer for Gooogle Spreadsheets. Contribute to DanielSnd/godot-gspreadsheet-importer development by creating an account on GitHub.

lost socket
naive topaz
#

looking good

#

do you make something like diablo,zelda,binding of isaac or vampire survivor ?

#

@lost socket

lost socket
#

But it started following a vampire survivor course on udemy hahahaha

naive topaz
#

i like project zomboid and zero sievert

#

the whole genere is lacking arcarde gameplay and friendly look

#

i think this can work

lost socket
#

Exactly! ^^

naive topaz
#

so will it have an story or is it mission like where you keep the loot when you survive ?

#

@lost socket

lost socket
#

Good question, at first it's mission like where you keep the loot when you survive.

#

Have to get to a place and stay within an area for X time to be extracted alive.

#

And you go building up a "base" with the stuff you're looting in the dangerous levels.

#

Unlocking stuff as you progress and, unlocking more levels to go to

#

Won't have time to work too much on it for the next couple months though, but I'm excited ^^

naive topaz
#

you need to see the axolotl game an steam i think its an mix of zelda and vampire survivor (not sure) but people have mixed feelings about it becauser rough like players want more vampire survivor and zelda player want mod adventure and less stress.

#

i search for it

#

@lost socket

#

AK-xolotl is the ultimate top-down roguelite shooter starring the most adorable amphibian! You're an axolotl armed with an AK, that embarks on an epic rampage, shooting down anything that stands in your way. Slaughter your way through a variety of biomes and conquer randomly generated rooms, all while collecting delicious food and capturing prec...

Price

$17.09

Recommendations

217

▶ Play video
#

most people find it and water down version of Gungeon

#

soundtrack and visuals are great

#

but most people dont know what the game want to be

lost socket
#

It does look pretty cool will have to check it out ^^

#

On the private Nintendo developers forum got access to a repository with a version of Godot that builds for the switch ^^ pretty excited, I was worried about console porting with Godot

naive topaz
#

godot itsself can be changed

#

the whole engine can be modded

lost socket
#

Yeah that’s nice ^^

naive topaz
#

so an good programmer that can use c# can fix everything an dev team needs or find themself, that the biggest advantage this engine has.

lost socket
#

C# is limited to the mono version, and even so doesn’t work on consoles/mobile/web, very limited

#

To edit the engine and make literally anything you’d need to use C++

#

Which unfortunately I do not know 😂 but I’m now thinking of learning

naive topaz
#

sorry i mean c++

naive topaz
#

@lost socket

#

when you need help with item/skill ideas and the balancing of them just ask

naive topaz
#

i dont have time at the moment to make one of my game concepts reality but i can help with yours.

#

afk

lost socket
#

I’m working on a multiplayer experiment now, making a little node js web sockets server with “rooms” so players can join rooms and play together kind of mimicking the experience of using “Unity Relay” but on Godot.

#

Just slowly building up the things I need to fully transition hahahah

lost socket
naive topaz
#

how much can join an "team" ?

#

i mean 4 player coop strugle because statisticly mopst people only have 2 very close friends

#

@lost socket

lost socket
#

I'm thinking up to 4

naive topaz
#

hmmm i would make 4 optional and 2 minimum

#

so an team of 3 dont get unbalanced

lost socket
#

Nah, singleplayer minimum, up to 4.

naive topaz
#

wait the singleplayer is also the multiplayer setting ?

lost socket
#

Yeah

naive topaz
#

ok i search for an golden rule you dont break when scale the SP to MP

#

i search for it wait

#

ah "never scale HP of enemy's and don't let them heal" "let spawn more enemy's,let them make new moves,let them hit harder and reduce good loot chances"

#

many coop games just make enemys harder to kill and some can self heal but its getting boring real fast.

#

@lost socket

lost socket
#

fair xD

naive topaz
#

Gunfire Reborn Coop was also fucked up because they ignored the rule

#

do you need an financial overview over 90% of the steam games and what kind of game they are ?

#

town there are tabs have fun

#

and yes everyone can make thier own copy

#

@lost socket

lost socket
#

Oh that's cool 😮 thanks

naive topaz
#

no problem

#

as i said i collect things that are helpfull

#

Ember Knights, is one of the best coop rough like out there but it had two flaws that let the wave of new players stop....... the price-contend ratio.
Most players have seen all and mastered it after 10 hours.Nearly all player discribed it as well balanced and really fun but lack of new players(paywall) and lack of new contend(to early released) I hope they get their momentum back with some updates.

lost socket
#

Ember knights looks so good ;o

#

I haven't played it yet

#

Haven't been playing much lately at all actually 😭

naive topaz
#

@lost socket

lost socket
#

That was a really good watch thanks for sharing ^*

naive topaz