#How do you structure your games?

1 messages · Page 1 of 1 (latest)

lofty tulip
#

Hello, for a long time I have been trying to make a game of my own, a large project to be proud of. However I awlways run into a problem: structuring. For this example let's say a 2d run and gun. I end up making large complicated systems for making NPC's enemies etc. But at some point it just becomes messy. Like the code I make is too flexible, making anything using the inheritance systems for enemies is a pain as most of them dont end up using the features I made at the base due to all enemies being so unique.

The dialogue and cutscenes are scriptable objects and are so flexible its hard to use and takes time to achieve anything. How do people avoid this problem? Keeping things too simple makes it feel too inflexible.

Also another question (part of main question), how do people deal with cutscenes? I made it a list of keyframe objects which all can do a specific action, like tell the player to walk somewhere...

Thanks for any responses :)

#

How do you structure your game?

#

How do you structure your games?

atomic zealot
#

making anything using the inheritance systems for enemies is a pain as most of them dont end up using the features I made at the base due to all enemies being so unique.
Your mistake here is leaning on inheritance for a problem that it's not good at handling

#

Learn about composition

#

Learn about making small, modular, reusable scripts that add behavior to things and can be composed with other scripts to create the desired behavior

#

For cutscenes perhaps look into tools like Unity Timeline

lofty tulip
atomic zealot
#

Sure that's one example

lofty tulip
#

And what about animations? Is there any point in trying to create a common animation system for all enemies to share? How would it even work?

And should certain components like movement and animation be in some way shared with the player object? Like a character controller of sorts?

placid mortar
#

Yes. you would use the same base controller and Override for other classes/enemies. This is all covered on the !learn site, as one place. also, myriad YT information tutorials