Posts Tagged ‘game maker’

Far Trader – Docking and HUD

Friday, September 25th, 2009

This week has been all about getting docking working. As trading will be the focus of the game, a system for docking at places to trade is pretty much essential. Along side the docking process comes the HUD. For now, the HUD shows some basic information such as ship hull damage, fuel level, throttle indicator, speed, grid reference etc. I have also created a radar system that centres around the player object. This radar gives a nice accurate system for showing where you are in relation to other objects in the room (hat tip to 3030 Deathwar for that idea).

Additionally, I have created a test system for changing the players ship. Object inheritance and changing is possible in Game Maker, but not something that I have found easy (until I finally started to read the GM Manual!), so now you can switch between 2 different ships that have different stats on the fly.

Docking has been a complicated affair as im still learning GML, but It has forced me to restructure a lot of the code in the process, producing a more organised application structure.

Wont say any more at the moment, but heres some screen grabs:

the HUD display with docking ring active

the HUD display with docking ring active

More ship sprites

More ship sprites

Game Maker Object Inheritance

Sunday, September 20th, 2009

Game Make is a very easy to use application which gives you the ability to create decent games (or applications) in a matter of minutes, but to create awesome games, you going to have to learn GML and other programatic structures like object orientation parent classes and inheritance.

The idea of parents and inheritance is pretty simple. Lets set an example using a car as our ‘object’. Our car will be a Trebant. In Game Maker, you would create an Object in the usual way and call it for example ‘obj_trebant‘. You would then set code and actions for obj_trebant.

Now, lets say your creating a game with a number of different cars, so you go ahead and create a bunch of objects to represent different cars, applying Events and Actions to each. This could turn into a long process depending on how many car objects are in your game. You could just duplicate the first car object and change Actions for each new object you create, that will save you a bit of time. But what happens if for example you need to change a variable or action for each car object further down the line. You have to edit each object in turn, manually changing Actions and Variables.

There has to be a better way, and there is. Using parent classes and inheritance…

In order to use parent classes and inheritance to good effect, your going to have to work out what each of your cars have in common. Using our car example above lets say that all cars have headlights. You might have a piece of GML or some other Action in your obj_trebant object that defines headlights. As we want all cars to have headlights, it would make sense to create a parent object and add the headlight code into that, lets create a new object and call it ‘obj_car‘. Now, we have two objects: obj_car and obj_trebant. In your trebant object set its parent object to obj_car. Jolly good, you have now created an object with a parent.

If you test your code, you will probebly find that any code in your parent class isnt being executed, why is this? This is down to object inheritance. If you have a Create and Step event in obj_trebant, it will by default override the Create and Step events in obj_car. To combat this you need to ensure that you add the ‘call event’ action from the control menu to each Event that you want to inherit code or Actions from. If you add Action > Event Call to your Create Event of obj_trebant it will execute the code in the Create Event of obj_car, then execute the code in obj_trebant.

principles like this can be very handy in games where you create a number of objects (cars for example) that you want both the player and AI to use. Think Grand THeft Auto, where the player can get in any car, the cars are also AI controlled. So by using parents and inheritance, you dont have to create player fixed object. Your player can simply be an object that can inherit its visible object from something else obj_trebant for example. This is an easy action in Game Maker with the GML function:

object_set_parent('object to change','object to change to');

Lets say we create our player object: ‘obj_player‘. By default, lets say hes a Subaru (create an object called obj_subaru) with a parent of obj_car. If we wanted to change the type of car the player is, add a code event with the following code:

object_set_parent(obj_player,obj_subaru);

I hope the above goes a little way towards explaining how parent classes work in Game Maker and helps you to create more interesting and efficient games.

Far Trader, finally some action

Wednesday, September 16th, 2009

Finally, some in game action

Finally, some in game action

Collision detection in place,as this image proves. I also has to rewrite a lot of the scripts and methods I was using. I had gone down a path of objectiveness that was counter productive to how Game Maker works so had to start from scratch. I made a lot of progress this evening.

I now have the basics for:

  • Ship movement
  • Inertia on movement
  • Particles to represent the ships engines
  • Collision between objects
  • Working projectiles
  • A very basic object health variable
  • object damage based on damage value in projectile object

Far Trader Game Maker project

Monday, September 14th, 2009

Ive decided to put up some of the ship designs I am working on before going into details of the game. enjoy my poor attempt at sprite design.

A selection of ships from far trader

A selection of ships from far trader

Game Maker – First attempt at game design

Monday, September 14th, 2009

GM-splash
I’ve always fancied designing and writting a PC game but I dont really have the required skills. Sure, I can develop in PHP with my eyes closed – same with MySQL and other related languages, but games development is a totally different dicipline.

Game Maker
That’s where Game Maker 7 comes in, I discovered this little gem while trying to find good XNA 3 tutorials and after only 2 – 3 days of light reading and playing around with it I already have some decent results. Game Maker takes a WYSIWYG approach, anyone who has spent some time using Flash and action scripting will feel right at home with the Game Maker interface. Developing a game centres around a number of Objects and other items such as sprites, backgrounds, fonts, sounds effects etc and rooms. A room is a playing field for your game to play out on. You place objects in the rooms and set actions and events on each object, these events can be predefined items or you can simply script them using whats known as GML (Game Maker Language).

Far Trader – my game in progress
The games ive always fancied putting together always seem to centre around space and sci-fi. As a kid I used to play a lot of pen and paper RPG’s like Megatraveller, Space Master and other sci-fi games. Megatraveller always appealed to me due to its hard fiction approach rather than the space opera of star wars. So there it is, I now have something to base my game on, Megatraveller the game of intergalactic trading and warfare. I do not wish to infringe on any copyright’s with this game so it wont be directly based on Megatraveller, just loosly influenced by its setting and attitude to sci-fi.

A lot of planning has and will go into this game and I plan to document it here, but for now I will show some images from the planning of the game and a couple of mini screen grabs from what I have so far, but before the images here is a VERY brief overview of the game:

Far Trader will be a top down 2D space trading and combat game, with an emphasis on the trading. As the player you will be able to trade goods by travelling from one system to another. Trading goods will net you profit, with this profit you will be able to purchase different ships, some ships will be more combat oriented, some more biased towards trading. The initial aim of the game will be to make xxx money in yyy time frame, more of a sandbox challenge initially, but over time i would like to add other ways of making money; pirate bounties, people courier tasks etc, then finally I would like to add some kind of over-arching storyline which would bring you to end game.

A small selection of the ship design templates

A small selection of the ship design templates

Some sample in game shots of the first ship moving

Some sample in game shots of the first ship moving

I will give more details in another post.