EasyRPG / Editor

Game editor similar to RPG Maker
https://easyrpg.org/editor/
GNU General Public License v3.0
350 stars 58 forks source link

Pathfinder / A* algo #216

Open Br4ssman opened 1 year ago

Br4ssman commented 1 year ago

I was thinking about whether to put it in the topic to suggest new commands, but I'd rather it was discussed first. In that pinned topic I proposed the following: https://github.com/EasyRPG/Player/issues/2338#issuecomment-837886830

Perhaps my proposal not to limit the pursuit exclusively to the hero event but to any event that is indicated could also be part of a command (I suppose in a revamped "Set Move Route" panel or perhaps separate from it).

The main drawback I see with the 2k3 editor is especially if a cursor is used, that the protagonist knows how to get to the destination without getting stuck.

Apart from this it would have many other applications such as managing minions (normal events), which can be sent from one point on the map to another following a route by simplifying the code (which right now can be done with a huge network of commands or using the hero event as a "focus" to follow in every minion order).

What do you think? Thank you.

ell1e commented 1 year ago

For what it's worth, all the code parts in the runtime player to make this work should soon be available: https://github.com/EasyRPG/Player/pull/3144 And I think integrating a move toward/away from player command that uses smart routes like that would actually be a useful idea.

Br4ssman commented 1 year ago

Hi @ell1e , thank you very much for supporting the project. I think events being able to reach their destination without "not knowing how to turn the corner" (xD) is a key improvement.

I think you might be interested to see this related: https://github.com/EasyRPG/Player/issues/2338#issuecomment-837886830

jetrotal commented 1 year ago

Hi @ell1e , thank you very much for supporting the project. I think events being able to reach their destination without "not knowing how to turn the corner" (xD) is a key improvement.

I think you might be interested to see this related: EasyRPG/Player#2338 (comment)

Hi, there's already a PR about face event/look away from event: https://github.com/EasyRPG/Player/pull/3111

To test it, you can download a .exe from the check tab, and use it throught TPC command:

@raw 2050, "FaceTowards", eventAIsVar,eventA, eventBisVar, eventB 
@raw 2050, "FaceAway", eventAIsVar,eventA, eventBisVar, eventB 

e.g.:

// Event 1 face towards or away event 2.
@raw 2050, "FaceTowards", 0, 1, 0, 2
@raw 2050, "FaceAway", 0, 1, 0, 2
ell1e commented 1 year ago

Right, but an actual editor UI entry for these commands would be nice! Including one for the walking part that behind the scenes then uses the actual path finding. That seems like a cool idea.