Hi.
I've used C2 for years and I completed only one project (and that's ironically not a game).
My bad organization has something to do with it.
I usually start a project cleanly. I write comments, etc.
Then when my project begins to have some working stuff, I try to create new ones quickly and dirty just to see how it's going, then it works and I keep them this way.
After a few days or a few weeks, my project is a labyrinth of badly optimized events, with few comments and it becomes a pain when I try to add anything to it.
If I do, that breaks something else.
Lastly, I made a working prototype of a multiplayer game (a minigolf game). But, as usual, it quickly became impossible to create new content without having new issues.
So I started my project from the beginning again, but I did some things to have a better organization :
I draw diagrams :
Putting your ideas on paper like this allow you to have a global view and prevent some conflicts. Not all of course as you can't think about all.
For example, I drew my diagram based on the fact a player turn ended when his ball stops moving. But it was a mistake : a player turn ends when ALL balls have stopped moving : what if a player ball hits another ball? Also, what if one or more ball collides with the hole during the same turn? I didn't think about that and it was a pain to fix this because I didn't predict this situation in my events.
Still, using diagrams helps a lot.
To do this, I use https://www.draw.io which can connect to google documents, so that's quite convenient.
I extensively log my events and functions in a text area, so I know exactly at which step my project is when something bad happens while it runs :
That might be obvious, but… I didn't do it that much before.
On the last version of my project, I also try to complete my features in a different direction. Before, I created my features in this order :
- Player log-in
- Game initialization
- Player actions
- Next player
- Change map if all players have completed their course
That's the order of the actions when we are actually playing. But that's not necessarily the right order to use when creating that game.
So I'm doing this :
- Player log-in
- Game initialization
- Change map if all players have completed their course
- Next player
- Player actions
Doing so I ensure that I won't encounter an issue when I'll try to make player change map. I've kinda isolated this event ahead and I can safely create the previous events that will lead to a map change. Same logic when creating the next player events before creating the content of a player turn.
While chatting with broknecho on the Construct 2 Discord server about this, he told me some interesting things he does :
[quote:2c47heb7]As another project helper, I started using the Dictionary plugin to start storing variables on it as Instance Variables. I would name one dictionary Globals, mark it as GLOBAL, and then when writing code, I would be able to use Globals.CurrentGameState as an example. It helped to unpolute the Global space and refactoring was a breeze.
[quote:2c47heb7]Another one I started using is [a dictionary called] FunctionNames and was able to have a single spot for the Function String names.
[…]
my function names would be like Player.UpdateHealth which allowed me to have complete context when using the inteli-sense
[…]
when I have to call a function, I type:
FunctionNames.PlayerUpdateHealth
So, what about you? Do you have any precious advice, tricks regarding a project organization?