Damm Collisions

Damm Collisions

What’s this? An actual post on the development of Factory? Madness!

I’ve now spent a good few weeks working on Factory and progress is going well. I have got to the point where most of the features from the flash version of the game are now in the game and it is very easy for me to add new machines and mechanisms to the game! I’ve a basic level editor which allows me, and eventually everyone else, to quickly create levels (which is cool! In the original I just placed stuff using the flash IDE so this is a big step for me).

New Features


Items moving through the pipe skip over the second row

I’ve actually also managed to include two new features already (kinda by accident). First is the in pipes (these are the pipes that the raw items arrive to your factory in) which have two new features! Firstly I’ve tweaked the randomness of the pipes so that I (and of course you once the editor comes out) can set it so that items always come out in order or completely random and some levels in between those two extremes. There can now also be more than one in pipe too which means that I can have one pipe on one side of the factory with one type of item and anther in an entirely different location. This will mean it will be possible to create more complex levels which require more thinking to complete.

The second new feature is to do with pipes. In the original pipes were completely visual only. Nothing would collide with them and didn’t actually do anything. While designing this version of the game I’ve added checks to see if an item is in a pipe and if it is it will pass through most other objects. This means that (and you can see this in the picture) that you can make junctions that go through another layer of conveyor belts.


One of the things I’ve been thinking about recently is the playable area of the game. As you can see at the moment it should be possible to fit 3 layers easily and 4 at a squeeze. I’ve looked back at the original again and the size of everything is actually a lot smaller so I may just scale everything down a bit. The other option is to have some sort of dynamic scaling based on the level, so that the first levels could start off with a small area and later levels could be a lot bigger with more things to manage at once. The main thing I’m thinking about here is about the user interface, I’m targeting the game to be playable on tablets as well as PC. And while I think the game may actually play well on anything larger than the screen size of an iPhone 6 at the moment, making the level size bigger, and the machines smaller, will make it so that the game will definitely not be playable on a small screen. What do you think?

Collision Boxes

Collision Boxes


While testing out the game with a lower frame rate than 60 (it’s not a resource intensive game, no one should have a frame rate lower than 50 at most unless they are running the game on a potato) I noticed that the items were not working correctly and some of them were even falling right through the conveyor belts. Not the best thing to happen. At that point each game tile had 3 collision boxes (You can kinda see them in the screen to the side). A box around the entire tile (mainly used for clicks) and a small vertical and horizontal boxes that cross the tile. These two latter boxes were originally a lot bigger so try and catch the items at most speeds and frame rates, but this still failed some of the time since the jump from one frame to the next was so large some of the time that the item would skip over the boxes completely.

In order to solve this problem I had to resort to using a ray cast, of sorts, that would test the path that the item would be moving in to see if it hit anything. If it did then the tile itself would have the ability to change the intended movement so that the normal collisions would work as intended. Yes I probably could have dealt with the collision logic in the ray intersection but the game felt a lot better when it just limited the movement instead. Problem solved and I could also make the vertical and horizontal collision boxes smaller and changed to using the origin point of the items to test for collision.

Check out the video above to see the collisions working in all their glory!

And if you haven’t already make sure to like our facebook page to more regular updates.