Entertaining Technical Distractions January 10, 2010
Posted by jhuculak in Technical, Uncategorized.Tags: igamemaker
add a comment
Over the last few months I have had a great deal of fun and pain with electronics and gadgets. In the last few months I have:
Buidling a home theater
I had been planning on building a home theater in my new house since August and I finished the majority of it in December 2009. Here is what I went with:
For roughly $3500 I have a 110″ 1080p image projected on my wall and great surround sound. I am by no means an audio or a video expert so this upgrade in quality has blown me away and was well worth the investment considering that you can spend the same about on a 55″ TV which is 25% of the size and the sound would be lacking. Some days I still wonder if I should have gone with the TV as the projector requires a bit more maintenance and doesn’t look good during the day. When I put a movie on at night, those little niggling thoughts go away and I remember how awesome theater can be! If you can control the light in your room and don’t mind playing around a little to set it up then there isn’t a better value on the market.
Repairing/Upgrading a broken PC
Moving my PC ended up being a series of unfortunate events.
What did I learn?
Research the chips a bit better. “Supported” and “Supported at full speed” are different things.
Don’t power off a machine during a bios update (duh…this was an accident as I left the disc in the drive at boot up)
Check everywhere for a delivered package, even if it required a signature.
Run x86memtest or something like that when you get new RAM.
Keep in mind how easy pre-built laptops are! ![]()
Next time consider just buying everything new to start with as I have probably invested what a reasonable new machine would have cost if I was searching for deals.
My new MacBook Pro 13″ – A love it, hate it roller coster August 17, 2009
Posted by jhuculak in Hardware.Tags: igamemaker, MacBook Pro, MacBook Pro 13", MacBook SSD, OCZ Vertex
2 comments
It has been a very long journey deciding to leave windows behind and try out Mac OSX. At the end of the day the 13″ MacBook Pro offered the best balance of performance for the price.
Mac Stores are Awesome – Love it.
I really have to say that Mac Stores make the buying experience easy and exciting. They have every model available and you can see everything you are interested in buying. This made my debate between the 15″ and the 13″ easier to handle. I have to give them a 10/10 for the store experience.
OSX Initial Impressions – Hate it.
First I hated it. The keyboard layout (control key is in the wrong place!), application control (odd folders, not really like start menu). Clicking on the keypad (needs physical click, right click took me a bit to figure out).
Configured a few things that helped like tap touching the keypad. Then I made the mistake of trying to get Wine running next.
Everything worked great to get Steam installed but literally NOTHING ran for me out of Wine without major issues (even Wolf3D!). After trying this for a few hours over a few days I gave up on it for now and decided to install the SSD instead.
MacBook Pro 13″ + OCZ Vertex SSD = Initial Configuration NIGHTMARE. Hated it.
I had read a couple of places that there might be issues installing SSD’s on the macbook both because of the SSD firmware version and because of the Mac books throttled SATA interface. I was to excited to prep for any of this and just ripped my case open to slap the new drive in. Sadly I didn’t have the T6 screw driver that I needed so this was delayed a couple of weeks. After that I popped the drive in, slapped the OSX install disk in and I was super excited. Then the install failed.
And it failed again the second time.
Read some forums…try minimal install.
Failed again. And now it doesn’t even recognize the drive as a valid partition…great.
Hmmm…read deeper into some technical forums and found three possibilities:
- Update the drive firmware.
- Update the mac driver for SATA
- Hold some magical key combination to clear out some kind of cached memory at boot up [Check this link out and search for "Resetting PRAM and NVRAM" for the key combination]
My scientific background wanted to try these one at a time. So I found a way to burn the driver update, ran the program and it told me I was already on the latest flash. Ok…why bother re-installing then? Might as well flash the mac. Slap in the old HD, run the update…it says I don’t need to. Ok…why bother re-installing? Put the SSD back in, hold down three magical keys and try the install again. Works fine and super fast. Great! I have no idea if step 1 or 2 actually flashed it and I have no idea why the third step worked but I now have a crash free Mac with a fast SSD.
Fast Boot and Wake up times – LOVE IT!
Launching applications, copying files and doing anything HD intensive is a dream on the new drive and it is silent! I’m loving what the hardware can do and how little time is spent waiting for anything except network traffic!
Post Install Thoughts – Warming up to loving Mac
After having issues installing the operating system and getting everything running I was a little worried I would regret the purchase. After using OSX for awhile and mostly using the machine for the usual web browsing and photo editing I am really enjoying it. I am even considering not installing windows because I don’t think that I will game on the laptop very much given that I will be moving into a bigger place and will be taking my desktop out of storage. One of the advantages of not having games on the laptop is that I may be more likely to make some of my own! That leads to some comments about continuing this blog.
Long Time, No Posts – Hate that!
The last few weeks have been hectic for me selling my place and buying a new one. I move in a few weeks and then I should have a longer commute that will let me work on my projects more (I hope!). This laptop purchase may be a bit of a hit in terms of my development because the popcap framework doesn’t run under OSX. In addition to that I think I may have caught the iPhone/iPod Touch development bug and may explore what I can do on that device. Hopefully I will be posting again more regularly in the near future.
Hardware addiction and potential Mac conversion July 10, 2009
Posted by jhuculak in Hardware.Tags: igamemaker, MacBook Pro, OCZ Vertex
2 comments
I’ve heard that the first step is admitting that you have a problem. In recent months I have been keeping my gadget addiction to a minimum through smaller purchases like new keyboards, mice and mouse pads.
Did my new apple keyboard satisfy my cravings?
No.
Did my new Razer Solmosa mouse satisfy my gadget needs?
No.
Did my new Steelseries glass mouse pad slow down my need to purchase gadgets?
No.
Did my BRAND NEW OCZ Vertex SSD drive satisfy my gadget needs?
YES! For now..
120GB OCZ Vertex SSD
I have a brand new OCZ Vertex SSD drive with no computer to put it in and it is the most exciting purchase that I have made in years. I’m not actually sure if I am more excited about the drive than a new laptop. This doesn’t make rational sense as having your boot times going from 1:30 to 0:30 wouldn’t be worth it to most people for the $349 Canadian that I spent on the drive…however for some reason it is the perfect gadget as SSD is probably the most significant advance in computer technology in years. I’m not deterred by the fact that it looks like a magazine bundled insert, that it weighs next to nothing and looks simple. This is a true gadget. Now I just need to find a place to put it.
What laptop will I buy?
I currently run on an aging Sony Vaio T140p that I bought a a job changing present for myself about four and half years ago. The little beast cost me about $2500 back then and I have loved having it for the last four years. I am hoping that my next laptop will last about 4-5 years as well and I am willing to spend about the same. Having friends making iPhone/iPod Touch games and playing them really makes me think that a MacBook Pro might just be the ticket.
I was initially going to go with the 13″ MacBook Pro but the reports that the screen has 6-bit processing has turned me off of it. I think the 17″ is to big and way overpriced so I will most likely end up with one of the 15″ models if I go the MacBook Pro route. If I do take the plunge it will be next weekend.
Laptop options
- MacBook Pro 15″
- Dell XPS 16″
- Sony FW
Stay tuned
Sadly this game making hardware obsession will take a dent out of any of the ongoing game projects. I will take a technical bend in profiling and setting up the machine in the next few weeks worth of posting. Oh…and I sold my house in the last couple weeks and will be moving so my posts will be a bit more erratic in the next little while…
If you have any advice for laptops or suggestions please fire them my way.
What do you code for fun? April 20, 2009
Posted by jhuculak in Technical.Tags: igamemaker, Small EXE
add a comment
Sometimes it is fun just to write something for the sake of writing it rather than to have a useful end result. I was out for dinner with a group I used to work with and one of them is currently writing a game for the Sega Genesis. You would think that programmers would see how illogical writing a game for a “dead platform” is. Obviously the end result isn’t the point, it is the journey. Non-programmers might not get that sometimes the point of coding is having fun.
What coding do I consider fun? For me I have always had a fascination with minimalism. Small executable and efficient code have always been fun for me. I even lost marks on one of my exams in University because I made a mistake on my third iteration of optimizing the code to answer the question. The solutions weren’t even rated on their performance or size! Did I learn a lesson from that? Other than being correct is more important than speed, I continue to enjoy writing a small amount of code that can do more.
Minimal Executable
So…how do you make a small executable? I remember reading about a contest to write the smallest application that could download code off the Internet and run it. The author of the program was able to do this in something crazy like 138 bytes or something like that. I’m not interested in going THAT small, but I am interesting in looking at what you can do with a modern compiler like CL.
How big is the following code when compiled with Visual Studio 8’s (Visual C++ Express 2005) compiler?
int main(int argc, char* argv[])
{
return 0;
}
Step 1: Simple compile with CL.exe – 45,056 bytes
cl main.cpp
Seems like a lot of space for not doing very much. What should we trim next?
Step 2: Turning it to a windows program – 2,048 bytes
Modified the code a little:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, int nShowCmd)
{
MessageBox(NULL, “Small Test”, “Small EXE“, MB_OK);
return 0;
}
cl main.cpp /link /SUBSYSTEM:WINDOWS /ENTRY:WinMain /DEFAULTLIB:user32.lib
2kb is about as small as I would be looking for. The trick moving forward is avoiding anything that uses the standard library and static constructors. I still need to dig into more of what overriding the standard entry point does before I start writing stuff that is “useful” with this framework. Do I recommend anyone actually does any of the above? No, it is just for fun to see what you can do with small exes. Might add some rendering stuff next.
Simple ship movement with Box2D (Part 3 – Trying to tune the force) February 9, 2009
Posted by jhuculak in Art, Technical.Tags: Box2D, igamemaker, Universe Image Creator
5 comments
Use the Force, Luke. – Obi-Wan
In the previous Part 1 and Part 2 I did what I would consider the easy stuff for tuning ship movement. This week was an attempt at getting a tuned ship movement experience while still using ApplyForce.
Goals
- Respect a top speed clamp when accelerating
- Provide a function that changes the force applied based on the current speed
- Have a method for damping when not accelerating
This weeks attempt
I realized this week that focusing more on management in my day job rather than coding has made me very rusty! I sat down for about an hour to work out how to do this and only a little bit of the dust wore off. I ended up with an experience I don’t mind the feel of but it isn’t “correct”.
Top speed
Originally I wanted to try to use damping to control the top speed and the deceleration. I wasn’t able to maintain a consistent top speed with damping enabled. I believe that damping is applied every frame and is applied as a percentage. This means that the faster you go the more speed is bled off. Rather than digging in to confirm this I decided to set damping to zero when the engines are on and to use a function (speed/top speed currently) to make sure that I’m not applying any additional force when I’m at top speed. This worked great and I thought I was done. Two problems, one my ship can go in reverse and when this happened the speed accelerated like crazy because the backwards top speed is different and two traveling at top speed if you turn the ship and attempt to accelerate no force is applied. Bummer dude.
I still don’t think I have found the correct way to account for this and if someone has a pointer to that I would be much obliged. What I am currently doing is using a dot product of the normalized velocity and the angle the ship is pointed at. If the value is less than zero I apply the full force since you are pointed in the opposite direction. That covers the backwards direction but I still haven’t found a good way to do the slightly off angle clamp. I’m going to work on that sometime in the next couple of weeks. The other thing I haven’t really covered is doing the same scale backwards. That is just a time limitation rather than not knowing how.
Function for top speed
Currently I am using speed/top speed as the force scalar and it is working fairly well so far. At a later time I’m going to make this exposed as a lua function that can be tuned per ship. For now this is functioning well enough.
Damping
Using damping to cause a deceleration has worked really well. I am currently using a value of 5 when above 1/4 of top speed and 20 when below 1/4. This lets me stop really fast and coast a little when “cruising”. Ideally when I rewrite all my ship code this will be a function as well.
Next Steps for Ship Movement
I really want to find a way to correctly control and map the top speed. This might go back to clamping the speed rather than scaling off the acceleration or actually taking into account the ship angle when scaling the force. I’ll those in the next couple of weeks. As it stands my ship can circle strafe and is actually feeling better as an experience so I am going to take a small break and design some game play or work on the look for the next couple weeks.
Sneaking in an update on art
When I get frustrated at not being able to solve something I take some advice from Micheal Abrash (Graphics Black Book – but I can’t find the chapter I mean!) and think about something else. In this weeks case I decided to fix my awful background image which was basically a noise texture. Space isn’t “space” without some nice stars and nebula’s. So I found this great old school space generation program. It took me about 5 minutes to download and create my own custom background. This is one of those pieces of software I am going to buy since it adds a ridiculous amount of “good space feel” to my game even if I’m not an artist!

I, Game Maker: Universe background
What am I thinking for this week
I think I need to take a break from physics and I may be doing one of the following:
- Re-writing all the game play classes and exposing them properly with Lua
- Adding in particle systems to make it really feel like a space game and be rewarding to shoot stuff
- Changing the shooting system to be aim with the mouse, steer with the keyboard
- Adding an enemy that is a ship to learn a bit about AI and OpenSteer
Any of the above is going to be fun to work on.
Simple ship movement with Box2D (Part 2 – Changing the limits) January 26, 2009
Posted by jhuculak in Technical.Tags: Box2D, igamemaker, physics
add a comment
In Part 1 there were a few things I needed to adjust in how I was using Box2D for my application. This post is basically about trying those changes out.
What did I learn?
Sometimes I find that when you are not sure how to do one things it gets much easier to do the other things that you do know how to do. Last week I set out to do five things with Box2D. I knew how to do most of the API related changes but I am less sure how I actually want to tune the ships. So instead of thinking about it, I just went ahead and did the API related changes and it went really well. My lesson for trying new things is Don’t think, just try. Playing with scale in Box2D worked really well and was easy enough to tune without understanding.
Changing the scale by a factor of 10
I went through the code and scaled the size of everything down by 10. A few small issues later and I was up and running at light speed! With the original impulse/speed values it was like WAY more than 10 times faster. If you tune with a clamp you end up with lots of values that would go over that clamp in an unconstrained environment. I had to go through and scale things down until it was starting to look correct. With the new scale my ship could easily travel at 2000m/s (thats 2 KILOMETERS per second!). It turned out that at my orginal scale the correct speed for the right space/speed size was around 300m/s. I’m going to toy around with that as the top speed.
Tuning correlated systems is challenging
The other changes that I made were: moving to using torque to turn the ship and using the built in damping in Box2D. After changing all of these variables I found out that they are all related to each other. I just don’t know the specifics of how yet. Given enough time the ideal thing would to to sort out what the combination of changing the scale (which changes the mass), adding damping and converting to using torque does to the overall ship balancing. Instead I just kept tuning with my Lua tuning file and found ranges that worked for me. I know that in the future I’m going to have trouble working with force since as I change the size of my ships the mass changes. I have to find a way to fix the mass to keep the balancing simple. You can avoid understanding for awhile, but in the long run you need to understand how things work to build on what you have.
Last weeks hit list updated
- How do I set the mass of the ship? – I think this one is going to be fairly easy.
- If I change the scale from 1 unit = 1m to 1 unit = 10m, what other variables do I need to change for mass?
- Convert from setting angular velocity to applying torque
- Determine how I want to tune the acceleration/force curve over time – I’m thinking that I will use a force vs. current speed function to tune this with a fixed mass per ship.
- Use Box2D native dampening rather than my own hacked functions
What is next
Physics
- Determine how damping works (top speed seems limited by this)
- Implement an engine system that will let me tune the ship experience
- Determine how to set the mass
Polish
- I’m dying to add particle FX for a reward on explosions and gun shots
- Starting to worry that I might not be able to do good missile trails in the PopCap framework
Art
- It has been to long since I’ve exercised the right side of the brain: Colors? Particles? Who knows…
So I’m not sure what I will be doing this week. You will have to wait and see.
Simple ship movement with Box2D (Part 1 – Box2D basics) January 19, 2009
Posted by jhuculak in Game Design, Technical.Tags: Box2D, igamemaker
2 comments
When adopting any technology it is always a good idea to look into how its authors intended for it to be used. Since I skipped that step with Box2D and was having issues with physics, I thought I would start the process of evaluation over from the beginning. I want to go over the basic restrictions/recommendations for using Box2D and talk about how I am going to make a tuned ship experience based on these recommendations and my own tuning/design needs.
Box2D Units and restrictions
- Unit (Meter Kilograms Seconds)
- Recommended scale of moving object 0.1m to 10m
- 200m/s top speed (this one took some digging )
Scale – Does not fit my needs exactly
Given that most of the objects I am working on are roughly fighter sized, 10 meters is actually a bit on the small side. I may have to go with 0.1 = 1 meter to get the scale where I would like it. With this, my smallest moving unit would be a missile at 1m length and the largest would be a 100m boss ship. I’ll have to test if I can simply scale this. Metric calculations should scale with this even if they aren’t mathematically correct as long as I am consistent.
Top speed
I have tested the top speed in my game and it is clamped to 200m/s. However, if you assume that the ship should cover 10-30% of the screen and lets assume it is 10 meters. This would mean a screen width of 33.3m – 100m. Giving it between 1 second to 1/3rd of a second to cross the width of the screen. I think that top speed should be fine but I will have to use ray intersections for things that travel faster and handle them as special cases. If I do my scale hack, I think that since 1m becomes 10m, 200m/s should become 2000m/s which should be more than enough for missiles (roughly mach six given that the speed of sound is about 340m/s).
Getting my ship moving
With the global restrictions out of the way, how do I move my ship?
- ApplyForce/ApplyImpulse – These will let me move my ship forward or backward using the API properly (SetVelocity bypasses this). The difference between a Force and an Impulse is that an Impulse is N*s (kg*m/s) whereas the Force is N. In my case I will be applying these at the center of mass so no torque will be applied.
- ApplyTorque - This will cause the ship to have an angular velocity. This can be overridden by setting the AngularVelocity directly.
- Damping – Both linear (velocity) and angular damping are supported and should make space…well less space like and have the ship slow down and be controllable by people that are used to friction.
In order to tune with the correct functions, I am going to be applying kg*m/s. For tuning what I am really interested in is things like the following:
- Time to top speed
- Max acceleration
- Ease-in/ease out
- Damping
These aren’t the things that you tune with Box2D so I am going to need another layer.
What do I have to figure out this week?
- How do I set the mass of the ship?
- If I change the scale from 1 unit = 1m to 1 unit = 10m, what other variables do I need to change for mass?
- Convert from setting angular velocity to applying torque
- Determine how I want to tune the acceleration/force curve over time
- Use Box2D native dampening rather than my own hacked functions
I now have a better idea of how to use the technology correctly and I am looking forward to mapping it to a more friendly tuning mechanism. More on the practical issues I run into next time.
2009: New year, new plans January 5, 2009
Posted by jhuculak in Game Design, Technical.3 comments
Plans:
- I will finish a game this year. There will be no worrying about check points along the way or releasing an engine, the game will always come first. I’m not guaranteeing it will be good or that it will be a version 1 release, but I will have a game.
- I will post once a week about the progress I am making or about things that are making me a better Game Maker.
Where is the game at and what is next?
I can summarize where I am in three sentences: Fly around and shoot asteroids. Large asteroids then break up into smaller asteroids which can then be destoryed and they dissappear completely. Run into asteroids and you will lose health but not die.
What to do tonight?
I love simplifying things and my view on work is that there are always two options for progress:
- Plan work
- Do work
Everywhere I have ever worked over plans and under delivers. I’m going to spend 5 minutes planning and an hour working. Planning should always be to get more work done.
Today’s quick plan (5 minutes):
- Add a number of lives for the player and a death state
- Create a “you win” when all the asteroids are cleared
Today’s results (1.5 hours):
Completed the plan and got lives and a you win case in. The you win continually increases the number of asteroids you have to destroy.
Today’s post (1.0 hours):
Posting is taking WAY to long. I decided to do a video again today and it is a long laborous process and since the video is boring I don’t think it will be worth doing these until I have something cool to show!
Project Assessment
Design:
Tonight’s progress drew me to two conclusions: My games currently sucks and it takes to long to modify stuff in my code base. It is still better to have a game that sucks than something that isn’t a game!
What are the next steps to make this fun?
- Sense of motion – You cannot tell where you are or how fast you are going. Need some starfield and some parallax going on.
- Controls – Inertia and movement speeds suck. Cannot aim or fly easily. I’m going to have to play with the force and inertia and find out why impulses are varying so much with Box2D. I think parallax will help here as well.
- Firing should be exciting and fun – Shooting is currently boring, hard to aim and uninteresting. I need bullets to die after a certain amount of time and not get stuck on the edges. They also need to pack a wallop and go where you intend to shoot them. I’m having real inertia problems here and might need to design around it.
- Finding asteroids – The game size to asteroid ratio became sparse today and that sucks. Might need a mini-map in the corner to help the hunting.
- Visual reward for destruction – No explosions/scoring for killing an asteroid. I think I need to add some explosions to things that die and perhaps have some kind of collectible in them for killing them.
- Sense of Peril – There isn’t anything to kill you yet but bad driving. Until I can easily fly around and shoot rocks this doesn’t bother me yet. One thing at a time.
- Visual punishment for death – Not really easy to die and it goes by without noticing. Death is probably less important than peril.
- Camera on edges – Camera is just centered and shows game world edges. Need to look at something that hugs the edges and perhaps something that lets me scale the visual distance better.
After the above list I will be able to re-evaluate and actually take the game in a better direction. Choosing the control and firing method may also redefine what my game is.
Technical Design (lesser priority)
- Compile times: On my little laptop things are taking about 3-6 minutes to compile each change. I might test out some compile flags or get the Christmas tree of my desk and use my PC again.
- Game classes not exposed in Lua: Variable tweaks are still exposed through C++ and increases iteration times. This might be something that would save time to address for tuning ship navigation and shooting.
Summary
I am happy that I made progress on my game. Before there wasn’t really any objective or consequence for action and now it meets the minimum bar for me to consider it a game. Now comes the exciting part of taking it from barely working to something interesting to play. Assuming my planning ratio holds at about 5 minutes of planning to 1.5 hours of work then I have my next few weeks planned! I’m also going to have to cut down on the time I take to post but I hope this video is entertaining for someone (deep down I doubt it though). See you next week.
Independent Game Creation – How do you work towards success? January 11, 2009
Posted by jhuculak in Game Design, Industry Commentary, Technical.Tags: igamemaker, lua
add a comment
How do you work towards success? One small step at a time. I do not believe in overnight success. I agree with the numerous sources Jeff Atwood’s recent post on Coding Horror. The one that particularly caught my eye was Peter Norvig’s Teach Yourself Programming in Ten Years. Given that programming is only one part of making a game, I may be at this “I, Game Maker” business for a VERY long time! Rather than finding this discouraging, I am using again to make sure that I have realistic expectations and that I make sure that I follow Peter’s advice:
I think that this advice works for any discipline. Picture an athlete only reading about how to get in better shape. These days people have too much confidence in what they “know” because they can search on google for it. Knowing where to find something and actually knowing what something is are two very different things. This further reinforces my resolve that my new years plan is to learn by doing. Two other blogs I follow also seem to take this to heart: Noel Llopis’ gamesfromwithin has created Tea Time! in order to learn how to release a product on the iStore and my friend Owen has released the first video of his up coming iPhone/iTouch game Dapple. Good to see that there are one man teams making games full time!
Given all that talking what have I done? I’ve made a few small steps towards success by evaluating what my game needed the most next and adding them.
Why did I go out of order?
Never assume your priorities are correct. If something is much easier to implement than another area you aren’t sure about then just DO IT. Learn by doing. I was wrong about the priorities because the mini-map was huge!
What is next?
I think I will work on having the shots disappear and then investigate how to get the physics in Box2D working how I would like.