Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Nikujaga

#1
Thank you for your replies.

AnimationDelay = 0 makes the animation run much faster, I guess the animation sprite is updated at the engine framerate ?


The more I think about all this the more I end un believing that the whole thing relies in the "MovementLinekdToAnimation" parameter. Setting it on TRUE is logically the ONLY way to make movement happen on a discrete basis, not continuous.
How does this parameter work ? I mean how is it coded ?
#2
Ok so if I understand well, in AGS, the Character "MovementSpeed" property sets by how many pixels the character should move (this amount of pixels needs to be specific to the sprite itself in order to avoid a glidin effect), and when "MovementLinkedToAnimation" == True this movement is not indexed on real time directly nor on frames but on changes of sprites ( "each time the loop's sprite changes, advance X pixels"), which means it is indexed on "AnimationDelay".

AnimationDelay counts frames, am I right ? But then how can I check how many frames per second AGS processes ?

I'd tend to say there are ways to have control over position in pixel with Godot  ; but as a complete beginner my problem is about knowing how to do it  :grin:

So far I have found 3+1 properties that impact character movement in Godot :

  • Speed : which is used in order to set by how many pixels the object moves per frame
  • Animation Speed (FPS) : which sets how many sprites are played per second
  • Speed Scale : which multiplies Animation Speed

The 4th parameter is line 13 of my code ("direction" is a vector of lenght 1) :

Code: Godot
# How much distance can the player cover in one frame
	var distance_per_frame = speed * delta
	
	# This loop moves the player along the path until he has run out of movement
			# or the path ends
	while distance_per_frame > 0 and path.size() > 0:
		var distance_to_next_point = position.distance_to(path[0])
		if distance_per_frame <= distance_to_next_point:
			# If the player cannot cover distance_to_next_point distance in
					# one frame then its position is incremented by 
					# distance_per_frame in the path direction
			direction = position.direction_to(path[0])
			position += direction * distance_per_frame
		else:
			# The player gets to the next point
			position = path[0]
			path.remove(0)
		# Update the distance to walk
		distance_per_frame -= distance_to_next_point
		if path.empty() == true:
			direction = Vector2.ZERO


I tried the following :

  • Godot.Speed = AGS.MovementSpeed = 4
  • Godot.AnimationSpeed = AGS.AnimationDelay = 4
  • Godot.SpeedScale = 1

But it doesn't work, and I think it is because Godot.AnimationSpeed calculates how many sprites should be played per second, whereas AGS.AnimationDelay counts how many frames should a sprite last before changing.
So obviously these two can't be equal... I am very bad at math, do you have an idea of how these two parameters could be related ?
[/list]
#3
Quite have the opposite question here  :grin: trying to understand how to mimic AGS character walk in Godot in order to make it less smooth.

I am new to game development / programming and am trying out both AGS and Godot. I would like to know how character walk works exactly in AGS:

Quote-Walk (only for Characters): this normally links movement to an animation (the walkcycle). The animation will only play while the character is walking, and the character will (usually) only move when the animation frame changes. The character will automatically switch animation to face in the right direction. The path is normally constrained by walkable areas. The speed is usually constant throughout the movement, (but normally affected by scaling).

Is it possible how exactly are movement and animation linked ? I mean if movement happens everytime the sprite changes, by how many pixels is it put forward ?

I am trying to replicate AGS's Tumbleweed template with Godot and so far my character looks like sliding on the floor with Godot (see here ; don't mind about the lagging, capture software is responsible of it; more generally look at any video of Pizza Boy and Dog Mendonça and you will see characters definitely look like sliding on the floor).
I think this is because the function I am using (Navigation2D.get_simple_path() for those of you who know about Godot) implies a continuous translation of the object Character. So the opposite of how I understand AGS works.
SMF spam blocked by CleanTalk