SFML community forums

General => SFML projects => Topic started by: Deathbeam on February 16, 2014, 06:01:15 pm

Title: Spooker - Open Source Game Framework
Post by: Deathbeam on February 16, 2014, 06:01:15 pm
(http://spooker-dev.github.io/img/logo2.png) Spooker
Open Source Game Framework

Hello everyone, I am new here and I wanna share with you project on what I am working.

Spooker Framework is fully free and open source game library, what will help game developers in making their own games faster. Spooker is based on SFML (Simple and Fast Multimedia Library) and its port binding SFML.NET. SFML is cross-platform (running on top of OpenGL) multimedia library, what is really fast and easy to use. Becouse of using cross-platform libraries, Spooker is able to run on most platforms, including Windows, Linux and even Mac.

I am working on this project mainly becouse I need good, stable and fast base for game on what I am working, so I am frequently testing all features and finding ways how to short time spent coding game using this framework. This framework will be pure 2D, do not expect any more dimensions from it (okay, we can jump over 3rd dimension and add here also time as 4th dimension, becouse using this framework is taking more or less time, and I believe that time is the 4th dimension, I do not care about scientists telling that it is not, for me it is! :D). Less code == More fun.

Please, consider watching us on GitHub (https://github.com/spooker-dev/Spooker) to be updated with latest releases. You can use this library in any project freely. Share it with your friends.
 
Website: http://spooker-dev.github.io/ (http://spooker-dev.github.io/)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Laurent on February 16, 2014, 07:27:55 pm
Calling your project SFGL is not a good idea:
- everyone wants to call his SFML-based engine SFGL
- the naming is really close to "SFML", which may make people think that it's the "official" engine based on SFML

This is just my thought, based on what I've already seen. The choice is of course up to you ;)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 16, 2014, 08:47:45 pm
Calling your project SFGL is not a good idea:
- everyone wants to call his SFML-based engine SFGL
- the naming is really close to "SFML", which may make people think that it's the "official" engine based on SFML

This is just my thought, based on what I've already seen. The choice is of course up to you ;)

I know, but I thought it will be good idea, becouse I am trying to strictly follow SFML way of handling things (like main game window initializing is simply inherited class from RenderWindow, so it can be initialized in almost same way). And also, I just <3 SFML and I want to show to everyone that I based this library of SFML.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Nexus on February 16, 2014, 09:50:03 pm
I know, but I thought it will be good idea, becouse I am trying to strictly follow SFML way of handling things (like main game window initializing is simply inherited class from RenderWindow, so it can be initialized in almost same way).
I think this is also a bad idea ;)

The SFML way of handling things is having functionality that is modular and independent to a big extent -- basic building blocks one can put together. Game engines, on the other hand, have a rather different approach: a lot of features are already fully implemented, the choice of how to use and combine them is often not left to the user. Furthermore, inheritance should be considered carefully, as it introduces high coupling and is often done wrong (see LSP (https://en.wikipedia.org/wiki/LSP)). Instead, composition might be a good choice.

I agree with Laurent; I wouldn't call the library SFGL simply because it is based on SFML. It will just create too much confusion: on one side with SFML itself, on the other with the at least two existing projects that are called SFGL. Find a unique name that one can remember, and that represents the philosophy behind your game engine :)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Lo-X on February 16, 2014, 10:02:27 pm
Funny, we had another SFGL just a few weeks ago :) Indeed the name is misleading/may be changed.

Your website is really nice even if not finished. You have a link that points on something called Cookie2D, or it's a mistake or I didn't get the link with your lib.
You should make a list of the features your lib have, I got to browse the code to know :)

Did you test it on linux and mac ? Because with .NET it's not straightforward on these platforms. You have to install things like Mono.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: zsbzsb on February 16, 2014, 10:30:02 pm
I agree about the name, you should find something unique to describe your library. However, here are some of my thoughts after looking over the code.


Also to be clear in your readme, SFML.NET is not a port, it is a binding.

Just my thoughts, there are some other things that could be done, but I hope you don't mind me giving feedback  :D

Did you test it on linux and mac ? Because with .NET it's not straightforward on these platforms. You have to install things like Mono.

Even on windows you still need to install the .NET framework  ::) And other than using Tao (for what I don't know yet) from what I looked at his code will run fine with mono.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 17, 2014, 12:25:45 pm
.NET can be replaced in other platforms with Mono. I already tested entire library with Mono compatibility (on my development PC I do not even have .NET installed, I am using MonoDevelop and Mono). And I am using Tao only temporary until I will make my own GUI library, becouse Gwen requires to clear depth buffer. Thanks for telling me your full name zsbzsb, It is always nicer to have full names in credits.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Lolilolight on February 17, 2014, 01:08:27 pm
The name of the library remind me something, but I've changed the name because my framework is not the official game engine of SFML.  :)

I don't use .NET, it's very paintfull to makes it works on linux and I've never have a sucess result.
I tried to run this followings games on linux : League of legends and rift.

But if your framework work with mono, why not. (But I hate to have to install an emulator, and it often doesn't work so well as the original plateform, personnally I'll not use this framework not because of your framework but because all the games doesn't work on linux, so I've stayed on window and I try to build the first big game who work on linux without using mono, but, it's a very long task)
So I'll be able to play and work on linux, and don't have to be dependant on window to play with my favorite game.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 17, 2014, 04:06:30 pm
And why I do not wanna include NetExt? Becouse I am planning to make my own particle system, and it will simply interfere with NetExt particle system and also I have own content managing system, so I do not need one from NetExt and I think it will confuse users when they will have that much choices :)

Btw, updated website with new Bootstrap theme by http://bootswatch.com/ called Spacelab. Now it is looking alot better imo. And also there added another tutorial for creating scenes.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 20, 2014, 11:01:35 am
Hmm I think this is not double-post, I do not know rules of this forum very good, but 3 days passed, so I think it is not.

I am working on new documentation using Sandcastle Help File Builder, so I started commenting library code. It is really pain and I am bored of it already lol. But I pushed some commits to GitHub, and I sucesfully commented most of code. Also, I created new state manager (hmm I should update site with updated tutorials....). And, as zsbzsb suggested, I removed Tao reference and updated readme.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Laurent on February 20, 2014, 11:29:10 am
Quote
Hmm I think this is not double-post, I do not know rules of this forum very good, but 3 days passed, so I think it is not.
I don't care about multiple posts. As long as you have something new to say, you can say it ;)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 21, 2014, 07:15:05 pm
Quote
Hmm I think this is not double-post, I do not know rules of this forum very good, but 3 days passed, so I think it is not.
I don't care about multiple posts. As long as you have something new to say, you can say it ;)
Fair enought :)

New SFGL 1.1 (https://github.com/sfgl-dev/SFGL/releases/tag/1.1) Release!

In this release I commented many more parts of code. Also, new scene manager is fully working. Also, most of code is using now my new Rectangle and Vector2 classes (structs).

I updated website of SFGL (http://sfgl-dev.github.io/) too with new landing page, new downloads page and hopefully finished and working documentation (http://sfgl-dev.github.io/documentation/index.html) page.

You can download latest release here: http://sfgl-dev.github.io/downloads.html.

I am occuring some StackOverflow bug right now, I think it is caused by GameComponent inheritance, so I am probably going to make GameWindow class static (and remove inheritance of RenderWindow and make it as component), hopefully it will fix it. But I do not wanna use GameWindow as static class, so if you guys have any tips how can I fix it, I will appreciate them. For some reason, MonoDevelop is refusing where that stackoverflow error occurs, so I am not sure if that GameComponent causes it.


Title: Re: [.NET] SFGL - Simple and fast game library
Post by: zsbzsb on February 21, 2014, 07:48:47 pm
I'm sorry this might sound rude, but let me get this straight. You copy and pasted in some NetEXT code and copy pasted in SFML.NET rectangle/vector classes all for the sake of "not confusing the user". Then you reinvent the wheel with your own drawable class (which looks more like an update class) all for the sake of trying to write a self contained library that hides what the library really doing internally for your little game dev community.

You also claim that the GUI used by your library is your own advanced code when you are really using Gwen. This really should be clarified, "Our GUI library makes endless possibilities in making of GUI for your own game" is extremely misleading.

To sum it up, you do your best to write your own library that hides the internal implementations from the user and prevents them from using the internal implementation directly in their own code. But at the same time you come to the community that powers your library and ask them to try your code that broken with the original library because you decided to copy and paste in code. It seems like an oxymoron to me, abstract away dependencies and then ask the dependency community to try out your code without directly using the dependency.

Not too good in my opinion, you can do what you want with the way you take my above comments. Remember its only the way I see it, but I don't plan on using any of your code since because as stated above, is broken with other libraries.

What I really would suggest you do is, #1 change the name - SFGL doesn't make much sense and is confusing, not to mention we just had this discussion over Lololilight's lib  #2 don't re-implement other libraries code in your own library just because being self contained seems neat - in the end it just causes more headaches.

Oh and since you are up to 3 different "game engines" now I suggest you read the following link.
http://scientificninja.com/blog/write-games-not-engines (http://scientificninja.com/blog/write-games-not-engines)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 21, 2014, 07:59:26 pm
I'm sorry this might sound rude, but let me get this straight. You copy and pasted in some NetEXT code and copy pasted in SFML.NET rectangle/vector classes all for the sake of "not confusing the user". Then you reinvent the wheel with your own drawable class (which looks more like an update class) all for the sake of trying to write a self contained library that hides what the library really doing internally for your little game dev community.

You also claim that the GUI used by your library is your own advanced code when you are really using Gwen. This really should be clarified, "Our GUI library makes endless possibilities in making of GUI for your own game" is extremely misleading.

To sum it up, you do your best to write your own library that hides the internal implementations from the user and prevents them from using the internal implementation directly in their own code. But at the same time you come to the community that powers your library and ask them to try your code that broken with the original library because you decided to copy and paste in code.

Not too good in my opinion, you can do what you want with the way you take my above comments. Remember its only the way I see it, but I don't plan on using any of your code since because as stated above, is broken with other libraries.

What I really would suggest you do is, #1 change the name - SFGL doesn't make much sense and is confusing, not to mention we just had this discussion over Lololilight's lib  #2 don't re-implement other libraries code in your own library just because being self contained seems neat - in the end it just causes more headaches.

Oh and since you are up to 3 different "game engines" now I suggest you read the following link.
http://scientificninja.com/blog/write-games-not-engines (http://scientificninja.com/blog/write-games-not-engines)

As first, I have all credits there. Second, I wanted to inherit that classes and just add functionality there, but for some reason, ihneriting structures is not possible. And in header of that 2 classes, I have that it is code from SFML. And no, I am not claiming that that GUI is mine, i have written in my release package on git that it is not my GUI library and that I am planning to write my own. But I understand what do you mean. And thanks for that link, I will surely read it. And, I am working on this lib as base for my game on what I am working on with some friends, here are few examples of it:

(http://indiearmory.com/filehost/files/2dbe8576bea9f8ce7765b588abab5a7e.gif)
(http://indiearmory.com/filehost/files/654866e169d12c48fcfe31e6663168b3.gif)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: zsbzsb on February 21, 2014, 08:07:28 pm
Just to be clear, I have no issue with you utilizing other libraries, or for that fact directly copying them in. My issue is when that method breaks usage with the original library due to the overuse of abstraction and boxing in the users. But as I said, do as you wish with whatever floats your ship.

Quote
ihneriting structures is not possible

Look at extension methods then. Also consider composition over inheritance.  ;)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 21, 2014, 08:54:32 pm
Just to be clear, I have no issue with you utilizing other libraries, or for that fact directly copying them in. My issue is when that method breaks usage with the original library due to the overuse of abstraction and boxing in the users. But as I said, do as you wish with whatever floats your ship.

Quote
ihneriting structures is not possible

Look at extension methods then. Also consider composition over inheritance.  ;)
Oh, I forgot about extension methods :) Thx. And yes, I am thinking about composition becouse I think I am doing inheritance in bad way :D
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 22, 2014, 03:40:02 pm
Thanks again @zsbzsb for your tips, replacing inheritance with composition on GameWindow class worked, now I am not getting any more stack overflow errors. Also, removed that misleading information from website, now it should be correct. And, I tried using extension methods, but I cannot define new constructors and add operators with them, so I will probably stick with my modifications of Vector2f and IntRect. Here is detailed commit on GitHub: https://github.com/sfgl-dev/SFGL/commit/d35bb4538d3c1b9298445280e7942605fa14c911
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 25, 2014, 10:30:23 am
So I sucesfully finished TileMap renderer what will render maps loaded with TiledSharp. I will probably post new commit today or tomorrow. Also, started working on Camera class, but I think changing renderwindow view will break GUI, so I must think about some other ways.
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on February 27, 2014, 05:02:28 pm
New SFGL 1.2 (https://github.com/sfgl-dev/SFGL/releases/tag/1.2) Release!


In this release I finished most parts of library. I also finished Camera class and added there options for camera smoothing. So probably, 1.3 release will be last one. Anyways, in this release I added these new features:

And overhauled these:

Also, some screenies of testing game, what I will push to repository maybe along with 1.3 release:

(http://indiearmory.com/filehost/files/8c3807b96512e2e64492e9f876e90a51.png)

(http://indiearmory.com/filehost/files/09e895201f4905ea9ebe2ddcf3bcd22e.png)
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on March 02, 2014, 06:10:27 pm
Again I updated SFGL a bit. I removed unoptimized spritebatch and added new simple spritebatch what is drawing Sprites. Also, I scrapped my own particle system, becouse I totally suck at maths, and converted particles from XNA samples to SFML. I can say that I am happy with results. I even made it to load custom particle types from XML files. Also, I created AnimatedSprite class what inherits from Sprite and added some new things to camera class. And, overhauled GameTime class to be more like XNA GameTime.

GitHub commit: https://github.com/sfgl-dev/SFGL/commit/f4530680439bff507fdce8b40d937a76051120d6
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on March 06, 2014, 06:24:19 pm
New SFGL 1.3 (https://github.com/sfgl-dev/SFGL/releases/tag/1.3) Release!


In this update I fixed many bugs what I found and also overhauled some parts of game (mainly GameWindow, ContentManager and State/StateUI).

Also, uploaded example game as I promised along with 1.3 release: https://github.com/sfgl-dev/Examples-Game
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on March 14, 2014, 03:06:36 pm
In upcoming 1.4 update I did major improvements to lib. At first, I stopped using Drawable and created IDrawable what is SpriteBatch using for drawing things, so now I can call spriteBatch.Draw(...something as IDrawable). Also, created my own Sprite implementation and overhauled Rectangle and Vector2 classes (used ones from MonoGame). And I also finally finished loading of Tiled collision polys, polylines and rectangles to human readable format :D. Everything is working smooth and fast right now. I will post more info maybe tomorrow and probably also new release. And I am also working on new site design for SFGL site and new logo. Oh, I almost forgot, I added option to GameSettings class for changing GameWindow icon. And, I made GameWindow class abstract, so it will work as XNA Game class (in really similar way, and I love how it simplified way to load additional components to GameWindow).

I would love some feedback on above, becouse this thread is a bit quiet [one-man army thread (only I am posting here :D) lol].
Title: Re: [.NET] SFGL - Simple and fast game library
Post by: Deathbeam on March 26, 2014, 08:54:56 am
I have v 1.4 almost ready. Some new features:
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on March 29, 2014, 01:09:11 pm
Big update


Okay, I decided to rename this engine to Spooker Framework, becouse yes, you guys was right, SFGL is not very original. Currently updating and renaming all repositories and site. I created new site design for Spooker site (what I am committing right now). Also, I fixed Gwen.NET SFML binding, becouse I had many problems with loading custom fonts for GUI, so I simply decided to fix it. I also uploaded fixed version on GitHub here: https://github.com/eatenbrain/Gwen.SFML. Then, I again looked to my sprite and texture classes, modified some bits here and there and I sucesfully increased performance of library around 2 times. It is great, becouse on my development notebook I have Intel Atom processor and integrated graphic card, so it is running pretty slow :D. On my other notebook, I do not even noticed this big performance increase lol.

Anyways, here is new GitHub link for Spooker: https://github.com/spooker-dev/Spooker

EDIT:
I updated all repositories finally, so site is updated and also Spooker repo. Here is commit of new release: https://github.com/spooker-dev/Spooker/commit/79cfa6acb890686748fd3f9ccf2924db66620c19
Title: Re: Spooker - Open Source Game Framework
Post by: Nexus on March 30, 2014, 11:26:04 am
Cool name :)

I saw that you provided an example game, do you also have a few code snippets that show the separate features on their own? Or maybe this will be part of the tutorials ;)
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on March 30, 2014, 02:02:40 pm
Cool name :)

I saw that you provided an example game, do you also have a few code snippets that show the separate features on their own? Or maybe this will be part of the tutorials ;)

Thanks :)

Yes, for most of features I will make tutorials on site, and for more complex things I will make example projects on GitHub.
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on March 31, 2014, 06:13:19 pm
Light engine

So I was tinkering with many methods of light engines, and becouse I do not know shaders at all, I decided to implement method using RenderTexture, additive and multiply blending. It is looking pretty solid and it also have good enought performance even with many light sources.

Example how to use light system:
Code: [Select]
lights = new LightEngine (GraphicsDevice, "lightmask.png");
mouseLight = new Light (Vector2.Zero, 1f);
mouseLight.Color = Color.Red;
lights.Lights.Add (mouseLight);

var light = new Light (new Vector2 (100, 100), 0.5f);
lights.Lights.Add (light);

light = new Light (new Vector2 (300, 300), 2f);
lights.Lights.Add (light);

Image:
(http://spooker-dev.github.io/img/features/lights.png)

And, I again made new site design (with this one I finally satisfied my web developer appetites ;) ) http://spooker-dev.github.io

I also made new input system using actions. Example of using actions:
Code: [Select]
var cameraDownA = new InputAction ("CameraDown", GameInput);
cameraDownA.Type = ActionType.Pressed;
cameraDownA.SetKey (Keyboard.Key.S);
cameraDownA.OnTrigger += () => {
mapCamera.Position.Y += 20;
mapCamera.Apply ();
};

var cameraUpA = new InputAction ("CameraUp", GameInput);
cameraUpA.Type = ActionType.Released;
cameraUpA.SetKey (Keyboard.Key.W);
cameraUpA.OnTrigger += () => {
Console.WriteLine("Pressed W button");
mapCamera.Position.Y -= 20;
mapCamera.Apply ();
};

var cameraLeftA = new InputAction ("CameraLeft", GameInput);
cameraLeftA.Type = ActionType.Pressed;
cameraLeftA.SetKey (Keyboard.Key.A);
cameraLeftA.OnTrigger += () => {
mapCamera.Position.X -= 20;
mapCamera.Apply ();
};

var cameraRightA = new InputAction ("CameraRight", GameInput);
cameraRightA.Type = ActionType.Pressed;
cameraRightA.SetKey (Keyboard.Key.D);
cameraRightA.OnTrigger += () => {
mapCamera.Position.X += 20;
mapCamera.Apply ();
};
Title: Re: Spooker - Open Source Game Framework
Post by: Peteck on March 31, 2014, 09:57:22 pm
Wouldn't it be a better idea using a simple fragment shader to render the lights into a texture? This way you avoid loading a image asset for such a simply task, also you have the ability to define how the light should look with some parameters. But if you still going with the lightmask in a image asset, well .. what if I use a zip archive for all my assets and I need to load it in by memory?

Btw. good choice changing the name. And even better that you have choosen a cool name :D
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on March 31, 2014, 10:22:34 pm
Wouldn't it be a better idea using a simple fragment shader to render the lights into a texture? This way you avoid loading a image asset for such a simply task, also you have the ability to define how the light should look with some parameters. But if you still going with the lightmask in a image asset, well .. what if I use a zip archive for all my assets and I need to load it in by memory?

Btw. good choice changing the name. And even better that you have choosen a cool name :D

So I was tinkering with many methods of light engines, and becouse I do not know shaders at all, I decided to implement method using RenderTexture, additive and multiply blending. It is looking pretty solid and it also have good enought performance even with many light sources.

xD I do not really know anything about shaders, never worked with them before. And hmm yes I should add constructor to load it from stream. And I am glad that you like name, I actually spent some hours using Google Translate and translating random words from random languages to english to find good name :D
Title: Re: Spooker - Open Source Game Framework
Post by: Peteck on March 31, 2014, 10:32:13 pm
Oh my bad. Didn't really read what you wrote. Just looked at your code  :-[
But I think you should really dig into shaders and you will find out that you can make alot of cool things for your game engine! And dont worry - shaders is actually pretty easy when you first know the basics of them, especially when it's only 2D  :)
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 02, 2014, 08:23:08 pm
Oh my bad. Didn't really read what you wrote. Just looked at your code  :-[
But I think you should really dig into shaders and you will find out that you can make alot of cool things for your game engine! And dont worry - shaders is actually pretty easy when you first know the basics of them, especially when it's only 2D  :)

Yes, I have planned to learn more about shaders, but for now it is like something... magical to me. I simply do not understand them at all lol.

Refactoring, fixes, state machine

I refactored a bit source again, so now game states are not handled directly under GameWindow, but under StateManager class. Also, added posibillity of loading game assets not only from direct files/file paths but also from streams. Also fixed major issue where user was not able to serialize GameSettings to file.

https://github.com/spooker-dev/Spooker/commit/9d142e457762b63a5458b7b1047e7700d73cdd9b

Image of new Game Example featuring also test of animations and AnimatedSprite class for making simple frame walking animation (p.s. that bright white light circle is following your mouse):

(http://indiearmory.com/filehost/files/e08456a4e38f19e06007b4c2b14fd284.png)
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 04, 2014, 06:28:46 pm
Input revamp

I revamped action-based input system what I introduced in last commits. Now actions supports multiple trigger keys/buttons and creating of actions is now a lot simplier. Also, minor but mega fancy update is that you can now set ambient color (in programming language clear color :D) of light engine. Also, fixed animations system (stopped using reset rectangle, now there is option to pause, resume and stop currently playing animation).

https://github.com/spooker-dev/Spooker/commit/bb65301339a57226cb4ba8b4c95601b78e40ff1b

Example of new simplier method of adding input actions:
Code: [Select]
GameInput.AddAction("CameraDown");
GameInput["CameraDown"].Add (Keyboard.Key.S);
        GameInput["CameraDown"].Add (Keyboard.Key.Down);
GameInput["CameraDown"].OnPress += () => {
character.PlayAnim("WalkingDown");
mapCamera.Position.Y += 20;
mapCamera.Apply ();
};

Example of new simplier method of adding animations to AnimatedSprite:
Code: [Select]
        character = new AnimatedSprite (Content.Get<Texture> ("sprites/sprite"));

character.AddAnim ("WalkingDown");
character["WalkingDown"].Duration = TimeSpan.FromSeconds (1);
character["WalkingDown"].Frames.Add (new Rectangle (0, 0, 64, 64));
character["WalkingDown"].Frames.Add (new Rectangle (128, 0, 64, 64));

Example image of blue ambient color for light engine:

(http://indiearmory.com/filehost/files/14b77eb162de733db5b619b44e9f661b.png)
Title: Re: Spooker - Open Source Game Framework
Post by: Doodlemeat on April 06, 2014, 01:45:23 am
I want to see Box2D as the physics engine in this library. For me, physics is a very important part of a game library, even it is created for simple game development.
Title: Re: Spooker - Open Source Game Framework
Post by: StormWingDelta on April 06, 2014, 01:56:15 am
I want to see Box2D as the physics engine in this library. For me, physics is a very important part of a game library, even it is created for simple game development.

Would save some time coming up with physics normally that's for sure but it never hurts to try and make some other forms of physics too. :)
Title: Re: Spooker - Open Source Game Framework
Post by: Doodlemeat on April 06, 2014, 02:21:15 am
True, but it would take really much time to investigate in it since physics is a pretty complex area. Catto has done a great job, I think. But I can see if this lib implements basic AABB collisions, but giving the developers the choice for more advanced physics aswell.
Title: Re: Spooker - Open Source Game Framework
Post by: Lolilolight on April 06, 2014, 10:57:02 am
For physics, you can create a hierarchy of entities, and store an AABB in each node, and you can do very accurate tests.
Or you store AABB in the root node if you want to do less accurate test.

In my framework I do like that and the unity time in my framework is in micro seconds, I really recommend it to you if you consider that physics is a really important part of a framework.

You can compute the MTU and other informations for physics with the separator axis theorem.
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 06, 2014, 12:37:09 pm
Hmm I thought about using Box2D, but physics are something.. that I just do not understand. I will try to read some materials about it, but I cannot promise anything. I know only some basics of physics, what I included into framework in update below:

Camera update, more physics, input delays

  In this commit, I redid most parts of camera, becouse camera was in this framework since I created it, but I forgot to update it when I was making changes to Spooker. So now, I simplified using camera (using views for creating camera was totally pointless) and removed void Apply, what was before used to apply camera to renderwindow, but becouse I changed how camera works, that void was pointless too. Also, fixed minor bugs in animations.
  I also added one easy, but big features, and that is adding delay to input. Becouse Spooker input class do not depends on elapsed time or on game speed, I added there simple float what will control how often will game input updates.
  And, one big feature what was already in Spooker before, but I removed it when I was redesigning sprites and textures are sprite collisions (AABB rectangles, bounding boxes collisions and pixel perfect collisions).

https://github.com/spooker-dev/Spooker/commit/18c2b84ffdae8f43130c3d0926954b1e939bc2c5

Here is also video demonstrating some features what are already in Spooker Framework (you can download source code of this example here: https://github.com/spooker-dev/Examples-Game)

http://youtu.be/eHfQiMYkNLc
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 17, 2014, 11:00:07 am
Physics, animations and camera fixes & updates

 In this commit I fixed camera finally and added Intersects property to both camera and map for easier checking for collisions. Also, fixed animations (before, when current animation was null, it was throwing error). And, removed update delay from input, becouse better results can be get by utilizing elapsed time (by multiplying values by it). Example of using elapsed time for movement action are in updated GameExample.

https://github.com/spooker-dev/Spooker/commit/a9527f53a02d5ccb77886e34c4039753cd57b5da

Here is another video demonstrating collisions in Spooker using objects loaded from Tiled Map Editor (sorry for lags in video, my PC sucks):

http://youtu.be/naP9gNi_ijE
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 20, 2014, 05:50:54 pm
Full support for "Tiled" objects

 I thought that I already added full support for Tiled to Spooker, but I was wrong, I forgot objects. Yes, I added support for collisions from Tiled objects before, but what I have forgot was other properties. So now, I added rest. You can now for example create light sources in Tiled and load them to your game only with 3 lines of code (or more, depends on how complex you wanna have your lights). Also added new option for animations and that is if animations will be looped or played only once. And also did some minor fixes to map bounds (I thought that map size is loaded in pixels but it was loaded in tiles, so I fixed this little bug).

https://github.com/spooker-dev/Spooker/commit/d1eb9ae40d2ab126652bb998d48737e78a812b53

I am thinking about releasing my implementation of Tiled for SFML as standalone library, becouse I think it is one of easiest to use Tiled implementations around (correct me if I am wrong :D ).

Here is video showing how easy you can add lights to your game using Tiled objects:

http://youtu.be/myTDt3HCl1U
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 23, 2014, 02:59:23 pm
Physics revamp

 Revamped handling of collidable objects, now it should be faster and easier. Also, added new collidable and that is circle. Ellipse is still WIP, but it should be finished in next update. And also, I did some small bugfixes and optimizations about what noone should care ;)

https://github.com/spooker-dev/Spooker/commit/7335add7f3102d569bcf2701078b2a2878a32292
https://github.com/spooker-dev/Spooker/commit/bf6d5aee8d67545a5fbf72e8b6ac9f9b516261ba
Title: Re: Spooker - Open Source Game Framework
Post by: Lolilolight on April 23, 2014, 09:14:37 pm
For physics there is a very good tutorials, it inspired me for the physic module of ODFAEG : http://www.codezealot.org/archives/55 (http://www.codezealot.org/archives/55)

I have some difficulties with equations so, I prefer using projections, matrix and vector.

So I re-use functionnalities of the graphic engine. :P

Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on April 28, 2014, 04:51:06 pm
For physics there is a very good tutorials, it inspired me for the physic module of ODFAEG : http://www.codezealot.org/archives/55 (http://www.codezealot.org/archives/55)

I have some difficulties with equations so, I prefer using projections, matrix and vector.

So I re-use functionnalities of the graphic engine. :P
Too much complex math for such a simple person like me :D Btw, another random update.

More interfaces, fixed timestep

So in this commit I overhauled use of Content Manager. Now it is only used in LoadContent(ContentManager content) void to avoid confussion and misuse of it. Also, move ILoadble to Spooker.Content and IUpdateable to Spooker.Time to avoid confussions. Also, now you can bind Camera to object what it should follow by inheriting interface IFollowable to object and then setting camera.Follow to that object. Also, changed InputAction bindings to events, so they now cannot be triggered from outside randomly. At last I added some more functionality to Vector2 and Rectangle classes. Hmm, I almost forgot. I also created my own implementation of SFML font and text classes, so now text can be easily drawn with SpriteBatch.

https://github.com/spooker-dev/Spooker/commit/06b472a88bbb49d78e160b11fe8caa0bb6cc35e4
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on May 01, 2014, 07:43:46 pm
Mega epic sprite batch overhaul

In this commit I tried to integrate some of great features of XNA spritebatch to Spooker spritebatch. I added Matrix transformations, sprite sorting and sprite blending to spritebatch. Also, created my own implementation of Transformable class and my own Matrix class. Also, fixed some confussions in GameTime class and created GameSpan class. Also, fixed new fixed timestep in spooker.

Now you can use Spooker spritebatch exactly like XNA one
Code: [Select]
spriteBatch.Begin (SpriteBlendMode.Alpha, SpriteSortMode.FrontToBack, mapCamera.Transform);

This code above sets blending mode of spritebatch to AlphaBlend, sorts drawn sprites from front to back and transforms all drawn sprite positions, rotations and scales based on mapCamera matrix.

Demonstration of camera transformation using matrix:
(http://indiearmory.com/filehost/files/cf8c652c70e6b2a05bb1dea9dfa2b65c.png)

https://github.com/spooker-dev/Spooker/commit/37a3481e1a3c2c4708b254827b594e783ddddbe1
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on May 04, 2014, 12:09:49 pm
New physics, networking overhaul

Soooo...... I finally decided to add some more depth to physics, so I instantly deleted all my "attemts" to make physics and replaced it with open source library Farseer Physics. Why I choosed FEP over Box2D? Becouse Box2D port to .NET called Box2DX is totally outdated. Also, now SpriteBatch can handle SpriteBatch stacking (so you can run another SpriteBatch within SpriteBatch). And, I increased performance of light engine by using SpriteBatch for drawing lights. Hopefully that´s all for now :)

https://github.com/spooker-dev/Spooker/commit/76cd40af53287412c345e2f0e2a74c31a4d58249

So, some demonstration video for your entertainment guys :) It also demonstrates camera rotation.
http://youtu.be/Jys9B6NWGCc
Title: Re: Spooker - Open Source Game Framework
Post by: Lolilolight on May 04, 2014, 02:14:34 pm
You've given me the envy to make a video.

Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on May 05, 2014, 01:54:59 pm
You've given me the envy to make a video.
I reccomend using ezVid http://www.ezvid.com it is great and simple tool for simple demonstration videos :P
Btwm I thought that I will get atleast minor feedback when I am making demonstration videos, but I have more feedback on Spooker on my own community with 10 active members :D
Title: Re: Spooker - Open Source Game Framework
Post by: Lolilolight on May 08, 2014, 07:25:10 pm
Ok ty I'll try it for my demo video. (if it works on linux)

Otherwise I've other programs to record video, but, it's difficult to find a good one.
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on May 09, 2014, 01:33:31 pm
Ok ty I'll try it for my demo video. (if it works on linux)

Otherwise I've other programs to record video, but, it's difficult to find a good one.
Okay xD ezVid is best and simplest to use imo :P

Particle and physics fixes
Not much to say now. I fixed some bugs in particle system and added
camera functionality to it and I also fixed few bugs in physics, so now
collisions should be handled perfectly. Also, commented most of
undocumented code.

Also, created extension library for Spooker with some RPG elements additions. Check it here: https://github.com/spooker-dev/Spooker.RPG

Also, for Occult, I created some advanced lights for particle system demonstration.

https://github.com/spooker-dev/Spooker/commit/e9ae8ffce1ba8b33dd9a95ff199f421102eb58b0

(http://indiearmory.com/filehost/files/f81d65534d046283812684e07f2b57d7.png)
Title: Re: Spooker - Open Source Game Framework
Post by: Deathbeam on May 17, 2014, 10:18:59 am
Optimizations, fixes and so on
Not much to say now. I fixed some bugs in particle system and added
So.... In this commit I fixed all GUI issues (it was loading 2 times
before). Also, I changed method of how LoadContent is called. Now, in
your game screen, you msut call it manually, so you have more freedom in
passing properties and so to assets or building sprites from oaded
assets, using fonts and so. Also, added all points totile Object, so you
are not restricted to use built in physics to use objects correctly (but
it is reccomenned to use builtin physics, becouse it is epic :D). And I
did also minor changes to EntityList and big changes to repository
structure, but they are not important, just for easier navigation ;)

https://github.com/spooker-dev/Spooker/commit/a1e9579a3703e33b5c1c6c07839caced563f635b