Sunday, 25 May 2008

Day two - Loading and saving

After a bit of an absense, I got back into my game again.

Today, I fleshed out the methods on how to load and save the Galaxy info including the game info (turns, etc), Factions involved, Facilities available, Sectors, Systems, and which facilities are on each system to and from the database.

The above is not completely finished, but damn close! Also, it has not had any real functional tests. The Galaxy itself and game info load great, but the rest has not been tested.

I found a nice galaxy background image on NASA, which appear to be free for re-use.

Though the code is building up, my bottom->up construction has yealded practically nothing worth showing off. So here is a picture of my testbed for loading and saving galaxies with just the background image showing and the buttons for loading, adding a background image (from a file) and then saving hte whole lot back into the database:












Tada! An image of this project. No one reads anything unless there are pictures :-)

Saturday, 24 May 2008

"Insurrection". Day one.

My first step was deciding what technology I was going to use to make it. Visual Studio XNA caught my attention, but does not work under a VM and I didn't want to interfere with my Delphi development environment. So I am using Delphi instead.

Also helping that along is my first project is really a 2d game overview and control. I don't need 3d until I start simulating space battles, which I know full well I will never get around to doing :-).

My initial preference was to use Delphi.Net. Why? Using .NET would allow me to interface with other languages, just in case anyone else joined the project but preferred, say, C#. Also, I thought I would use XML (for much the same reason) to store game data. By using .NET Serialization I figured I would save myself a lot of work with loading and saving.

I started to flesh this idea out, and quickly realised that .NET Serialization was not going to be the silver bullet I imagined. In fact, due among other things to the complexity of serializing images (TImages anyway) it became murder. It was already more work then I considered acceptable to make it worth while.

So I went back to the starting board. Then it occurred to me that a game state (when saved) was just a database. Now THERE is something I am more familliar with! So for good or for bad, I have ended up falling back to what I know. Delphi + Database.

People installing a game don't want to install a database engine, so I needed a database which didn't require that. Again, my old faithful came to my rescue. Firebird. The embedded (Single redployable DLL) method would be perfect.

Again, I wanted to test this theory. My goal was to impliment the load/save functionality first as this would allow me to have a shared set of classes which would have their own smarts to build themselves from memory and save themselves back to the database. These could be used in the game itself and the editor (Handy....).

So, on the first day I built the data structure for the galaxy and game info (Who's turn, etc), sectors (groups of planetary Systems), Systems and Facilities (manufacturing). This also gave me the class structure I would want.

Next, I started a new project with a form (for the editor which I was going to start with) and a shared directory with the classes in it. I then began laying out the class properties and method husks.

That was about as far as I got before going to bed and becoming tied up for the next week or so. Only a couple of hours work, and no real functionality at all yet. Depressing, but I have some patience....

What my game is about

As I mentioned in a previos post, my game is based vaguely on Lucas Arts Rebellion. This is an old game, but one I dearly love playing. Unfortunatly, it is a bit primative and seems to be one of the many orphaned titles out there. So I wanted to make somethihng similar but with some enhancements.

  • First and fore-most, it must be easily modable. People in the (unofficial) Rebellion forums spend a lot of time hacking about in the original game to enhance it. But I want to take it further and make it easier.

  • Secondly, I want to update the economy model. At first I wasn't sure how to do this without making it significantly more complex to play (reducing simple minded fun). But I have decided at this stage to simply include 'Commerce' for money to run aside the continued 'resources' model.

  • Next, individual systems can have bonuses in either Industry (eg, Corellia for ship building), Commerce (Corscant maybe), Resources (Kessel) and Defence.

  • As for this next one, it bit includes the 3d part which will never exist. I want to make combat more realistic in starting and ending conditions. I INTEND (plans change) to have hyperspace levels at each system. Low, medium and high. To get to a planets surface (to make a ground assault for instance) you need to get below any defending fleets. This introduces the theory of having multiple fleets in orbit of a single system at the same time (not possible in Rebellion).

To ballance out this new requirement, if a fleet jumps in over a defending fleet and the defenders want to get away, they will have to fight their way out through the blockaid.

Tough, but fair :-)

  • Finaly (for now atleast) I want to allow for more then just two factions. My version will include as many factions as the person using the editor designing the starting map wishes to create.

Cool, eh?

That is all for now. Bye!

How not to build a game

Hey there,

I have been doing all kinds of things lately, I have changed jobs (and possibly career, we will see how that goes) amongst a lot of other things.

Something of (dubious) interest currently is my side project of making a game.

Do be warned, I have never successfuly created a game and I doubt this game will get anywhere near finished. However, little tid bits of my experiences may help or at least amuse you.

My game is called "Insurrection". It is based vaguely on the old Lucas Arts game; Rebellion.

I will put some posts here outlining what I am up to with it.

Chao!

Wednesday, 23 April 2008

Action Lists

I found this very good artical on the equally underused TActionList component in Delphi, when searching for a way to get the Sender of an action...

http://bdn1.borland.com/article/borcon/files/6102/paper/6102.html

Don't know what an action list is? Well, you are missing out. They are awesome. Mr T loves them and pities you, fool. Read the above link to enlighten yourself and simplify your life from this point in :-)

The answer, by the way is the ActionComponent property of the sender, TAction.

And to get the Popup menu's calling component, check this one out:

http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.language.delphi.general&messageid=41771880$1@newsgroups.borland.comhttp://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.language.delphi.general&messageid=41771880$1@newsgroups.borland.com

Thursday, 20 September 2007

Delphi Games

Games are not easy, but they are a fun little thing to play around in.

I have done some basic games in Delphi, primarily a VCL space invaders programme. It is limited, but was a cool first step for me.

There are books about games in Delphi, but I recently found this web site which I really like and thought I should share.

(When ever you think you know the Delphi Community, remember that what/who ever you knowis only the tip of the iceberg which is visible above the waterline. Much more lie beneath.)

Any how, this site includes some of the most straight forward tutorials I have ever seen as an introduction to Game Making in Pascal. I am going through them myself.

When working on games, there is an active community for Delphi/Pascal users at www.pascalgamedevelopment.com . Pascal Game Development also run annual competitions which are well worth a look. Help them out and check the sponsors while you are there :-)

For general game development, www.GameDev.net is also good, but although the delphi/pascal users there are passionate (and it would seem, growing) you will still find yourself in the minority!

Happy hunting.

Monday, 23 July 2007

Good tutorials and help

I have been slightly, well, absent from this blog for a while. My businesses and the addition of a puppy to my family :-)

So sorry for that!

The good news is that there have been some really good blogs and web sites come to my attention recently. I want to post them here.

First, CodeGearGuru. This guy has put some real thought and effort into the demo's he has made.
http://codegearguru.com/

Secondly, DelphiFaq.net is a nice collection of hints and tips.
http://www.delphifaq.net/

Go check them out!