Construct Game Freezes

For questions about using Classic.

Post » Sun Jul 12, 2009 4:11 am

Hi,

I ran into a strange bug in version .98.9. So I found a cool example .cap of a space game on the forums that had walls around the playing area that was 4000 x 4000. I removed the walls on the left side and increased the playing area to 50000 x 50000. Now when I fly at an angle south east I lose all movement control around 20000, but the game doesn't lock up because I can still fire. Any ideas why this would happen?? I'm not sure if this is a Construct bug, or just doing something stupid with the .cap so I didn't want to post a bug report yet.

[url:37ofzthp]http://www.mediafire.com/file/1z2d52mzx0k/large_arena_space.cap[/url:37ofzthp]

btw... Would you recommend learning on version .98.9 or using the latest dev build?
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Jul 12, 2009 4:19 am

It's a limitation of the physics behavior. If I remember correctly, the size of the layout is limited to a certain amount. Anything beyond that and physics stops working. I'm not exactly sure what the range is, though. David would be the one to ask, he's the fellow that implemented the physics behavior.

And I suppose that's something that should be added to the wiki :P

Anyway, if you're making a space game, there are better ways to make large areas like that. You can fake it with manually scrolling backgrounds, for instance. You don't actually have to make ginormous levels like that, it's kind of a waste. With a little pre-planning you can set up a system where it seems like the universe goes on forever but in actuality it's just a small area.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jul 12, 2009 4:49 am

Looks like the limitation is 20000 x 20000. I updated the wiki to state that.

I figured there was a better way to give the appearance of a large world without making it ridiculously large. I'll have to experiment some with scrolling backgrounds then. I still want the world to seem large as in: the x and y coordinates still increment to a large number, and I can place objects at large x or y position. Once I figure it out I'll post an example. Cheers!
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Jul 12, 2009 5:59 am

Hmm in our code we used:

b2AABB worldAABB;
worldAABB.lowerBound.Set(-100, -100);
worldAABB.upperBound.Set(400.0f, 400.0f);

The default scale for physics is 2% = 0.02

So 400 / 0.02 = 20000

So yeah, 20,000 pixels is the max size.

I need to do a review of the physics code because the speed values dont conform with pixels per second like everything else does.

We originally wrote the physics using newton...and then we changed to chipmunk...and then we changed to box2d...so the codebase got a bit confusing trying to make it backwards compatable with older versions (so that force values all remained the same)

However so many of the games use physics, if I suddenly changed the unit measurement it would make lots of games behave wrong...I'll probably add a checkbox to use 'old unit scale' which will be ticked if your project is old :)
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sun Jul 12, 2009 11:09 am

Even if it broke old physics games, the time to do that is now - the sooner the better.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Sun Jul 12, 2009 11:31 am

[quote="David":2tt0j86e]I'll probably add a checkbox to use 'old unit scale' which will be ticked if your project is old[/quote:2tt0j86e]

Good idea.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sun Jul 12, 2009 4:38 pm

[quote="Ashley":2ci21fh3]Even if it broke old physics games, the time to do that is now - the sooner the better.[/quote:2ci21fh3]

Agreed. It's ultimately for the best.

And even if there is a conversion checkbox, it wouldn't really be suitable to have it remain in the 1.0 version. People are going to have to bite the bullet some time, and either convert their physics settings and math to the new way, or finish their game with a beta version.

Of course, that's just my opinion :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jul 12, 2009 9:27 pm

[quote="deadeye":3c4obdpl]bite the bullet...my opinion[/quote:3c4obdpl]
Mine too. Yay for pixels/second, that'll make messing around with physics much easier.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Jul 13, 2009 3:07 am

[quote="deadeye":xdv77l1a] it wouldn't really be suitable to have it remain in the 1.0 version.[/quote:xdv77l1a]
and why not? it's just one checkbox.. :mrgreen:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests