Tuesday, April 19, 2011

Spinning Up The Time Machine

So, I'm still playing with python. Not sure I'm going to write an entire roguelike in it, but figured I'd hack out to the step 4 (walking around a room) on the 15 steps to a roguelike.

I noticed the number of files/lines of code seemed to be much smaller than I remembered, so I pulled up the equivalent submission in magecrawl.

The python copy looks like this:


While the magecrawl looked similar to this (this was from a few weeks later, similar idea though)



Here is the comparision (excluding test code). This isn't comparing to the map generator picture above, just the walking around an empty room.

Python - 3 source files, 127 lines of code.
C# - 13 source files, 503 lines of code.

Much of that difference comes from the verbosity of C#. Some of it comes from the use of interfaces in C# compared to duck typing in python. The rest comes from an effort to implement the minimum needed and keep things simplier.

As a side note, pygame is pretty awesome. I might pull in libtcod for line of sight and pathfinding, but since I want "tiles" graphics, pygame made that crazy easy.

Friday, April 15, 2011

Has it been 6 months already?

Wow, I can't believe 6 months slipped by that quickly. Between work and my personal life, I seem to have lost track of time (and stopped updating this). Eitherway, I'll try not to let that happen again.

I've picked up programming for fun again, but so far not on magecrawl. I still want to finish it or something like it, but I've come to realize something about myself and the projects I work on as a hobby. I find things fun that are different from what I work on while at work. While I was working in C/C++, C# was fun to work on; now that I use it 8+ hours a day, not so much now. The Silverlight front end was fun until I started wrestling with Silverlight at work.

I'm playing around with Test Driven Development and Python these days. It is kind of funny that I have more test code in my little project than actual lines of code, but I hear that is how things are supposed to be.

Once I get something a bit more presentable I'll post more about it. I just wanted to get back in the habit of blogging again.

Sunday, November 7, 2010

Learning OpenGL, slowly...

So I've burned a few hours trying to learn OpenGL. I'm using C#, accessing OpenGL via OpenTK. The tutorials here are great, but a bit out of date. After much frustrations, I found that ramblingcoder picked them up and converted them to C#.

Wednesday, November 3, 2010

Frustrations on programming languages

So, I'm honestly a bit demotivated to work on Magecrawl. Part of it is that I'm in the middle of porting it to Silverlight as a way to get a tiles version with little work that will work on Windows/Mac/Linux. Then this week, I come across these articles.

While it isn't like they are canceling Silveight, their "change in focus" and the fact that Mono is currently two major versions behind has me a bit worried. I don't want to sink another 20+ hours fixing things up, and then in a year or two have to move to another UI layer. I also don't want to loose being able to work on it on my Mac, and right now I'm in that boat.

More fundamentally, I'm frustrated that there doesn't seem to be a "good" way to do cross platform UIs for my game. I'm going to rattle though the programming languages I know or are good options. None of them right now seem to be a good fit.

C# - Silverlight: Only Mac/Windows right now. Linux is an unknown period of time away. A bit worried about its future, but probably best option right now.

C# - libtcod: Works everywhere, but no tiles UI.

C# - winforms - Yeah, it might technically work on Mac/Linux, but there are licensing concerns that make ppl not want to install it.

C# - GTK# - Doesn't look native on ANY platform except Gnome.

C/C++ - Any number of frameworks here, QT being the most obvious framework or OpenGL. Ignoring the rewrite aspect, I'd rather not chase memory errors in an unmanaged language when I'm not being paid for it.

python - pygame would be the most logical choice. I don't think I want to write in a dynamically typed language.

objective C - See C/C++ for the unmanaged language type. It also wouldn't work well on Windows/Linux, and I have no clue what GUI framework to use. 

Java - Seriously? Swing looks terrible anywhere, and with Sun Oracle trying its best to kill developer uptake, that isn't an option.

In writing this article, I've come across opentk, which appears to be a open gl binding for C#. While I'd have to learn yet another UI framework, at least I know it'd work everywhere...

Sunday, October 31, 2010

Status Update - Not dead yet...

As one might have noticed, my postings the last few weeks have been few and far between. There are a few contributing factors to this decline:
  • Large amounts of software testing reduce my motivation to come home and work on Magecrawl
  • Work on a website for my wife's business. {shamelessPlug} Music therapy in Austin, Round Rock, Georgetown {/shamelessPlug}. This involved learning pretty quickly CSS/HTML and Joomla as a CMS.
  • Starcraft II - I gave in and got it. It is video games goodness distilled into a drug like potency. I am currently playing against Gold level players on 1v1, and I have a pretty mean 4gate rush. 
 I still haven't given up on Magecrawl. With the testing at work ending and the website up and running, things should be calmer over here. The only hurdle to working on Magecrawl will be not playing SC II...

Tuesday, October 19, 2010

[Offtopic] Pain in PDF printing on my mac, workaround...

So, since I spent three hours of my life on this, I figured a post on the internets for other to find was worth writing.

My goal was simple. My wife had created a document in pages and wanted it professionally printed. First attempt was a simple "save as pdf". That failed, as there were tiny inconsistencies when viewed on a PC. I installed adobe reader on my mac and low and behold, they showed up there. I thought PDFs were supposed to look the same everywhere...

Some google research pointed to PDF X-3, which iWorks claims to be able to export. It is apparently a subset of PDF that everyone agrees on. Yes, let that last sentence sink in. PDF, the format that is supposed to look the same everywhere, now has a sub-format to do that job. Eitherway, attempts to export the document fail with a generic "can not create PDF-X3" error. Apparently this is a long standing bug with iWorks where some complicated documents throw that error. No fix, no work around. This is starting to sound like bloody Linux...

Alright, next approach is using the "ColorSync Utility" to create a filter. People online seem to saying this sometimes works. After launching the beast, I find out that it apparently fails to save resolution settings at all. This means when I filter wife's document through it, it comes out looking like 1990 smacked it upside the head, low resolution and all...

The solution I have come up with is the 500 lb  (226 kg for my metric friends) sledgehammer of a solution.

  1. Open iWorks. Save document as PDF that won't work in adobe.
  2. Open PDF in preview, File->Save As.
  3. Selection JPG, change quality to full and DPI to 500.
  4. Send that 15 meg JPG to the printer...

Thursday, October 7, 2010

crawl-tiles announcned, a "public domain" source of graphical tiles

My work on getting the crawl tiles public domain is complete. Here is the "press release" that I posted to R.G.R.D:

I am happy to announce the first release of the crawl-tiles project
(http://code.google.com/p/crawl-tiles/).


Crawl Stone Soup (http://crawl.develz.org/wordpress/) has a beautiful
set of graphical tiles based on rltiles (http://rltiles.sourceforge.net/) with many extensions and modifications.

Until now, they were under the "Crawl license", derived from the
Nethack license and thus unusable by most projects.


A majority of the developers/artists have signed off their work into
the public domain (CC Zero license technically), and thus their work
is now redistributable and usable by other projects.


I have packaged that work up into a form easily consumable by other
projects, and placed it on the crawl-tiles download page.


Feel free to take a look, use them in your new project. If you do so,
please consider noting in your game where they came from.