Friday, April 21, 2006

Lack of Inspiration

I'm lacking inspiration to do some programming. It's something that comes around every once in a while, and I'm sure most hobby programmers get it sometimes, but I can't think of anything I want to write. And even if I did, can I be bothered to spend another hour of my life hunting down another bug?

This gets me round to the question of programming in general. I don't want this to sound like I'm saying I can't hack it, but shouldn't programming be a lot easier? I've been thinking about this on-and-off for a few years with no answer, but maybe we should go about it in a completely different way. The human brain works best with visuals, so why do we write programs using words? How about something like what Tom Cruise uses in Minority Report? This is obviously heading into 4GL territory, but there's so much that can be improved in that area. Computers should be at our command a lot easier than they are. Someone off the street should be able to walk up to a computer and get it to do whatever they want.

Anyway, I digress. The main point of this was about my lack of inspiration. I enjoy writing games, more than I enjoy playing them. So after I've finished a game, I don't really play it, so it feels like it was a waste of time. I stick it on the internet of course, but the lack of response if deafening. (I've often commented to people that there should be more comments from other programmers, on, say, Sourceforge, so at least you know someone else has seen it). I much prefer multi-player games, but that means having a network and someone else who wants to play that particular game, which is easier said than done.

So I don't know what to do next.

Monday, April 03, 2006

Make, Compile, Clean, What???

I do think that some free-software makers like to make life as hard as possible for the end user, and unfortunately Linux software often comes in this category. When you download something specifically for Linux, it's normally just the source (which is fine if that's all you're expecting) but sometimes when you just want to use the software, you have to wade through reams of README text, and follow instructions that involve going to the command line and typing in 'compile' commands that take minutes to run, and often fail if you haven't got the correct version of gcc installed.

The software arena is a crowded place, and software like this isn't doing itself any favours. No wonder Windows is prevalent - despite all it's shortcomings, it's pretty easy to get any downloaded program up-and-running with just a few clicks of the mouse. Linux software isn't going to attract new users by making it complex and hard to install new software. People just don't have the time or inclination. And why should they?

Tuesday, February 28, 2006

Viruses Plague British Businesses

(According to the BBC). Well there's an easy solution - haven't they heard of Linux? What are they waiting for?

Saturday, February 18, 2006

Calculating Line of Sight - Help Needed!

At the moment, Emergent Mercenary uses the following algorythm to work out of one unit can see another (i.e. are there any walls in the way):-

(Note - the map of the game is a simple 40x40 array, and each cell can be a wall or floor. Unit positions are stored as floating point numbers, so they can be anywhere, not just in the centre of a map square)

1) Work out a line from one unit to another
2) Move along the line, and at every interval, check whether the point is part of a wall or a map. If its a wall, the unit cannot see the target.


This does work well in general, but if two units are close together but round the corner from each other, it can sometimes return true when in fact there is a corner in the way. I could try increasing the interval, but this obviously increases the time it takes the algorythm to run. Does anyone know a better method?

Any help much appreciated.

Removing Rogue Startup Programs From Windows

Until the world moves over to Linux, here's how to remove programs that keep starting up when you start Windows. Remove the following registry entries:-

HKCU\Software\Microsoft\Windows\CurrentVersion\Run

Launches a program automatically when a particular user logs in. This key is used when you always want to launch a program when a particular user is using a system.

HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

Launches a program the next time the user logs in and removes its value entry from the registry. This key is typically used by installation programs.

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Launches a program automatically at system startup. This key is used when you always want to launch a program on a particular system.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

Launches a program the next time the system starts and removes its value entry from the registry. This key is typically used by installation programs.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices

Launches a service (a standard NT service or a background process) automatically at startup. An example of a service is a Web server such as Microsoft Internet Information Server.

HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce

Saturday, January 21, 2006

Keyboard Control in Java on Linux

The more the I think about it, the more I can't see a way to write good keyboard control in Java on Linux. Let me explain:-

Say you are writing a basic shoot'em-up. AFAIK, there are basically two ways to control the players sprite when your interface is the KeyPressed and KeyReleased events: you can either have the actual movement code inside these events, such as:

public void keyPressed(KeyEvent e) {
if (e == Key_UP) {
ship.y_pos++;
}
}

The problem with this way is that the ship will move as fast as the keyboard repeat rate, regardless of the main game loop or anything.

The other way (and the way I'm doing it in my game) is to store which keys are currently pressed (in a boolean array), and then process them in the game loop, such as:-

public void keyPressed(KeyEvent e) {
keys_pressed[e.getKeyCode()] == true;
}

(and set it to false on the KeyRelease as well).

public void gameLoop() {

while (true) {

if (keys_pressed[KEY_UP] == true) {
ship.y_pos++;
}

// Rest of game code here
}
}


The flaw with this, as I mentioned, is that if the player holds down a key, then with so many keypress/release events being fired for the duration it is held down, the key might not be marked as being pressed at the time when the keys are being processed in the main game loop.

Can anyone tell me what I'm missing? Or should I just move to another language?

Saturday, January 07, 2006

A Different Kind of Language

I used to say all programming langauges were the same. "Yeah, what's the difference between C, Java, Pascal and Basic? Some use squiggly brackets, some use begin/end, some use two equals signs, some use ":=". But apart from that they all boil down to pretty much the same thing."

That was until I discovered Lisp. I've only started even looking at it in the last few days, but I've learnt enough to know that all programming languages are not the same. Obviously I'd heard of Lisp; I've been programming for enough years now to have heard of all these strange old languages (Fortan, Algol etc..) that they used in the 60's, but never thought anything of actually using them. However, from what I've read, Lisp's power seems to be a well-kept secret by the Lisp community designed to give them the advantage. Their secret is out now, and as soon as I get my head round Lisp enough to actually write something more than Hello World, you'll be the first to know.

Wednesday, January 04, 2006

Whats the best programming language?

I hope to write more on this sometime, but I think that if you spend more time trying to get the language to work rather than the program you are trying to write with it, you're onto a loser.

Thursday, December 15, 2005

More Microsoft Shenanigans

Expect OpenGL in Vista to be approximately 50% slower than DirectX (made deliberately slower my M$). From the posting:-

  • OpenGL performance will be significantly reduced - perhaps as much as 50%
  • OpenGL on Windows will be fixed at a vanilla version of OpenGL 1.4
  • No extensions will be possible to expose future hardware innovations
More here at the Wikipedia article:-
Microsoft has taken the decision not to release the information necessary to allow third parties (such as those at NVIDIA, ATI or the other large graphics card manufacturers) to develop replacement drivers, leaving no way to avoid the 50% speed drop.



Wednesday, December 14, 2005

Where's the 3D On Slow PC's?

With the latest programming technology and libraries, how come is it that 3D now requires the latest top-of-the-range graphics cards? I'm not just talking about the latest commercial games, but open-source projects. I run a bog-standard 600Mhz PC with no special graphics card, and I can't run any modern 3D game, apart from the ones I write. Half-Life (1) and Quake run vert smoothly without a problem, but for some reason anything written in the last 5 years either runs like a dog or not at all. It's one reasons why I make sure all my 3D games can run on the lowest spec PC. Why should we lose out on all the fun?

Thursday, December 08, 2005

Piracy Lies!

More lies about piracy are being peddled by the industry. Lets address a few:-

Why should we fight piracy?

  • Piracy/counterfeiting is illegal and punishable by fines and jail sentences. - Especially now that the lobbying of governements has got into full swing; you can put put away for longer for pirating a game than beating someone up.
  • Counterfeited/pirated games are often mixed with obscene or pornographic material. Where? And why haven't mine?
  • Consumers have no recourse under law for faulty pirated games, which can damage hardware. True, they can damage your hardware if you drop a box of them on your PC.
  • Local and national jobs are lost as a result of pirate operations.
  • Proven links exist between piracy and organised crime, including drugs and pornography. Yes; they are both on their web page.

Tuesday, December 06, 2005

New Upload of Emergent Mercenary (v0.4)

It's finally turning into a game! In the latest upload, you start in a deserted field. A ship then flies overhead and teleports down some comrades; just in the nick of time as something seems to be moving in the distance...

The unit intelligence is getting better, and they look more realistic now, especially with their moving legs.

The game is freely available here.

Sunday, November 27, 2005

More on "Emergent Mercenary"

I keep having good ideas on what I want to implement, but not enough time to actually write it all! I just stumbled across a few very favourible (sp?) reviews of Resident Evil, so I'm now creating some Zombie game objects, which will wander around the map randomly until they see someone they don't like. I thought it would be cool to have them be teleported down from a ship that swoops from overhead, and that got implemented very quickly, apart from a small problem where the supposedly transparent "teleport" beam hides the zombies as they come down it, whilst you can still see walls behind it. ???

My next problem though, is making the people walk round realistically. At the moment the legs don't even move, but I have a feeling that will be the least of my problems. I think making them look natural will be hard.

Thursday, November 24, 2005

Emergent Gaming

It's the next big thing, and I've jumped onto this bandwagon.

My intention is to write a set of game objects that can be dropped into a game, and then let them do the rest themselves, by reacting to the player and each other.

I've also been influenced by a video of Quake 4, where the player walked around the landscape and a large ship swooped down from the sky. So an additional aim is to have an environment that the player can walk around while cool stuff happens around them.

You can download my current effort at SourceForge. It's called Emergent Mercenary, and is currently very alpha, though you can walk around.

Tuesday, November 22, 2005

Is Programming Too Hard?

I have a dream; that one day, a programmer will be able to look at any program, and within just a few minutes will know exactly how it works, how all of its classes fit together, where the bugs are, and how to change it do to do what they want.

"Am I mad?" I hear you ask? Probably. I'm a pretty experienced programmer, doing it as a hobby and job using loads of different languages (see Laser Squad 3D for my current raison d'etre). I say different languages, but are they really that different? And I'm not just talking about Java and C. I think all languages involve text, with the compiler/interpreter starting at the top and getting to the bottom (generally).

I think we need to start again.

The human brain, apparently, works better with images than words. So maybe this is how we should program. This has been baking at the back of my mind for years, and still has a long way to go, but I imagine programming visually. E.g., have a picture of a database, and a picture of a form, and maybe arrows pointing from a button on the form to a table in the database. I dunno. Maybe someone will tell me there already is a language like that. The main problem is that at the moment, to know how a program works, you have to read it. And it could be better.

Thursday, November 17, 2005

Prototypes? Who needs 'em?

One aspect of C (or Delphi) I don't like is prototypes. In my humble opinion, programming languages should be there to make the programmer's life easier, and any work that the computer can do should be left to the computer. Take prototypes, for example. Why do we need them?

When I ask C programmers, the main argument seems to be "So the compiler knows the function definitions." My response to that has always been "Why can't it go through the source file twice then? Once to get the function defintions (from the function itself - fancy that), and the second time to do the compiling? Why should I have to write everything twice (and change everything twice if I change a function)?"

Tuesday, November 15, 2005

CD's To Avoid...

..if you like your computer.

http://www.idiotabroad.com/?p=58

[This is a (growing) list of CD's which have the Sony Spyware (tm) on them. Don't put them into your 'puters CD player if you want to be able to program games!]

You'll notice as well that there are far more than the 20 that Sony stated. The site has a good reason why they lied about this.

Multitasking Programming Projects

I've come to the conclusion that is bad for programming to concentrate on more than one programming project at a time.

My situation is as follows:- I write ASP pages for the education industry as my full-time job, and then spend my spare time (what little I have, natch) writing 3D multiplayer strategy games in Java at home; two completely different aspects of programming. I find I can cope with one, because my subconcious (which seems to do a lot of my thinking for me) is quite happy mulling over problems when I'm asleep, or generally just not thinking about them. But it can't seem to handle two, so it means I've got to take over and do the thinking manually. And I'm not just talking about the big problems (my subconcious does have limits after all). I'm talking about every little thing. I find myself adding semi-colons to the end of lines of ASP code. I make mistakes in Java. It seems that cos I'm having to remind myself (and failing) of so many things that I would do automatically otherwise, I'm making so many mistakes. Is it just me?

Sunday, November 13, 2005

What's Wrong with Free Software?

While the debate over free (as in beer) software and free (as in speech) software continues, I think one thing should hold true - free software of any kind is not a bad thing, and should be held up along side non-free software. So why do most magazines (even the ones who promote the free software ideology) not review free software in the same format as non-free software?

I did write a letter to Linux Format asking them why they gave full page (or 2-page) adverts for non-free software, while for free software, which they claim to promote, only gets half-page reviews. I can't remember their reply, but I do remember it not answering the main point. How is free software going to claim a foothold when even those that use it treat it like a second-class citizen?

Friday, November 11, 2005

Too many engines!

Do a simple search for an RPG on Sourceforge, and I think you will see that over a quarter of them are "engines" (and don't get me started on the number of unfinished projects). I think the reason for this is simple - its much easier to write an engine as you don't have to make it a product that end-users (the most discerning of all people that use software) will have to use. You only have to appeal to other developers, and they are normally experienced enough to get a difficult piece of software running, as they understand phrases like "compile" and "libraries", and it means you can write something that doesn't have to be finished.

Don't get me wrong - engines do help. Almost any piece of software written these days requires some library or engine to run. But how many people are just re-inventing the wheel? And not even the full 360 degrees of it?