home comics writing pictures archive about

2014-02-14 - Modelling

When I was younger I played around with modelling for a bit. I made a plane, a canyon, but what I really got into was porting models. Taking models from one game and converting them so that they could be used by another game. To port a model you need to find a way to extract the models out of the container format the first game uses and then find a program or series of programs that will allow you to get it into a format that the second game uses. It was a puzzle. You knew the start and end points but you had to figure out what lay between them.

I converted models from a few games but the two big ones were Homeworld and Aliens vs. Predator 2. They are two of my favourite games and they also happened to have interesting models. I ported all of the strike craft in Homeworld as well as all of the Turanic Raider ships. I ported a bunch of weapons from AvP2 as well as some helmets and masks. I also ported a couple alien eggs, a Chestburster, a Facehugger and an Alien. You can see some of them here. I rigged the Chestburster to have a skeleton but someone else did the Alien. All of these models were ported to the source engine and G-Mod since its sandbox nature made it really easy to spawn and use the ported models.

It's only a model
Ported Homeworld Carrier

Skeletons were actually one of the reasons I stopped porting the Homeworld models. A lot of the bigger ships (corvettes, frigates, and capital ships) have turrets and other moveable parts. To port these models properly those parts should be rigged and I never got around learning how to do that for non-humanoid models. I’d go to port some more models, remember I needed to learn how to rig the turrets, then get discouraged and stop. I had already solved the puzzle anyway.

2014-01-31 - Passing Parameters

C is an old but very influential programming language. In C there are two ways to pass parameters to functions, by value and by reference. Pass by value means the parameter passed to a function is a copy of the original value while pass by reference means the parameter is a pointer to the original value. The main difference is that pass by reference allows you to modify the original value. If the function is called with a variable passed by reference then any changes the function makes to the variable will be visible to the caller when the function returns.

Jump forward a few years to the rise of object oriented programming languages. In these languages most functions use pass by value but there’s a bit of an issue. In object oriented languages the object variable contains a reference to the object’s data and not the actual data. So when you pass an object by value the system is actually making a copy of that object’s reference. The original reference and the copied reference still point to the same data. This means that even though you are using pass by value you can still change the original variable’s data. If you had an employee object with name “A” and you passed it into a function that changes its name to “B” once that function returns the original employee object would also have the name “B”.

That is as long as you don’t change the reference. Changes to the function’s variable affect the original variable because they point to the same thing. If you change the thing the function variable is pointing to then this is no longer the case. This can happen if you create a new object or perform an action that creates a new object and assign the result to the function’s variable.

2014-01-17 - Budgeter Project part 3.5

I originally planned to do a post for each stage of the project but it turns out that when I get coding I don’t really feel like writing afterwards. They are fairly similar activities and I only have so much creative juice to go around. In the future I will likely leave the writing till long after the program is done and just put it on the writings page, separation of coding and writing.

I do want to give some updates on the project though. Part 1 was the database planning as I posted earlier and that’s never going to be done. I’ve changed it a bunch since I “finished” planning and will likely change it more. Part 2 was the DataViewer prototype application, which is mostly done. It needs a bit of clean up and re-organization but it does what it’s supposed to do. Part 3 is the program itself and that’s going along nicely. I’ve been using it for a few months and it’s been working out well. There’s a few features that I still need to add but the base functionality is there. To carry on from the last post here is a diagram of the current database structure. It has changed a fair bit.

Database map for project
Database table map

Speaking of databases, one welcome side effect of the program is that since all my transactions are in a database I can run queries against them. I wanted to know how much I’ve paid on my student loans recently and I was able to do a simple select from transactions where description like “%NSLSC%” query which game me all transactions that mention the NSLSC. It’s always nice to be able to do things easily.

2014-01-03 - New Monitor 2

I went and bought myself an actually new monitor. The colours still look strange but at least they’re consistent. The old new one seemed to change colour depending on how I looked at it and it also had a dark spot right in the middle of the screen. So it's at least an improvement, it’s also wide-screen. Display settings are one of those things where it’s not really a case of right and wrong but more just differences.

If you look at a display long enough you will get used to that specific display’s settings. If you look at a different display it will look wrong because it’s different. If you look at a different display long enough you will get used to it and the other display will start looking wrong. Without a “perfect” display to use as an example it’s very hard to actually tell which is more correct.

It is also nearly impossible to get two displays to match up. With Brightness, Contrast, Red, Blue, and Green you have 5 settings to try and align. There’s also the difference in viewing angle between two monitor setups and differences in monitor technologies. You end up with a lot of variables and only one equation. Linear algebra was a while ago but I can still tell that’s not an easy equation to solve.

I replanted the old monitor’s stand with the old new monitor’s stand. They have the same connecting mechanism and the old mew one is more adjustable. So it’s wasn’t a complete waste.