Need advice on how to get on with my framework

Hi there,

i hope my question is placed correctly in this part of the forum.

I need some advice on how to set up the framework for my game.
I don’t know anyone personally developing games in Unity or any games at all.
I want to know if the ideas i have are promising to finish my game in a good and managable way.

Maybe some of you stand before the same decisions and can share some knowlede.
I hope my introduction will not be too long and boring.

First of all, i am really new to game dev myself. All i developed in the past were some business
applications, frontent mostly and some database parts.

I know C# very well but the concept of Unity goes slightly another way that i am used to.
But i come to that part later again.

A short description of my game and the objects i wand to implement.
? I mark my major questions with a questionmark at the beginning.

The game (and here comes the first decision) consist of three check board likewise consisting of n*n Tiles.
The Tiles itself have some stats like health, armor, resi and some more. They can be destroyed, turned, switched anything you can think of. Units can walk on them, items are scattered everywhere and buildings can be build on then et cetera.

? I have tried to use Tilemaps, but for a field of lets say 12x12 i am not sure if this is the best solution because Tilemaps are made for hundreds of Tiles and reuse then to save memory. My Tiles are all different, so the second solution i found is to simply fill a grid with gameobjects, rectangles and sprites. Do you have any ideas or pros and cons?

The next part i quarrel with is how to set up the framework of the game.
One example, everything can be destroyed. Units, buildings, items and even the ground(Tiles) itself.
My idea was to create an abstract class with abstract properties and methods to destroy everything derived from that class.

? You can’t multi inherit from classes in Unity so my idea can not be implemented (am i right?). My second idea was to split everything in little tiny scripts and put that on any object like DestructBehaviour that contains the HP variable, getter and setter for this and checks if the object gets destroyed, but i’m not sure if this is a good way either.

Thats mostly my biggest questions on how to get on and not waste too much time because with two kinds you only got some hours at night if at all :wink:

Thanks all for reading and your advices.

Jason

I appreciate your effort to do it right. However I don’t work that way and most successful game developers don’t either. Games are simply too fluid and changing to adhere to plan-in-advance Soviet methodology.

Instead I recommend starting a small game, something you can finish in an afternoon or so. Think Pong or perhaps Space Invaders.

Then do something else. Then something more complicated. etc.

1 Like

@Kurt-Dekker thank you for your advice. I thought so and started some sample projects but i am so impatient to get my ideas on the screen. I’ve been reading so many pages and set up so many example projects for every little programming concept in unity that it seems i will not get an MVP finished this year. Thats annoying and i know programming takes so much time and effort.

It took two weeks of learning and testing to turn a tile slowly with a crude solution. I think so many people can do this better but i don’t know where to get that specific knowlede for every idea because i read so many articles already.

But i will not give up. I keep on learning and improving and even tear everything down to start anew.

Jason

1 Like

As far as Tilemaps vs a bunch of GameObjects, I’d suggest just prototyping both and see which one seems to be the best fit.

As far as your destruction framework question, I don’t exactly understand what you need, but any MonoBehaviour script will call its own OnDestroy() method when the GameObject gets destroyed. So you can have each attached script clean up for itself without needing to build a system which takes care of everything from the outside. You can also have a MonoBehaviour attached which says it can be destroyed, and handles kicking it off if there is some other effect you want to happen. When trying to destroy an object, you can just GetComponent() or whatever you want to call the class, and if it exists you call a method on it to destroy the object.

I don’t know if it is useful for your destruction framework question, but on inheritance you can have a script which inherits from MonoBehaviour, adds its own stuff, and then you can write another script which inherits from that script. I don’t use that often, but I do that for network aware scripts which need to sync data between their client and server counterparts.

@Joe-Censored thanks for your answer too. I will prototype both and share my findings what worked best and why.
The other part with the destruction seems simple. I will try to implement this too.

Thanks for sharing your ideas with me. Sometimes you enmesh in your own ideas and get complicated results but the solution is easier than expected.

You get a free copy of the game if it’s finished :wink:

1 Like