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.


Topics - fallahn

Pages: [1] 2
1
SFML projects / Purcitop Garden - A mini adventure game
« on: May 08, 2021, 04:15:55 pm »
If you've been following me on Twitter you'll have seen updates over the past year to my newest game: Purcitop Garden. The game is a procedurally generated, family friendly adventure game made with my SFML based framework xygine.



You can download it (for free!) from itch.io: https://fallahn.itch.io/purcitop-garden

2
Pull Requests & Testing / Audio effects: Reverb, chrous, delay etc
« on: November 10, 2020, 08:03:11 pm »
https://github.com/SFML/SFML/pull/1708

Implements OpenAL sound effects for reverb, chorus and delay. Can be easily extended to more types supported by OpenAL.
This was discussed some time (10 years!) ago here: https://en.sfml-dev.org/forums/index.php?topic=2245.0 the conclusion being that available OpenAL implementations were not capable. Thankfully things have changed somewhat in the last decade. I've tested this on platforms using openal-soft (windows and ubuntu) and on macOS using Apple's OpenAL library. I was pleasantly surprised to find that the effects are supported by the Apple library, although they are audibly rendered differently - particularly the delay which sounds much softer. However it seems openal-soft is supported on macOS and building SFML against that makes the effects sound consistent across tested platforms. I'm unable to test on mobile platforms.

I'm putting this here to gauge interest - if there's enough feedback I'll add high/low/band pass filters.

3
SFML projects / OSGC - Open Source Game Collection
« on: May 11, 2019, 12:46:43 pm »
So I started this a little while ago as a place to put all my small game projects / prototypes. OSGC is a front-end browser application which allows games to be created as plugins (compiled as dlls/dylibs/SOs) and simply placed in a plugin directory for the browser to find them.

Right now there's only one game, Drone Drop, but I'm already working on prototyping a remake of one of my earliest projects, Space Racers. Here's a video of Drone Drop in action:



There are windows downloads available on itch.io here: https://fallahn.itch.io/osgc-open-source-game-collection but I also check to make sure OSGC can be built on linux and mac regularly. The source is available on github: https://github.com/fallahn/osgc

If anyone wants to make a game plugin (or contribute to Drone Drop - the maps are made with Tiled!) I'd love to see what they come up with :D

4
I started this project as something to do over the Christmas holidays - only to have it turn into a full game :)

The idea is to use a block programming interface to create a 'program' which guides the automated lawn mowers around the garden. Clear the entire lawn in as few moves possible, eventually unlocking the lawn editor, a mutator mode - and maybe even find an easter egg hidden away ;) Features achievements and high score tables provided by Steam, and available for Windows and macOS



Thank you to all the SFML community who have helped make the library such fun to use over the years :D

Steam store page
DRM-free itch.io version
Twitter
xygine github (engine the game uses)

5
Window / DInput update appears to cause an exception with Steam API
« on: April 11, 2018, 07:16:00 pm »
When using the Steam API closing the application throws this error



(I later loaded the debug symbols for ntdll.dll to find the function is RtlFreeHeap())

 on any version of SFML since this commit 'Added support for interfacing with joysticks via DirectInput'. This happens on Windows 7/10 64bit using VS2017 and can be recreated thusly:


#include <SFML/Graphics.hpp>
#include <steam/steam_api.h>

int main()
{
    if(SteamAPI_Init())
    {
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

        while (window.isOpen())
        {
            sf::Event event;
            while (window.pollEvent(event))
            {
                if (event.type == sf::Event::Closed)
                    window.close();
            }

            window.clear();
            window.draw(shape);
            window.display();
        }

        SteamAPI_Shutdown();
    }
    return 0;
}

 

Commenting out the two Steam specific lines stops the error from happening. I realise this is probably a Steam problem as much as anything and I shall be reposting this on the developer forums, but I'd like to point it out here as it is likely the next version of SFML (as the current revision all ready does) will break any games by people developing for Steam, who decide to update SFML.

6
If you've been on the IRC channel you'll know I've been working on this for the past few months - and now it's ready for Steam release!



Quote
Castle Clamber is an arcade inspired action platformer for one or two players, either locally or over a network. It tells the time-old story of a devoted underdog, blinded by a well-meaning sense of duty and a rose tinted visor. Trap enemies in your bubbles, defeat them with explosions or crush them with crates! Reclaim the food they stole and carry it to the waiting Princess Niamh to collect your prize and earn a place in the world online rankings.

A big thanks goes to everyone who helped out on this: Jonny, Rosme, Therocode, Tank, select_this to name but a few (sorry if I forgot anyone!)

Castle Clamber will be available from 12th April 2018 for Windows and macOS, with linux support hopefully to come. The store page is here!

7
SFML projects / DoodleBob - Virtual Pet Game
« on: February 12, 2017, 02:04:48 pm »
This was a project I worked on mostly over the christmas holidays, and have finally got it together enough to put on gamejolt.

DoodleBob is a cross between and perhaps Tamagotchi. Bob lives in his house with his cat Bella, and your job is to keep him fed and entertained whilst managing his income. Bob lives in real time - there is a day night cycle and he continues to live even when the game is not running.



Downloads:
There are windows and linux binaries on the gamejolt page. The source is here on github if anyone wants to try. There's no macOS version as it does not support the compatability context DoodleBob requires.

I'm open to any suggestions for gameplay, although I'll admit this was just a fun holiday project for me so is unlikely to recieve any major updates.

8
SFML projects / tmxlite - a Tiled map editor / tmx parser - v1.0.1 Released
« on: November 15, 2016, 04:21:18 pm »
This is meant to be a portable parsing library which can be used with any graphics rendering library, including SFML. The 'lite' part refers to the library not needing any external dependencies such as boost or zlib, while still supporting compressed map formats. I'm posting it here in case anyone finds this useful (there's an SFML example included in the repository).

Github

9
SFML projects / SpIn - Space Invader Emulator
« on: April 20, 2016, 04:05:37 pm »
A little project for funs and learning (building on my CHIP-8 interpreter), uses SFML for all the multimedia parts:



Source

10
Apologies for the vague title, it's a little difficult to summarise in a few words. The problem is this: as far as I can tell drawables with more than a certain number for vertices have incorrect vertex data sent to the vertex shader. I noticed when trying to apply lighting to a scene that drawables such as sf::CircleShape or vertex arrays with a lot of vertices are not lit correctly in relation to the light source. sf::Sprites and quads created with a vertex array are lit fine, however. In this video the light position is set to the cursor:



The only difference between the first and second half of the videos is how the drawables are constructed. Notice in the second half the (rather dark) drawable on the right is only lit when the light source is in the top left corner, as if the drawable was sat at 0, 0. The world transform relative to the light source is not accounted for. Here is a minimal example which draws a sprite and a circle shape. The effect is more noticable: when the mouse cursor is over the sprite a small red dot is drawn - but the mouse has to be in the top left corner for the dot to appear over the circle shape. Apologies for the length of the shader, I gut it best I could.

#define SFML_NO_DEPRECATED_WARNINGS
#include <SFML/Graphics.hpp>

static const std::string vertex =
"#version 120\n"

"uniform vec3 u_pointLightPosition;\n"

"varying vec3 v_eyeDirection;\n"
"varying vec3 v_pointLightDirection;\n"

"const vec3 cameraWorldPosition = vec3(400.0, 300.0, 1780.0);\n"

"void main()\n"
"{\n" \
"    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
"    gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;\n"
"    gl_FrontColor = gl_Color;\n"

"    vec3 viewVertex = vec3(gl_ModelViewMatrix * gl_Vertex);\n"
"    v_pointLightDirection = vec3(gl_ModelViewMatrix * vec4(u_pointLightPosition, 1.0)) - viewVertex;\n"
"    v_eyeDirection = ((gl_ModelViewMatrix * vec4(cameraWorldPosition, 1.0)).xyz - viewVertex);\n"
"}";

static const std::string fragment =
"#version 120\n"

"varying vec3 v_eyeDirection;\n"
"varying vec3 v_pointLightDirection;\n"

"vec4 diffuseColour;\n"

"vec3 calcLighting(vec3 normal, vec3 lightDirection, vec3 lightDiffuse, vec3 lightSpec, float falloff)\n"
"{\n"
"    float diffuseAmount = max(dot(normal, lightDirection), 0.0);\n"
"    diffuseAmount = pow((diffuseAmount * 0.5) + 0.5, 2.0);\n"
"    vec3 mixedColour = lightDiffuse * diffuseColour.rgb * diffuseAmount * falloff;\n"
"    return mixedColour;\n"
"}\n"

"void main()\n"
"{\n"
"    diffuseColour = gl_Color;\n"
"    vec3 normalVector = vec3(0.0, 0.0, 1.0);\n"
"    vec3 blendedColour = diffuseColour.rgb * vec3(0.2, 0.2, 0.2);\n"

"    vec3 pointLightDir = v_pointLightDirection * 0.001;\n"
"    float falloff = clamp(1.0 - sqrt(dot(pointLightDir, pointLightDir)), 0.0, 1.0);\n"
"    blendedColour += calcLighting(normalVector, normalize(v_pointLightDirection), vec3(1.0, 0.0, 0.0), vec3(1.0), falloff);\n"

"    gl_FragColor.rgb = blendedColour;\n"
"    gl_FragColor.a = diffuseColour.a;\n"
"}";

int main()
{
    sf::RenderWindow rw;
    rw.create({ 800, 600 }, "Buns");

    sf::Texture texture;
    texture.loadFromFile("whiteSquare.png");
    sf::Sprite sprite(texture);
    sprite.setPosition(100.f, 500.f);

    sf::CircleShape circle(50.f);
    circle.setTexture(&texture);
    circle.setPosition(600.f, 500.f);

    sf::Shader shader;
    shader.loadFromMemory(vertex, fragment);

    while (rw.isOpen())
    {
        sf::Event evt;
        while (rw.pollEvent(evt))
        {
            if (evt.type == sf::Event::Closed)
            {
                rw.close();
            }
        }

        auto pos = rw.mapPixelToCoords(sf::Mouse::getPosition(rw));
        shader.setParameter("u_pointLightPosition", sf::Vector3f(pos.x, pos.y, 10.f));

        rw.clear(sf::Color::Blue);
        rw.draw(sprite, &shader);
        rw.draw(circle, &shader);
        rw.display();
    }

    return 0;
}
 


11
SFML projects / Chip8 - A CHIP-8 / SuperCHIP Interpreter
« on: March 04, 2016, 03:03:09 pm »
These are a dime a dozen, but I thought I'd have a go too just for funses. I cobbled this together in about 4 days.



A selection of games can be found here and the source here. Requires SFML and SFGUI. The CMake file is tested on linux and there is a VS2015 project for windows. I may possibly add MegaCHIP support, but for now I'm bored and am going to move on :)

EDIT: I've also written a short blog post about the bytecode format it uses, for those interested.

12
Graphics / Errors setting transform with new shader API
« on: January 18, 2016, 08:51:12 pm »
I've recently updated to the latest revision of SFML eager to try out the new shader uniform settings (particularly the ability to set arrays of data) and run into the following problem when trying to set a matrix parameter with sf::Transform:

int main()
{
    sf::Shader shader;
    shader.loadFromMemory(xy::Shader::NormalMapped::vertex, xy::Shader::NormalMapped::fragment);

    sf::Transform tx;
    shader.setUniform("u_inverseWorldViewMat", tx);

    return 0;
}
 

won't compile because 'setUniform(const std::string&, sf::Glsl::Mat3&) and setUniform(const std::string&, sf::Glsl::Mat4&) are ambiguous', and

int main()
{
    sf::Shader shader;
    shader.loadFromMemory(xy::Shader::NormalMapped::vertex, xy::Shader::NormalMapped::fragment);

    sf::Transform tx;
    shader.setUniform("u_inverseWorldViewMat", sf::Glsl::Mat4(tx));

    return 0;
}
 

gives me:

Error   LNK2001   unresolved external symbol "void __cdecl sf::priv::copyMatrix(class sf::Transform const &,struct sf::priv::Matrix<4,4> &)" (?copyMatrix@priv@sf@@YAXABVTransform@2@AAU?$Matrix@$03$03@12@@Z)   Example   C:\Users\Documents\Visual Studio 2015\Projects\xygine\Example\main.obj   1   

Clean build and install of SFML using the latest revision with Visual Studio 2015 Community, Windows 7 Pro 64bit. I can see the function in question in Glsl.cpp which is included in the solution generated by CMake, so I'm not sure why it should be unresolved. The old setParameter() functions work fine.

13
SFML projects / pseuthe - casual survival game [1.0.3 Released]
« on: June 30, 2015, 05:16:42 pm »
pseuthe (pronounced 'soothe') is a small project which started when I was playing around with writing my own physics. You take on the role of a deep water plankton and simply must survive as long as you can by feeding on other microbes.



You can find binaries for Windows, Linux and macOS here (it's free!), and it is also open source. Thanks to everyone who has helped me with this, particularly eXpl0it3r, Tank and select_this :D

14
SFML projects / Crush!
« on: February 16, 2015, 11:32:31 am »
I've been working on this a few months now, so it's time to make the initial, buggy, incomplete, yet playable version public :)



The repo is here (tested on Windows / ubuntu) and there's a YouTube playlist documenting the evolution of the game over the last few months. The windows version also includes a map editor for creating new maps.

Postmortem (in progress)

15
SFML projects / Space Racer
« on: February 08, 2014, 02:21:04 pm »
I started work on this somewhere around last June, but not worked on it since November as I've lost interest in it a bit - so I thought I may as well post what I have here:




Binaries (Win/Linux): here

EDIT: Breakdown of some of the techniques I used:
Part 1: Map format
Part 2: Node Navigation
Part 3: Vehicle Handling

Pages: [1] 2