RSS Feed

RSS

C# and XNA

I know Microsoft is the company many love to hate. But dam do they keep impressing me with their achievements. And I’m not talking about vision, everybody has enough of that. I’m talking about the actual C# and XNA deal, the day-to-day work and actually finishing projects with this. From vision to reality, from concept to production. I believe C#/XNA is setting a standard that will leave most behind. In all my years of game development I’ve never seen a framework so intuitive, powerful and straightforward.

I downloaded the XNA beta on August 30; looked at it… it looked ok. Then a few days ago I created a new XNA Game Project and four days later I had a game framework, entity editor, and a few entity types (camera, grid and volumes). Worth mentioning is the fact that this was my first time using C#. Although, I do build frameworks and games for a living, which helps me code known patterns, I did find features that opened a new window of refactoring. I’m also creating a script engine using as language C#, which in this case might not mean scripting, but realtime compiling. And the results are promising.

The XNA Content Pipeline will be the deciding factor. It will make it or break it. Let’s see what the giant comes up with. I’m a bit scared ’cause my expectations are high.

Scripting Is Very Real

I remember those days when C++ developers were not real programmers. Because the real programmers were C developers. Who in their right state of mind would use C++ to write games. Yup, that’s how it was in the old days. You can still find a few dinosaurs lurking around in the game industry, but lets ignore them for now.

If you’re one of those that can’t stand the word scripting, lets just imagine we’re talking about a very sophisticated data-driven system. I’ll come back to this in another post.

Scripting is very real, its happening and its helping drive the next generation of gameplay. More than ever companies are relying on scripting to innovate. It helps iterate through hundreds of gameplay scenarios and create (sometimes by mistake) new experiences. I can’t accept not using scripting in a huge project, where the goal is to innovate (unless boss gives me the look). It’s just so dam fast; the iteration, I mean. When designers start speaking to me about ideas, I start seeing gameplay; I don’t see data structures, project configurations, XML files, memory management. And don’t give me the crap that you can do this if the engine is well designed. I’ll tell you this… if you’re innovating and trying new things, a perfectly designed engine is the one that gets the hell out of your way. By the way, sometimes the experiment is such that the designers don’t even know what they want, its just a feeling deep inside their hearts. And I really believe I don’t want to spend time writting sophisticated C++ code over a feeling. And don’t get me wrong, I like when designers don’t know exactly what they want; it might be the beginning of something very cool.

Script the most outrageous things, test it, throw it away, refactor it, script it again. Wow!! Now you have a nice piece of gameplay working, its beautiful, its fun… shit its slow… no problem rewrite it in C++ (or C). Oh… I know what you’re thinking. Why didn’t I do it in C++ in the first place. Because, while you were debugging your your classes, designing your data structures and adding new tags to your XML… I’m already playing with my game script. Yeah, I’m already talking about how to get two more monsters to fly into action and trigger a volcano that will spit some lava, which the player will use to surf to safety. What do you think? Oh sorry… you’re still linking, my bad, I’ll come back after coffee. Then I will put my already perfectly designed piece of gameplay into C++, if I need too.

There is nothing more real than this. But nothing comes for free. You need to get scripting right. Getting scripting into an engine is far more complicated than what is posted out there. It takes understanding the engine you’ll be working with. Let scripting do more than the engine can do, but let scripting also start using new engine features as they come online. A bad binding and exposing strategy will haunt you. But then again, why do you get paid? You go and start scripting, but do it the right way.

Note to myself: Take a look at XNA and C#, it looks cool. Please stay open-minded while experimenting with it.