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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - gamepopper

Pages: [1] 2 3
1
I'm currently working on a small game and what I want is for the music to loop in small segments, with each segment building up the music.

The solution was to set loop points when playing a track and then after a specific event change the loop points to further along in the song.

The solution worked, anytime new loop points were set the music would keep on playing up until the end of the new loop point where it would jump back to start of the new loop point. However, the music would stop playing eventually, even though no functions were called to stop the sound.

I assumed it was just something in my engine, but I've modified the sound example to only play my music file and update the loop points every 25 seconds, and the music eventually stops (even the music status no longer returning the Playing state). I've attached the sample code and file in the post.

 // Load an ogg music file
sf::Music music;
if (!music.openFromFile("resources/" + filename))
    return;

music.setLoop(true);
music.setLoopPoints(sf::Music::TimeSpan(sf::seconds(0.0f), sf::seconds(8.0f)));

// Play it
music.play();

int level = 1;

// Loop while the music is playing
while (music.getStatus() == sf::Music::Playing)
{
     // Leave some CPU time for other processes
     sf::sleep(sf::milliseconds(25000));

     level++;
     float loopEnd = (level + 2) * 8.0f;

     if (loopEnd <= music.getDuration().asSeconds())
     {
        music.setLoop(true);
        music.setLoopPoints(sf::Music::TimeSpan(sf::seconds(loopEnd - 8.0f), sf::seconds(8.0f)));
    }
}

I'm using the latest SFML source code (last update 15th April 2020) and running on Windows 10, using Visual Studio 2017 for dev.

I've found that setting the loop points only once does not cause any issues, but setting loop points to the same music stream more than once causes it to eventually stop.

2
Yeah I copied the string from SFEMOVIE_AVAILABLE_ENCODERS to SFEMOVIE_ENABLED_ENCODERS and now the videos work!

3
Ah I see... these were the ones set default in CMake:

theora;flac;vorbis;vp8;vp9;opus;adpcm_4xm;adpcm_adx;adpcm_afc;adpcm_ct;adpcm_dtk;adpcm_ea;adpcm_ea_maxis_xa;adpcm_ea_r1;adpcm_ea_r2;adpcm_ea_r3;adpcm_ea_xas;adpcm_g722;adpcm_g726;adpcm_g726le;adpcm_ima_amv;adpcm_ima_apc;adpcm_ima_dk3;adpcm_ima_dk4;adpcm_ima_ea_eacs;adpcm_ima_ea_sead;adpcm_ima_iss;adpcm_ima_oki;adpcm_ima_qt;adpcm_ima_rad;adpcm_ima_smjpeg;adpcm_ima_wav;adpcm_ima_ws;adpcm_ms;adpcm_sbpro_2;adpcm_sbpro_3;adpcm_sbpro_4;adpcm_swf;adpcm_thp;adpcm_thp_le;adpcm_vima;adpcm_xa;adpcm_yamaha;interplay_dpcm;pcm_alaw;pcm_bluray;pcm_dvd;pcm_f32be;pcm_f32le;pcm_f64be;pcm_f64le;pcm_lxf;pcm_mulaw;pcm_s16be;pcm_s16be_planar;pcm_s16le;pcm_s16le_planar;pcm_s24be;pcm_s24daud;pcm_s24le;pcm_s24le_planar;pcm_s32be;pcm_s32le;pcm_s32le_planar;pcm_s8;pcm_s8_planar;pcm_u16be;pcm_u16le;pcm_u24be;pcm_u24le;pcm_u32be;pcm_u32le;pcm_u8;pcm_zork;roq_dpcm;sol_dpcm;xan_dpcm

4
What binaries did you use or how did you build it?

According to the FAQ there are two different versions: http://sfemovie.yalir.org/latest/faq.php#supported-codecs

I'm not sure how I can tell what binaries I have, I cloned what was on GitHub and built the entire project with CMake and MSYS2 Mini-GW 64-bit. The codec object folder (FFmpeg-objects/libavcodec) seems to show the full list of codecs in that FAQ. have I've missed a step or there are completely different setup instructions for Visual Studio?

5
Hello,

Dumb question probably, but I'm trying a bunch of videos with the sfeMovieDemo and for most of them the lib cannot find the audio decoder.

I've tried MKV (cannot find mp3), MP4 (cannot find aac) and MPG (cannot find ac3). The only format that works for audio is uncompressed AVI (where the video stream doesn't work but the audio stream works fine).

I'm building from the source using Visual Studio C++ 2017 for Windows.


6
Okay, the good news is that I fixed it myself!

What I was doing wrong was after rendering the 3D scene onto a render texture, I called resetGLStates() from the main render target AFTER rendering a sprite with the render texture set to it when I was supposed to call it.

const sf::Texture& V3DScene::GetTexture()
{
        sf::Texture::getMaximumSize();

        renderTex.setActive(true);
        renderTex.clear(BackgroundTint);
        glCheck(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
        glCheck(glViewport(0, 0, renderTex.getSize().x, renderTex.getSize().y));

        glCheck(glEnable(GL_DEPTH_TEST));
        glCheck(glEnable(GL_CULL_FACE));
        glCheck(glCullFace(GL_BACK));

        Shader->Bind();
        Shader->Update();

        for (unsigned int i = 0; i < members.size(); i++)
        {
                V3DObject* base = dynamic_cast<V3DObject*>(members[i]);

                if (base != nullptr && base->exists && base->visible)
                {
                        base->UpdateShader(Shader.get(), Camera.get());
                        base->Draw(renderTex);
                }
        }

        renderTex.display();
        renderTex.setActive(false);

        return renderTex.getTexture();
}

void V3DScene::Draw(sf::RenderTarget& RenderTarget)
{
        if (!visible)
                return;

        sf::Texture texture = GetTexture();

        if (PostEffect != nullptr && VPostEffectBase::isSupported())
        {
                postProcessTex.clear(sf::Color::Transparent);
                PostEffect->Apply(renderTex, postProcessTex);
                postProcessTex.display();

                updateTexture(postProcessTex.getTexture());
        }
        else
        {
                updateTexture(texture);
        }

        RenderTarget.resetGLStates();
        Sprite->Draw(RenderTarget);
}

One other positive out of this is that I got the OpenGL example fully working with modern OpenGL with GLM and GLEW, so if anyone wants a reference to how to use the OpenGL programmable pipeline in one cpp file, here you go!

7
Graphics / Nothing displaying with Modern OpenGL with SFML 2.5.0
« on: May 20, 2018, 09:37:40 pm »
So I've been working on getting Vigilante Framework to support SFML 2.5.0, and I've been getting a few issues with the sf::RenderTexture. The main ones I've been going back and forth with eXpl0it3r on Twitter so I want to make this one separate and look for some help.

Basically, I use modern OpenGL rendering that's based on the Mastering SFML Game Development: Chapter 7 book by Raimondas. The key difference being that instead of rendering to an sf::RenderWindow I render to an sf::RenderTexture.

This implementation worked fine in 2.4.2 (as seen in the first attachment) but stops working 2.5.0. There is no error found using glGetError() and the only GL specific error I get is RenderTextureImplFBO (third attachment).

My only hint so far is that if I try to clear the RenderTexture to a specific colour, the screen doesn't display that colour, meaning that there could be a context issue causing the texture data not to display properly?

Also I'm not sure how about to create a simplified version of this project, since I need glew for the extensions and GLM for matrices since you cannot use the GL legacy stuff. I managed to convert the OpenGL example project to use modern OpenGL although texture coordinates and recreating the window to toggle sRGB aren't working properly.

8
Seems to work fine now. The program can be executed out of the box and I finished one level with keyboard and mouse without any issues (except that the controls don't really correspond well to my AZERTY keyboard).

Just a minor detail, the controls section in the readme is only aligned when a tab is aligned to 8 spaces.

I'll keep that in mind, are you able to try an Xbox 360 or Xinput gamepad? I've got it to work in the past (can't at the moment, for some reason my Linux VM thinks my mouse is a joystick) but I want to make sure.

9
You should try making a .tar.gz (or .tgz) file instead of a .zip, that should preserve the file permissions.

Done! :)

10
I had to change the permissions of the runGemstoneKeeper.sh and Gemstone-Keeper files to allow executing them.

When going into the cavern and clicking "start level", the game crashes with a std::bad_cast error after the screen faded to black. The backtrace does not show anything as the executable is not a debug build.

In the terminal output there is also a repeating error because "VFrame/depend/arial.ttf" can't be found.

Is there anyway to set those permissions permanently so users don't have to change them themselves?

Also found the bad_cast issue and it has been fixed. Feel free to download a fixed build on the itch.io page and let me know if you find anymore issues. Thank you. :)

11
No Linux Version? :(

No Linux version  :'(

Good news you two (and any others)! I have been working on a Linux build, and I have a demo that I would like to be test run, much feedback would be necessary to ensure this build goes out smoothly. Specifically I would like to know:

  • Can the game boot up from the build script?
  • Does keyboard and mouse input work?
  • Does Xbox 360 gamepad support work? (I've tested with xboxdrv and have gotten it to work but not so sure)
  • How well does the game perform (FPS, lag, crashes)?

If there are any faults, please describe in best detail what the issue is, and if possible any ways I could fix it. Linux is still faily new to me after 2-3 months so stuff isn't perfect at this stage.

12
SFML projects / Re: Gemstone Keeper - An ASCII based Roguelike Shooter
« on: April 06, 2017, 07:06:38 pm »
Video Game writer Dean Noakes is currently doing a poll on which game from the Twitter group #IndieDevHour to write about. My game is on that list, so if you do have Twitter, please vote on Gemstone Keeper right here. Thank you all!

13
SFML projects / Vigilante Game Framework
« on: April 05, 2017, 09:16:16 pm »
View on GitHub





So I've open sourced the framework I built for my game on Steam, Gemstone Keeper.

The basic goal of this was to provide a code base to allow me to have a base game loop with ability to render, update, change game states and so on, and I was mostly inspired by how HaxeFlixel structured their framework. Later on I added some of the more fancy features like the infinite scrolling backdrop and 3D rendering.

I'd appreciate some feedback and ways to improve the code, optimisations and whatnot. Since almost all of us are coders I'm sure there are many ways stuff in here could be approached, hopefully it's all clear enough but if not I'm willing to answer any questions.

14
SFML projects / Re: Gemstone Keeper - An ASCII based Roguelike Shooter
« on: April 04, 2017, 12:40:38 am »
No Linux Version? :(

I'm sorry, I'm not ready to approach Linux just yet.

15
SFML projects / Re: Gemstone Keeper - An ASCII based Roguelike Shooter
« on: March 21, 2017, 11:36:10 pm »
Wow I have not been updating this...at all.

So Gemstone Keeper will be on Steam in about 10 days, that's exciting!

Here's the trailer!

https://www.youtube.com/watch?v=mVnMpCjsiyI

Pages: [1] 2 3