Where Have I Been?
Working on a class to display a font… I’m pretty much done with it, my mother-in-law is coming in this weekend so I’m not sure if I’ll get to wrap it up and put a bow on it…
Any ideas where to host the zipped up file? Anyone know the legality of using fonts/are there any “open-source” fonts I can use?
XNA Screenshots
Shawn Hargreaves has an incredibly nifty and usefull bit of code to allow you to take screenshots of games running on the Xbox:
http://blogs.msdn.com/shawnhar/archive/2007/01/08/capturing-screenshots-from-xbox-xna-games.aspx
When I read things like this I’m just amazed at what people are able to do with XNA and C#. Programming is problem-solving skills + knowledge of what you can do with the language. Both of those things come mostly from experience. I love the fact that there are blogs are over the internet talking about programming and XNA so that I can just learn at the feet of these code masters… One of these days I hope to meet these guys and just say thanks for all the wisdom they are unknowingly passing down.
Viva Pinata: A Programer’s Prospective
I think I can finally say I’m a programmer. A young, naive one; but a programmer. I finally completed a working program, the newsletter tracker. I’ll do a post-mortem on that some other time.
When I was doing video production full-time, I found myself not able to watch a movie or commercial without thinking about how the scene was cut, how the actors were lit, or how the camera panned away. When you begin to have just a little knowledge of how something might have been done, you begin to digest its products in a different way; when I play video games or use a program, I have begun to see them for their parts, not just their sum.
That said, I think there is one game that every aspiring developer should play while they are trying to learn prgramming:
Viva Pinata.
The game is PERFECT for the concepts of Object Oriented Programming. The game is, from my perspective, an abstract tutorial in programming concepts.
Almost every introduction to programming book I have read uses the something along these lines of understanding for oop:
You have an object; let’s call it an animal.
You have a dog. A dog is an animal, but an animal might not be a dog.
You have a duck; a duck is an animal, but not a dog.
You have four-legged animals. A fourlegged animal is abstract; it’s an animal, but not all animals are four-legged. Dogs are four-legged. Dogs bark. Bark dog, bark.
And so on. So with Viva Pinata, you have, really only a few basic “objects”:
Animal. Plant. Building. Land. Helper.
You have to treat each one different. But they all interface and interact. And certain animals interact with other animals. So, in my mind, it become so simple to view each animal as a class:
class public Snake()
{
int snakeNumber;
String snakeParent1;
String snakeParent2;
bool Romance1
bool Romance2
public void doRomance1() {
//player did something
Romance1 = true;
}
}
And so on. The game really puts a cute, 3D skin on object oriented prgramming in my mind. It really helped me piece together the “aha!” moments of how a game works. So what’s the point?
For all you XNA developers out there who are far beyond me, I have a request:
a Viva Pinata Starter Kit for XNA
I could only image the fun in creating my own animals to romace, setting what skills they need and so on. If anyone from Microsoft stumbles on to this blog… a Viva Pinata Starter Kit is a new revenue stream for you; I love being in the Creator’s Club and getting free stuff like the XNA Racer (once it comes out). Perhaps you could also offer licensed IP starter kits? Maybe they don’t include the right to create a game off the IP, but I’d pay just to fool around and look at the code of Viva Pinata, or a game like it.
So if you’re reading this, and you’re a programmer, you need to purchase Viva Pinata. Today. It is an incredibly fun game and hasn’t sold nearly was it deserves. Viva Pinata makes Object Oriented Progamming fun for the masses.
what stories?
Joran asked a great question in his comment to me:
“So, what’s your story?”
What a loaded, loaded question. I think my life could be current summed up in three stories:
1) I am a part of the redemptive history of mankind
My mind can’t settle for the simplistic story that we are just here by chance; that we really are just the most “advanced” life form on the planet (were that the case, then we’re more of a virus to Earth than a positively contributing part of it). To think we’re just a product of happenstance is too simple.
I can’t accept a world where there is so much beauty just by accident. Songs and poems and paintings instill too much emotion to be some kind of instictual response. Prayer and conversation with other people brings too many thoughts to my brain for it to be “just” a communication tool no different than a dog’s whining or barking. Pain is far too good of warning for things far more important than just the physical.
So a part of my story is my belief that humanity is here for a purpose and that we are here to live. I believe we’ve been gifted with an oppertunity to love each other. That we were created to interact, to play together, to hurt one another. And that, perhaps, that Creator wouldn’t mind a bit of our attention now and then.
A part of my story is to tell that story; to give people hope that there is a sane person out there wo still believes in more than just atoms and molecules. That spirits and souls, that blood and love still have a place in this world. And that yes, that Creator wants us to enjoy His other creations.
2) Love is a choice; and is always the right choice
I’ve been married for just over a year now. Marriage brings with it a huge number of suprises and changes that one never guesses. So many of those suprises are so good; so few are painful and damaging. Unfortunately, in today’s world we’re told to focus on those few hard things and someone else will say you shouldn’t have to deal with that painful thing.
And so, this love you chose to give no longer becomes about choosing to love another creation, but instead the relationship becomes about the pain and discomfort. And love becomes less a choice and more a waning emotion.
I believe love is a choice, and the right choice everytime. I believe love is something above simple emotions and evolution. I believe that I want to love you and, deep down, you want to love me.
So my story is that love is good; that my wife and I love each other and choose to everyday. We love each other through the few painful suprises and we love each other through the many smiles, laughs and kisses. My story is one of love, of loving other creations, and letting them love me.
3) Art is never done, time just ran out
My mother passed away in May of 2004. She wasn’t done; she was a beautiful piece of art, but she wasn’t done. Her time ran out, though. She left behind love, beauty, and stories to tell my wife and children.
Through the end of her life, she clung to the hope of a Creator and that her life wasn’t done; just that her time here had run out. She believed in a redemptive history; that even though she had done wrong in life, she was still beautiful.
My mother wasn’t done; I’ll never be done; no piece of art realy ever is. But that doesn’t mean it isn’t good – no, it just means that things will get more beautiful.
So those are the three threads in my life right now. So what are the stories I want to tell? Well, I’ve written a couple of comic books that the art is being worked on (I’m no artist). One set is about courage and realtionships, another book is about how death effects the people left behind more than the dying. I’ve written some poems, made some videos, etc etc.
So yeah, I have stories to tell; some serious, some not so much. But life, if nothing else, is at least a series of stories. And I love hearing them as much as I love telling them.
createScale(args)
Here’s a little snippet of code I wrote tonight to be able to scale a sprite dependant upon how far down the triggers were pressed, borrowing heavily from the XNA documentation. The “float elapsed” comes from “elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;” being in the Update portion of the game class. I’m not writing anything ground breaking here, but I hadn’t seen anyone scale a sprite off the triggers before, so I figured I’d throw it out there (though, to be sure, everyone who ever wrote a tutorial would know this off-hand. I mean, I knew how to do it off hand, so I’ll assume you do too, dear reader. Humor me.)
public void createScale(GraphicsDeviceManager graphics, Texture2D sprite, GamePadState state, float elapsed){
if (Scale * sprite.Width < graphics.GraphicsDevice.Viewport.Width || Scale * closeRight.Height < graphics.GraphicsDevice.Viewport.Height)
{
Scale += state.Triggers.Right * elapsed;
Scale = Scale % 6;
}
if (Scale > 0.001f)
{
Scale -= state.Triggers.Left * elapsed;
Scale = Scale % 6;
}
}
I Want to Tell Stories
Joran Omark is one of the leading people helping the XNA Community learn. He manages the xnatutorial.com site, a site that I used extensively during the first beta, helping me figure out how to put sprites on the screen.
One of his posts from his personal blog hits the nail on the head as to why I’m trying to learn XNA and programming for games:
“By next year, there will be an influx of total beginners, who will want to know how to tell their stories. I propose that the very best stories to come from those future beginners, will be the ones that thoroughly understand the storytelling tools they use. For this, they need help.”
So thanks to everyone involved in all these tutorials, they’re truly helpful. You’re setting the stage for us “young” storytellers.
XNA: For Beginners or No?
Dennis, the senior software engineer for Cecropia, makes any interesting analysis of the XNA tools on his blog.
My young programmer mind boils down his post to two things:
1) He doesn’t like that XNA is a propritary API
2) He doesn’t like that you have to pay to run the applications on a 360
I understand the concerns about XNA being proprietary. Me learning XNA is not going to help me learn a whole lot about C++ in order to later code for Nintendo’s systems. However, me learning XNA is, in fact, helping me learn C# and, to an extent, JAVA. Giving a geek the opportunity to code for a gaming system, no matter which one, is motivation enough to learn.
It works! XNA on the 360
That’s right.
XNA was launched today (msdn.com/xna). I haven’t touched the XNA tools since September, before the second beta went out. I saw all the problems people were having with the transition from alpha to beta, so I didn’t want to get stuck.
Well let me say that XNA rocks.
In about 2 hours I was able to write the neccessary code to place my head on the screen, move it around and, of course, make its mouth open and close. It’s all the first steps of my first real game.
Amidst all the questions of work, career and studies, it was a simply awesome experience to site down for a couple of hours and see something through. And as cool as writing programs on a PC is, there is a huge amount of joy in writing something to run on a video game system.
When I was a young child, my dad tried to learn BASIC in order to make a game for the IntelliVision. He told me once that he was going to make a game for me and my sister. Unfortunately, he never quite got around to it.
But here I am, 20-some years later, and I have the beginning workings of a game. I can wait to see what comes out of XNA not just from myself, but from the whole XNA Community.
Java Path
c:/program files/java
sigh – why must i make the simple things so complicated…
on the good news, during lunch today i was able to connect to the mysql server via code and do a system.out.println of the attributes within… go me!
Barrier to Entry (Programming Annoyance #1)
The problem with learning to program isn’t that the actual programming is hard. That part’s easy; logical and abstract. As you code more, you learn new tricks and new vocabulary.
The problem is the barrier to entry. It’s not just one thing you have to learn, it’s 25 different things. You have to decide what language to focus in on, and what IDE to use. You have to know EXACTLY where to place files, you have to know what services to download and install, and what plug-ins are worth your time.
I hear and read rumors of things like ANT and Hibernate… but I have no clue if I’ll ever get to them. I’m still trying to learn how to get my system set up right.
This is one of the major differences between JAVA and C#. Microsoft holds your hand almost too much, while JAVA is a wide desert, with each piece of sand representing some other source of information. I applaud you Microsoft, for making such solid product that try their best to break down the barrier of entry.
Tonight, however, I was back in JAVA because, frankly, I know how to do a little more in it right now and have a simple project I want in usable form by Monday. So I’m working away, getting my gui set up and a little ActionListener here and so on, when I get to the point where I need data. A database.
So here’s the first of non-coding language things I need to learn… how to set up the database. Not to big of a problem, get it done (and done correctly). Well, I want to hit the database with my app from across the series of tubes we call the Internet, so then I have to go set up a dynamic dns service.
So I get out the handy dandy MySQL Cookbook, and run some test code to make sure everythings working right… and it is on my Mac (where I have the database set up). I head out to the living room to spend some time with my wife while testing my code on my PC laptop to make sure I can hit the database…. and no success.
Now, I know everything is working correctly becuase I can use a MySQL Query browser to hit the database, so that’s fine. So how in the world can code that worked on one computer in Eclipse NOT work in another computer in Eclipse. I struggle with this idea for over and hour, trying so many changes to the code, when finally I realize the problem.
I have to download the MySQL J/Connector and put it in my javapath.
So, now I’m left with the pressing quesiton before I get some sleep…
How do I find the javapath on a Windows machine..?

