View Full Version : 2D Graphics Library & an article about a 2D renderer
Mattias Gustavsson
11-07-2007, 12:43 AM
I've recently released the source code to my graphics library, and thought I'd tell you guys about it, in case it's of use to someone. It's free to use, no weird licensing issues. Also does music playback in a few different formats.
http://www.colossusentertainment.com/DevelopmentStuff/PixieGameEngine.html
I've also finished an article I started ages ago, about a software 2D renderer I made (actually the one used in my graphics library)
http://www.colossusentertainment.com/Articles/2DSoftwareRenderer.html
Hope this stuff is useful to someone :-)
/Mattias
Cool, thanks!
I'm already using my own stuff, but I'll probably peruse your source in my spare time anyway :)
jimflip
11-07-2007, 01:59 AM
Likewise we also have our own system but will be interesting to look through your stuff. It is great that you have shared this with the public.
Out of interest, how long do you think this took you to develop?
Mattias Gustavsson
11-07-2007, 02:08 AM
A bit hard to say, but most of it was written in 2-3 weeks of evening and weekends, but then I already had some things from an earlier engine (a 3d engine I'm no longer working on) like the platform abstractions and the containers, those sort of things...
ggambett
11-07-2007, 09:22 AM
Mattias, first of all, thanks for relasing this - I'm sure it will be quite useful for a lot of people.
I haven't looked at your code, but reading the article makes me wonder - is all of that worth the effort? Originally my framework did software rendering only and I had a lot of code to deal with dirty rectangles and micro tile arrays and stuff, and used SDL blitters to do the optimized blits you mention.
However, 2 or 3 years ago I implemented a hardware accelerated renderer, the code is much cleaner and I had no serious compatibility or performance issues.
So while I'm sure it was fun to do (optimizing low level stuff is always fun!), I don't really see the business sense of investing so much time in it.
Please don't read this as a criticism, I'm just curious.
Mattias Gustavsson
11-07-2007, 01:28 PM
Good question, and no, I don't take it as critisism :-)
I think it's worth the effort, yes :-) I have a renderer which exactly suits my needs, I know the code inside out, if there's any bugs in there, I'll find them very quickly. I don't have any dependencies on specific DirectX versions or things like that, and I'll be able to very easily port things to any platform I want in very short time.
And it took me 3 days to do the rendering part of the library, the 2-3 weeks of evenings and weekends I stated above included things like the music playback, buttons, sprites, text etc, which would still have to be done if I had used hardware acceleration.
Also, by keeping everything in software, it's easier to do per pixel manipulations without the performance hit of readback as I'd have if using a 3D api, and I rely a lot on those types of things for the procedural generation of things in the games I'm doing.
So it's probably not the right choice for everyone, but for me it is exactly what I need, and a hardware accelerated renderer wouldn't have cut it for me. It just wouldn't have been flexible enough, and not simple enough either... :-)
Oh, and as for the business sense part, I wasn't making games as a business when I first wrote the lib, I was doing it for some oldschool demo stuff www.mattiasgustavsson.com/pixie...
/Mattias
xelanoimis
11-09-2007, 07:01 AM
I had a short look over your source code, and I have to say it looks very nice and clean.
You did a great job with the engine!
As for the software-hardware debate, don't worry too much. It's more important to have it well structured, and easy to port on various platforms, or future os versions. And if it's about a simple 2D game, there's nothing that a software engine can't do.
By the way, I also use the STSound library made by Arnaud Carré, in my DizzyAGE engine. In fact, I was well surprised to see he credited me in the version update file, for fixing some bugs :)
Keep the good work!
Alex
gdunbar
11-10-2007, 07:46 AM
Thanks for the article, it was very informative and interesting.
Geoff
Mattias Gustavsson
11-12-2007, 04:33 AM
And if it's about a simple 2D game, there's nothing that a software engine can't do.
True :-) And I'd argue that a lot of things gets easier to do as well, when not having to wrestle the HW api :D
Mattias Gustavsson
11-22-2007, 04:46 AM
I was recently in a 48 hrs rpg-making contest, and used my game engine to make my contribution. I've released the source code to it as well, which I guess can serve as a (quite messy) example of how to use the engine. More info here:
http://www.colossusentertainment.com/Blog/TheAmazingAdventuresofKas.html
Btw, both the engine and the game source code is public domain (except for the STSound component included in the engine, which is GPL).
http://www.colossusentertainment.com/forumref/kassandratitle.png
http://www.colossusentertainment.com/forumref/kassandraingame.png
Mattias Gustavsson
12-27-2007, 01:08 AM
Just thought I'd let you know I've put the source code of another example game up for download. I made a simple little game for the Swedish Game Awards Warmup competition (the theme was "vikings and the future").
Hope it will be useful to someone. It is released to the public domain as usual.
Source code (including engine):
http://www.colossusentertainment.com/Downloads/babyviking_source_1_5.zip
Game:
http://www.colossusentertainment.com/Downloads/BabyViking_1_5.zip
Screenshots:
http://www.colossusentertainment.com/Images/Screenshots/babyviking_title.png http://www.colossusentertainment.com/Images/Screenshots/babyviking_ingame1.png
Mattias Gustavsson
01-10-2008, 09:04 AM
I've put sourcecode for another game using the engine on my website now, but more importantly fixed a few issuses with the rendering part of the engine, so framerate should be improved :-)
Mattias Gustavsson
01-11-2008, 12:23 AM
Thanks, glad you like it. It's all done in Poser though, so I can't take too much credit for it :p
Mattias Gustavsson
07-02-2008, 02:56 AM
I've done a major update to the Pixie engine (http://www.colossusentertainment.com/Blog/ThePixieGameEngine.html) recently so I thought I'd post an update here rather than create a new thread for it. I've fixed a lot of little issues with the engine, and generally cleaned it up a bit, so I'd say it's rather usable now.
More interestingly, I've written two tutorials for the engine, one "hello world" tutorial (http://www.colossusentertainment.com/Articles/PixieTutorial1-HelloWorld.html), and one which displays a bouncing ball (http://www.colossusentertainment.com/Articles/PixieTutorial2-BouncingBa.html)
It's public domain btw, so no weird license restrictions :cool:
And there's some online documentation (http://www.colossusentertainment.com/pixiedocs) now as well.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.