Archive for February, 2006

Quantum Star SE Evolved 0.18 – released for testing

Today marks another Quantum Star SE milestone. Back in September the quest started to rewrite QS in earnest in what we called the “Evolved” branch. Today I have released a limited version of Quantum Star SE Evolved 0.18 which is primarily aimed at exercising the backend library (Partholan) and catch any final bugs that need fixing.

The download: http://www.quantum-star.com/devsite/Quantum_Star_SE_Evolved-0.18prealpha.tar.gz

So what makes QSE so different from the normal Solar Empire derived flavour of QS2 and QS Generations? A lot. QSE leapfrogs 6 years of PHP usage, debate and best practice. Where SE still lingered in the 90′s when PHP3 was predominant and security practice non-existent, QS Evolved was written for the new age of PHP. It relies heavily on design patterns, code generation, variable filtering and escaping, object oriented programming, and the key objectives of security, maintainability and reuse.

Its not perfect. I never had an intention of building an all-consuming framework. But as a loosely combined collection of classes it excels for my purpose – creating PHP games easily modified by users. So where complexity might have made things easier to maintain, I opted for simplicity in some cases. Where a design pattern may have injected an unintuitive connection, I opted for a roundabout yet clearer method. The code is readable, commented, tested, PHP4 compatibable, easy to work with and avoids any form of messy spaghetti solutions Solar Empire is famous for.

It’s one of the most complete approaches ever seen in a PHP game. And its completely re-usable. Want another game? Then take a shortcut, grab Partholan 0.18, change a few constants, and off you go. The basics you get for free – no time investment of a few months required.

This is not a complex application to figure out. Knowing what MVC stands for is 80% of the battle, the rest is experience and a little experimentation. The main barrier is the OOP approach. Most novice PHP developers are procedural fans, but the jump to OOP is worth making.

The good points get better. Where QS and SE generally are difficult to install and work with, this new version offers as its test case the new Installer. This is so simple a complete newbie can install the game in a few minutes. It just requires a little general server know-how for changing 2 directory permissions, and knowing your database details. No path settings, no url setting, no niggly little variables about file writing or other options. It’s simple, intuitive, effective and fast. It works.

The installer saw a lot of attention. Many will see that as something of a waste of time but QSE was never going to follow the Solar Empire tradition. QS has always had a strong user focus. Despite its numerous flaws, a year-old version of a buggy QS2 beta still draws a loyal following. QSE will draw a lot more when its playable. If anything the Installer is key to gaining a following. It is the single most important application that determines how an application is perceived by the public. Make it simple and they will see quality and care, make it difficult and they will see the opposite. It’s worth the time spent designing and simplifying it.

Now the bad points. ;-)

There are problems with my approach. Every “action” requires the use of 3 classes: Command, InputFilter and View. You need all three to be created and edited for every action in the game/installer. The reasoning is to facilitate flexibility. So thinking an action needs one class is not possible in QSE. The code is also slower than an equivalent app written without OOP (i.e. procedural code – like QS2). This is a price paid for the superior maintenance and stability of an OOP based framework.

There is also a level of inflexible structure in the source. For example the code cannot handle UNIONS, JOINS or other database queries that generally save the app from running unnecessary queries and slowing execution. Another price paid for the simplicity and standardisation of Data Access via a fixed, predictable API.

There are other problems and blemishes, but none at this stage are considered show stopper criticals, barely any are even rated minor. What’s important is that this release complete testing, we fix the bugs, we announce it stable and we get this game up and running! :-)

Should source code be copyrightable?

Apparently Mr. Greg Aharonian does not, noting source code is a collection of “algorithms” and “data structures” which are uncopyrightable ideas or processes. Wording here borrowed from the article at http://patentlaw.typepad.com/patent/2006/02/court_upholds_d.html.

Huh? It may surpise everyone maybe… Fiction, and all written text is just that afterall, it’s hardly limited to source code. Any writing is a preconceived structure of rules, data and ideas. What’s important is not the presence of such, but the methods and intent with which they are congregated and phrased. If source code is not copyrightable then neither can any form of written word.

Source code is written in a language. Like any work of fiction it expresses the authors intent in a unique and personal way. It is their property, and any argument to the contrary is pure foolishness. Yes, the ideas might well be common to millions of similar texts. Yes, it follows a predictable pattern (grammer). Yes its composed of largely previously known information. But its still unique. It still retains value as a complete work.

Not copyrightable? Pull another leg…

How hard can it be to see that source code is identical is every way to the written word?

Sort of an aside. There’s usually a few funnies on the patent-o blog: http://patentlaw.typepad.com/patent/. ;-) There is currently a patent for a warp drive in process (the patent office has requested a working copy) which may prove interesting. Maybe there’s an Einstein sucessor at work in secret. This is followed by a few interesting applications which anyone half familiar with physics will find hillarious. There’s even a vague reference to casimir attraction:

# 2004-197727 GENERATOR USING CASIMIR POWER SUCH THAT TWO METAL PLATES PARALLELLY PLACED IN SLIGHTLY SPACED RELATION IN VACUUM ATTRACT EACH OTHER

Stating the obvious makes for a good patent case apparently…;-) Maybe I should apply to patent “forward motion generation via the sequenced placement of rods one afore the other in alternate succession”. Hmmm. I could charge the entire planet’s population of walking animals a small fee.