HTML5
June 8, 2019
June 8, 2019
Darkhouse was made in Flash, because it has worked well and there were not very many issues with it. One problem that did show up was that Flash doesn't recognize the Enter key as an input. I didn't previously know about this issue, so I released Update 0.0.1 with an alternate attack key, among other control options.
I still expect more bugs to be found over time, but overall, Flash has worked great for Darkhouse. The main problem is that Flash is being discontinued next year. Newgrounds does have a workaround, but HTML5 games are still preferable. But Darkhouse doesn't work in HTML5. It has a lot of issues that make the game unplayable, and I'm not sure how to fix them. I have a couple ideas, which I'll get to later in this post.
One problem with HTML5 Darkhouse is the sound. All music and sound effects seem muffled, as if the quality suddenly got worse. It might have something to do with the fact that, at least in the game engine I'm using (Stencyl), HTML5 requires sounds in both .mp3 and .ogg formats, while Flash only needs .mp3, but I'm not sure if that's the issue.
Another problem is that during levels, the game occasionally lags and freezes for a moment. This might be because in the enemy AI a lot of things are happening, and there are a lot of enemies. I might need to simplify it or optimize it so it doesn't reduce performance. Again, I'm not positive this is what's going on here.
The big issue, though, is that Darkhouse crashes in HTML5 very frequently. It doesn't happen immediately, but after spending too much time in one scene, the browser goes black for a moment, then reverts and the game goes black and can't be interacted with. No error messages pop up. The music still continues to play, and for some reason if you right click and then click on "View page source," the game returns to normal, but it will still crash if you remain in one scene too long. So if you frequently move from scene to scene, either on the menu or in game, it won't crash. Because of this phenomenon, I had previously thought the issue was with the boss, because you remain in that scene longer than other scenes since your fighting the boss. But after further testing, the game will crash in this way on the Home screen, the Settings menu, while the game is paused, and during boss fights. It doesn't look like it will crash in the Scoreboard menu or during an unpaused game.
My best guess is that my drawing code is causing the issues. In the Settings menu, and while the game is paused, I draw boxes for the user interface, a black one on top of a slightly larger grey one. When the game is paused, I also draw a black, transparent box over the whole screen (not including the pause menu) to dim the screen. I also draw a box on top of a slightly larger box to make the player and boss health bars. Stencyl doesn't recommend that you draw shapes on top of each other, though, saying that it wastes processing power. But this hasn't been an issue on Flash, and I don't draw these boxes on the Home screen, where the game still crashes. I have also experimented with more complicated drawing code to avoid drawing shapes on top of each other, but the issue persists. However, I've also tried a boss fight scene with no health bars, and it did not crash, or lag, which leads me to believe that the drawing code is the problem.
The Home screen is the only place where I don't draw shapes and the game still crashes. On that screen I draw text only, and I have a lot of code setting text attributes to make sure everything works. The code in the Settings menu works the same way. They're the only two scenes where you can navigate the menu instead of just pressing "Back to exit," for example.
If these are the issues, then I have a few ideas for how to work around them. For example, in the Scoreboard scene, I use a background for the list of scores instead of drawing boxes, so I could do the same thing for everything else. And for the menu screens that feature navigation, I could simplify them to only operate where a specific key is assigned to each menu item instead of the scrolling and selecting currently in Darkhouse. I don't like the idea of removing that feature, though. For example, I'd have to make it operate with "press Z to start," or "press X to view scores." I can do that, it's just not as cool as a functioning navigation for the menu screens. That being said, the pause menu doesn't feature navigation, because it didn't work. Since the game is paused, attributes don't change in real time, so it wouldn't update what item you have selected on it's menu.
I don't know if this is the whole story, either. HTML5 is different from Flash, and there may be other problems and things that cause problems that I'm still unaware of. I'll continue to experiment with some of the ideas I've stated, and I don't know if they'll fix the issues or not. I'll also post updates on what I find if I discover anything new, especially if it contradicts something I've previously said. I'm still very new to game development, so if you have any questions, ideas, or suggestions, please let me know. I want to make Darkhouse the best game that it can be, a fun, challenging, and bug-free game.