Debugging help

Get help using Construct 2

Post » Sat Mar 16, 2013 5:23 am

I've solved most of my debugging issues by adding a new GUI layer and checking various object properties and watching how they update in realtime.

However, there is an issue I am not sure how to test, and that is why my enemies are sometimes rendering off the screen. Perhaps this is a Firefox issue, as I haven't seen it happen on Safari (yet).

You can play the latest version of the game build here.

Enemies spawn only at the beginning of a wave, and the code that spawns them is:



I have boxed the spawning code, and yet they still sometimes spawn off the screen and never show up (they have pathfinding, but when they spawn off the screen they do not move). I am starting to wonder whether it may be a bug with C2 itself, as there are no other events that spawn them off the screen. There could be a rare case where an asteroid spawns on an enemy and physics causes the enemy to move off the screen, but the enemies have the Wrap behavior and should show up on the screen anyway.

Speaking of Wrap, the Wrap behavior isn't working on my enemies. I had to manually implement wrapping events. Possibly a C2 bug?

ImpulseCollision.capx
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Sat Mar 16, 2013 7:57 am

At least the spawning problem seems to be caused your layout scaling, instead of 'Scale' you should use 'letterbox scale' or similar, take a peek at layout scaling stuff at manual/soem tutorial. Seemed to solve the problem for me at least. I'd imagine the wrapping issue might be caused by this as well.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sat Mar 16, 2013 8:20 am

I'm not a fan of letterbox scale because it causes black borders to appear. Perhaps this could be changed by adopting a 16:9 aspect ratio? Currently I'm running at 900x600, and letterbox scaling causes black bars to appear.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Sat Mar 16, 2013 9:09 am

[QUOTE=Excal] I'm not a fan of letterbox scale because it causes black borders to appear. Perhaps this could be changed by adopting a 16:9 aspect ratio? Currently I'm running at 900x600, and letterbox scaling causes black bars to appear.[/QUOTE]

Check this tutorial for more info: https://www.scirra.com/tutorials/73/supporting-multiple-screen-sizes/page-1

You should probably adapt your game to support multiple fullscreen resolutions if that is your intention.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sat Mar 16, 2013 6:21 pm

[QUOTE=vee41] At least the spawning problem seems to be caused your layout scaling, instead of 'Scale' you should use 'letterbox scale' or similar, take a peek at layout scaling stuff at manual/soem tutorial. Seemed to solve the problem for me at least. I'd imagine the wrapping issue might be caused by this as well.[/QUOTE]

Just tried letterbox scaling, still having the enemy spawn off-screen in Firefox.

I created an event that checks for the enemy being offscreen. Basically the event looks like this:

if Enemy is onscreen, set Enemy.IsOnScreen to 1.

if Enemy.IsOnScreen = 0 (it's zero by default), then
-Every tick, set enemy position to Enemy.X + 1, Enemy.Y + 1

It doesn't seem to work, however, because when an enemy spawns off the screen it's not coming around. I have my own custom wrapping code that is supposed to bring the enemy to the other side of the screen once it exceeds WindowWidth/WindowHeight or if X/Y is less than zero, but those aren't working either.

Maybe it's just an issue with the latest version of Firefox (version 19.0.2)? This doesn't seem to have problems on Safari.Excal2013-03-16 18:30:09
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Jul 10, 2013 7:07 pm

I just played your game.   It was fun.   If there was a glitch, I did not notice it...too distracted by playing. cool music.
B
16
S
2
G
1
Posts: 35
Reputation: 1,033

Post » Wed Jul 10, 2013 8:21 pm

Maybe use a different method for spawning altogether if it is an unfixable issue.

Could set invisible markers around the environment (one at each corner for example) and each round the ships spawn from these positions.

In-game this could be covered up with a graphic showing a wormhole, ship spawns and is propelled 64 pixels into a direction towards the player with a random add to the angle of + or - 45 degrees.

This whole mechanic inturn tells the player, "ships will always spawn from these 4 points - best to keep away from them in future" and the random angle the ships fly out of each wormhole at least prevents the whole thing feeling too "uniform".

(Part of the reason I'm suggesting this is because multiple times the ships spawned on me/too close to me, inflicting massive damage)

Otherwise love the game, reminds me alot of that astroids game Activision released a few years back :)
B
15
S
5
G
2
Posts: 154
Reputation: 3,076

Post » Wed Jul 10, 2013 9:38 pm

@Excal would like to check it out, but file isn't correctly linked
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, TheHat, tomi71 and 1 guest