Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411488 Posts in 69377 Topics- by 58433 Members - Latest Member: Bohdan_Zoshchenko

April 29, 2024, 03:16:50 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Pixie - A nice 2D Game Engine
Pages: [1]
Print
Author Topic: Pixie - A nice 2D Game Engine  (Read 2235 times)
ColossusEntertainment
Level 1
*

Royal Leamington Spa, UK


View Profile
« on: January 25, 2010, 02:15:10 AM »

Here's something I've been working on for the last three years:
It is a simple and  easy-to-use 2D game engine in C++. It is specifically written to be easy to modify and port to any platform, and I've tried to have as few external dependencies as possible - so it doesn't even require directx, as it can fall back on windows gdi functions if necessary. All rendering is done in software, which is maybe not ideal for all types of projects, but it gives a wider range of hardware which it can run on, and it can be convenient to always have direct access to all pixel data, and not have to deal with differences between GPU's/drivers. Pixie is not for everyone, but it IS for those who just want to get sprites on the screen and have it just run everywhere.

Throughout the development, I've been making little games to drive the development. I think that is a key part of developing any engine, as it is only by using it for making games that it can become good for making games.


Pixie is public domain. Can't really have a more generous license than that, right? :D So, if you can use it, or any part of it, just go ahead (though there's a few bits, mostly support for different file formats, which I didn't write and which is not public domain, but they are clearly marked, and still have pretty good licenses).



I've set up a site for pixie: www.pixieuniversity.com and there you will find downloads for the engine and all the sample games source code (their code is also public domain, so might be a good base to build a game from, if you're just starting out) as well as online documentation and tutorials on how to get started (and there's more tutorials and sample games to come).

For now, this is only for windows, but I've started looking at a linux version, and as soon as I can get a Mac I'll look at porting it to OsX too. But there's not a lot of platform specific code, as most things are done in software, with as few platform dependencies as possible. I've also put together a "Pixie Lite" package (which can be found on the site) which is just the platform specific bits, broken out from the main code, for those who are interested in helping with porting this to other platforms.

I hope you will enjoy working with Pixie, or at least find some bits of code in there which is useful to your own projects. And if you have any questions or need any help, just ask Smiley

Thanks for your time,
Mattias
Logged
Dataflashsabot
Level 2
**


View Profile
« Reply #1 on: January 25, 2010, 09:01:30 AM »

This looks very interesting, but why does it need the DirectX SDK? I don't really want to download the half-gig monster, especially when this claims to be almost platform independant- why isn't OpenGL used in that case?
Logged
ColossusEntertainment
Level 1
*

Royal Leamington Spa, UK


View Profile
« Reply #2 on: January 25, 2010, 09:31:33 AM »

That's a fair question Smiley

All rendering is done by the engine, by just moving bytes around in memory - that's obviously platform independent. When a game frame has been composited, it needs to be displayed - this bit needs to interact with the hardware, and Pixie has a function to send a backbuffer to the screen.

The current, windows implementation, makes use if DirectX9 to do this (by transferring the data to a dynamic texture, and render it to the screen. That's quite efficient) if DirectX9 is available. But if it isn't available, or any function of it fails, it falls back on DirectX3, using DirectDraw to present the backbuffer to the screen. And if no DirectX at all is present, it falls back to Windows GDI, which will always work, but not be as fast.

On Linux and Mac, this bit of the engine (Platform_Screen) will most certainly use OpenGL. But for windows, there's some issues with using OpenGL, especially on old windows versions where it didn't come properly pre-installed. It's just more safe to go with DirectX on windows.

The same thing goes for sound, where Pixie will use DirectSound if available, and fall back on windows WMM if it isn't.

Yes, it does mean that you will need the DirectX SDK installed to build the windows version of Pixie, and yes it is quite a big download. But you only need to do it once, and the end result is a game that runs fast on more systems out of the box.

However, I've started working on the Linux version, and that will involve making an OpenGL version of Platform_Screen. When I do, I'll make sure to add a windows version for it as well, so those who really don't want to install the DirectX SDK can still use it.
Logged
Dataflashsabot
Level 2
**


View Profile
« Reply #3 on: January 25, 2010, 09:42:47 AM »

I see. The download is kind of out of the question for me at the moment, so I'll wait for that version. Thanks Smiley
Logged
ColossusEntertainment
Level 1
*

Royal Leamington Spa, UK


View Profile
« Reply #4 on: January 25, 2010, 09:46:50 AM »

It will take a while though - just in the middle of moving right now. I might look at making a GDI-only version in the next few days if I get some time. We'll see.
Logged
Hima
Level 4
****


OM NOM NOM


View Profile WWW
« Reply #5 on: January 25, 2010, 09:35:49 PM »

I remember you posting this long time ago. Good to see that it's still on!  Anyway, that's a very generous of you releasing everything for free, both the engine and the games source code. I've bookmarked pixie site( which is much more organized than the old one, I've gotta say! ) and will find time to play this baby soon Smiley
Logged

ColossusEntertainment
Level 1
*

Royal Leamington Spa, UK


View Profile
« Reply #6 on: January 29, 2010, 12:53:56 PM »

Thanks :-) I'm happy to hear that you remember it. If you have a go at it, I'd love to hear what you think about it
Logged
AaronAardvark
Level 1
*


Formerly RazputinOleander


View Profile WWW
« Reply #7 on: February 02, 2010, 06:54:08 PM »

Mattias - you should throw this up on GitHub.  I can do a little bit of porting work here or there, but I quickly get overwhelmed since I'm not really familiar with Linux OS-level programming.

The last attempt I made, it sort of turned into a jumbled mess because I was just jumping around from file to file with no way to track the changes I'd made.  It was a pretty poor ad-hoc approach to porting. :\  I can definitely see porting a file or two at a time, though.  Maybe even just a couple of functions at a time.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic