All posts tagged Programming

The Intricate Web

Martin · 2 years

I've been developing my own websites for over 20 years, and doing the odd website work for a few clients lately, and so I keep up with that scene as best as I can.

The amount of stuff you need to know to be a solo web developer in 2021 is kind of mind boggling though, and I concentrate mostly on the design side, along with rudimentary things like HTML, PHP, CSS, and some Javascript.

I aspire to be able to be better at Javascript, and I'd like to learn Ajax properly someday. And get good at making things with three.js.

I like that we can have websites that do all this stuff - it's crazy compared to the rinky-dink sites I learned how to make back in the Geocities days. But I also sort of lament how complicated everything is, too.

I don't want to compile a website before deploying it. I don't want to have to worry about SEO, and compromise (or worse, homogenize) my designs because Google wants things to be a certain way. I don't want to add special code to my websites so Facebook understands the content flow better.

I hate that this stuff is common. It makes the web feel less like a tool for free expression. But if you don't learn it, and don't do it, others will - and then you won't get work.

474 72 0

Optimization Allure

Martin · 2 years

Whenever I'm working on a programming project, I often get caught up in little optimization routines as I go. It's hard for me to just code things to work, and worry about making them work good later.

So today, I wrote some improvements to the way my game project renders stuff. Nothing too fancy - just some checks to make sure objects are within the camera view before rendering - but it felt good to test it and see that small bump in frames per second go up.

I'm hoping that as I remove more of the debugging code, much of which is very slow primitive drawing, I'll see another improvement as well. But I need to stay disciplined and just keep working on the actual game!

545 80 0

Taming Gutenberg

Martin · 2 years

My work on the next iteration of this website is coming along well! My to-do list has been steadily shrinking, and most everything is looking just how I like it. As always, I've started having misgivings about the new color scheme, but I can tweak that as I go - no use getting stuck on that at this late stage of production!

Really, all that's left now is to tie up a few loose ends here and there, make some last-minute adjustments to my template names, make sure everything works alright on mobile... and hit the big, red Activate button. The closer I get, the more tempting it is to just push it and clean things up later, but I will control myself (for now).

I know nearly nobody is reading this, but I don't care - I like shouting into the void. If you're out there and reading this - thanks!

538 84 0

Blendering

Martin · 10 years

Some of you might already know this, but back in September of this year, I ended my job at CytoSport, Inc. to pursue other interests. So far, things have been going well for me, and I have been doing a lot of interesting and challenging contract work. Much of that work has been in Blender, software which, at this point last year I'd barely touched. A lot can change in a year though, and as it happens, Blender is now one of my favorite pieces of software. It has completely replaced my ancient copy of trueSpace for 3D development.

I'm still in the process of learning more about Unity for game-making, but in the meantime, one piece of software which I still like to dabble with now and then is GameMaker. Though I never seem to have enough time for personal game-making as I'd like, I still get a kick out of firing up GameMaker: Studio and trying ideas out.

Recently, I've been bungling around with GameMaker's 3D graphics again. I know the program isn't suited for anything particularly grand when it comes to 3D projects, but I like it nonetheless. One issue I kept running into though was getting my 3D models out of Blender and into my game.

Traditionally (even as described in one of my tutorials) this is a somewhat convoluted process. One would have to make a 3D model, save it to a format one of the many 3D programs / scripts people have written over the years would read, and then use one of those to load the model directly into the game, or more often the case, convert the model to a format GameMaker would understand, and then load that into GameMaker in a separate step.

Along the way, all kinds of odd things had to be done, and the software one chose to use had to suit those needs. UV maps had to be flipped. Models needed to be rotated 90 degrees this way or that. Normals were often lost in translation or reversed. I often found that my models wouldn't turn out exactly right - somewhere in the process, the numbers describing the locations of the vertices in my models would get rounded off! Worse still, one had to jump through each of these hoops each time a model needed to be updated or added to the game. Slight revisions to geometry or UV map would take a long time to implement. In short, it was not a lot of fun.

So, with my recent work in Blender, and my lasting interest in GameMaker, I decided there had to be a better way to do all of this. I searched around for examples of export scripts for Blender, and after finding a suitable starting point and reading a little bit about Python, I cobbled together something that works much better than the convoluted mess I described above - I've crafted a nice little export script for exporting 3D objects directly from Blender to GML.

It wasn't a particularly hard project, and I'm sure the script lacks a lot of the finer points that someone who really knows what they are doing might have done, but it works, and I'm happy with it. And I'll have a link up on the site soon.

Basically, this new script will let you select an object in Blender, triangulated or not, and with about two clicks of the mouse, export it as a text file which contains all the GML code needed to create the model in GameMaker. If one wanted the model to exist externally from GameMaker but still in GameMaker's native model format (which is very quick to load), it would then be trivial to save the model and from then on, use the new external file.

A lot of credit for this script is owed to Jeff LaMarche for his work on a script he built for converting Blender models to a suitable format for Objective C/iOS development. I used his script as a template to write my own, and I could not have created this without his as a starting point.

Anyway, I'm going to have to write up a bit more about how to use the script, but I'll have it online soon. I hope that it makes it easier for people to get quality 3D graphics into their games!

758 90 2