Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Morpheus - Ludum Dare Jam #30 Entry  (Read 4844 times)

0 Members and 1 Guest are viewing this topic.

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Morpheus - Ludum Dare Jam #30 Entry
« on: September 01, 2014, 07:10:31 am »
Hey guys!

We've finally managed to create a "playable" game for a Ludum Dare with our own engine!

Here is the link: http://www.ludumdare.com/compo/ludum-dare-30/?action=preview&uid=7901

The concept (as always) was bigger, but at least it is playable.

My engine uses a 2013 snapshot version of SFML with changes to the audio module to allow for music loops. It uses a modified version of Bullet Physics for the physics simulation.

Hope you guys like it!

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #1 on: September 01, 2014, 08:15:12 am »
Congratulations on finishing a playable game.

My engine uses a 2013 snapshot version of SFML with changes to the audio module to allow for music loops.
There's no need to modify SFML for that. See, for example, my Jukebox class.

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #2 on: September 02, 2014, 04:32:10 am »
Congratulations on finishing a playable game.
Thank you!

My engine uses a 2013 snapshot version of SFML with changes to the audio module to allow for music loops.
There's no need to modify SFML for that. See, for example, my Jukebox class.

From what I understood from your code, you are checking the status of the current sound every frame and starting the next when it stops. Is that how you did it?
If it is, then it will create gaps in between sounds (between when the sound ends and when you check), and that sounds just awful for a background music loop. I've already tried that before resorting to modifying SFML.

My modification is for playing linked portions of sound without ever stoping. The only way that could be achieved (at least on the 2013 snapshot that I used) was by using a private class (I think it is called SoundFile), so it had to be a modification of SFML itself. Laurent said that class would be made public on the next version of SFML, but I don't know if it is public already on the SVN.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #3 on: September 02, 2014, 08:54:25 pm »
It's a shame this game didn't develop a little more; it seems a little cut short.

I completed it first time without ever being hit. I wasn't even sure at which point I would be hit so I just (easily) avoided each one completely. I even forgot to try to jump; I didn't need it! I tried it again to see what happens when you get hit and ended up running through to the 19th (I think) room without being touched. If you continue with the development of this, you may want to limit the progress speed e.g. maybe open a door every few seconds, start with a few open etc..

On relation to the music looping discussion, the music when you complete the game loops with very noticable delays between each loop. Also, SFML's music has a loop option. I'm not sure how long it's had one, though, so you may need a new version to use it. It seems to do so well though (tested using a 3.5 minutes .wav file and an .ogg file).
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #4 on: September 02, 2014, 09:14:02 pm »
From what I understood from your code, you are checking the status of the current sound every frame and starting the next when it stops. Is that how you did it?
If it is, then it will create gaps in between sounds (between when the sound ends and when you check), and that sounds just awful for a background music loop.
Yes. That's what I do.
If you are updating at 60fps, then it's ~16ms between one song stopping and the next starting. I don't know how long such a gap between songs needs to be before actually being audible, but since most music (at least that I've used) either fades to silence at the end or slowly fades in at the beginning, a bit of silence for a few milliseconds between them is not noticeable at all. At least it works perfectly for my own use-cases. :)
« Last Edit: September 02, 2014, 09:16:34 pm by Jesper Juhl »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #5 on: September 02, 2014, 09:27:49 pm »
I don't know how long such a gap between songs needs to be before actually being audible
I agree that it would be fine for normal songs that are independent of each other but stops being acceptable when you want to make an infinite piece of music by looping a section (like the endgame music in the OP game does; not sure about the background music).
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #6 on: September 02, 2014, 09:33:53 pm »
Also, SFML's music has a loop option. I'm not sure how long it's had one, though, so you may need a new version to use it.

If you mean the basic loop option where it starts playing from the beginning after it hits the end, that's in 2.1 so it's been around for ages.

If you mean "loop points", where the music will stop some time before the end and restart some time after the beginning (so as to avoid that annoying quiet period while it fades out and in), then there is an oustanding pull request which implements that, so you could always try merging that into your copy of SFML.
« Last Edit: September 02, 2014, 09:36:28 pm by Ixrec »

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Morpheus - Ludum Dare Jam #30 Entry
« Reply #7 on: September 03, 2014, 08:12:30 am »
It's a shame this game didn't develop a little more; it seems a little cut short.

I completed it first time without ever being hit. I wasn't even sure at which point I would be hit so I just (easily) avoided each one completely. I even forgot to try to jump; I didn't need it! I tried it again to see what happens when you get hit and ended up running through to the 19th (I think) room without being touched. If you continue with the development of this, you may want to limit the progress speed e.g. maybe open a door every few seconds, start with a few open etc..

Thank you for playing and for the tips! I didn't have any time at all to do the second dream at the time of the competition, I've finished the first dream and the cutscenes just minutes before the time limit was over. On the second dream you would have to jump between platforms, but that unfortunately didn't make it out of the concepts.

On relation to the music looping discussion, the music when you complete the game loops with very noticable delays between each loop. Also, SFML's music has a loop option. I'm not sure how long it's had one, though, so you may need a new version to use it. It seems to do so well though (tested using a 3.5 minutes .wav file and an .ogg file).

The music at the end is like that because I only had half an hour to find music loops on the internet and insert them on the game, so I got the first free ones that could fit on those three places and sent it in like that. The last one ended up not looping well, but it was the sound's fault, not my modification's.

If you mean "loop points", where the music will stop some time before the end and restart some time after the beginning (so as to avoid that annoying quiet period while it fades out and in), then there is an oustanding pull request which implements that, so you could always try merging that into your copy of SFML.

I've also made a "public version" of my modification. You can check it out here: http://en.sfml-dev.org/forums/index.php?topic=6213
That pull request seems a bit too limited to me, only allowing one loop per music file. Mine allows any amount of looping you want with any sound files and any positions.

P.S.: There might be some memory leaking on my public version. I've found a few memory problems recently on my private version, but I don't know if they also affect the public version. I've tested it and it works, though.

 

anything