MarkPal

Members
  • Content Count

    22
  • Joined

  • Last visited

Everything posted by MarkPal

  1. Hi all, I just went through of putting all the single image files of my game into texture atlases. This made my game load and run faster, which was a good thing. I, however, noticed that implementing texture atlases gave me worse results when monitoring my game's memory usage with Google's Timeline tool. Before this the memory usage of my game was quite steady but now it goes up and up every time I switch from Main Menu -state to Game-state and back repeatedly. It never comes back down like it used to. Is there any differences in the way memory/cache works if I create sprites from single image files or atlases? Currently I'm destroying everything using shutdown but it seems that these sprites created from atlases doesn't get fully destroyed. To destroy a sprite I'm doing this.sprite.destroy(); If someone could help me with this, I'd really appreciate it. I was just making final optimizations for my game and now this is causing me some unwanted memory leaks.
  2. I have this same issue, sort of. I get all the files loaded successfully but when I try to play them the game freezes. I tested this multiple times and I noticed that if I have many sounds playing simultaneously the game freezes. If I only have background music and one sound, let's say, everything works pretty fine. Therefore it seems that in Mobile IE you can't play many audio files at the same time. Do you get any error messages when your game gets stuck? You can see it right from your phone by using this: http://markknol.github.io/console-log-viewer/
  3. Hello all, I've noticed that If I make a game with a Phaser version 2.2 or above my Nokia Lumia 920 can't show any of its graphics. It's using Mobile IE as a browser and this problem never occurs with a desktop version of IE. For example I once went through this SpaceHipster tutorial, which worked pretty well with Phaser versions under 2.2. Then, at that time, I made it run Phaser 2.2 and suddenly my Lumia phone was showing only black screen with background music playing. This same thing is happening to me now in my client project, in which Lumia only shows the background image of my HTML file. In this project I'm using Phaser 2.2.2. I also tried Phaser 2.3 but it was the same. Any ideas what could be causing this?
  4. I'm wondering if I could do this somehow by adding a function to Loader's onFileError event. The difficult part of that is all different file types, I guess. At least if I make it to load something again by using basic commands (this.load.audio... this.load.spritesheet...)
  5. Okay, I tried this but I still seem to get this error randomly. It's always a different file that doesn't load and gives a Phaser error message. Any other ideas?
  6. So if I do it like icp suggested, will it also make sure that all the loadings inside my Preload state get assuredly done? I mean that even though it makes sure that all scripts etc. have been loaded, I'm still making the game load more files when Boot-state has completed and switched to Preload state. window.onload = function() {var game = new Phaser.Game(640, 960, Phaser.AUTO, 'game');game.state.add('Boot', Candy.Boot);game.state.add('Preloader', Candy.Preloader);game.state.add('MainMenu', Candy.MainMenu);game.state.add('Game', Candy.Game);game.state.start('Boot');};Preload state starts inside window.onload after Boot.
  7. No, it's not. In my index.html file I load all script files inside <head> tag and then inside <body> tag I load main.js, which is the main game file. Would this window.onload help in this preload issue of mine? How?
  8. Hello all, I don't actually know if this is a Phaser issue or if this is a server related problem. So, sometimes when I start my game and go through the Preload-state, I get this log message in browser's console which says that one of the assets wasn't loaded. It's a Phaser message and it goes like Phaser.Loader error loading file... When this happens the file is always different. Sometimes it's an audio file, sometimes a single image file or sometimes a spritesheet. It's completely random. Now I'm wondering if there is any efficient way to ensure that every file has been loaded before switching state. Do I have to check the game's cache with every key or is there any better way? I'm using Phaser 2.2.2 and in the Preload state I'm loading quite a load of files: 10 audio music files22 audio fx files41 single image files24 spritesheets2 atlas filesThis has happened on both PC and mobile. It would be great that the game wouldn't skip a file in any case because that eventually leads into a crash.
  9. Okay, that's interesting. I, however, just checked my audio files and they are all 44100Hz. I'll pass this information to my audio guy and let's see what he thinks.
  10. I had this same problem and ended up to create a keyboard of my own. It looks like this: POISTA = Remove character VÄLI = Space By doing this it's very easy to input names and anything on any screen. In addition to that using keyboard is also allowed on PC. By making your own keyboard like this you can also make it look the same as your game.
  11. I tested this audio thing a few times more and for me it seems to happen only in my game's version which runs in Phaser 2.2.2. This hasn't happened yet with Phaser 2.1.2. So I'm wondering if there are any differences in the way SoundManager works between these versions that could be causing it? I would much like to share a link to my game but unfortunately my clients wouldn't like if I share it here in public.
  12. When my iPad Mini 1 crashes it only says something like "A problem occured with this webpage so it was reloaded." It doesn't go back to home screen but I guess this is the same case? At least when my iPad 2 crashed when I had memory leaks it did the same thing. It's just strange that with iPad Mini 1 it sometimes happens during preload and sometimes it lets me play a couple of levels before it happens. Gotta try putting all my graphics into texture atlases next, then. Maybe it will help. Thanks for the tips! Luckily this audio issue happens quite rarely.
  13. Also iPad Mini 1 has the same amount of RAM as iPad 2, which runs the game with no problems at all, using the same iOS version and browser.
  14. Yes, I've used Google's Dev tools to monitor my game's memory usage. In fact I previously had some memory leaks because in my game I load dozens of images in every new level and I wasn't removing them from cache before. Now the memory usage stays steady, but I still have to say that my game is quite heavy. By this I mean that I have tens of different graphic files (in addition to level-specific images), some of them are quite big, and I also have tens of sound files. I'm not using texture atlases yet so maybe they could make an improvement? Even though my game would take a huge place from memory I'm still wondering why it makes the audio play at half speed. It plays like in 50% tempo. This didn't ever happen in Phaser 2.1.2.
  15. I'd like to add that it's not happening only on this particular iPad Mini 1. I have two of them and it happens on both devices. The game is also running on WebGL. I've tried using canvas but it kicks the frames-per-second from 30-40 down to about 10. Sometimes iPad Mini 1 also crashes either in preload or in the beginning of some random state. It's difficult to track down because the crash always occurs in a different time. I've also noticed that sometimes it doesn't load a random file during preload (Phaser.Loader error loading file *) which makes the game crash eventually. So many crashes, and all these are happening only using iPad Mini 1. Sadly, my game is going to be played at schools and all the students there are using iPad Mini 1s.
  16. Hi all, I just upgraded the Phaser version of my game from 2.1.2 to 2.2.2. I did this because I was experiencing many, many issues playing the game on iPad Mini 1 (iOS 8.3, Mobile Safari). Now, although the game works a bit more fluently, I noticed a strange issue: sometimes when I start the game by doing a clean start by clearing cache all the audio starts to play at half speed. It's like everything is in slow motion except graphics. Do you have any idea what could be causing this? To play audio, I first load them in my Preload-state like this: this.load.audio('menuMusic', ['assets/audio/music/MenuMusic.ogg', 'assets/audio/music/MenuMusic.m4a']);I also make sure that the audio file has been decoded before I start my Main Menu -state. When audio starts play at half speed, it's not only a single audio file but every other file as well, including all SFXs. This hasn't happened using PC or Android mobile devices. Also my iPad 2 (which should have the same specs as iPad Mini 1) plays the game flawlessly. The iPad 2 is running the same iOS version 8.3. This problem doesn't usually repeat if I press the update button of the browser and let the game start all over again.
  17. Thank you all for your tips and clarifications. I got it to work by doing this: this.levelMusic.play('', 0, 1, true);this.levelMusic.onLoop.add(this.playLevelMusic, this);And then with the function playLevelMusic I set it to play once again: playLevelMusic: function() { this.levelMusic.play('', 0, 1, true);}That way it seems to work for me. Somewhat similar to phantomas' solution. Dunno if this is very efficient, though.
  18. Hello all, I've nearly finished one big game using Phaser and today I encountered a problem I haven't noticed before: all the audio files I have set to loop doesn't loop in Chrome browser. This happens with both desktop and mobile. When I play my game using Opera or Firefox all these audio files play flawlessly and loop. I'm using ogg and m4a as file formats for music files. For sfx I'm using wav, ogg and m4a. Have you got any ideas what could be the cause of this problem? I'm using Phaser 2.1.2 and for looping sounds I'm doing this: this.levelMusic.play('', 0, 1, true); In Chrome, despite the boolean value for loop being true, the audio file plays only once. If I check from console the value of looping (this.levelMusic.loop) it also says it's true. All help is much appreciated. - Marko
  19. Oh, I hadn't thought that that could be the reason. Always learning something new.. This was really helpful, thank you!
  20. Hello all, To start with, I'm still using Phaser versions 2.1.x in my game projects as for some reason Phaser 2.2.x doesn't display anything at all when started on Nokia Lumia (Mobile IE). In any case, I came across this problem today to which I need some help. In my game I'm using special characters such as å, ä and ö in Text objects. In addition to this, I'm using Helsinki webfont. These special characters are displayed nicely without any errors using Phaser 2.1.2. Today, however, I wanted to add fadeTo-method to my background music and for this I needed to upgrade my Phaser to version 2.1.3. Doing this upgrade unfortunately made all my special characters appear like this: å -> a ä -> a ö -> o Is there anything I can do to get these characters displayed like they did with Phaser 2.1.2? I really need both special characters and fadeTo -methods in my game, so I'd appreciate your help. Thanks! - Marko
  21. I got this solved myself by checking time values with game.onPause and game.onResume. If somebody is struggling with this same problem, here's how I did it in my Game-state: create: function() { ... this.game.onPause.add(this.onGamePause, this); this.game.onResume.add(this.onGameResume, this); ... } onGamePause: function() { // Saving duration (time left) of TimerEvent when pausing the game. this.timeOnPause = timer.duration; // Stopping Timer and clearing its events. timer.stop(true); } onGameResume: function() { // Adding a new TimerEvent with new delay time. timer.add(this.timeOnPause - this.game.time.pauseDuration, this.timeIsUp, this); // Starting Timer once again. timer.start(); } Now it doesn't matter if the player switches tabs or puts the window down. Everytime the game resumes it has a new delay time.
  22. Hello all! I'm still quite new to Phaser and this is my first post in here. So, I've been developing a big educational game in a group for about three months now and I've run to this little problem. As our game is an educational game, one of our intents is to use it also in exams. This means that our game has to have a timebar which works in a way that the player can't cheat. At this moment I've got the timebar up and running but there is this one problem in which the player can switch browser's tabs or put the browser window down causing Timer to pause. So I'm wondering is there any way to prevent Timer from pausing like this? Although I've got lots of answers to many programmatical issues from this forum, this one is still an issue to me. In one discussion on this forum I learned how setting stage.disableVisibilityChange to true makes the game not pause when visibility changes. I added this line of code in our game's Boot-state but this doesn't clear the case. The Timer still pauses when this value is set to true - enabling players to cheat. The only thing I've noticed after playing with this value is that our game's music doesn't pause anymore when switching tabs. If somebody of you knows the answer to this problem of mine, I'd really appreciate the help. Thanks! - Marko