My brain makes things explode.
Archive for March, 2010
Qt4
Mar 29th
As of last night, I started looking into using Qt4 for future Application development projects of mine – and damned if it doesn’t look like the best option available to me (the best alternative being writing the UI on each different platform individually). For those who don’t know, Qt4 is an immensely popular and very powerful cross-platform application library that works with C++, and is supported on a large number of machines – from 64-bit Windows desktops to 32-bit embedded Linux solutions to the wonder that is Mac OS X. All without having to change the code – all that is required is a recompile (assuming you’ve set things up properly, of course). It even supports cross-platform project (.pro) files, and has a cross-platform toolset that accompanies its SDK – including a GUI designer, a set of debugging tools, and even an IDE that ties with a MinGW compiler.
I’ve started working again on an IRC client – now under the name alienIRC (formerly SevenIRC, which was being planned solely for Windows). I’ve also decided to make it completely open-source, and intend to license it under LGPLv3, something it shares with the Qt framework that is going to power it. I’m going to be setting up a Git repository on Gitorious for the project, and will be setting up some development pages on this blog – including issue tracking, a wiki, and some other tools. Right now, my plan is to closely emulate the mIRC interface – mostly because mIRC is my favorite IRC client – and will be working to make sure it feels native on all supported platforms. I will personally be maintaining builds on Windows (32- and 64-bit), OpenSUSE 11, and Mac OS X Snow Leopard. I will primarily be using the IDE that comes with Qt, though I will work to ensure that it compiles in X-Code 3 and Visual Studio 2008/2010.
As far as alienIRC itself goes, I’m looking at the possibility of using WebKit for the chat windows’ messages. This would make it incredibly easy to add formatting, because I could easily change messages from the mIRC color character into HTML tags before adding the text to the message box. It all depends on how it runs compared to a custom text box. I also plan to implement a number of features that are popular with mIRC, such as scripting (Lua, specifically), “address books,” nick highlighting, file sharing, et cetera. I’m currently working on some UI concept work – since it will have to be different from SevenIRC’s WPF plans and the previous OS X-only alienIRC UI concept that relied on some UI elements only found on Mac (such as Drawers).
If anybody is interested in contributing to this project, send me some messages – I’d be happy to hear your input, especially on features that you feel would be good to implement. Make sure you sign up for an account on Gitorious – and that you upload your SSH keys and such. If you’ve never used Git, and you’re a Windows developer, this is a very useful link for seting it up on Windows: Git for Windows Developers: Part 1
Beh
Mar 28th
Alright, so I thought I’d give a bit of an update, since I was trying to release the next tutorial in the D3D Pong series today. I spent this week (meaning my twenty-first birthday) with my girlfriend, and while I have the code written and in usable condition (written while she was at work), I have some tinkering to do to get the mouse input working properly, and then I have to actually write up the tutorial. I’m also in the process of setting up a GIT repository for the game engine, in which I will store the latest changes to the engine. But right now, my mind is still in Phoenix, and I’m not in the mood to write up the next bit of the tutorial. I will give you a bit of a roadmap for what is to come in the future, though: (subject to change)
Tutorial 4: Input
Tutorial: Basic Collision Detection and building the Pong prototype
Tutorial: Audio
Tutorial: Piecing the Game Together
Tutorial: High Scores
Polishing Addon: Shaders
Polishing Addon: “Event”-based programming
Polishing Addon: Particle Systems
C++/D3D Pong Maintenance: The Game Loop/Frame Delta
Mar 25th
Tutorial Description
While running the game/engine that we’ve been developing throughout this tutorial series, you may have noticed that the engine kind of runs… like crap. So, before moving onto the next tutorial in the series (the code for which is completed), which will cover keyboard and mouse input, I feel that it’s somewhat important to fix this. It’s just going to be some small updates to CGameEngine.cpp, so it won’t be hard.
Code Listing 1: CGameEngine.cpp -> CGameEngine::CGameEengine(void)
First, we’re going to correct an error with our game timer, which we never actually created an instance of in code – causing the GetRunTime feature to fail due to a member variable not being initialized (CGameTimer::_start). Replace the constructor for CGameEngine with the following, in CGameEngine.cpp
CGameEngine::CGameEngine(void)
: _windowHandle(NULL), _windowTitle(L"D3DPong"),
_screenWidth(640), _screenHeight(480), _colorDepth(32),
_gameRunning(true), _gameTimer(new CGameTimer())
{
}
Code Listing 2: CGameEngine.cpp -> CGameEngine::Update(void)
Our new Update method is much smaller than it was before. We’re still using fast-as-possible rendering and updating, so this isn’t going to fix the minor graphics tearing that you’ve no doubt noticed before this, but it is going to make things run a little better.
void CGameEngine::Update(void)
{
float delta = this->_gameTimer->GetRunTime();
GameUpdate(delta);
this->_gameTimer->Reset();
this->BeginRender();
GameRender(delta);
this->EndRender();
}
Nicer, cleaner, shorter. This was caused by a bit of an inconsistency and laziness on my part, but things should run a bit smoother now. In the next tutorial, we’re going to be adding input, and will put the beginning pieces of our game into effect. I’ll cover enabling VSync at a later point, because I’m too lazy to deal with it right now. It’ll probably be in another “Maintenance” mini-tutorial.
Expect Tutorial 4 soon!
C++/D3D Pong Tutorial 03: Scene Objects and Sprite Rendering
Mar 21st
Tutorial Description
In the last tutorial, we finished getting Direct3D set up, implemented a timer system to allow us to calculate the time between each frame, and set up the framework that will grant us access to our game without interfering with the core engine. In this tutorial, we are going to implement a reusable Scene Object class, which will be the parent for all future classes that we wish to enable in a scene manager. The scope of this tutorial series makes a full-fledged instance management system overkill, so we will not be building one in here. However, as this tutorial series will act as the base for future tutorials that will implement a scene manager, I am going to implement the scene object class here.
Downloads
Binary Only (18.8KB)
Full VS2010 Project Dir (28.4KB)
Starting Words
I just wanted to point out that this tutorial series borrows a lot of the structure of Jonathan Harbour’s Advanced2D game engine, from the book “Advanced 2D Game Development“. While I certainly believe it to be a wonderful book, and an excellent starting point for beginners (in fact, the reason for me borrowing the format for his engine is because I find the method well-suited for beginners), I find that I have a lot of personal quirks with Jonathan’s methods and programming habits, and there are a number of inconsistencies in it. Furthermore, there are some topics that are covered in the book that just aren’t well-suited for beginners, and can cause things to be a bit confusing and convoluted. In this tutorial series, I don’t plan to implement three-dimensional rendering, which he does cover briefly, and have no intention of including game scripting, though several more advanced tutorials will cover these aspects at a later date (read: when I stop being lazy). Anybody looking at learning to program two-dimensional games with DirectX and C++ should look into the book, but should remember that there will always be better ways to implement certain systems than what is shown to you in a book – or an online tutorial. Anybody that wants to gain a solid understanding and truly grasp the depth of these programming systems is highly encouraged to look up information on any subjects that they are unfamiliar with. I strongly recommend Safari Books Online – I read a lot of books there, and it’s certainly helped me improve myself. Advanced 2D Game Development is available on SBO, as well.
Notice: This tutorial continues from where “C++/D3D Pong Tutorial 02” article left off. Please read it if you have not already.
I’m not dead. I promise. So can I please eat your brains?
Mar 16th
Well, I haven’t exactly blogged much of anything in the past couple weeks, mostly because I’ve been side-tracked with a couple projects, such as the new website for the Keyboard-Failure IRC network (http://www.kbfail.net- or point your IRC client of choice to irc://irc.kbfail.net). You can see the new theme (which I think is a major improvement over the pink-background, black-text spawned by the lack of any desire to work to give KBFail a real theme/system. What can I say? We’re all lazy.) by going to the development page: http://minalien.dynalias.net/kbfail/. Guess when I get around to working on it, I’m going to install the newest Release Candidate of SMF for development/testing of the new site, and I’ll probably get around to rebuilding my old mod to integrate Alex Gorbatchev’s SyntaxHighlighter (which I use on this blog) sometime soon, too. Gods, I wish SMF were object-oriented. :P
It seems that I do actually have somebody paying attention to the Direct3D Pong tutorial series I’ve been writing. I kind of shrugged off doing much more work on the project because I didn’t think anybody was bothering to read it, but a recent tweet shows me that there is at least one person reading it. That, for me, is plenty – so @Ogreman, you can look forward to the next tutorial in the series to come along (hopefully) by the end of this weekend.
I’ve been going through some.. personal issues. Anybody familiar with my past will probably know what I’m talking about, so I’ll just kinda leave the details at that. Suffice to say that life is a pain in the ass, but I’m (uncharacteristically) looking toward the brighter side of things and moving forward with life. On the lighter side of things, my plans to visit Erin in Phoenix are going through, so I’ll be blissfully free of work and hanging out with a friend. I’ve been acting very out-of-character for me, recently. I mean, social activity? Something seriously has to be wrong with me. I think I broke my head. D:
Recently renewed my subscription to Safari Books Online – I pay for the $40-ish unlimited subscription, but they’ve got a $20-ish (monthly) ten-books-per-month plan. Very useful, and I highly recommend it for anybody who deals with technology on a hobby basis. Large collection of full books on there, ready for you to read on your computer at home, or even in mobile-optimized forms on your iPhone or (if you’re one of the cool kids, like me) Android or other smartphone. Anyway, I’ve been reading up and studying for the CCNA certifications, which I’m hoping I will be able to take on-base without first going through the “NCO” courses. In the worst case scenario, I’ll just find somewhere closeby off-base, probably in Los Angeles, to take it on my own. They’ve got a full collection of Cisco networking books, programming (including game programming) books for a large selection of languages (Obj-C, C, C++, C#, Ruby, Java, HTML/XHTML, PHP, ASP.NET.. you name it, it’s there). For those who can afford it and will use it, it’s much cheaper than buying each of the books separately, and much more legal (and less of a pain in the ass for searching) than downloading the books on your favorite torrent client.

