To morfik or to make things work

Posted in Shackled on October 14, 2009 by Frederik Hertzum

I think it’s about time I bitch about Morifk (www.morfik.com).

Morfik is a RAD (Rapid Application Development) tool, designed to make it easy to produce applications that reside on the net (in a browser to be accurate), allowing the programmer to do all the code in either Object Pascal, Visual Basic or C#. That idea is fine and if they got it right it would be a great thing to have. But, as you may have guesse already, Morfik doesn’t live up to it’s own promises.

The first thing you may notice when you start using Morfik is that you often have to resort to using custom built data extraction routines, unless you are doing stock webpages (in which case it would have been smarter to simply have made a template webpage and sell that) — if you do not use one  of the (few) standard layouts, you are simply not going to have any use for the database aware components of Morfik. This means using webmethods and rebuilding what is essentially the same routine over and over again (code sharing is not a strong point of Morfik).

Another thing you will soon notice is that the date type is handled differently on the server and in the browser — the (to me) most odd thing is that it’s the browser that handles dates the best. In the end I had to code my own date type that doesn’t make use of server or browser specific code (of course I still need a browser and a server implementation, but since they are identical, that’s a minor issue more than a problem).

The company behind Morfik calls Morfik the WebOS, but in reality it feels more like you’re writing software for a set of operating systems that have to communicate over the most complex channel they could think of — raw socket programming in C is less complex (not really, I’m just frustrated).

Another strangeness of morfik is how text is handled. You cannot do things like casting a character to an integer and then print the result (that is the numeric value of the character) — that means that I, for example, am not able to search and replace anything out side the basic English alphabet, since I have no idea what morfik is using nor what external datasources are using. Which brings me to another point. Morfik uses unicode. Or it claims to do. Or that is, Morfik claims to be using unicode when it doesn’t claim not to do so. That is, Morfik doesn’t really do anything with unicode. In fact, Morfik doesn’t seem to be doing much really. If you try to print the danish letters ‘æ’, ‘ø’ or ‘å’ (or the capital equivelant) you get garbage — and since you have no idea what the numeric values are and (strangely) you cannot compare those letters with themselves once they have been outside of morfik, there is no way to replace them with the html codes for those letters (nor should you have to — morfik should just do things right).

These issues and problems are not related to the Morfik program though — the problems with the IDE are enough to make you cry. Random crashes, lock-ups and plain weirdness is abundant. For example, I often get an error message that says “Cannot copy to clipboard”, when I hit CTRL+X. The content is always copied but the original is never deleted. Also when viewing datatables (weither internal or external) I often get no result at all, which locks up the database components of Morfik forcing me to shut down and restart the IDE to restore it.

I wish I could be allowed to do things in PHP. Sigh.

How to save the Playstation 3 platform

Posted in Uncategorized on March 22, 2009 by Frederik Hertzum

The PS3 has been around for some time now, and still it doesn’t have a lot of games. More annoyingly, most games for the platform are crap — either fully or compared to the Windows and Xbox versions of the games. A few of the games are decent — but they are not all over the place. A lot of developers have been complaining about the console — which may be one of the reasons why the PS3 doesn’t have a lot of games.

I think I have a solution to the problem. First of all Sony has to realise that to gain control over the market, they have to release (some) control over the console. This control will actually not be lost, but shifted, if my proposal is followed. One thing that’s bugging a lot of people is that you have to pay money to develop games for the console. That may seem like a minor problem as you also have to pay money to develop stuff for the XBox and the Wii. The difference (from the XBox) is that the XBox in many ways is just a stripped down Windows machine running on a triple cored Power 970. You can make a game for Windows and be reasonable comfortable that porting won’t be a too big issue. In some cases, it will be very close to just doing a recompile for the XBox. The PS3 is completely different. As far as I know, it doesn’t look like anything else. I have no details on the SDK, but there is no reason that it should look like any other operating system and the fact that it has a completely new type of processor, may seem frightening to some people. Of course the Cell processor should just be seen as yet another “GPU” like processor and the SPEs should just be treated as an easily accessable set of GPU cores — not like a real part of the CPU.

The first part of my suggestion is this: release the SDK to the public. Allow anyone to develop and publish software for the PS3. Then, make all game disitribution go through PlaystationStore. It is extremely convenient to buy games of PlaystationStore and it adds that you don’t have to have disks lying around or change them to play another game. Further it means that Sony is the only middleman from the developers to the consumer, which can result in two things: cheaper games or increased profit (both for Sony and for developers). If the cheaper games option is chosen, it’s not unlikely that it will also increase profits.

The second part, which is a bit more drastic is to revise the Playstation 3 console itself. Add a lot of memory — at least a total of 1GiB — and increase the harddrive capacity to at least 500 GiB. The extra memory reduces the problems developers have had with the PS3 operating system hogging up to 84 MiB of the preciouse 256MiB of memory it has. Furthermore it will make it feaseable to run GNU/Linux on the machine, which is rather painful at the moment.

Fallout 3 sucks

Posted in Shackled, Software with tags , , on December 3, 2008 by Frederik Hertzum

Some of these points are known to about every single person who has every heard of Fallout 3 (and especially those who play it). It’s a rant with no purpose but me letting steam out.

I got a Playstation 3. Then I got a couple of games. I knew that Fallout 3 had been released for the Playstation 3, and while my stationary computer is more than capable of running Fallout 3 in terms of hardware, I do not have Windows installed (and no, it’s not an option to install it) — so I got Fallout 3 for Playstation 3. Now, I love the Playstation 3 and can’t wait for people to see what potential it has. The Cell is a kickass processor — read some technical docs on it, wikipedia is definitely not enough.

Before I got the game, I was quite nervous that I would be getting some crappy rip-of of the Fallout franchise so I decided to read some non-commercial reviews (that is by people who are not paid to write nice stories or are too biased towards crappy FPS games) and found two reviews which seemed to be by people who likes Fallout as much as I do. The most important quote from these reviews where

Fallout 3 is Oblivion with guns

Having never played Oblivion, I figured it would be an advancement from Morrowind (which I have played a bit of and kinda liked a bit), so I got the game (still rather nervous).

Now, when I got the game, I looked around in a few shops and found that I could get the PS3 version for 550 DKR (that’s danish kroner) or the Windows version for 450 DKR. Let’s just repeat that — 550 DKR, An increase of 22.22% from the Windows version, for a console where there has yet to be made a single illegal copy of a game This is important because illegal copies has been used time and time again as argumentation for inflating the price of video games (oddly enough only for Windows, never for other platforms), but still the  Playstation 3 version is the more expensive one. I would have expected the reverse to be true at best, at worst that the price was the same. Finally I managed to find a shop that gave me a discount so I only had to pay 500 DKR, but the standard price (actually, the only other price I found) is 550 DKR — which includes webshops. They would have given me a discount on the Windows version too, also at 50 DKR (which means the price difference is 25% (500/400)).

Booting the game, I find several fundamental flaws in how the game develops, the basic premises and mechanics and just about anything else. I did say I love Fallout, right? Well, I love Fallout so much, in fact, that I have given a great deal of thought to just why I love Fallout. I have completed Fallout, Fallout 2 and Fallout: Tactics (which is an excellent tactical game in it’s own right, but is not a Fallout sequal). It all come down to detail. See, in Fallout and Fallout 2 details are only important when they are important. The player is never forced to figure out some detail or play a mini-game unless it’s important. That’s what the character is there for. Instead, Fallout and Fallout 2 are about exploration and expanding your world. You explore a world, which should be completely void of life (since it’s been devastated by several very large nuclear detonation), but instead you find that the world is teeming with life (although rather absurd lifeforms). Oh, and the people in the world are really cooked. Please also note that guns where actually not that important in Fallout or Fallout 2 (though it often was to me). The game spent more time on exploration, dialog and related events than combat (at least it does when I play it). Dialog and quests where often complex and combat was simple.

On anther note, regarding the main character — in Fallout and Fallout 2, the main character is actually rather unimportant. In the first game the main character is picked at random to go out and find a new water chip and in the second game, it was planned for the main character to meet another chosen one, sent prior to the game starting. In Fallout 3, Three Dogs keeps talking about the main character and his father (who seems to be trying to save the world, at least), which brings me to yet another point. Fallout and Fallout 2 have such great stories because they are much smaller than the world, but the world contains a lot of similar sized stories — some stories in Fallout 2 can take as long as the main quest to complete, and can involve more complex dialog and world interaction than the main quest. In fact, the main quest in Fallout 2 can be done in about 30 minutes (with a bit of luck).

In Fallout 3, I find the reverse is true. I constantly have to play stupid mini-games (lockpicking, hacking), combat is almost constant and exploration is almost negligible and dialog is reduce to the most basic form. Combat on the other hand is complex and a shift has been made from turnbased to real time (V.A.T.S. is still real time) and now, players have to repair their equipment (which for some reason requires you to have two of the same type or an NPC which charges money). Fallout 3 is a first person shooter (possible the best one, but still, it’s a first person shooter). V.A.T.S. reduces some of the nastiness of playing action packed games on consoles so I’m not going to bash that too much. V.A.T.S. does have one very large and one minor flaw. The large flaw is damage to gear. In V.A:T.S. you hurt your weapons more than if you don’t use V.A.T.S. (but do more damage) the small one is that combat cannot be exclusively V.A.T.S., because Action Points do not replenish once a V.A.T.S. “round” is complete.

Let’s get back to the price issue again. Like I wrote, I paid 500 DKR for my copy for Playstation 3, paying 22-25% more for a game that cannot (yet) be copied illegally. But wait — that’s not all. I don’t get the same game as the Windows version. See, the Playstation 3 version doesn’t have support for keyboards or mice (which is an absolute must] for games like these), you cannot play multiplayer games, don’t get a G.E.C.K., and (likely) will never be able to use G.E.C.K. modules — that is, you pay more for than alternative versions, and get far far less. I’m not going to talk about bugs, since that’s a completely different issue. Software engineering is not easy and complications (especially for a completely new platform) are impossible to avoid — bugs will exist.

I think Bethesda did a few things wrong here. First of all, Fallout is Oblivion with guns. This, if true (I never played Oblivion), seems rather silly. Why not just make Oblivion with guns if that’s what they wanted? Fallout is not about guns and the game style of Morrowind (which I assume is copied to Oblivion) is not really suitable for the Fallout world. The nice graphics of Fallout 3 are in fact, also not really something that fits too well with the Fallout universe. Fallout and Fallout 2 could have had nice graphics and more realistic animations, but didn’t. I think the style of the graphics fits perfectly with the style of game found in Fallout and Fallout 2, but in Fallout 3, I find that they clash — there are way too many details and too little content.

In conclusion I’d say that Fallout 3 was not made by people who knows and plays Fallout, Fallout 2, or even Fallout: Tactics (which is more of a followup to Fallout 2 than Fallout 3 is).

4 times 28 minutes later

Posted in Uncategorized on October 19, 2008 by Frederik Hertzum

I’ve been playing a “Zombie Survival” mod on a Neverwinter Nights server a lot lately — so I decided to watch some “Zombie” movies and found out that I hadn’t seen “28 days later”. Well, while it was a great movie in it’s own right, it isn’t a Zombie movie for at least the following reasons:

  1. We know when, how and why people start turning into mean cannibals that don’t know when to stop.
  2. About at the end, we learn that life outside the British Isles have not been infected.
  3. The story starts after the infection period and people have already died. Society is gone — it’s not going.
  4. People survive. The two main characters (Jim and Selena) as well as Hanna all survive, at least to get the attention of what seems to be the US military (why not France, Spain or Germany who all practically are neighbours to GB?).
  5. Jim goes into a rage and kills all the soliders at the mansion.

The last part is actually the real plot of the movie, and is the actuall reason why I don’t consider it to be a zombie movie. The movie calls the virus that infects people ‘rage’ in the very first scene of the movie, which reveals that it is in fact not a zombie movie. “28 days later” reminds me more of “Alien”, which is about molestation, rape and similar assaults, than for instance “Dawn of the Dead”, which is about surviving an absurd situation and, more importantly, how people behave in said situation.

This however, made me think about making my own Zombie or Survival mod for Neverwinter Nights. Now, I’m not still thinking about it, but I did do some more thinking and found out just why I’m frustrated with the server I’m playing at — it all comes down to that I have a certain view about what Zombie Survival really is (which is also reflected in my critique of “28 days later”) and too many of the people who play on that server don’t seem to agree with me — more importantly, the DMs don’t. Now, here is the important thinking I did: Just what kind of view should people have, for me to enjoy playing a Zombie Survival game, with them. Now, I’m not saying that this is the view on Zombie Survival, but I do believe that it is a good one at least. Regardless, I think the most important thing I realized (I didn’t actually realize it because of this — I think it’s pretty obvious considering, well, at least my experiences with people) was that if two people simply cannot agree on how a game should be played, they should find other people to play with.

I did come up with a system of determineing if people should play with each other (for ZS games) that I believe would work out nicely. It’s rather simple and work on the concept of “double annihilation” — I made up 6 multiple choice questions that would be relevant to a zombie invasion scenario and rated the questions, where lower numbers whould be the best option, from 1 to the number of answers to a given question. If someone answered these questions, I can pretty easily determine if I would likely enjoy playing with this person (or at least, that’s the idea). If a person answers just one single question with an answer that has a score that’s too high, they “die” and turn into a zombie. If not, then they can join the ranks of survivors and become one of the peopl I would like to play with. Ofcourse, this isn’t fool proff and I haven’t actually tested it. I do believe, though, that it is a pretty good system, at least, to sort out the really bad instance of “survivors”.

Strangest adventures in finite space

Posted in Uncategorized on October 8, 2008 by Frederik Hertzum

I decide to play some Strange Adventures in Infinite space today and found out that the source code has been released under the GPL, and, that there has been made moves from the original authors to port it to SDL. According to them, it should be a breeze compiling it on Linux…

Now, this is a class example of just why stupid people should not attempt to do any sort of programming. While it properbly does compile on ancient compilers that doesn’t follow standards (Microsoft Visual C++), it does not compile on standards compliant compilers and certainly not on modern ones. The source code is supposedly a C++ program, but looking at it, it reminds me more of BASIC than even C. Not a single C++ header is used and no features (or misfeatures) of C++ is used anywhere. It’s all basic C, and poor C to boot.

On top of that, the project makes heavy use of non standard functions, that are only found on DOS decendent operating systems — i.e. I have to rewrite those bits for the thing even to compile. There are absolutetly no comments and symbols are being defined that are defined in standard C, meaning porting it is going to lead to bugs, bugs, bugs and.. oh yeah… bugs… I’m beginning to consider writing it from scratch instead of simply porting it — and at the same time letting the original authors know how to write real code. This looks like the work of a first year student who never looked at a programming manual before.

On the bright side, I’ve gotten most of the bad code compiled by simply replacing all instances of char * with std::string and a few modifications here and there to make sure things are used the right way. Some functions are kind of odd though and would likely require complet rewrites — especially the file handling functions, where wheels are being reinvented all the time.

More powers!

Posted in Uncategorized on June 11, 2008 by Frederik Hertzum

I just got my copies of the Dungeons and Dragons core rulebooks (technically yesterday — it’s 4 in the morning) and better yet, I also got a new wireless networks card for my laptop!

I am a bit dissapointed in the D&D 4th edition rules. Some of the things in it is pretty great — the concept of powers and rituals for instance is pretty awsome — while some of it is not quite as great — the concept of minions springs to mind. The idea that a level 1 character can land one, soft, lucky blow to a demon that has suffered battle after battle and kill it outright, just seems too ludicrous to me. Yes, it makes sense to have minions from time to time, but utterly barring some creatures from being anything but cannonfodder just seems stupid.

Anyways, the core of the rules are unaltered and it appears that the guys who made the new rules had a long hard look at other d20 systems like Iron Heroes — the concept of powers for instance reminds me a lot of how Iron Heroes works.

The new Dungeons & Dragons system appears to have been designed (by someone who doesn’t write computer software) to be adopted to computer games. There are some pretty dumb designs with regards to that, but mostly it is a great deal easier than Dungeons & Dragons 3.x. Again, the core is the same, the details are vastly different. Speaking of computer software designs, I have ofcourse decided to not make libd20 implement the dungeons and dragons 3.5 rules, but dungeons and dragons 4 rules. It is very likely however that I will never be able to release the software since the new licensing of the rules should be very strict — final word on this is yet to arrive though.

Matrix multiplications

Posted in Uncategorized on May 15, 2008 by Frederik Hertzum

I tried a few tests using the naive matrix multiplication algorithme, the GCC vector extension and GCC 4.3.0 — to my surprise it takes about 0.7 seconds to do 10000000 4×4 tests. That’s just 0.1 seconds more than additions, suggesting that GCC 4.3.0 is really good at optimizing for this kind of task.

I tried using openmp to utilize all processors at the same time, but the overhead was so massive it took about 15 seconds to finish the same amount of multiplications — clearly, it doesn’t pay to do this kind of thing multithreaded (ofcourse it pays if you have larger matrixes, but 4×4 is just too small).

More matrix tests

Posted in Uncategorized on May 13, 2008 by Frederik Hertzum

After having installed Fedora 9 x86_64 I decide to try the matix tests I did a few days ago — the results are about 0.6 seconds for 10000000 iterations and 56 seconds for 1000000000 iterations of matrix addition.

This is a lot faster than what 32 bit could do, taking about twice the time to do the same amount of 4 by 4 matrix additions.

The Bleeding Edge

Posted in Uncategorized on May 13, 2008 by Frederik Hertzum

I just installed Fedora 9 last night (which is officially not out for a couple of hours yet). Damn, did things change a lot.

First of all X startup time has been cut a hell of a lot down — in F8 it would take at least 10 seconds to be read for login. X in F9 is a bit less stable regarding startup time (not actuall stability) but I haven’t had to wait for more than about 7 seconds mostly no more than 2 seconds. Virtual terminal switching also nolonger takes ages to perform, but is done “instantanious”… which is very nice.

The down side from upgrading to F9 is that the evil graphics chip company hasn’t released any drivers for X.org 1.5 yet (which is what F9 uses) — this means I have to use non accelerated graphics drivers for my GPU. I can live with that and properbly be a lot more productive since I can no-longer play all the interesting games I have (which I shouldn’t be playing anyway — mostly because most of them are Win32 games).

F9 also has GCC 4.3.0 which does wonders with optimization and fully supports openmp 2.5 (as I can tell) — which means I’ll have fast painless threaded programs.

On the Java side, F9 doesn’t use icedTea anymore. Instead it uses openJDK 1.6.0, which makes Sun’s test on java.com complain and ask me to install Sun Java 1.6.0 update 6. Well, I don’t like Java anyway, so I’m just going to ignore that completly.

On the theme side of things, F9 now contains a warped version of the Nodoka theme that’s rather spacy — the default GDM (and user) background looks like something out of the original star trek series with rays coming out of rings with stars all over the place. Oh, and yeah it really looks nice that the background is the same after login as before the login.

Browsers… well, the default browser is Firefox 3.0b5, which is a great UI improvement over Firefox 2. Password dialogs are now given in the top of the window instead of intrusive pop-ups, and the default theme is a lot more vivid.

I still haven’t gotten an x86_64 release yet, so I’m going to reinstall at a later time No point in doing to much work on installing stuff or configuring the beast.

The weirdest thing

Posted in Uncategorized on May 10, 2008 by Frederik Hertzum

I’ve tried to write an optimized version of my matrix multiplicationi library (one that only allows 4×4 matrixes with double as the type) — so far I’ve done everything except optimize the multiplication operator.

The weirdest thing happened when I tested using the add operator — when running 10000000 iterations over the same data, it takes about 3 seconds to finish. For 1000000000 (that’s 100 times the previouse) it takes a little less than 2 minutes and 20 seconds — that’s 200 seconds. It should take about 300 seconds. Ofcourse the original does finish rather fast so random interrupts might be a problem.

The downside to this is that I can only use one core if I want to optimize using SIMD instructions — fortunately, that’s not really a problem since the time it takes to do addition is reduced to about 1/10 of that of what my original matrix library can do using two cores.