Showing posts with label toys and games. Show all posts
Showing posts with label toys and games. Show all posts

Sunday, July 28, 2013

Yashica D resurrection



I found my uncle's old camera when sorting some old things, a Yashica D. It has been non-operational for the last 20 years, used mainly for projecting images through the viewfinder onto the ceiling with a flashlight. Now I started wondering if the camera could be used for photography again. The camera looked to be in a nice condition, but the shutter was stuck.

Kalle came to the rescue, armed with an excellent guide to disassembling the shutter on the Yashica D. We followed the guide, disassembled the shutter mechanism, and found that two shutter blades had stuck. We cleaned the blades and assembled the shutter again, and it worked!



While taking the camera appart, we had to unscrew a lens without damaging or scratching it. A bottle opener turned out to fit the lenses well and gave a suitably gentle but firm grip.



The shutter is designed in modules, with the self timer and the shutter speed regulator working as independent units. Each one is a kind of clockwork with several cogwheels in series. At one point we opened the wrong screw, and the shutter speed regulator came apart. Putting it back together again was a real challenge, as it contained several small wheels and springs. It was difficult to get all the pieces positioned correctly, so that the top cover could be put back on. What worked for us in the end was clamping a few pieces of cardboard to the desk, and to keep the timer module and its various parts in place with pins stuck into the cardboard.



I am very impressed by all the small mechanical parts in the shutter, especially considering that it all must have been designed without using computers. It was very pleasing when we got the camera put back together again, and to actually see it work. Kalle has already shot a couple of film rolls with it, here are a few samples.

The shutter disassembly guide by Dave Gauer was invaluable to us. We also found it useful to take photos of the parts in various stages of disassembly, in order to check the placing and orientation of the parts later when reassembling, and to keep the screws and small parts that came off in each step in a separate bowl.

Friday, March 15, 2013

Favourite Games: Widelands

widelands buildings
Widelands - a strategy game where you build up your civilization and defend it from your enemies. The best defense may well be striking first. Widelands is an open source game, and is said to be similar to Settlers II. The game is still evolving, but is already very enjoyable.

The game contains a complex economy, with different types of goods and buildings that produce goods or process goods from one form to another. In fact, building and then maintaining a working economy is the main part of the gameplay. There is also fighting with your neighbors, of course, but the battles take place with a minimal input. The only real choice is what to attack, and when to do it.

Widelands mines
Each warrior needs an axe. Axes are made in an axe factory using iron and coal. Iron is made by combining coal and iron ore in a smelter, these two resources one gets by constructing a mine at a suitable mountain site. However, the miners work only when they are well fed, which requires bread, meat, or fish, prepared into meals in a tavern. Every item produced is transported along roads between the buildings, so having an efficient road network in necessary for a productive economy. When the flow of wares becomes too much for the carriers, one can breed oxen for use as pack animals.

I like building my empire more than I like fighting the other players, so it suits me fine that the game emphasizes construction over battles. It feels nice to construct an efficient system of factories. In the game I played while writing this post, I ran out of wood in the beginning and then all construction projects ground to a halt. I had a small border battle with my green neighbor, but that war fizzled out when we both ran out of fighters. Then I lost some time before constructing an axe factory, since I believed it required a master blacksmith (which it doesn't). Another thing that caused trouble is that upgrading a building wastes all resources in it. (To save them, one has to order the stores to be emptied before upgrading. This problem is discussed on the bug tracker.) My greedy neighbors left me alone for quite some time even though my defenses were very thin, but eventually they defeated me by burning down my head quarter and storage. I'll get them next time though.
Widelands headquarter destroyed

There is a bit of a learning curve for this game, it takes time to find out how the wares should flow between the different buildings. There is some in-game help, in the form of a tutorial game and a list of all wares and how they are produced. The game music is quite monotonous. Because of it, the game is locally known as the meeh-meeh game. In all other respects, a great game! There is a multiplayer mode which I have not tried, but it sounds like great fun.

If you feel brave, try out the development version. The current development version, in preparation of release 18, still has some rough edges, but also notable improvements over the last stable release (17). The graphics is nicer and the colors have improved a lot. They were very saturated before, but are calmer now.


The Favorite Game series

Sunday, January 6, 2013

Nut Domains



The square nuts from our Meccano set. Pushed together randomly, they form nice orientation domains - little areas where each square lines up with its neighbors.  Gaps open up between these domains, since they are not  lined up with each other.

The pattern reminds me of a city map, where rectangular buildings on a block are lined up, and then at a bigger street, the angle changes.

Sunday, December 2, 2012

Favorite Games: Nethack



Nethack A classic. You are an @-shaped hero, and your goal is to explore a dungeon filled with monsters (mostly letters) and treasures (gold $ and gems *) and other objects. I haven't played this one seriously for a while - it is much nicer to play on a full keyboard with a number pad, and I seem to usually sit at a laptop. This is a very addictive game, once you get past the initial steep learning curve. For this post we wanted a couple of screenshots, and once we started playing we got hooked again. We even learned to play without the number pad.

While exploring the dungeon one finds weapons (, armor [, and spell books +, and gets tougher by gaining experience and by learning new skills. Nethack is fun because it is so unpredictable. The ascii graphics is very simple, but the world of Nethack is complex. Monsters can interact with each other and with the world around them. You never know what will happen next, and the text description of the events in the dungeon forms an unpredictable story - sometimes a completely absurd fairy tale.

I grew up playing Nethack on DOS, and liked the way the map is drawn there with full lines for the walls. It is tricky to get this graphic mode to work in a unix terminal, for some reasons connected with different character sets. Anyway, there are several solutions. I installed the program konwert, and ran Nethack in this way on one of the text mode consoles (control+alt+f1):
nethack | konwert cp437-utf8
Then simply enabling IBMgraphics in the in-game options make the graphics look as it was meant to.



Taking screen shots of a text mode terminal is something I have never needed to do before, but it is possible with the snapscreenshot program. I ran it in this way, in a text-mode console, with Nethack running in console 1:
sudo snapscreenshot -f8 -c1 -x1 > screenshot1.tga
In an X-term window snapscreenshot does not work.

The Favorite Game series

Wednesday, November 7, 2012

Favorite Games: OpenTTD

This is the first post in a small series about computer games I like. I plan to focus on open source and independently made, or just plain home made, games. Suggestions or tips are naturally welcome in the comments!



The first game is OpenTTD. This is a great game for us who did not get a model railroad when we were kids. OpenTTD is an open source variant of Transport Tycoon Deluxe from the 1990:s.

The aim is to move cargo, mail, and people between cities and factories, and of course to generate profits for your transport company. There are many vehicles to choose from, but trains are by far the best. Building an efficient railroad network with good-looking and optimal intersections is a real challenge. When a city receives good transport service it grows, and getting the cities to grow as large as possible, extending your customer base, is one of the main goals. The game can be a bit stressful when there are hoards of people in each city waiting for your trains (if you're the type to care).

I have played OpenTTD at LAN parties, which is great fun. I prefer cooperative multi player games, in which one can build huge railroad networks together with friends. The MIDI music in the game is great, both the original tunes and the free ones composed for the open version. An active community has grown around the game, with a forum and a wiki. Railway signals, for example, is a complex topic, luckily there is good help in the wiki gameplay manual.

As a bonus, one learns geography when playing scenarios set on real-world maps, such as the town of Urk in the Netherlands on the screen shot above.

The Favorite Game series


Sunday, September 16, 2012

Decagon Girih Solutions



In an earlier post, I wrote about two solutions for the pattern on the ten-sided Girih tile.

In the middle is the standard one, also in paper in Science. The one on the right, with straight lines, I saw in a post on Robodino about laser cutting Girih tiles. The one on the left I might have seen somewhere, or made up myself... Anyway, these are three different solutions with tenfold rotational symmetry.

Wikipedia says: "Most tiles have a unique pattern of girih inside the tile which are continuous and follow the symmetry of the tile. However, the decagon has two possible girih patterns one of which has only fivefold rather than tenfold rotational symmetry." - but it doesn't say which ones they mean.



After some playing around, I realized that there are all kinds of ways to connect the patterns while still (I think) following the rules. The ones above have only a twofold rotational symmetry. These are probably not the only ones, but with their low symmetry, they are not the most interesting...

Instead, I'm really happy about these! They all have fivefold rotational symmetry. The upper left one is the one we cut in acrylic, and the rest are new. The lower left one might not quite conform, since it has another type of crossing in the middle, but who cares? It's pretty!

All in all, these are eleven possible girih patterns for the decagon. Could Wikipedia be wrong on this?

Monday, August 27, 2012

Beaded bowl surfaces


Hexagons side by side forms a flat surface, with zero curvature. Reading Make Magazine's Math Monday, I learned that a pentagon among the hexagons makes the surface  curvature positive, like the surface of a sphere. A heptagon does the opposite - it creates a saddle surface, which has a negative curvature.

Here, I've built the same bowl-shaped trial surface from white glass beads and from Magnetic spheres. The surface is formed from hexagons, with a pentagon in each 'corner', to make the surface curve.

In an earlier post, I used only pentagons, which shapes the surface into a sphere.

Friday, August 17, 2012

Trying out the Raspberry Pi

I am a happy owner of a Raspberry Pi - a tiny (and really cheap) computer, capable of running Linux. Now I too am a part of the Raspberry revolution. I am just starting to try it out, but I already got our platform game running on it! More on the game will follow in a later post, first some notes on the Pi itself.

I decided to try out the Raspbian flavor of Linux on the Pi. I chose this for the hardware floating point support, and since the Raspberry Pi foundation recommends it.

I currently don't have an USB keyboard, so I hoped to access the Pi over the network with ssh. Luckily, Raspbian is set up with an ssh server running. The only things required is to make sure that the Pi gets an IP address when it boots, and then find out which IP it got so that you can ssh to it.

I connected the Pi to a laptop running ubuntu, and tried to use the network manager on the laptop to give the Pi an IP address with DHCP when it boots. Sadly, this did not succeed. Apparently the laptop Ethernet interface stays "down" as long as nothing is connected to it (the Pi is off), and the Pi got no IP address when it booted.
Fortunately it was easy setting up a DHCP server on the laptop manually:
1) Turn the network manager off, so it does not get in the way
2) sudo ifconfig eth0 192.168.0.2 #enable eth0, give it an IP address
3) sudo udhcpd -f
4) boot the Pi, wait a while.
5) udhcpd prints out the IP address it offers
6) ssh to the address. User name pi, password raspberry.



If you have the Pi connected to a TV or monitor, you will see the Pi printing some messages while it boots, and then launch the raspi-config program.  Without a keyboard raspi-config is not usable, but you can still access the Pi with ssh. Raspi-config seems to start automatically at each boot, until you have completed it once.  It can be run from a terminal at any time.  If one wants the Pi connected to the internet, some more networking is needed than what I describe above. A router would probably be the most convenient solution. I have had success with Windows "internet connection sharing".

EDIT: When trying to share an internet connection from an Ubuntu laptop to the Pi, this bug bit me. After the suggested work-around, sudo killall dnsmasq on the laptop, I could boot the Pi and it got an IP address. Then the next problem appears: how to find the IP address of the Pi? The Pi prints it on the TV or screen during boot. If no screen is connected one can use the nmap tool:
nmap -sP 10.42.0.1-254
this IP range being the one that Network Manager seems to offer. -sP tells nmap to ping all the hosts in the given range.

I have a PAL TV connected to the Pi. PAL needs a setting in the configuration file config.txt, located on the boot partition (the small, FAT one) on the SD card. Either edit this file on the card and uncomment the line
sdtv_mode=2
or use raspi-config on the Pi.



In this discussion and here I found interesting observations about which SD cards work well with the Pi. Apparently the fancy and expensive cards, called Class 10, are not the best since they are highly optimized for sequential reads and writes. This is good for photography but not for running Linux of the card. For this application, the speed of short random reads and writes is much more important, and these speeds may well be much better on cheaper cards of lower class. I got an 8 Gb Class 4 Sandisk SDHC card from the local Media Markt for 8 €. It seems to work well, but I have no serious benchmarks yet.

Wednesday, July 18, 2012

Laser cutting Girih tiles

Laser cutter
The laser cutter at Fab Lab Groningen.

Laser cutting girih tiles
The machine can both engrave and cut. It is almost magical to see one's design gradually appear as a physical object. Here the laser is cutting our girih tiles from a 3 mm acrylic sheet. The machine does the engraving first, one sees the knot pattern formed by the pieces appear. This is how girih patterns typically look when they are used for decoration, you see the knot pattern but not the borders between the pieces. Then the pieces are cut. The cut lines are quite different from the lines drawn on the tiles. Probably this is part of the reason for the complexity and beauty of girih patterns.

Laser cutting girih tiles
I find the Fab Lab concept fantastic, giving anyone the chance to use this kind of professional fabrication machines. They had 3D printers and a CNC mill as well. Not to mention the nice people at the Fab Lab, guiding me through the process of using the laser cutter!

Someone else also made a set of  laser cut girih tiles, at the Fab Lab in Lille. Some more pictures of our tiles, and the svg file for the laser cutter.

Sunday, July 15, 2012

Platform game, level 4



After many months, we finally have a new version of the platform game! As always, it comes with a new level.

Download the game here: for Windows, Linux(32) and Linux(64). See these instructions for installing it on different platforms.

Wednesday, July 11, 2012

Acrylic Girih Tiles


We stumbled across the local Fablab on our holiday in Groningen, the Netherlands. We wanted to try their laser cutter, so I designed some girih tiles in Inkscape. These things have so many wonderful features, so more posts to are sure to follow - the laser cutting process, and the svg file for the laser cutting machine.



A nice collection of girih cut out of paper.

Wednesday, May 16, 2012

The New Grey

Since I had almost no grey Lego bricks in my old collection, I ordered some new ones from Pick-A-Brick. I realized that the color was different - the new grey bricks, on the left, make the old ones on the right look even older and dirtier than they are. According to Brickipedia, this new color, bley, has some blue in it and replaced the old one in 2004. A pity, since the old grey bricks are among the most stylish objects I know.

UPDATE. Fascinated by this shape, I made a painting of it.

Wednesday, April 18, 2012

Lego Storage



Organizing Lego bricks has always been something of a problem, if you're inclined to categorize. We took a clear plastic lidded box, a SmartStore Classic 31, and cut clear plastic sheets into the proper shape, to divide the box into sections. The sheets are polycarbonate Lexan sheets, 1.5 mms thick, just thin enough to be cuttable with household scissors. Five sheets were used in one direction, giving one compartment for each of the six traditional Lego colors. Compartment width was chosen to match the relative frequency of each color.



Where the sheets cross each other, we cut out a thin rectangle from both sheets, from the top to the center in one sheet, and from the bottom to the center in the other, to form a cross halving joint. It was helpful to drill a 2 mm hole at the inner edge of the rectangle, and then make two parallel cuts from the side to the hole. We fastened the plastic sheets with hot glue to the box. One long sheet was placed perpendicular to the six shorter ones, to stabilize and to separate thin and thick bricks.



Here is the box with the divisions in place and filled with our supply of bricks.

Wednesday, March 14, 2012

Compiling zziplib with MinGW

In our platform game, we use the zziplib-library to access game data files from within a zip archive. On a Linux system zziplib is easy to install via the package management system, but on Windows it is more challenging. I could not find the library precompiled, so I compiled it myself with MinGW. Here is a list of the necessary steps and tweaks. In addition to MinGW, msys is needed (to run the configure script). Python is needed during the compilation, apparently when formatting the documentation. Either one has to disable  the documentation step (but I don't know how) or have a Python interpreter in the PATH. Since I have the great drawing program Inkscape installed and it ships with Python, I just added that python interpreter, C:\Progra~1\Inkscape\python to the system path. Note that spaces in the path lead to problems, for that reason I used the name C:\Progra~1\...

Get zlib. The header files, lib files and the dll are needed. Download both "Binaries" and "Developer files". Put them where they will be found during the compilation, I chose C:\mingw\include for the header files and C:\mingw\lib\ for the lib files. The file zlib1.dll should be in the same directory as the application.

Download the latest version of zziplib. Extract it somewhere, make sure there are NO SPACES in the path. Turn off any anti-virus software for the duration of the compilation process. At least f-secure often pretends to find viruses in files compiled with gcc. Also, any antivirus program may interfere with the configure scrips in the following steps, if it opens a file which the script creates and then quickly wants to remove.

cd to the zziplib directory. Edit the file configure. Replace uname -msr by uname -ms in two places. This is necessary, since uname -msr returns a string containing brackets. This string is used as a directory name, and for that brackets are not allowed. (This tip is from here, on the MinGW mailing list.)

Run sh configure --disable-mmap --prefix=C:/mingw/ . Without --disable-mmap the library compiles fine, but causes a segfault in some mmap function when accessing a zip file. --prefix describes where the header files and libraries should be installed. Then run make and make install.

Wednesday, February 29, 2012

Game programming notes

I have learned a bit about game programming by writing a platform game. Today's post is about the libraries and tools and resources that have been useful in this process.

Graphics
Much of the hard low-level work in the game is done by the SDL library.  This library handles drawing graphics and playing sounds in a simple way. Best of all, the library is available for Linux and Windows and several other platforms as well, which makes it simple to write a portable game. I learned how to use SDL from the official documentation and by reading Lazy Foo's tutorials. In addition to the SDL library, we use the following additional modules:
SDL_gfx   for drawing primitives and frame-rate control
SDL image  for loading images in various formats (png)
SDL mixer  for playing sound clips and loading ogg files

Sound
Most of the sounds in the game were generated with the small program sfxr by DrPetter. The program generates sounds with a nice 8-bit feeling. One can tune the sound by changing a set of parameters, like the frequency and wave form. One can also control the sound envelope with attack, decay, sustain, release like on the good old Commodore 64. Sfxr produces wav files.  I packed these in the ogg format. In the game code, it is then simple to play the ogg files at appropriate times with the SDL_mixer library.

Data files
I want to minimize the number of files that have to be distributed with the game. Unfortunately the libraries used require a number of dll files (on Windows). But at least one can pack all the game data in a single archive file. So far I have used the zziplib-library to access game files that are packed in a zip file. See also this post for some details on how to get zziplib to work well with SDL. Compiling zziplib on Windows was not trivial, but this I save for another post.

One could also try to pack the game data in the game executable file. Here is a hackish method to create a file that is both the game executable and a valid zip archive, which can be read with zziplib. Another way is to simply compile the data into the exe file. I found that the Linux command-line tool xxd can format a data file as c array (use the flag -i).

Future
An installer system for Windows would be nice. The Nullsoft installer seems promising. Another lighter alternative would be some self-extracting archive.
Related Posts Plugin for WordPress, Blogger...