-
Notifications
You must be signed in to change notification settings - Fork 154
RTS Formations Example #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adjust entity position in formation to try and make it more seamless - WIP
…ously, it can use more work. Entities now go to location and choose a destination based on distance.
Optimize and cleanup rts subsystem for large-scale use Still need to consider if its feasible to move some logic to a processor rather than the subsystem
Get units to move in formation...at least good enough Adjust tolerance for reaching formation position
Add RTSUpdateEntityIndex to spread out logic cost when finding formation index Fix bug where entities would stop moving when travelling to new destination
…culated every processor tick. This also allows me to implement different formations in one spot.
Move enum formation to FormationPresets to avoid circular dependency, should be moved to its own class in the future
Implement smooth rotation of unit when the angle is not extreme
… interpolation is already built-in Temporarily remove optimizations for debugging Add specific logic for smooth rotations at close angles while recalculating units index when making large turns Remove LerpDegrees as it is no longer used
…better separate code chunks Implement simple comments to core functions in RTSFormationSubsystem for my own sanity
Modify turn rotation on units so they turn about half as fast - should be a variable in the future
Add GameplayDebuggerCategory_RTSAgents Add GameplayDebugger to dependency list
…o mass processors
|
Sorry about the lack of response, I'll get around to looking at this over the weekend! |
|
No problem! I got a little carried away with some of the functionality (and some WIP features) so let me know if it is too complex or should be condensed to fit the MassSample. |
|
This is sweet because it's an often requested feature (RTS stuff!) It's even in a separate plugin which shows off the power of composition and saves people who don't need it some space. However, I think I broke it? UnrealEditor-Win64-DebugGame_2022-09-05_19-23-36.mp4Did I miss something? I assume there is some setup I forgot or I may be using the wrong pawn. Do you have some content only stored in your project or something? |
Ah shucks, Im going to take another look and get back to you on that. I think there might be some content I forgot to move over to the plugin. |
…nal before calling Fix units not updating their position correctly when setting a new preset or being spawned in-game
Move Hash grid processors to their own file
…t an observer working for the life of me - should be further investigated
Add BP_Pad for base class of interactables
…fault, will need to determine whether its worth it to create an LODCollectorProcessor or leave it out for simplicity
…g due to roadblock with observers - needs further investigation
… are included in the plugin
|
The current version still has a few bugs to iron out (also I can definitely do better in terms of performance) but all my changes should be available. Let me know if for some reason the map is still not functional. The gamemode in the map should be MassSample-RTSDestruction.mp4 |
b7635d9 to
ec20df0
Compare
|
Hi! I just found this pr, while I want to work on a rts type game. I looked at the code and it seems to be a great example of what I want to achieve. However, does the video you showed in this pr came from the NewMap level? Because I cannot manage to open it with 5.4, and I tried to create a new level on my own but this is not yet a success (I am quite new to unreal so I spend ages to do simple things :D). For the completeness here is the only warning I have when loading the level: |
I have a similar version hosted on my repo MassAIExample. It should be updated to the latest version of UE. Let me know if you have any questions. Do keep in mind this is simply an example and I highly recommend reading the code to get a better idea of the logic. |
|
Thanks for the answer ! I'll check your repo. And of course I checked the code first in this pr, but I'm a bit confused about the seperation between what you have done in the editor side and in the code side and how you retrieve all the entities created by the spawner. In my project, I want to do everything programmatically, since the loaded level will be dynamic. If I do have more concrete question, I'll surely open an issue on your MassAiExample repo, to avoid spamming here ;) |

Apologies in advance for the duplicate PR, just goofed up with my fork and made a PR in main
Basically, just a simple PR to add a formations example to MassSample. In my opinion, its not breaking any barriers, but I think it's a good example to see what is possible with Mass. It is all encapsulated in its own plugin too! Consider checking out #37 for more info.
MassSample-FormationV1.mp4