How do I, couple of questions (Performance & odd behavior)

Get help using Construct 2

Post » Thu Aug 07, 2014 8:21 am

Message: Vallar can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hey guys,

So I have this game (http://goo.gl/HEFZBH or the forums' thread if you prefer scirra.com/forum/space-whackinator_t111739) and I have a couple of questions, some of them are general others are specific to problems. Not sure where to post exactly (and I didn't want to post multiple threads so I kind of figured one would do, if that is bad, let me know I'll shoot it down)

The first question is about the player movement. I have the setup below.

Code: Select all
Every Tick > Set Player.X to Mouse.X


That is fine, however in the game one of the enemy types shoots a snare bullet at the player. So I wanted to slow down the player's movement. I tried something like below:

(note the "wait" isn't nested sub event it is just the formatting messes with how it looks. They are both on the same level same as below too).

Code: Select all
Every Tick > Set Player.X to Mouse.X
---------------> Wait (0.2) seconds.


That practically did nothing. So I tried something else.

Code: Select all
Every Tick > Set Player.X to Mouse.X - 5
---------------> Wait (0.2) seconds.
---------------> Set Player.X to Mouse.X


That didn't work either. I thought I am thinking of this the wrong way, instead of "lagging" the player sprite. Why not apply a "lag" effect on the mouse itself. There was no such option. Then I tried to put the player's timescale to 0.3 and that didn't affect the movement, only the animation of the sprite itself.

So I am not sure exactly how can this be done using mouse (I can and was able to do it EASILY with keyboard but mouse... is proving to be elusive).

This above has been resolved thanks to LittleStain.

The second question is memory. Now since this is the first game I have done in Construct 2 (aside from many others using tutorials and some stupid stuff to get to know the software more), I don't know much about the memory thing. It says on the toolbar 297 MB. I am a little concerned by that due to the fact that I feel I don't have a lot of things going on.
The project has about 15-20 sprites of which 4-5 has animations (1-3 animations per) and each animation is average 4-6 frames. I feel that 297 is too much (my initial target for the game is web or standalone .exe stuff like an offline game, if there is interest I might port it to mobile but I am not going there just yet). Is that a correct feeling? Or am I being paranoid? If I am correct, what can I do to enhance this?

Third question is weird behaviors (actually 2 in one):
1- When I launch the game and test it, sometimes the ball hits walls/enemies/rocks multiple times in succession (as it is cornered for example between a wall and an enemy) and instead of bouncing it goes through the wall/enemy as if it wasn't there. It is rare and doesn't always happen, but when it happens it breaks immersion/looks extremely weird. Is there a way to counter this behavior?

2- Behaviors that happen in specific browsers only. Now I had someone test the game on both Chrome and Firefox (I only test on Chrome for now). They mentioned that in Chrome everything is fine (as I test it) and all walls function pretty well (aside from the occasional above problem). But when he switches to Firefox things get strange. The top wall in the game suddenly becomes "hollow" and things tend to move through it almost consistently. They mentioned this only happens on Chrome... now what exactly does Chrome do that Firefox doesn't that causes this? And how do you deal with specific browser problems such as this?


Sorry for the long post but these questions have been boiling up for a long time and I have been putting them off. I do appreciate you reading this and definitely thank you very VERY much for trying to help/your time :)
Vallar.
Last edited by Vallar on Sat Aug 09, 2014 7:46 pm, edited 3 times in total.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Thu Aug 07, 2014 10:51 am

I would try using lerp (linear interpolation) for this
something like:

every tick player set position x=lerp(player.x,mouse.x,0.5) y=lerp(player.y,mouse.y,0.5)

the issue with the walls could come from the bullet missing the collisions due to speed
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Aug 07, 2014 11:25 am

That just worked like a charm with the lerp! Thank you very much.

As for the missing of the collision, the ball's maximum speed was about 400-500 at that level. Hardly ground breaking... nonetheless is there a way to fix this aside from slowing down the ball? As the game as you see does depend on it.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Fri Aug 08, 2014 8:08 am

Bump still having a problem with the other issues:

1- Now since this is the first game I have done in Construct 2 (aside from many others using tutorials and some stupid stuff to get to know the software more), I don't know much about the memory thing. It says on the toolbar 297 MB. I am a little concerned by that due to the fact that I feel I don't have a lot of things going on.
The project has about 15-20 sprites of which 4-5 has animations (1-3 animations per) and each animation is average 4-6 frames. I feel that 297 is too much (my initial target for the game is web or standalone .exe stuff like an offline game, if there is interest I might port it to mobile but I am not going there just yet). Is that a correct feeling? Or am I being paranoid? If I am correct, what can I do to enhance this?

2- When I launch the game and test it, sometimes the ball hits walls/enemies/rocks multiple times in succession (as it is cornered for example between a wall and an enemy) and instead of bouncing it goes through the wall/enemy as if it wasn't there. It is rare and doesn't always happen, but when it happens it breaks immersion/looks extremely weird. Is there a way to counter this behavior?

3- Behaviors that happen in specific browsers only. Now I had someone test the game on both Chrome and Firefox (I only test on Chrome for now). They mentioned that in Chrome everything is fine (as I test it) and all walls function pretty well (aside from the occasional above problem). But when he switches to Firefox things get strange. The top wall in the game suddenly becomes "hollow" and things tend to move through it almost consistently. They mentioned this only happens on Chrome... now what exactly does Chrome do that Firefox doesn't that causes this? And how do you deal with specific browser problems such as this?

4- Is it better that one can use Webstorage (for ingame store) + the normal save/load (for saving and loading the game normally) system built in Construct or would Save/Load do the trick for both uses?

Thank you very much for reading and trying to help :)
B
19
S
7
Posts: 161
Reputation: 1,751


Return to How do I....?

Who is online

Users browsing this forum: kellehk, MadSpy, oosyrag, R0J0hound, totoe, Yahoo [Bot] and 36 guests