New Game! (3.3): Paddles

paddles-big

paddlesgameplay

A new game to play in Renoise! Features MIDI controls, sound FX, a CPU opponent, multiplayer and more!

To learn more about the game, visit the official page here, or click the Help Button!

The game should not interfere with whatever project you have open, but to be safe, it is always recommended to save your work before using any tools, including this one. Sound support was accomplished without using OSC, so at first it may appear to mess with your project file, but rest assured that when you exit/stop the game, or turn off the sound feature, your project should remain unaffected.

Have fun!

Download

21 Likes

: O Super cool and inspiring ; D Thanx !!
--------> testing ā€¦

1 Like

Thanks a good game to relax at times where music making gets us tired

2 Likes

The power of the API! :grinning: Still donā€™t want to learn how to make LUA tools?

3 Likes

Got this error notice when closing down the tool gui, then after having the sound of the ball bounce still playing in the pattern editor, I pressed ctrl + n in Renoise to start a fresh project;

"ā€˜C:\Users\pluge\AppData\Roaming\Renoise\V3.3.0\Scripts\Tools\mom.MOMarmalade.Paddles.xrnx\main.luaā€™ failed in one of its notifiers.
The notifier will be disabled to prevent further errors.

Please contact the author (MOMarmalade [xephyrpanda@yahoo.com]) for assistanceā€¦

std::logic_error: ā€˜trying to access a nil object of type ā€˜class RenoiseSongā€™. the object is not or no longer available.ā€™
stack traceback:
[C]: ?
[C]: in function ā€˜__indexā€™
[string ā€œdoā€¦ā€]:37: in function <[string ā€œdoā€¦ā€]:35>
main.lua:517: in function main.lua:326"

1 Like

Ah, thank you Djeroek! :smiley: Itā€™s not a harmful error, and I think most people probably wouldnā€™t encounter it anyway, but Iā€™ll release an update ASAP to fix the issue :slight_smile:

Update! The error has been fixed! :slight_smile: However, I do want to release an update that will pause the game when the Paddles window is closed. But for now, this will avoid the error you encountered :slight_smile:

1 Like

@Orangalang. Here is a suggestion to improve the codeā€¦

Do not access the entire table, only access each object. Will be faster.

song.patterns[firstpattern].tracks[1]:line(1):note_column(1) 

change it for:

song:pattern(firstpattern):track(1):line(1):note_column(1) 

Another case:

song.instruments[1].sample_device_chains[1]:device(2).parameters[3].value

change it for:

song:instrument(1):sample_device_chain(1):device(2):parameter(3).value

Always use the colon :, the two parentheses () and the singular name. Do the same with all cases. Probably, inside your tool it does not have much importance, but it is a good way to get used to it.

Your game has surprised me! It is clear that you know how to program.

One question, is the bounce random or do you get it redirected based on movement up or down?

2 Likes

Thank you for the good info @Raul! I did read about using (): instead of []. but didnā€™t want to get too caught up in optimization and risk never releasing the game. But now that you point it out, Iā€™ll be refactoring my code to use this from now on, and Iā€™ll release an update to Paddles that will incorporate this too :slight_smile:

The ballā€™s direction/velocity change is a result of where it touches the paddle:

  • Dead center: no effect
  • Above center: adds velocity upward
  • Below center: adds velocity downward

This can be used to slow or speed the ball, depending on which direction the ball is traveling (up or down) when it hits the paddle.

If you set the Paddle Size to 1 though, the direction/velocity change becomes totally random.

Update! Some new features have been added into the game, including variable game speed, variable trail length, and paint mode. I have also incorporated the code improvements recommended by @Raul, and fully eliminated the error found by @Jonas ! :slight_smile:

The biggest performance bottleneck is updating the bitmaps each frame, so if youā€™re struggling to push frames, the best thing you can do is limit the trail length, or reduce the game speed.

If the ball flickers during movement, you can increase/turn off Renoiseā€™s FPS limit to help alleviate this.

Have fun! :slight_smile:

2 Likes

@Orangalang Can you think of another similar game, like chess? I have recently come to think that I would be able to build such a game with the Renoise API. But I do not have time :smiley:

Renoise Chess?

1 Like

Ok Claude Shannon, how is paddles related to chess(?) NVM, will you be writing the lua chess engine? (sunfish.lua/sunfish.lua at master Ā· soumith/sunfish.lua Ā· GitHub)

2 Likes

@Orangalang Very good work. The way you setup the pixel grid got me inspired to try this approach for my own little pianoroll tool.

1 Like

It will be that both are a game that can be programmed. Yes, chess is also a game with ā€œmoving elementsā€.

1 Like

I figured you were working on a more simplistic level Raul hence the ā€˜NVMā€™ in my post :slight_smile:

1 Like

Certainly not simple :grinning:

1 Like

I do have some other ideas Iā€™ve been considering :slight_smile: I donā€™t want to give any hints at the moment though :wink:

Thank you @toimp, very kind words! :slight_smile: Iā€™m interested to see where you go with the idea :smiley:

Sneak peek:
image

Nothing special yet, currently trying to optimize the rendering performance. VB seems pretty hungry on refreshing complex grids.

Edit: Made a twitter post to show the current state in action: https://twitter.com/xoonx/status/1350788024465055744

4 Likes

Woah!! That looks so cool! Reminds me of FLā€™s piano roll (which I loooove)!
Yeah, the best solution I came up with is to monitor individual items for changes (in this case, individual notes on the piano roll), and only update bitmaps that have changed. Monitoring for changes isnā€™t even close to as expensive as updating all those bitmaps.

1 Like

Yep, that was intended. :slight_smile: Love the fl piano roll, too. I currently use buttons to render this grid, itā€™s fast enough but changing color slows it down. Only happens, when you scroll through. I use a timer to fresh it every 50ms during scrolling. Its currently just render the current track. Note drawing is next on my list. Iā€™ll upload it to github, when its ready to use.

1 Like