Any good C++ gamemode examples?
Recently I started learning UE4 as a game is going to support modding in the future and I want to implement a gamemode. Examples is the best way of learning for me but there aren't that many good examples for Gamemodes, gamestates and playerstates and alot are outdated.
So if anyone has a few good examples to share that would be greatly appreciated!!
asked Jan 24 '18 at 09:34 AM in C++ Programming
Any C++ demos from launcher will do, if you have expirance with game modes in blueprints, you practiclly know how to do gamemode in C++, you will automatically find equivalents in C++.... i mean it's same class to begin with. So check API refrence:
Note that you don't need to mirror what other games/demos do (you probably won't learn anything either by doing so), you should look on events and functions avable to do and use them in the way to achieve what you want to make, this is programming. Only thing you need to learn i how classes behave and avoid anything that they don't expect and getting in there way and try to bland the code with it.
Best way to make game mode moddable is by making UT-style mutators, kind of plugins for gamemode. Make something like AMutator class with event functions that will help them manipulate the game (like forwarding all the game events optionaly you can make delegates for mutators to plug in to, it's actully more optimal way, in game mode make function helpful for them to control the game), make array of
Alternativly you can look up UT4 source code in git hub and see how mutators are implemented there, but remember you can't copy any code from it.
If you user want to modify on even bigger scale, they can just override gamemode, your should allow to use different gamemode classes, i mean you will need that yourself for the game eitherway. To make class more modable all functions that you want for user to be able to alter should be virtual.
Also read EULA as there restrictions of editor code distribution and use for modding the game.
answered Jan 25 '18 at 10:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here