Very slow with WebGL

Get help using Construct 2

Post » Mon Feb 06, 2012 4:48 pm

Ok, I got the idea, thanks. Any suggestions - what can I use instead on Physics in this case? Can Platform imitates real physics?
B
7
Posts: 36
Reputation: 628

Post » Tue Feb 07, 2012 10:46 am

But how can I use Physics behavior if it so slow on any device? It's impossible to create a good game with 2 or 3 physical objects only. Seriously, I am confused and no more sure that software is so awesome..
B
7
Posts: 36
Reputation: 628

Post » Tue Feb 07, 2012 11:09 am

You only need physics if you want realistic glancing collisions, etc. (e.g. if you want a stack of crates to fall down properly).
You can still have physical objects. Give them the solid behaviour. They won't move but will still cause collisions with other solids and objects with platform, 8-direction, etc.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Feb 07, 2012 2:17 pm

Ok, I tried to apply:

1. Physics and Solid - for one moving object.
2. Solid for other objects.

But when moving object collisions with solid object it's just fly through.

For my idea I need 20 non-moving objects and 1 moving, so I want to apply physics to only one object. How can I set other objects to detect collisions with them?
B
7
Posts: 36
Reputation: 628

Post » Tue Feb 07, 2012 2:25 pm

There is a file with example. Can somebody show how to use only on physical object with other non-physical objects. I need realistic movement, platform is not a good idea.

http://terademix.com/physics.capx
B
7
Posts: 36
Reputation: 628

Post » Tue Feb 07, 2012 4:02 pm

Read the tutorial Physics in Construct 2: the basics.

[quote]Note: Physics objects only interact with other physics objects. Adding the Solid behavior to the floor has no effect on physics objects. They ignore anything which does not also have the physics behavior. Physics objects will pass right through 'Solid' objects, unless you give them the Physics behavior and set them to immovable.[/quote]

Physics should perform OK with up to 20-30 objects, enough for an Angry Birds type game. Are you sure Physics is causing the slowdown itself? Mobiles have pretty weak hardware, and simply drawing the screen can cause most of the slowdown. If you remove Physics entirely, does the game run a lot faster? If not, you must conclude that Physics isn't causing it to run slow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Feb 07, 2012 9:51 pm

2Ashley: I have worries because currently in my game only 5 Physical objects and game is already too slow. When I delete 2 object (3 are still in) gameplay is awesome - no slow bugs at all, WebGL at 50-60 FPS.

I red all tutorials and manuals about Construct 2 few days ago and apply most of advices to increase performance, but still no results.
B
7
Posts: 36
Reputation: 628

Post » Tue Feb 07, 2012 10:46 pm

[QUOTE=alexgold87] There is a file with example. Can somebody show how to use only on physical object with other non-physical objects. I need realistic movement, platform is not a good idea.

http://terademix.com/physics.capx[/QUOTE]


In your example, the blue block uses physics behaviour, but the object your using for the floor is just flagged as solid(with no physics)

The floor has to have the physics behaviour assigned to it for the collisions to work correctly.

You need to spend a couple of hours reading the manual before you start making your games.

It will save you loads of time in the long run.



B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Tue Feb 07, 2012 10:50 pm

Ok, I got the idea. To show realistic move you have to set up world gravity from 10 to 25-30. After this all objects start to move like usually even with 30 FPS. Thanks to everybody.alexgold872012-02-07 22:51:23
B
7
Posts: 36
Reputation: 628

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests