Categories
Game Development

D3DX Math functions very fast

I ran across this
http://cache-www.intel.com/cd/00/00/01/76/17699_code_zohar.pdf which is a math library using SSE2 to do fast math operations. I spent a lot of time upgrading his code to be more suitable to games, such as doing a transpose for an inverse of a orthonormal matrix. But after profiling I found his code was slower than the equivalent D3DX math functions, even for matrix multiply.

D3DXMatrixMultiply 10000000 times:
diffGP=564 milliseconds diffDX=396 milliseconds

Bleh.

I also tried this: http://www.cs.nmsu.edu/CSWS/techRpt/2003-003.ps

It appears that D3DX already does better than this as well:
Theirs=695 milliseconds Mine=801 milliseconds

However, the version without scaling was 100 milliseconds faster. However, that is such a special case it’s not worth leaving in.

So Kudos to Direct3D because their math functions are very fast!

By the way, this is something I was able to figure out while experimenting. In every library I’ve ever used, except the one at The Collective, this was very unclear. I think they used to always store the matrices transposed to make them easier to use or something.

[code]
inline D3DXVECTOR3 * GetAtVec(D3DXVECTOR3 *out, D3DXMATRIX *in)
{
out->x=in->_13;
out->y=in->_23;
out->z=in->_33;
return out;
}
inline D3DXVECTOR3 * GetUpVec(D3DXVECTOR3 *out, D3DXMATRIX *in)
{
out->x=in->_12;
out->y=in->_22;
out->z=in->_23;
return out;
}
inline D3DXVECTOR3 * GetRightVec(D3DXVECTOR3 *out, D3DXMATRIX *in)
{
out->x=in->_11;
out->y=in->_21;
out->z=in->_31;
return out;
}
inline D3DXVECTOR3 GetAtVec(D3DXMATRIX *in)
{
return D3DXVECTOR3(in->_13,in->_23,in->_33);
}
inline D3DXVECTOR3 GetUpVec(D3DXMATRIX *in)
{
return D3DXVECTOR3(in->_12,in->_22,in->_23);
}
inline D3DXVECTOR3 GetRightVec(D3DXMATRIX *in)
{
return D3DXVECTOR3(in->_11,in->_21,in->_31);
}
[/code]

Categories
Game Development

Smart Pointer System

I’ve taken a liking to smart pointers lately. The overhead is negligible and it’s vastly easier than having to keep track of pointers all over the place.

I read a bit about the std smart pointer. I don’t understand why the articles on smart pointers are so long or complicated, or why the boost library made a smart pointer. To me this seems the easiest thing in the world. Perhaps I don’t understand all the issues involved?

Smart Object

Smart Pointer

To use it, just derive your class from RakSmartObj. When instantiating your class, assign the pointer to an instance of RakSmartPtr. When all instances of RakSmartPtr are deleted or assigned to 0, then the class instance is automatically deleted.

Categories
Game Development

RakNet in Develop Magazine

Alan Lawrance pointed out to me that Develop Magazine had an article on networking middleware and listed RakNet. Here is a screenshot.

RakNet article

He also sent me the article. Right click to save as.

They spelled the name wrong, and didn’t mention that RakNet also supports the Mac and Linux. They also put that the license is $5000, while actually that is the site-license, and the regular licenses are as low as $100. There are also quite a few companies using RakNet that aren’t listed on the front page.

In other news, Auran is using RakNet for Battlestar Galactica too, which just came out on the XBOX 360.

Categories
Game Development

Gamebryo

I’ve been using Gamebryo lately and the more I use it the more I like it. What I like the most is the toolset. Yesterday I was able to create an object in MAX that had 3 different textures with the default shader and apply an animation. I was then able to directly export this into the level editor, see the animation, and add a sound property. From there I was able to load the file into the game and with some debugging to see my object move around.

The equivalent in my engine right now would have been a monumental task, involving material files, adding programming for the sound and animation, and study of the code to figure out how to get the animation in the right place and to update over time.

The more I use it the more I realize the art problem with my own game was that I lacked the artist support tools that they provide

1. Level editor, with support for custom properties
2. Editing/viewing shader properties by artists in MAX
3. MAX previewer using the game renderer
4. Direct import of levels
5. Direct support for .fx shaders

If I had these things from the beginning I would have saved months that I otherwise wasted redoing art assets and the levels would have looked 10X better. Plus it would have been supported on the consoles.

Support is also very good. I get answers the same or the next day and the technicians are helpful.

My only major complaint is the documentation is incomplete. Yesterday, I spent 3 hours trying to figure out how to load their level asset format and then get the scene node root pointer. It took me 2 days to figure out how to load a custom shader, again mostly debugging. The documentation tells you part of what you need to know, with undocumented preconditions, or references to other systems. In those cases you have to debug the samples and source which is very time consuming.

Ogre is very good about this, where I generally can program from the documentation and didn’t have to build the source until late in the project.

What’s ironic is had I known about Gamebryo at the start of my project I wouldn’t have licensed it. The licensing fee would have scared me away, and if it didn’t, I still wouldn’t have used it. I would have looked at Ogre’s documentation and whatever I want to do would be very clear, vs. days of debugging in Gamebryo, assuming I had the source.

However…

Knowing what I do now, at the end of this project, I would have licensed it. I spent more than the licensing fee in wasted money on artists, redoing art myself, and setting up hard to use tools.

If I manage to find a publisher I’m probably just going to restart the project and use Gamebryo. Especially now that I’ve already been learning it.

Categories
Game Development

Looking for an on-site artist

After seeing what one artist can do in Mount and Blade I realize I wasn’t getting my money’s worth from my existing outsourcing art team. Several times recently at my job I will look at what other artists can do at my contracting job and say “Wow, one artist did all that?”

What really was the last straw was when they sent me this, as a carrier interior

Carrier Mess

It’s just a tremendous ugly mess. And I look at what they did up close and you see this:

Carrier Mess 2

So they spent a huge amount of time modeling control panels right down to the lights, when you actually play the game with the camera about half a kilometer away (as in the first screenshot). I’m about the least competent artist there is but even I understand if you are looking at objects from half a kilometer away maybe you shouldn’t spend time modeling buttons you don’t even see. They’ve been playing the game for 3 months too, so I’m dumbfounded on how this wasn’t obvious.

This has been going on from day 1, which is why it took them 7 months to do essentially half the work they were contracted to do in 4 months. It’s not that they can’t do a good job, it’s that you can’t leave any detail unspecified.

I give up. I’m going to find someone preferably local to salvage the situation.

Categories
Game Development

Contracting + publishing

As Galactic Melee is truly out of money I don’t have time to develop it significantly anymore. I’ve gone back to contracting and have taken 2 full-time contracts. Since I’m now used to working 100 hours a week anyway this is actually a reduction in how much I work a week. The contracts both pay fairly but I’m not making that much because the money still goes towards repaying ongoing or past costs on Galactic Melee development.

On the positive side, one of the clients is a large publisher with both the potential funds and the genre interest to pick up Galactic Melee. Upper management has already expressed interest in looking at the game. Of course there’s a huge difference between a manager verbally asking to look at the game, and actually having the company publish it, but working with and knowing upper management on a regular basis gives me a boost over any other random developer. It’s still a long-shot, maybe 1 in 100 chance, but if it works the game would be published on a console as well as the PC.

Categories
Game Development

Dungeon Crawl

I was playing Dungeon Crawl and it’s this incredibly fun game with a huge learning curve and bad graphics, yet I was addicted. I’m thinking I should have taken this approach with Galactic Melee. I could have did the game for 1/10th the cost and 1/4 the time.

Categories
Game Development

Invested vs. paid

A chat with my friend Bill today.


Kevin: By the way, I found a really fun game called Mount and Blade
Also programmed by one dude, with one artist

Bill: nice… free?

Kevin: Sort of pisses me off cause he has about a dozen models, characters, and weapons and my larger more expensive art team takes like a month just for 4 fighters.

Bill: haha… well, that’s the difference between an artist who is invested and one who’s just getting paid

Kevin: You’re so right about the guy who is invested thing
They should make a new word for right just to describe how right you are

Categories
Game Development

Good time for Americans to go contracting

The last time I contracted to Europe was about 4 years ago. I forget the exact figure, but the pay was quite poor, partly because at the time the dollar was worth more than the Euro. I think it was .7 to 1 or something (easy to look up if anyone cares to).

With the dollar now so devalued that a penny is worth less than the copper used to make it, the opposite is true. I can make more contracting to overseas companies. The current exchange rate is 1 euro to 1.37 dollars.

This is good timing because I’ve had several contracting offers the last week. Compared to four years ago, I can ask for twice as much money and it’s considered the same thing. Since inflation hasn’t risen correspondingly (yet) I benefit from the lag. It also keeps me busy as I get contracts now where I wouldn’t have before. Maybe I should buy a bunch of gold.

It helps RakNet too since it means RakNet is cheaper.

I see now why China likes to peg its currency lower than its actual value.

Categories
Game Development

Billing problems again

I got an email from a pissed off “Customer” this morning complaining about getting double charged. Which is funny, because I am not charging yet, nor have plans to in the near future.


Dear XXX:

Our records indicate an overdue balance in the amount of $49.99 USD
remains on your Galactic Melee account. To avoid interruption of
service, you must bring your account current.

If your payment has already been made, please accept our thanks and
disregard this notice.

If you feel the information included in this notice is incorrect or have
questions about your Galactic Melee account, please contact us at .
Thank you for choosing Galactic Melee.

$49.99 is the cost of my lifetime subscription fee.

My billing service provider Aria Systems must charging when I told them not to, sending out payment emails in test mode, and/or charging monthly for the lifetime subscription.

I told the (potential) customer I will personally refund his money if he was charged and the billing provider does not deal with this satisfactorily. I don’t want chargebacks and complaints of theft before I even open for business.

Another problem is that two weeks ago I also found that Aria did not verify email addresses on signup, which I discovered when I tried to contact a few people for some feedback. Admittedly, I never specifically asked for this, but it’s sort of obvious this is a necessary requirement. I don’t know of any online games that don’t verify email addresses, it’s just common sense that this should have been implemented, or at least they could have asked me “Hey, is it important to you that you can communicate with your customers?”

When I emailed asking about this I was ignored. So I followed up a week later and get a reply to the effect of “There is no central repository of all valid email addresses, how can we verify it?” Perhaps, the same way everyone else does, which is to make the user click a link when they get a confirmation email. I never heard back again after that – maybe they are doing it, maybe not. You’d think they have the code for this already, since every online game needs it.

Since I’m a small customer I’m really trying hard not to ask for too much. But still, for a $1500 setup fee and a percentage of my gross revenue is this too much to expect?

Speaking of fees, it’s been bothering me that the credit card processing company takes 10% They don’t call it 10%, but at the end of the day this is the difference between what I charge and what I get.

If I can find a 3rd party billing provider that:

1. Charges less than 10%
2. Can generate a purchase confirmation code that my game can automatically check
3. Can add paid registrations to my database automatically (through a web form ?)
4. Verifies customer information before sending it to me (esp. email address)

I can switch over, do lifetime subscriptions only, and fix both of these problems in one swoop. I think the hardest part will be #3 though. I know there are download services, and services where you get an email for every new customer, but I don’t want to go into the database every time I get a new customer.