I am coding a game in which the users moves a character trough the mouse by clicking where the character has to go, on a flat 2d map seen from above, just like a MOBA.
To do so, I thinked that I required a pathfinding function that would find what would be the shortest way from the character to the point indicated by the user, so I searched a bit and I quickly found about A* algorithm.

My problem is that all the pathfinding funcitons I found needed some graphs to work, and my map is not a grid, and hasn't some waypoints I could create, since there is a lot of space between each wall (for the one who don't know MOBA maps, here is a link).

I found two ways to solve this problem, but I'm not sure which one is the best, and overall if they're good:

1. the first would be to create a grid with very small squares, then to find the path normally with A* algorithm, and then to split the path into direct lines so the character doesn't change direction between each square, to make the illusion the character isn't going on a grid
2. make a lot of waypoints at every single angle, so you can join every point of the map to a waypoint with a direct line (without crossing a wall), and then using them as graph

A common issue to those solution is that they require huge work even for a small map (creating tens of waypoints, or calculating a graph that is a grid where each tile is almost a pixel).