Event Sheet organization

Discussion and feedback on Construct 2

Post » Sat Apr 27, 2013 6:50 pm

So, I was wondering what methods or personal standards everyone has regarding how they set up their Event Sheets. Obviously, certain rules within C2 apply (like the flow in which every Event is checked per tick).

But when it comes to organization, how do you try to set things up?
For example...
Do you try to keep things as condensed as possible? Do you organize related Events close together? Do you add comments to every Event or just the main ones?

What're your Event Sheet habits?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sat Apr 27, 2013 8:01 pm

ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Apr 27, 2013 8:04 pm

@shinkan - That'll definitely help. :) But I'm just curious about individual habits. Like, what's the logic BEHIND why everyone does things the WAY they each do them.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sat Apr 27, 2013 8:13 pm

It's quite hard question to answer to be honest.
I have no answer for that :D

Personaly I like using different event sheets for stuff like player controls, global events etc. and groups. For me doing it that way it looks obvious and clear what is what and where to find stuff I need to change/add.

But there are many people who like to use only one event sheet and groups to organize things in it (or even use variables instead of groups).

so yeah, it's hard question :)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Apr 27, 2013 8:15 pm

@shinkan - I totally understand. I started using separate Event sheets, too, so I can call on them when needed. It makes it easier to see what other Events I have that are related to each other.

But your answer was precisely the sort of input I was looking for. :) The REASON behind what you do. :)
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sun Apr 28, 2013 1:52 am

Obviously I'll be repeating a lot of suggestions from the above linked "programming best (and worst) practices" discussion, but as you're after individual habits and reasoning I'll list some of the things that are most important to me personally here, and try to briefly explain the reasoning behind them.


1. Always be consistent. Always.
A lot of things in programming -- and using an event sheet is essentially programming -- are subjective and come down to personal preference. It's important that you choose a preference and stick to it within any given project; you should never have to wonder if a variable name is in camelCase, ALL_CAPS_WITH_UNDERSCORES, or some other style, because you should be following your own consistent set of rules for these things.

If you assign some meaning to particular styles (ALL_CAPS for constants for example) it will even help by providing additional hints when reading your code.


2. Use sensible, meaningful variable and object names.
Don't be tempted to save typing by using one character or very short abbreviated names unless there is already an established convention to do so for a particular usage.

It may be clear what you mean now, but it might be less clear if you have to read the same code again after not touching it for a year or if you find you need to hand it over to someone else to be updated.

Using proper names is also a good step towards making your code/events "self documenting", rather than having to explain what it means by adding comments -- see the next point.


3. Use comments to describe why things are a certain way or to explain unusual code, not to describe what your events are doing.
Your events already explain what they're doing, and should be quite clear if you've chosen sensible names. Comments should be used to explain why you're doing it, which may be less readily apparent at a glance.

For example, you might have an event that sets a boolean instance variable to true if a particular sprite is colliding with another. You don't need to write a comment saying that, as the event already describes it perfectly; instead, explain why you're doing so.


4. Use the functions and expressions that most clearly express your intent.
Something there will be multiple functions or expressions which produce the same result. Consider for example the system expressions floor() and int(): when applied to a number such as 4.6 both will produce a result of 4, but these functions have different purposes, and you should use the one which matches what you're actually trying to do. Again, this will help to make your code "self documenting" and easier to understand.


Hope that's the sort of thing you're after.
B
24
S
5
G
2
Posts: 104
Reputation: 3,136

Post » Sun Apr 28, 2013 2:36 am

@jbadams - That's VERY much what I'm looking for...or close to it. The tips are great, but the specific things I was interested were the WHY - as you mentioned in #3 - people do it. Like, why does one person use separate Event Sheets while another one doesn't? And so on. But those are great and give me a lot to consider, too.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sun Apr 28, 2013 3:20 am

[QUOTE=Rhindon] why does one person use separate Event Sheets while another one doesn't?[/QUOTE]

I think you could compare C2 to programs like photoshop.
There are some rules You must follow to make working game but how you actually use your software depends entirely to you.

I know many great artists who use dozens of layers and different brushes in photoshop to draw something and many other artist who use only one layer and one brush to do same thing.

It really doesn't matter if you are using groups, variables or include event sheets. Like @jbadams said, it all comes down to personal preference. There are many path you can follow but eventually they will all end up in same place. Finished and working game ;)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sun Apr 28, 2013 7:31 am

@shinkan - Exactly. It's those personal preferences and the reasons behind them that I'm interested. :) When either one will suffice just fine, what goes into the decision making for each person.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Post » Sun Apr 28, 2013 11:21 am

I like to keep all of my core gameplay mechanisms in a single event sheet, which I organise by being very liberal with groups and sub-groups. It's also where I keep my debug group, which I sometimes split off into its own sheet if it gets too big. I then use a small event sheet for each of my game's levels. I also use a separate event sheet for global variables, as those can't be neatly tucked away in a group (for some strange reason).

I find that this process forces me to make my events reusable, so in my level event sheets I basically just put in the parameters for each level, like MonsterSpawnRate or LevelTime, which is then passed along to the main event sheet. If a particular level has its own unique mechanisms, then I just put those events in the local event sheet. As soon as I find that I want to use those events in another level, I go back to them and make them suitable for reuse by changing any fixed numbers that need to be variable, and move them to the core sheet.

Otherwise, I comment for every major block of code, but this is often superfluous and I just do it to visually break up the events. I also make sure that my projects tab is well organise with groups and sub-groups, and I do my best to use families wherever possible. I'm also now starting to get into the habit of making better use of functions where it's appropriate, like for character dialogue.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests