[SUGGESTION]Event sheet for objects

Discussion and feedback on Construct 2

Post » Tue Oct 29, 2013 8:43 am

In large projects I find it difficult to separate the logic enough and often end up with lots of events triggered by different objects, sprites and states. When the flow is non-linear it gets almost impossible to keep track of what you are doing.

I am an experienced programmer and I miss the possibility to use design patterns for my projects, but at the same time I really like the simplicity of using event sheets. I would suggest the possibility to add an event sheet to a sprite, where the sprite could itself control it's behaviors, much like in flash. It would also need to be able to send events to the layout and maybe other sprites as well and it needs to be able to expose methods for the master sheet to be able to call.

I understand that this might be hard to implement but have you anything like this in the pipe? Or is there a plugin that facilitates this kind of functionality?

Thank you!
B
7
S
1
Posts: 22
Reputation: 526

Post » Tue Oct 29, 2013 9:36 am

I'm not sure I understand, but this is what I do.

I like oop. So what I do is have my master event sheet and include each component (their own event sheets).
I usually have groups that can activate/deactivate different components (include event sheets).

I structure my project by creating folders and subfolders which store individual components and merely include those where needed.

I also use "Functions" to reduce repetitive code.
And families
And bookmarks and search - these tools help keep you ontop of the a project with 1000's events.

Makes bug sniffing easier too lol. Cause it is structured you just browse to Folder/subfolder/eventsheet. you choose your own names for folders, eventsheets.DUTOIT2013-10-29 09:37:04
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Tue Oct 29, 2013 10:00 am

I'm not sure how associating event sheets to objects would work, especially since objects don't have to be in every layout.
Then there's the order, how would that work since events must run logically in order?

We already have a few decent tools, such as bookmarks, groups, and comments. Also, functions are nice, but they can get a bit annoying since you can place them almost anywhere.
Image ImageImage
B
169
S
50
G
173
Posts: 8,315
Reputation: 110,274

Post » Tue Oct 29, 2013 10:10 am

We have 10 000+ events(no joke) and it is still easy to manage.

For every Layout we have 1 eventsheet (14 actually) and for every bigger functions(like viewpoint functions or often used family/image management) another event sheet which gets included every time we need it.

The eventsheets are grouped up by objects/functions.
Eg. The player or the top bar is a big part so we create an group named "player" includes the groups "functions", "control or handling", "effects" and so on and every group includes more specific groups like "Creation" or "Attack".

This makes it for us quite easy to manage and every team member can easily find what he searches ;)Darklinki2013-10-29 10:11:23
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Tue Oct 29, 2013 10:15 am

I always thought being able to add sheets to individual objects would just make it worse. Instead of going through a simple event sheet list you now have to remember which object you put those events in. It could make all your events even more scattered and unclear. Do you really think it would genuinely help?
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,496

Post » Tue Oct 29, 2013 12:16 pm

I think groups, including event sheets, functions and folders are enough. Not sure if I understand it, but wouldn't include already enable stuff like this with a single event?
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Tue Oct 29, 2013 12:53 pm

[QUOTE=Ashley] I always thought being able to add sheets to individual objects would just make it worse. Instead of going through a simple event sheet list you now have to remember which object you put those events in. It could make all your events even more scattered and unclear. Do you really think it would genuinely help?[/QUOTE]
This could be of tremendous help for making widgets, especially if we could attach events to groups.
It would be a dream for managing windows and UI as well.
You can add a tiny 16x16 icon to the object to highlight the fact it has an event sheet associated with it.

Aditionally, we could have hooks for functions: a private function is only available in the scope it was declared, but a public function can be called from outside the object, so an "enemy" object could have its own custom "chase the player" function. This relies mostly on features already implemented, and has the added benefit of keeping concerns separate.

This would be wonderful!Fimbul2013-10-29 13:02:22
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Oct 29, 2013 6:08 pm

We have vague plans for broader modularity features in the long-term, but they'd go a lot further than just an event sheet hidden away behind an object. So maybe we'll address this eventually anyway.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,496

Post » Wed Oct 30, 2013 7:25 am

Thanks for your tips and thoughts. To clarify, what I want to be able to do is to create custom behaviors for sprites the same way that I now create events in the event sheet. For me it would be far more OOP to place the logic on the sprite instead of mixing it with the general flow of the game. We should of course also have introspection on the public methods and parameters (code hinting) and the possibility to open the declaration (or event sheet) for the object from out master event sheet (like pressing F3 in eclipse).

This is somewhat possible now by coding custom behaviors in javascript but it would be really nice to be able to use the fast workflow in the event sheets.

I have not been working with multiple sheets per layout and I will try this approach to see if it makes it somewhat what I look for. nice to read that you have exciting plans for the future, keep up the good work!
B
7
S
1
Posts: 22
Reputation: 526

Post » Mon Nov 04, 2013 3:01 pm

I really like the idea of objects having their own event sheets, or someplace where I can define object specific functionality that would be bound to a specific object. Regardless of what layout I use that object on, the event "code" always goes along with it. Being a professional developer, who works in OOPs all day, every day the concept of binding object specific functionality to that specific object appeals to me.

I also like the concept that each instance of an object would have it's own codebase as well so if I wished to tweak just one instance, I would be able to without any impact on the other instances.

Many people attemtp to simulate this by defining an external event sheet with the object specific code, then just including it in the main level's event sheet, which is close but still not quite the same as binding them to the objects themselves.
B
14
S
6
G
1
Posts: 143
Reputation: 1,795

Next

Return to Construct 2 General

Who is online

Users browsing this forum: brupibo and 8 guests