This blog has moved:

In addition to my current writing, all the old posts are collected on the new page.
(You can use your browser's "find" function to find what you're interested in there.)
Your browser does not support Javascript.
This site requires Javascript.
You can see where this becomes a problem.
Without Javascript,
Many posts will look wrong
Comments are inaccessible
Interactive dialogues won't function
Hidden text will never be revealed
The sidebars will not open

If you choose to continue, be warned
That you are missing crucial elements
Of I Am Not's design.

Wednesday, October 14, 2009



BlitzMax isn't a very good programming language. I spent a few days trying to get rid of a nasty glitch in the way the game was displaying, a glitch which didn't make any sense to me. I looked over the code over and over, and it all looked correct. So I pinpointed the problem to the specific lines of code that were causing it (though they seemed to be perfectly fine), and then I made a test program to see if the basic function they were using was working. And it's not. This isn't a function I programmed myself, it's a built-in function of BlitzMax. And it doesn't work.

Specifically, what's not working is viewports. A viewport is the area of the screen that the program's allowed to draw to. If I don't want to draw over something, I use a viewport which doesn't include that spot, draw whatever it is I need to draw, and then go back to a viewport that covers the whole screen. This makes sense to me. Apparently it doesn't make sense to BlitzMax. Tests have shown me that when dealing with images (rather than shapes), the viewports only work on the X axis. If I tell it not to draw on a certain portion of the Y axis, it just ignores me. This is why my game, which I painstakingly programmed to not draw things in the wrong place, has gray rectangles showing up where I specifically told them not to go.

I asked the BlitzMax programming community to help me out, and they responded with a general "What, viewports? You've gotta be kidding!". Okay, so not that rudely, but politeness is not helpfulness. Apparently BlitzMax's viewport function is notorious for only working with specific graphics cards, so people who program in BlitzMax never use them. There is no alternate function that does the same thing; you just don't do that if you want your code to work. One user suggested a function he'd programmed himself, which lets you draw a part of an image rather than an entire image. That wasn't exactly what I was looking for, but I figured with some creativity and time I could probably get it to do what I wanted. So I tried using it, and immediately got a compile error. This function is apparently broken. And since I don't understand any of what it's doing (that would take a more advanced understanding of BlitzMax's inner workings), I can't really learn anything useful from it either.

So here's where I stand. Ever since I decided that I really wanted to program, every day I didn't program was a day I felt slightly depressed in. I can't program my game, because I'm running into a glitch to which there is apparently no fix. I started watching yet another TV show (How I Met Your Mother this time) to make myself feel better. It's working okay; it distracts me from my problems for a little bit. I've also been playing piano a lot, and playing more games than usual. But eventually I'm going to have to get bak to working. And while I do want that, I'm scared that I'm going to spend hours and lots of effort on this game only to find that what I'd like to do isn't something that's doable for some inane reason which I can't possibly predict right now. (If not the viewports, then something else.) What if I really can't do this?

No, I'm not really being serious there. I can do this. If I'm patient, the problem with the viewports will disappear. Maybe I need to rethink the whole way the game is functioning, but there's gotta be a way to get around that. And then something else will pop up, and I'll deal with it, and so on. Programming isn't supposed to be this annoying, is it?



While I definitely don't think March of Bulk needs to be made in another programming language, I would strongly suggest that you start looking into XNA and the whole C++, C#, Visual Basic programming thing.

I haven't had time to really get into it, but from what I understand, learning to use XNA could lead into a much broader framework for making games. It is harder to use at first, but in the long run will open much more potential. I also suspect that Microsoft does a very good job of support their products.

Check out It might be a little painful in the short term, but it will have huge benefits in the long term.

Update: I programmed a function that mimics viewports, using the other function I mentioned, and it looks totally broken. I can see from how it's being drawn that all the math is right, but this function-on-a-function is too imprecise. Clearly the forum is not going to be any help, so I'll need to find some creative way of making it look right without using viewports along the Y axis.


Post a Comment