NPC pathfinding
Moderators: Bob the Hamster, marionline, SDHawk
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
The screenshot is just from a tiny test rpg using slightly modified versions of some of Fnnrf's free sprites.
I might make it into a real game later, you never know ;)
Nightlies are more likely to have bugs, so report them if you find any.
Make a backup of your rpg file before using it with the nightly, since the nightly makes some file format changes so you sometimes can't easily go back to the stable version after having used the nightly.
There is also a file named IMPORTANT-NIGHTLY.txt which lists some specific issues to be aware of.
I might make it into a real game later, you never know ;)
Nightlies are more likely to have bugs, so report them if you find any.
Make a backup of your rpg file before using it with the nightly, since the nightly makes some file format changes so you sometimes can't easily go back to the stable version after having used the nightly.
There is also a file named IMPORTANT-NIGHTLY.txt which lists some specific issues to be aware of.
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Can you increase the size of walkabouts very easily for Dwimmercrafty, or will that also require an extreme amount of work? If you decide to increase it soon, please allow the size to be as large as easily possible. I know the whole engine is built around tiles that are 20x20 pixels, and larger walkabouts will have negative effects, but that won't affect my plans. You could add a setting for choosing different sizes.TMC wrote:Yes, I mentioned that I think we should do a release soon instead of waiting for all the animation stuff to be finished, because that might take a while.
There are some things that should be finished first (like, obviously, pathfinding; there's lots left to do on that).
I will try a daily build later to try this pathfinding feature:
https://bitbucket.org/rbv/ohrrpgce-svn/ ... 99b98ae15e
That description seems like a method for on-map battles, like in Action-RPGs (Zelda-Style). Am I misinterpreting what that is? Could you extend your pathfinding idea to allow enemies to follow your character and he can "splat" them? That would be a great addition to this engine! I hope I'm not misinterpreting it.
My idea is to have enemies follow you, and you and your enemies would each receive a few swipes before they die (a death would remove a walkabout from the map, possibly with a fade-out effect). The animations for the swipes won't need to be added because this method of battling would be an experimental setting. It would have a disclaimer that says "this battle method is experimental. I may or may not ever improve it. It's just for fun."
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
I have been doing some more work on the pathfinding.
Now with support for NPC collisions and zone collisions
I also added some limits so that pathfinding doesn't grind to a halt on a giant map.
Right now I have the pathing limited to searching 30 tiles away from the NPC's current position, which prevents them from getting around some obstacles larger than that size.
Eventually I want to have an option to allow an NPC to override this limit, in case you want an NPC to be able to solve a complex maze on a gigantic map, fps-be-damned
Its also still super easy to bog down a map's speed by adding too many pathing NPCs all at once (see the map with 25 slimes in my gif. The gif recorder skips the slowdown, so it fails to capture how laggy that map is when I actually play it)
I haven't started profiling and optimizing performance yet, so hopefully eventually we will be able to have even more than 25 pathing NPCs all at once without problems, but we shall see.
@Billiard this could be used for an action rpg, but in my experience A* pathfinding is not actually what you want for most action RPG games. I recently re-played Zelda 3, and I don't think there was a single enemy in the whole game that used real pathfinding. Many would run towards you, but they would always get stuck on walls if you could get a wall between you and them. Most other enemies moved in fixed patterns.
EDIT:
Oh, and I also added some internal debugging tools to visualize the pathfinding search, which was helpful in spotting a few of my mistakes
Now with support for NPC collisions and zone collisions
I also added some limits so that pathfinding doesn't grind to a halt on a giant map.
Right now I have the pathing limited to searching 30 tiles away from the NPC's current position, which prevents them from getting around some obstacles larger than that size.
Eventually I want to have an option to allow an NPC to override this limit, in case you want an NPC to be able to solve a complex maze on a gigantic map, fps-be-damned
Its also still super easy to bog down a map's speed by adding too many pathing NPCs all at once (see the map with 25 slimes in my gif. The gif recorder skips the slowdown, so it fails to capture how laggy that map is when I actually play it)
I haven't started profiling and optimizing performance yet, so hopefully eventually we will be able to have even more than 25 pathing NPCs all at once without problems, but we shall see.
@Billiard this could be used for an action rpg, but in my experience A* pathfinding is not actually what you want for most action RPG games. I recently re-played Zelda 3, and I don't think there was a single enemy in the whole game that used real pathfinding. Many would run towards you, but they would always get stuck on walls if you could get a wall between you and them. Most other enemies moved in fixed patterns.
EDIT:
Oh, and I also added some internal debugging tools to visualize the pathfinding search, which was helpful in spotting a few of my mistakes
Last edited by Bob the Hamster on Fri Jun 02, 2017 10:17 pm, edited 1 time in total.
Debugging is fun when you have test games like you to play with!
Hmm, I guess that gif shows "Press Ctrl-F12 to stop recording" because of the way that the A* debug works; it's not meant to happen normally. So I don't need to fix anthing
Doing a stable release won't have any significant effect on when this is all implemented. As soon as animations are ready, I definitely will want to do another stable release; but you could just use nightlies until then.
I don't know whether larger sprite sizes would make it into Dwimmercrafty, but the idea was not to wait for that.
I don't think it makes sense to add engine built-in features for zelda-likes right now. But after battlescripting is added, it would be cool to try to allow creating NPCs which can be treated like in-battle enemies with stats, so that attacks can be used on them (like how the "map cure" command already allows using attacks on heroes out of battle).
But it's certainly not necessary, in fact it would barely help you script a zelda-like.
We haven't explicitly said what license the scripts for the test games are under, but we should probably release them into the public domain (like the default resources are (all the existing music is public domain, although we allow CC too)). I'm certainly happy to release all the test games I've added as public domain. The exception is autiotest.rpg, which mostly contains public domain music, but also has a file by Mr 8bit and a couple files under the ModArchive Distribution license, which allows redistribution as long as it's "unbundled"... so it looks I might be in the wrong there.
Hmm, I guess that gif shows "Press Ctrl-F12 to stop recording" because of the way that the A* debug works; it's not meant to happen normally. So I don't need to fix anthing
There won't be any size limit (well, maybe 1024x1024 or something like that).Billiard wrote:Can you increase the size of walkabouts very easily for Dwimmercrafty, or will that also require an extreme amount of work? If you decide to increase it soon, please allow the size to be as large as easily possible.
Doing a stable release won't have any significant effect on when this is all implemented. As soon as animations are ready, I definitely will want to do another stable release; but you could just use nightlies until then.
I don't know whether larger sprite sizes would make it into Dwimmercrafty, but the idea was not to wait for that.
You misinterpreted it; that is a test game, it's not part of the engine. However, it shows that this sort of thing can be scripted without much trouble (as you can see, the "try to splat" script is very simple). someone should create a set of free scripts for creating zelda-likes, like Mogri's SideSidescroller 101 scripts which have been used to create many side scrollers.That description seems like a method for on-map battles, like in Action-RPGs (Zelda-Style). Am I misinterpreting what that is? Could you extend your pathfinding idea to allow enemies to follow your character and he can "splat" them? That would be a great addition to this engine! I hope I'm not misinterpreting it.
I don't think it makes sense to add engine built-in features for zelda-likes right now. But after battlescripting is added, it would be cool to try to allow creating NPCs which can be treated like in-battle enemies with stats, so that attacks can be used on them (like how the "map cure" command already allows using attacks on heroes out of battle).
But it's certainly not necessary, in fact it would barely help you script a zelda-like.
We haven't explicitly said what license the scripts for the test games are under, but we should probably release them into the public domain (like the default resources are (all the existing music is public domain, although we allow CC too)). I'm certainly happy to release all the test games I've added as public domain. The exception is autiotest.rpg, which mostly contains public domain music, but also has a file by Mr 8bit and a couple files under the ModArchive Distribution license, which allows redistribution as long as it's "unbundled"... so it looks I might be in the wrong there.
Last edited by TMC on Sat Jun 03, 2017 8:31 am, edited 2 times in total.
I once used those scripts to make a top-down game ;)TMC wrote:someone should create a set of free scripts for creating zelda-likes, like Mogri's SideSidescroller 101 scripts which have been used to create many side scrollers.
Last edited by kylekrack on Sat Jun 03, 2017 9:36 am, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
I'm getting major slowdown with just 3 pathfinding enemies on a map. It is a rather large and complex map, however.
Also, I'd love an option to set how far an NPC can "see" before it starts following the player.
Also, I'd love an option to set how far an NPC can "see" before it starts following the player.
Last edited by guo on Thu Jun 08, 2017 4:27 am, edited 1 time in total.
vvight.wordpress.com