Legend of Fordham Forest (Version 0.2 Demo Release)

merrak

  • *
  • Posts: 2423
Box2D Wobbling Towers Problem

Now that I've gotten to some of the larger levels, I started having more problems with wobbling towers and freeze-ups.  :-[

hxscout turns out to be a vastly useful tool. I figured the problem had to be too many collisions--which was the case.

Wobbling towers has been a constant struggle throughout the entire development of this game. I knew I had to be missing something, since games like Angry Birds and Crush the Castle had much more complex structures than I have, and didn't seem to have any difficulties. Although, I did notice in Angry Birds that some larger buildings had little gray boxes that acted as anchors. I borrowed the idea, but it only solved the problem for the initial state of the level. Plus, it didn't solve this:


Figure 1. This is bad, but some creative marketing could help. "Runs at 120 frames per minute! One-hundred twenty is twice as much as 60!"

Interestingly enough, the solution may have been to make the structures more complicated. I took a look Joints Extension and realized that I should be thinking about the problem in terms of how actual buildings are constructed (and knocked down):

- Foundations set in the ground
- Mortar, nails, etc. holding the building together
- Failure of foundation, mortar, etc., when the angle between the pieces is too great

I came up with a little code snippet that loops through all the blocks that are touching each other and creates a weld joint between them. This joint can be broken if either connected block takes too much damage, thus allowing pieces of the towers to break off.

Initially, the entire tower would jump around. This was pretty amusing, although not what I wanted. Creating a foundation fixed that. The foundation is a block that cannot move, to which the first "real" block in the tower is welded to.

The weld joints seem to have reduced the number of collisions, which brought CPU usage to a reasonable amount. I can now build very large towers. They also have more realistic failure modes, since I'm now doing a better job simulating real construction.



I can now make more interesting levels. Here is one where you are ascending a steep valley. You have one player that can fly, but the others can only jump. The challenge in this level is to clear the enemies without doing so much damage to the towers that your other players can't get to the top.



Another piece of the level with enemies flying around:



« Last Edit: January 23, 2016, 11:32:44 pm by merrak »

mdotedot

  • Posts: 1554
Thank you merrak for the approach. Had some things like this myself and couldn't crack it. Your solution seems complicated but might be very helpful in some of my later work!
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2423
Thank you merrak for the approach. Had some things like this myself and couldn't crack it. Your solution seems complicated but might be very helpful in some of my later work!

This has definitely been a tedious problem, one of those where every time I think I've solved it, something new crops up. I haven't had a chance to test the game on a tablet since December, so I'm not sure if the frame rate issue has been completely resolved. It works on the computer, though, which is definitely a good sign.

Even without joints, going into the engine an changing the arguments to world.step from (0.01, 3, 3) to (0.01, 8, 8) had an immediate effect on stability. Going much above 8,8 drops the frame rate. The Box2D manual recommends 8,3, but there's still a lot of wiggling in even modest towers.

merrak

  • *
  • Posts: 2423
Milestone!

So I reached an important milestone.  8)  I've now completed 36 levels out of 144, which is a full quarter of them. 1/4 is an appreciable fraction, but more importantly, 36 levels was the plan for the demo. I wanted to have a web-based demo to promote the full game, so all that's left to do is polish the older assets, such as the character and enemy sprites, fix a long list of minor quirks and bugs, add the rest of the sound effects, and the rest of the UI.

The only setback is that fixing the wobbling towers made some of the early levels too hard. Now that the towers don't fall over at the touch of a feather, I'll have to insert some new weaknesses. Still, I feel like I have better control over the levels and how they play.

The last set was the volcano set, which includes a "boss" level.



So far the fixes to the Box2D parameters have held up nicely. It's neat to be able to make levels that require some real strategy in how you move your players. This level is pretty tough, but by the time you get to it, you may have learned how to bring the towers down in a controlled way, so that you still have cover from the elements.


The towers sit atop a volcano. Can you take out their enemy occupants while staying clear of the rain?


Sneak through the towers.

gurigraphics

  • Posts: 688
Nice. I also intend to follow this strand of the strategy rather than ability to use control.

sorecactus

  • Posts: 31
There is some really cool strategy in this game. And the lighting effects are incredible!

merrak

  • *
  • Posts: 2423
Thanks! :D I keep meaning to update this journal, too. I'm getting pretty close to done with the 36-level web version. I always underestimate how much time it takes to add an interface, configuration controls (mute, etc.), tutorials/help, etc.

The solution to the wobbling towers problem has held up pretty well. The game runs fairly smoothly on my Galaxy S4 and Note 10.1, although it stutters a bit on that final level with the huge towers in the last screenshot. I need to fix that, but I do have a couple more tricks to throw at it. I haven't tried the game on my wife's iStuff yet, but she has newer hardware. I'm assuming if it works on my phone/tablet, then it'll work on newer phones.

I also managed to actually reach the final level. Balancing the difficulty will have to be a task to jump on after the beta run, since I'll need to input from people who haven't played each level dozens of times through.

« Last Edit: February 18, 2016, 12:10:33 am by merrak »

tigerteeth

  • Posts: 734
Hi Merrak!

I've been following the progress here for a while and it looks cool! I'm looking forward to the 36 level demo.

There's just one comment that I'd like to make: the images seem really dark on my screen, to the extent that it's not really clear what's background and what's playable. Is it just my eyes?

merrak

  • *
  • Posts: 2423
Hi Merrak!

I've been following the progress here for a while and it looks cool! I'm looking forward to the 36 level demo.

There's just one comment that I'd like to make: the images seem really dark on my screen, to the extent that it's not really clear what's background and what's playable. Is it just my eyes?

I just recently had a chance to start playing around with some more mobile exports, and I started to notice that, too. I think I must have high-contrast monitors on my PC    :o

Any object in the game that can be lit (like the bricks) starts out dark, so that I have a wide range of possible light levels. I achieve lighting by raising the opacity of a fully lit version of the actor, but I can't subtract light. There's no shadow layer.

Earlier levels had little lampposts that added more ambient lighting. I think I just need to add some more illuminated actors. As long as they don't move, illuminated actors don't cost much CPU time. Dimming the newer backgrounds should help, too.

I've also started to notice some quirks with colors. I have a Galaxy S4, and it seems to have very saturated oranges and reds. My wife used to have an older iPad (unsure of generation), and I was pretty happy with the way the colors looked on it. She recently upgraded to a newer iPad, and the greens are very bold.

The S4's display is especially problematic on the last few levels, which have a red theme. Even dim reds and oranges render fairly bright, which reduces the contrast even more than the game's lighting itself would.

Anyway... I didn't mean to rant too much about colors  :P   But I do think it's worth noting the wide range of potential differences in these mobile displays... something to keep in mind when designing the look of your game.

tigerteeth

  • Posts: 734
I'm on my other (newer) mac and it looks better now. It's crazy how these days you have to be graphic designer and programmer and marketing expert all at the same time...

merrak

  • *
  • Posts: 2423
I'm on my other (newer) mac and it looks better now. It's crazy how these days you have to be graphic designer and programmer and marketing expert all at the same time...

I'm glad being a one-person team is at least an option. I suppose it's not the most profitable one, but I like being able to design and build the entire game myself.

Unfortunately, I just learned I'm pretty terrible at making sound effects. So that part is still missing from the game.

I've been re-evaluating my marketing plan, and I realized I may be better off releasing this game in episodes. It would definitely help to take a break from this game and get back to the other one I started last summer. I could release the game sooner, then come back to the later episodes with fresh ideas.

So far I've outlined the differences between the web-based demo and the mobile game. I'm going to stick to the web demo having 36 levels in a linear sequence.

The full game (episode 1) will include the 36 levels the demo has, plus about 15-20 more, in a non-linear sequence. I'm thinking something like an overworld map, with certain levels acting as gates that must be cleared to proceed. Others can be skipped entirely. One RPG element my game is missing is grinding. Each level can be completed only once. Throwing in some extra levels would give the player a few more opportunities to level up--but can also be skipped if they're going for fastest completion. It may also add some replay value--especially if I include multiple paths to the goal.

gurigraphics

  • Posts: 688
To generate sound effects you can use this:

http://egonelbre.com/project/jsfx/
http://www.bfxr.net/

But you should already know.

I also use reverb effect in audacity, to no get too chiptune

Another solution is to find audio public domain or without attribution here:

www.freesound.org

With attribution you find something here:

http://opengameart.org/
https://www.assetstore.unity3d.com



merrak

  • *
  • Posts: 2423
To generate sound effects you can use this:

http://egonelbre.com/project/jsfx/
http://www.bfxr.net/

But you should already know.

I also use reverb effect in audacity, to no get too chiptune

Another solution is to find audio public domain or without attribution here:

www.freesound.org

With attribution you find something here:

http://opengameart.org/
https://www.assetstore.unity3d.com


Most of these I've seen, except jsfx. I like that one a bit better since it has a synth option.

I also stumbled upon this:
http://sfbgames.com/chiptone/
which has a lot of features.

gurigraphics

  • Posts: 688
wow.  This is a laboratory of sound. ^ ^

tigerteeth

  • Posts: 734
I'm also glad to be a one man team until I have to do absolutely anything related to graphic design, a process which I find endlessly boring. Sound I can do though.