New ‘Action Roguelike’ C++ Project on GitHub
For the Stanford University Fall 2020 Curriculum, I built a small game project using mainly C++ mixed with some Blueprint in Unreal Engine. For those interested, the entire Computer Science course (CS193U) was provided through Zoom lectures and has been recorded. I’m working on getting this published and meanwhile, this project is already open-source through GitHub to be taken apart by anyone!
Check out the full project right here on GitHub!
Description
The game was built with a wide set of features to cover a variety of useful coding concepts to students including AI, multiplayer programming, save games, async asset loading, etc. Check out the non-exhaustive list of features below, I’m sure there is more that I forgot to include or that will drip in at a later time.
Those interested in a GAS (Gameplay Ability System) style design might be keen to check out how we handled Abilities (Action.h) and Buffs/Debuffs (ActionEffect.h) as this shares many similarities with GAS design, albeit its much simpler.
At the time of writing, there isn’t a whole lot that makes this a real ‘roguelike’ with things like permadeath or proper RNG. But, I hope to extend this project later on with more relevant features to have a proper game loop to earn the name ‘Action Roguelike’.
Features
Below I’ve listed some of the more relevant features included in the project. I think these code samples can be invaluable in getting an idea on how to use them in the Unreal Engine eco-system. Especially things like Asset Manager have limited public examples, which is one of the benefits of this open-source project.
- Third-person Action Character Movement
- Action System (Gameplay Ability System-lite)
- Dash Ability (Teleporting via projectile)
- Blackhole Ability
- Magic Projectile Attack
- “Thorns” buff (reflecting damage)
- Burning Damage-over-time effect
- AttributeComponent (Health, Rage etc.)
- SaveGame System for persisting progress of character and world state.
- Heavy use of Events to drive UI and gameplay reactions.
- Mix of C++ & Blueprint and how to combine these effectively.
- GameplayTags to mark-up Actors, Buffs, Actions.
- Multiplayer support for all features
- GameMode Logic
- EQS for binding bot/powerup spawn locations.
- Bot spawning system (bots cost points to spawn, gamemode gains points over time to spend)
- DataTable holds bot information
- DataAssets to hold enemy configurations
- Asset Manager: Async loading of data assets
- Async loading of UI icons
- AI (Ranged Shooter style)
- Minion AI with Behavior Trees (Roam, See, Chase, Attack, Flee/Heal)
- C++ Custom Behavior Trees Nodes
- EQS for attack/cover locations by AI Powerups
- Powerup pickups to heal, gain credits/actions (UMG)
- Main menu to host/join game (UMG)
- UI elements for player attributes and projected widgets for powerups and enemy health.
- C++ Localized Text Example
Check out the project file right here on GitHub!
What’s Next?
Over time more features and improvements are actively being added to the project along with updates to the most recent Unreal Engine version. The Readme on GitHub will have the most recent additions if you’re interested.
Hi Tom,
I have noted in this project and I think the coop tutorial as well that the projectile targeting is not working right – The projectile is always firing at the crosshair, even if that is behind the character if that makes sense – so the dude is facing forward but the spell is cast backward – is there a fix for that?
You can limit the adjustment and use some vector math to figure out if the target is behind you.
PlayerActorForwardVector (dot-product) (EnemyLocation – PlayerLocation) = value between -1 and 1 where values lower than 0 mean it’s behind us and higher than 0 is in front.
This is a good suggestion to add into the project, I’ve made a note of it and see whether I can add this into the github repo.
Hi Tom, Do you already have a date for course release?
No specific date, as soon as possible. Waiting for third party approval for a few important things to make this all possible.
Can you get approval? Thanks
Will the lectures themselves become public or even through a paid video course ?
They will be on YouTube at some point, I also intend to have a paid alternative available with support and better course features that YouTube can’t offer.
Ok, I’d love a new course. I already did the Udemy one. Godspeed !
you are unstopable. this one is gold! thanks :D
Was just about to start using the gameplay ability system and is always great to have some example use cases.
Hello Tom! Thank you very much for sharing this with us! I will dive into the code ASAP. What does the “S” prefix stand for in your C++ classes? For example, “SAnimInstance”.
“Stanford”, I have often used it in my other public projects where it meant: Survival or Shooter. It’s just a prefix to identify the project specific classes.
Cool! Thanks. Have a great year.
Will there be wepone stats or inventory type stuff and if not is there any compatible course we can use to merge with this one ?
No promises, but perhaps I can do more with inventory at a later time…(currently there is no inventory system)