npruehs / ue4-rts

Real-time strategy plugin and showcase for Unreal Engine 4.
MIT License
747 stars 151 forks source link

Character slows down when spamming move order #133

Open coolyoshi opened 4 years ago

coolyoshi commented 4 years ago

Hey all,

Having an issue where if player spams move order, it makes the character stutter a tiny bit. I've tried turning acceleration off by setting "Requested Move Use Acceleration" option to false in the character movement component, which seems to have helped but unit still seems to stutter a bit

npruehs commented 4 years ago

Hey @coolyoshi ,

I think we've seen the same for A Year Of Rain, and that issue is related to the behavior trees being restarted every time you issue an order. We added an order flag for whether the behavior tree actually needs to be restarted when issuing the same order type multiple times (e.g. consecutive move orders), but that flag hasn't been merged back to the plugin yet.

coolyoshi commented 4 years ago

@npruehs

I see, thanks for the reply. I checked out the game A Year Of Rain and was really impressed. Noticed it had some path finding issues. After watching some videos I've moved that much closer to the top of my priority list. Do you have any tips or what kind of methods I should be looking into to implement a path finding solution?

npruehs commented 4 years ago

Hey @coolyoshi

Thanks for the nice words :) It was a lot of work, and yes, in the end, it looks like both navigation and savegames were the most prominent issues with the game, so you might want to tackle these early.

Usually, path finding isn't the major issue - for us, it was path following that caused most pain. We started implementing a flow field navigation system for Unreal Engine, but unfortunately, weren't able to finish it in time. Flow fields are used by successful RTS games like StarCraft 2, and I suggest you start there. Especially if you're using melee units in your game, you might end up failing to find a better solution.

Still, I'd be happy what you come up with in the end! Is there any public website I could learn more about your game?

coolyoshi commented 4 years ago

@npruehs

Yeah can't imagine how much work must've went into the game. Was awesome to see heroes fully functioning in an RTS game and was really digging the art style. Truly inspiring

Wow thank you for the tips, wasn't even aware of the term path following but I think I can see the differences now. Will definitely look into flow fields as I am in fact using melee units. And I will try to look into this as early as possible as you mentioned, although I don't think my game needs a save games feature. By the way I saw your repository for gameplay abilities and wanna thank you for that as well! Already started taking a look into it.

I don't have a website for my game but the game I'm planning is a combination of MOBA, RTS, and Tag. Basically it's humans vs undead (8vs4). The humans have to run away from the undead, build a base (if they're a builder), and evolve until they get strong enough to defeat the other team. The undead team can also evolve as well. I already made the game in Warcraft 3 as a custom map and it's been around for a long time. It's called Evolution Tag. Just thought it would be amazing to recreate it in ue4, especially with all the issues/limitations of the Warcraft 3 engine (cough desyncs).

iliags commented 3 years ago

Is the flow field code still floating around? I ended up writing a version of the flow field pathing and would be interested to compare code for it. I used https://howtorts.github.io/ along with the Game AI Pro pdf as a reference and dropped it all into a world subsystem so I am pretty sure I will get some replication bugs but it would still be interesting to see another UE4 implementation.

npruehs commented 3 years ago

Unfortunately, that code is proprietary to Daedalic Entertainment, and I doubt they'll open-source it (at least for now).