Log In  

Cart #yugiwohen-0 | 2021-12-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

This is a remake of an old Flash game I used to enjoy.
Here's an URL to the Author's Boomshine page: https://k2xl.com/#/games/boomshine

Anyway, one of the best things about the game was the music, but I struggle with the sound/music part. So, if anyone wants to create the music that would be great! Here's a working version of the game online (I'm assuming it's some kind of Flash emulator): https://www.addictinggames.com/strategy/boomshine

Also, my sound effects are pretty crappy too.

Another thing that bothers me is how much the game slows down once we reach 40 balls at the screen at a time. I've gone over everything and I've narrowed it down to the following function.

-- distance
function distance(obj1,obj2)
 return ((obj2.x-obj1.x)^2+(obj2.y-obj1.y)^2)^0.5
end

It's just finding and returning the distance between two points, but of course I have to compare every ball with every other ball so I guess it adds up. If I comment out the logic in that function (and just return a value), the slowdown doesn't occur (even at 60 balls). It looks like some pretty simple math for it to cause so much trouble.

Anyway, thanks for checking it out and any feedback would be great!

Edit: Oops, I forgot to add the score.
Edit 2: Oops, I forgot the Author's URL.

P#103061 2021-12-18 18:29 ( Edited 2021-12-19 23:32)

Thanks for sharing, it's a neat mechanic. It seems mostly luck-based as-is but could serve as a foundation for some interesting gameplay (maybe you keep playing instead of it resetting between rounds, and you gain moves by chaining enough explosions?)

Re: distance, there are a couple of optimizations you could employ.

  • If you're only detecting collisions, you can deal in dist^2 rather than distance. This lets you cut out the square root operation from the distance function (and you just compare it to the square of the distance you're checking.) So if the collision distance is the ball radius + explosion radius you'd square their sum and compare that to the dist^2 function result.
  • It looks like your code is running the dist check on every ball against every other ball independently in their own updates. Instead consider a game system that keeps a list of active colliding explosions only, and steps through them once. This should only require checking explosions vs balls since balls don't inter-collide. In addition, you could avoid situations where A vs B is checked AND B vs. A is checked, etc.
  • For highest performance you could use a spatial partitioning scheme (e.g. divide the screen into regions and track/compare only those things in adjacent regions with one another) but this would be moreso if balls were all bouncing off of one another and actually needed to track distances.
P#103070 2021-12-18 21:34

@Logarhythm has some good ideas. I'd like to offer a simple one, @pootie. If you fail to complete a level. A new single ball is added to the mix making it easier to complete that same level.

Naturally this would count against your score as you score more according to completing a level the first time it is seen.

I have played a game similar to this for the Super Nintendo. Here:

https://youtu.be/9hsUBtbcSqM?t=1482

Note how each explosion lasts a good time and the explosion radius itself sets off others.

As for speeding up the game, the screen is only 128x128 pixels. It should be possible to generate a lookup table ahead of time for any calculations that deem to slow down the overall execution.

P#103099 2021-12-19 03:31 ( Edited 2021-12-19 03:42)

Thanks for the feedback @Logarhythm and @dw817!

As for the game play mechanics, I was just trying to reproduce what the original did. I'd like to add your suggestions but I'm not sure how to easily indicate that it's a remake/demake, but that it's been changed. I suppose I could just add "extended" or something; it's not like I'm selling it.

Was it clear that you could move your cursor around? I realize that you could play the whole game leaving it in one place, but you can move the cursor too.

I'm working on the performance enhancements suggested by the both of you.

P#103118 2021-12-19 14:41

@pootie

I enjoyed a brief play on this. Thanks for posting it.

Moving the cursor seemed obvious enough to me, but as I tend to try all the regular Pico-8 buttons (cursor keys + z/c and x) on the games here anyway, that's no guarantee of it being obvious to others.

Because two buttons together were used to go through the menus, I did find myself continually pressing both (o) and (x) buttons throughout the gameplay, even when I knew I only needed one of them.


I think you'll get the most benefit out of Logarhythm's suggestion "consider a game system that keeps a list of active colliding explosions ... This should only require checking explosions vs balls since balls don't inter-collide."

Just have both the player and the balls generate a new explosion object when appropriate. You'll be able to keep a lot of the code you've already written just by moving it from the ball object definition into the explosion object definition.

You might also be able to cut out sort and tick/ticks (these seem to be used only in sort?). (Obviously as you're more familiar with your intention than I am, you are better able to judge how necessary sort is; I'm only pointing it out as another place where there could be a delay because it iterates over a number of items.)


Plus, from my playthrough and looking through the code, I think you have omitted to reset levels.index to 1 when the player wins, but that's an easy fix.

Regards, Remcode.

P#103120 2021-12-19 15:17

I've made some changes:

1) Performance
-Moving from comparing all balls to each other, to maintaining a list of 'explosions' fixed the lag issue.

2) Appearance

  • I did away with the outlines on the explosions.
  • I switched to a start button look.
  • I did away with the 'sort'; it was just to make the newest explosions appear on top, but I don't think it really matters.

3) Functionality

  • I did away with the two buttons to start thing.

Next, I'll add some of your suggestions into a different cart as an enhanced version of Boomshine.

Thanks again @Logarhythm, @dw817, and @remcode!

P#103139 2021-12-19 23:40

Wow, I'd totally forgotten about this game, but I definitely remember the original. This is a fun return to the concept. I'll be curious to see the enhanced version!

P#103140 2021-12-19 23:44

For alterations, what about a par system like golf?
So you'll always be able to eventually get the count, but you're trying to do it by using as few of your own balls (I don't know what else to call them).
i.e. the first level, could be a par 1 or something.

P#103235 2021-12-21 06:40

Final score: 267
Nice work, it runs great now!

P#103248 2021-12-21 15:01

Nice!
Thanks. Separating the balls from explosions made all the difference.

P#103262 2021-12-21 18:27

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 06:21:52 | 0.062s | Q:29