Aligning Player Movement with Camera

In a game with a static camera (looking down at the level) it is important to align the character movement with the camera. Failing to do so creates a distorted input feeling as the input and the actions of the player character don’t correspond to each other. To achieve a correct movement, the directions have to projected from the screen onto the scene.

Wrong movement along axis of the coordinate system.

Wrong movement along axis of the coordinate system.

Naive implementations of player movement use the axis of the coordinate system as directions. Left and Right correspond to the [1,0,0] direction and Up and Down to the[0,0,1] direction. This implementation is correct and usable as long as the camera is correctly aligned to this axis. If the camera is not aligned the movement directions no longer correspond to the perceived directions of the player (see image above). To correct this we have to extract the directions from the camera.

Corrected movement along projected directions.

Corrected movement along projected directions.

To compute our new directions we unproject three points from camera space to world space. Most framework/engine have built in functions to do this ( godot, opengl, unity ). We have to preform 3 unprojections for the points: (0,0), (1,0) and (0,1). By substracting the result of latter two from the former we obtain two 3D-Vectors that represent our new directions. To receive planar movement direction set the height value (mostly y) to zero and normalize the vectors.


var p0 = cam.project_position(Vector2(0,0))
var pH = cam.project_position(Vector2(10,0))
var pV = cam.project_position(Vector2(0,10))

camH = pH - p0
camV = pV - p0
camH.y = 0
camV.y = 0
camH = camH.normalized()
camV = camV.normalized()

camH is the horizontal movement direction and camV the vertical. Instead of using the axis of the coordinate system ([1,0,0] and [0,0,1]) as movement directions, use camH for left/right movement and camV for up/down movement.

Pasta Arugula Salad

This is my favorite salad. It’s suitable for most occasions and can serve as a main or side dish. It takes around 20 minutes to prepare.

The ingredients (in a copyable fashion):

  • 500 g Pasta
  • 250 g Mini Tomatoes
  • 250 g Mozzarella
  • 125 g Arugula
  • 100 g Green Pesto
  • 2 Tablespoons Honey
  • 2 Tablespoons Mustard
  • 1 Handful Grinded Parmesan Cheese


Cook the pasta as described on the package (al dente). While the pasta is cooking you can cut the mozzarella and the tomatoes. I divide the tomatoes once or twice, depending on their size. The mozzarella is cut into pieces roughly the same size as the tomato pieces.

Add everything to the bowl, except the arugula! It takes a long time mix everything up if you add the arugula directly. Mix the ingredients until everything is coated than add the arugula and mix it again.

Giving Pathfinder Professions More Meaning!

I wanted to add additional mechanics to professions in Pathfinder to give them more meaning. At the moment the only usage of a profession is to earn some money. Occasionally some professions can be used in other ways; for example fixing a cart. These additional mechanics should give players more incentive to pick a profession, instead of spending their points on perception.


Preparing a Lavish Meal:

To prepare a Lavish Meal you need one pound of fresh ingredients per small or normal creature to feed. Additionally you need spices worth at least 1 gp. per person. It takes one hour to prepare the meal. If you want to feed more than 10 people it takes an additional hour per 10 people. You need a fire, or any other sufficient heat source, a pan and a pot.

Everyone eating a full Lavish Meal is healed. The amount of HP recovered depends on the Profession(Cooking) throw of the cook. A normal Lavish Meal heals 2 HP. You can only benefit from a Lavish Meal once per day.

The DC Profession(Cooking) to create a Lavish Meal is 20. For every 5 by which your check result exceeds the DC, the meal heals additional 2 hit points.


Find Weak Spot:

You can analyse wooden objects, e.g. wooden doors, to find their weak spots to break them more easily. If you know the weak spot of an object the Strength DC to break it is lowered by one point. Additionally the objects hardness is lowered by one point.

It takes 1 minute to find a weak spot. You can use the bonus as long as you can see and access the found weak spot. Once you found one, you can describe it to other persons to allow them the same bonus. You have to stand next to the person, when she is breaking or attacking the object.

The DC Profession(Woodcutter) to find a weak spot is 20. For every 5 by which your check result exceeds the DC, the Strength DC to break the object and the hardness are lowered by an additional point.


Splendid Drink

To prepare a Splendid Drink you need herbs worth at least 2 gp. per small or normal person. You can create at most 10 drinks with one Profession(Brewer) throw. It takes 30 minutes to prepare the drink. The drink has to cook for 4 hours before it is usable. You do not have to tend the drink while it is cooked. Splendid Drinks can be filled into flasks, waterskins or similar containers. A Splendid Drink has to be used 1 week after its creation or its effect is lost.

The DC Profession(Brewer) for brewing a Splendid Drink is 20. A Splendid Drink grants a +1 bonus to any skill check for 10 minutes. For every 5 by which your check result exceeds the DC Profession(Brewer), the drink grants an additional +1 bonus on skill checks. Tasks that take longer than 10 minutes, e.g. crafting, do not benefit from Splendid Drink. A Creature can only benefit from a Splendid Drink once per day.


Prepare Letter of Recommendation

It takes 1 hour to create a Letter of Recommendation. You need parchment and ink worth at least 1 gp. and a quiet environment with a suitable surface to write on.

A Letter of Recommendation gives you a +2 bonus to one diplomacy throw against a merchant or an official instance, e.g. a mayor or town guard. The person the Letter of Recommendation is used against will keep it, regardless the result of the diplomacy throw. You can only use one Letter of Recommendation per diplomacy throw.

The DC Profession(Scribe) to create a Letter of Recommendation is 20. For every 5 by which your check result exceeds the DC, the diplomacy bonus granted by the Letter is increased by two points.


Spare Horses:

While driving a curt you can use Spare Horses to travel longer. You need to drive the cart or wagon the full 8 hours to uses be able to use Spare Horses. You can also use the skill when the cart is pulled by other animals than horses.

Spare Horses allows you to travel 1 hour longer before the horses get exhausted. The DC Profession(Driver) of Spare Horses is 20. For every 5 by which your check result exceeds the DC, you can travel an extra hour before your horses get exhausted.


Support Research:

You can support an ally, including yourself, in his research. You need access to library or a book collection with at least 100 books. You have to support your ally for at least 1 hour. A person can only be supported once per knowledge check.

The DC Profession(Librarian) of Support Research is 20. A person you support in his research gains a +2 bonus on his knowledge check. For every 5 by which your check result exceeds the DC Profession(Librarian), the target gains an extra +2 bonus to its knowledge check.


Test your Luck:

Your are used to risk everything for the chance of winning some coins. Even outside the tavern you can test your luck. By testing you luck you gain a luck points applicable to skill, attack and saving throws.

Test you luck is a move action. If success you gain luck points. You have to use the luck points in the next round or they are discarded. Luck points are applicable to skill, attack and saving throws. You have to apply the luck points before throwing the dice. You can split up you luck points, for example using 1 point for an attack roll and 1 point for a skill check.

The DC Profession (Gambler) of Test your luck is 20. If you succeed you gain one luck point. For every 5 by which your check result exceeds the DC Profession (Gambler), you gain an additional luck point. Once your fail the skill check profession (Gambler) you can’t use Test your Luck for the rest of the day. Additionally your next skill, attack or saving throws is performed with a malus equal to the luck points you gained that day. You can’t do a useless check to dismiss the malus.