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

Author Topic: Spooker - Open Source Game Framework  (Read 26979 times)

0 Members and 4 Guests are viewing this topic.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #30 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):

Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #31 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:

« Last Edit: April 04, 2014, 06:57:58 pm by Deathbeam »
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Doodlemeat

  • Guest
Re: Spooker - Open Source Game Framework
« Reply #32 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.

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Spooker - Open Source Game Framework
« Reply #33 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. :)
I have many ideas but need the help of others to find way to make use of them.

Doodlemeat

  • Guest
Re: Spooker - Open Source Game Framework
« Reply #34 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.

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: Spooker - Open Source Game Framework
« Reply #35 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.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #36 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)

« Last Edit: April 06, 2014, 12:39:26 pm by Deathbeam »
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #37 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):

Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #38 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:

Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #39 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
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: Spooker - Open Source Game Framework
« Reply #40 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

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

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


Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #41 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

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
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #42 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:


https://github.com/spooker-dev/Spooker/commit/37a3481e1a3c2c4708b254827b594e783ddddbe1
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Spooker - Open Source Game Framework
« Reply #43 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.
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: Spooker - Open Source Game Framework
« Reply #44 on: May 04, 2014, 02:14:34 pm »
You've given me the envy to make a video.