C3 Architect Request list

Discussion and feedback on Construct 2

Post » Wed Apr 29, 2015 9:29 pm

what i'd suggest is something better - way better - behviours and plugins should have event listeners for ticking. once tick happens - each object / each behaviour updates globally, therefore no for loops at all.


this. kinda

Polling every single condition every single tick is always going to be much slower than an event-driven architecture.

Here's a small example:

CONDITION: Compare two Values-> [PlayerSprite.x] Bigger Than [500]
ACTION: ..

By polling, you check every tick if PlayerSprite.x>500. An Event-Driven way to do this would be like that:

Assume BehaviorsTriggeredArray which is always empty at the beginning of every tick.

The game runs and the player moves to the right. Somewhere deep in the engine there's a MoveSprite() function. When MoveSprite is called, it will trigger a MoveSprite event to which all Conditions that depend on Sprite Positions listen to. This is when the condition will check the PlayerSprite.x>500 expression, and if true, it will add a [Behavior#15Triggered] Object to the BehaviorsTriggeredArray.

When the engine needs to update, it goes through the BehaviorsTriggeredArray objects one by one, and acts accordingly.

If our game only had that one condition above, then with the polling method, the engine checks, 'is player X bigger than 500?' every, single time.. Even if the player never moved.. That's a huge overhead that can be avoided. In the event-driven scenario, the engine does absolutely nothing.. Then, when the player starts to move, it will check if it's X is bigger than 500. Which makes much more sense.

My two cents
B
6
S
1
Posts: 7
Reputation: 354

Post » Thu Apr 30, 2015 8:25 am

i'm just gonna drop this here...

https://www.youtube.com/watch?v=rfQ8rKGTVlg
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,455

Post » Thu Apr 30, 2015 2:46 pm

It's a good video. I don't know how much C2 uses them, I now C2 uses some. I'll put this in the architect list. Just as a referene that game engine needs to put to the rendering system first.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Sun May 10, 2015 10:36 am

just a short question (since i don't have time to loop through 13 pages),

would it be possible to add expressions to properties of objects?
for example - pathfinding on some object - set it's max speed to i don't know someglobalvar * 20,
or something like that..

and apply that for each property on every behav, object and other stuff.. (not just for speed).
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,455

Post » Sun May 10, 2015 3:29 pm

In the wish list, but if I/we can figure out some architecture reason to develop spreadsheet like formula fields then I think the idea would go farther. However Ashley has said that formula fields were in C2 development path.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests