Download Construct 2 release 43

Discussion and feedback on Construct 2

Post » Mon Jun 20, 2011 12:20 pm

OH. Cripes. I didn't notice it before because "angle of motion" has its own "section" with three choices of events, I was expecting just the one "set angle of motion" event, and I missed it completely as a result. WELL I'LL BE DAMNED. XD
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Mon Jun 20, 2011 9:19 pm

[quote="cow_trix":5ls0zorz]Hey Ash. I can't seem to get the 'CurrentXYZ' expressions to work. Here's a cap... Should this make a grid of tiles, or am I missing something?[/quote:5ls0zorz]
You just made a little mistake, your 'update' event runs before the 'initialise' event, and the array defaults to all zero!

Just a warning: creating grids of sprites is extremely inefficient! You should definitely use a tiled background as a base, and only create sprites for tiles which are different on top of that, and even then you should still use tiled backgrounds wherever possible.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Jun 20, 2011 11:01 pm

What I did for TimeScaling objects only was to set its speed to Object.Speed * TimeScale or dividing if the other way around.

But this looks alot easier, and just gave me an idea for-

OH GREAT NOW I WANT TO MAKE SOMETHING ELSE INSTEAD OF WHAT I AM DOING AGAIN. UGH.
B
26
S
7
G
5
Posts: 202
Reputation: 5,235

Post » Tue Jun 21, 2011 12:12 am

@Phobos - you're right it's possible to compensate for the time scale by dividing/multiplying all the speed, accelerations etc., but it's often inconvenient. It's also impossible when the time scale is 0, because your dts are all 0 so there's no way to recover any other time scale. With this release, though, you can pause the game by setting the time scale to 0, but still have an animated pause menu by setting a time scale of 1.0 for all the objects involved in the pause menu. I thought it was worth a dedicated feature, anyway.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue Jun 21, 2011 1:20 am

Why are tiledbackgrounds more efficient than sprites? Sounds like its best to use them for anything static.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Tue Jun 21, 2011 10:42 am

nice work Construct folk - I'm hanging out for audio!

Then, Max/MSP for Construct :)
B
5
G
2
Posts: 40
Reputation: 930

Post » Tue Jun 21, 2011 1:56 pm

Ah, yes, that results in a a grid being made, thanks.

Edit: So I've update the .cap because there's still a problem with it once you swap the events. I'm pretty sure the events should only create a grid 128x128x1, as only one Y coordinate is specified. However, it appears to be making a sprite for each and every value in the array. Am I still missing something?
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Tue Jun 21, 2011 2:36 pm

[quote="alspal":12gbrw45]Why are tiledbackgrounds more efficient than sprites? Sounds like its best to use them for anything static.[/quote:12gbrw45]
It's the same rules as Construct Classic. Grids of sprites are incredibly inefficient at two things: rendering, and collisions.

For rendering, graphics cards are very good at repetitions and can draw a tiled background of any size in about the same time it takes to draw a single sprite. However, if you have a grid of sprites, they're all drawn separately (because it isn't aware that their positions and angles align to make a grid).

So if you have a 20x20 grid of sprites on-screen, it draws 400 times slower than if you had a tiled background the same size. It could have rendered an entire tiled background by the time it's finished rendering the first sprite in the grid of 400. That's a pretty massive performance hit. So, always use tiled backgrounds wherever you can!

Secondly, for collisions there is a similar case. To test if an object overlaps another one, it generally has to test if it overlaps any of its instances. A tiled background counts as one instance, and again a 20x20 grid of sprites counts as 400 instances. So instead of making 1 collision check, it makes 400. Again, 400 times slower.

Imagine if your grid is bigger than 20x20! Even worse! Once more for luck: always use tiled backgrounds wherever you possibly can!

[quote="cow_trix":12gbrw45]However, it appears to be making a sprite for each and every value in the array.[/quote:12gbrw45]
ceil(random(0, 1)) is almost always 1, because ceil(0.0000001) is still 1. It will only ever be 0 when random(0, 1) returns exactly 0, which is basically never, because there are a lot of possible values between 0 and 1!

You should also know that 'for each element' also triggers once for every element in a 3D array, including repeating the event for each element down the Z axis. If you have a 128x128x32 array, For Each Element is repeating the event 32 times for each 2D cell, which you probably don't want...
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue Jun 21, 2011 3:30 pm

by the way, reading this i wanted to make something like that, but with a grid of tiles.
Here is the result:
[url:1fbo4qt8]http://dl.dropbox.com/u/23880596/Pasto.capx[/url:1fbo4qt8]
B
16
S
3
G
6
Posts: 19
Reputation: 3,204

Post » Sun Sep 25, 2011 11:51 pm

Hi,
The link to the "custom movement demo" is broken (in first post).

Can someone post a link to a well commented demo file or a tutorial using custom movement?

I'm also interested in any pathfinding that works in Construct 2. Any suggestions?

Thanks!!!
B
19
S
2
G
1
Posts: 2
Reputation: 1,438

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests