Adding VFX to my first game

Godot Version

4.4

Question

First of all, the game is 2D, visual addons should enhance the looks and maybe give it some depth and realism. That’s my goal.
I am at the point where the base game is working, I know how to make a UI but the textures are just awful. I want to make my game prettier!

I searched a bit but I really struggled implementing a lot of stuff to my game because it differs from the usual case.

My issue number 1: Parallax “scrolling” background

In my game, player isn’t moving, camera isn’t moving. Objects are the ones “approaching” to the subject and entering the viewport continuously at a faster and faster pace. Kinda like Google Dino or Geometry Dash. I want to add a background image (or multiple of them composing a multi layer background) that would scroll along automatically and gradually speed up along with the objects.

In the youtube tutorials I’ve already looked at, the tutor is always dealing with a movable character, camera that’s following him and parallax background being applied to the player/camera.

I also checked the documentation but continuous social media doomscroll caused an ADHD-like effect on me so 80% of the docs become extremely boring after 5 minutes of reading or aren’t well visually represented so I can’t follow them.

The 2nd paragraph could be considered a joke but I will say that documentation lacks visuals. Where it does have visuals, it’s mostly screenshots of how assets would look like but not actual node structure and inspector tabs, they’re replaced with code (which maybe isn’t a bad thing, but it’s very intimidating to a newbie who came to look for help and found even more meaningless code).

Issue number 2 is adding shaders.

I want to add glow to my objects (just imagine a light saber) but would also probably add some shadows and graffitis to my background brick wall for example.

I tried adding WorldEnvironment Node to my objects to give them glow but I found it hard to control (half of the settings applied don’t seem to make any realtime difference). I did follow a youtube tutorial for this one and even after doing everything right I ended up with a completely unwanted results.

Shadows and graffitis are a problem on their own and I haven’t even dove into their specifics yet.

Can anyone give me a thoughtful, visual if possible, tutorial on these? Maybe even guide me to some valuable resources that aren’t outdated (most of youtube) or complicated to understand (docs).

Last words
If you’re willing to help me, I will gladly give feedback on your input or any other information about the game and textures/features I am trying to implement. Thank you for your time!

For this one, the Parallax2D node has autoscroll settings in the ‘repeat’ tab in the node inspector. Set these values and your parallax background will scroll without cameras or camera movement.

If you want to modify it then don’t use autoscroll directly in code as this can cause a jerky behaviour as it is not supposed to be dynamic. Instead, you can manually control the scroll offset like this:

EDIT: This is fixed in 4.4 with thanks to @markdibarry for mentioning it below

extends Node2D

@onready var my_parallax_node = $Parallax2D

var scroll_speed: Vector2 = Vector2(100, 0)
var scroll_acceleration: Vector2 = Vector2(50, 0)

func _process(delta: float) -> void:
	scroll_speed += scroll_acceleration * delta
	my_parallax_node.scroll_offset += scroll_speed * delta

Which I have tested and as long as your repeat sizes have been set, works perfectly smoothly.

Hope that helps with issue 1 at least.

1 Like

@pauldrewett just FYI, the jerky behavior was fixed early on in 4.3, they just haven’t released a 4.3.1, so you can modify it all you like now in 4.4.

1 Like

@markdibarry
Thank you. That is very interesting. I am still using 4.3 and when I was testing the parallax for the answer above I started by adjusting the autoscroll and it went very jerky indeed. That is why I mentioned it in my answer and changed my answer to adjust the scroll offset which worked fine. I don’t actually do this myself in my current game as the camera is used to control the paralax, but was just trying to help as I had seen the autoscroll settings and wanted to try them out anyway.

I have not upgraded yet as I thought I would leave it a week or so to see what issues or bugs may arise before I encountered them myself. (I know that is not exactly the open source way, sorry).

But this has convinced me I should so I will do it at the weekend. Thanks for the push and also, thanks for pointing that out - much appreciated.

Imma pull the trigger I have no idea how to make good lighting…

The idea is that it should glow in the dark like a lightsaber pole and light up background and player without the foreground.

I can post one screenshot per post, shame…

I also decided to tile my background (I have some brick assets but they’re all too small images so tiling is the only way) but have no idea how to do it :sob:

Don’t get me wrong, I tried already but it didn’t work (tile editor automatically selected all of the pixels in the photo instead of seperate objects like it did in the tutorials I saw).