Difference between revisions of "Guidelines for Programming games"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
The following are guidelines that you should consider when programming games:
 
The following are guidelines that you should consider when programming games:
* Games should be playable with joystick alone. All menus and such should be possible to select using joystick alone. This allows the game to be played on GX4000 for example and to play it without needing to press a key. It could be also selectable with number keys or arrows.
 
  
* 'P' key should be used for pause in joystick control mode. This makes it compatible with the GX4000. It's pause button is mapped to the 'P' key.
+
* Games should be playable with joystick alone. All menus and such should be possible to select using joystick alone. This allows the game to be played on GX4000 for example and to play it without needing to press a key.
  
* Both digital joysticks should be selectable to use. The Amstrad plus has both connectors, the CPC can have a second joystick using a joystick splitter or using one of the official Amstrad Joysticks.
+
One suggestion is that the game allows the user to press fire on the gamepad/joystick or the corresponding fire button on the keyboard.
  
* Analogue joystick on Plus should be selectable if Plus machine is used. You can detect if a Plus machine exists programatically. Analogue joystick can be used as an alternative to a digital joystick (this avoids "Keyboard Clash" when used in 2 player games in conjunction with keyboard or another digital joystick) or to their full analogue ability where it makes sense in the game.
+
The game recognises which was pressed and uses this to determine which controller will be used in game.
 +
 
 +
 
 +
* 'P' key should be used for pause in joystick/gamepad control mode. This makes it compatible with the GX4000. It's pause button is mapped to the 'P' key.
 +
 
 +
* Both digital joysticks should be selectable to use. The Amstrad plus has both connectors, the CPC can have a second joystick using a joystick splitter or using one of the official Amstrad Joysticks. If the game supports 2 players allow both digital joysticks to be used.
 +
 
 +
* Analogue joystick on Plus should be selectable if Plus machine is used. You can detect if a Plus machine exists through code. Analogue joystick can be used as an alternative to a digital joystick (this avoids "Keyboard Clash" when used in 2 player games in conjunction with keyboard or another digital joystick) or to their full analogue ability where it makes sense in the game.
  
 
* It should be possible to select "No Sound", "Music", "Sound Effects" or "Music and Sound Effects" (where possible).
 
* It should be possible to select "No Sound", "Music", "Sound Effects" or "Music and Sound Effects" (where possible).
Line 12: Line 18:
 
* If you are using overscan, consider that the position of the screen may not be the same on all monitors, so a method to centralise it before the game starts, or in the options of the game.
 
* If you are using overscan, consider that the position of the screen may not be the same on all monitors, so a method to centralise it before the game starts, or in the options of the game.
  
* It should be possible to redefine the keys to the choice the user wants, or to be able to choose from a preset list. Good key "presets" are cursors and space (good for cpc6128 and Plus more awkward for 464 and 664), q for up, a for down, o for left, p for right and space for fire.
+
* It is very important that keyboard controls should be redefineable. There is not one perfect control scheme for all, so this allows the controls to be chosen by the user.  
 +
 
 +
There are some reasonable keyboard configurations:
 +
 
 +
 
 +
Directions = Up, Down, Left, Right
 +
 
 +
Directions: Cursors
 +
Fire: Space OR copyGood presets:
 +
 
 +
 
 +
Directions: Q, A, O, P
 +
Fire: Space
  
 
* Games should support the FIRE 2 button for gamepads/joysticks. Maybe the player character  needs to be able to jump, and then UP is used for this. And that is ok. Just don't forget to include the FIRE 2 button for jumping as well.
 
* Games should support the FIRE 2 button for gamepads/joysticks. Maybe the player character  needs to be able to jump, and then UP is used for this. And that is ok. Just don't forget to include the FIRE 2 button for jumping as well.
  
 
* Consider supporting AMX Mouse (or compatibles such as Bryce's USB mouse hardware) and Symbiface 2 Mouse where it makes sense in the game. Movement could also be used for moving to the wanted menu item and clicking the mouse button to select.
 
* Consider supporting AMX Mouse (or compatibles such as Bryce's USB mouse hardware) and Symbiface 2 Mouse where it makes sense in the game. Movement could also be used for moving to the wanted menu item and clicking the mouse button to select.
 +
 +
* The game should be playable on green screen or greyscale monitors in addition to colour monitors. This means things are easy to see and identify when used with all monitors. Ideally, the user should be able to choose the type of monitor, this will enable the game to adjust its colors to maximize the display for each monitor. Where games rely on colour, consider using visual differences in the tiles so they can be identified on monochrome monitors without needing to use colour but when used on colour displays they benefit from the extra colours.
 +
* A game should provide a high score list (if it makes sense) and save it to disc.
 +
 +
* The availability of memory expansions should be investigated. And if additional memory is found the game shall use it in some way. Examples are to add additional features or to load all levels at one at the beginning.
 +
 +
* If a game relies on a specific memory configuration (e.g. 128K), then the game or it's loader should check for this, report it to the user and stop them from continuing. This avoids the user not understanding why the game didn't work on their computer.
 +
 +
[[Category:Programming]]

Latest revision as of 03:51, 1 September 2014

The following are guidelines that you should consider when programming games:

  • Games should be playable with joystick alone. All menus and such should be possible to select using joystick alone. This allows the game to be played on GX4000 for example and to play it without needing to press a key.

One suggestion is that the game allows the user to press fire on the gamepad/joystick or the corresponding fire button on the keyboard.

The game recognises which was pressed and uses this to determine which controller will be used in game.


  • 'P' key should be used for pause in joystick/gamepad control mode. This makes it compatible with the GX4000. It's pause button is mapped to the 'P' key.
  • Both digital joysticks should be selectable to use. The Amstrad plus has both connectors, the CPC can have a second joystick using a joystick splitter or using one of the official Amstrad Joysticks. If the game supports 2 players allow both digital joysticks to be used.
  • Analogue joystick on Plus should be selectable if Plus machine is used. You can detect if a Plus machine exists through code. Analogue joystick can be used as an alternative to a digital joystick (this avoids "Keyboard Clash" when used in 2 player games in conjunction with keyboard or another digital joystick) or to their full analogue ability where it makes sense in the game.
  • It should be possible to select "No Sound", "Music", "Sound Effects" or "Music and Sound Effects" (where possible).
  • If you are using overscan, consider that the position of the screen may not be the same on all monitors, so a method to centralise it before the game starts, or in the options of the game.
  • It is very important that keyboard controls should be redefineable. There is not one perfect control scheme for all, so this allows the controls to be chosen by the user.

There are some reasonable keyboard configurations:


Directions = Up, Down, Left, Right
Directions: Cursors 
Fire: Space OR copyGood presets:


Directions: Q, A, O, P 
Fire: Space
  • Games should support the FIRE 2 button for gamepads/joysticks. Maybe the player character needs to be able to jump, and then UP is used for this. And that is ok. Just don't forget to include the FIRE 2 button for jumping as well.
  • Consider supporting AMX Mouse (or compatibles such as Bryce's USB mouse hardware) and Symbiface 2 Mouse where it makes sense in the game. Movement could also be used for moving to the wanted menu item and clicking the mouse button to select.
  • The game should be playable on green screen or greyscale monitors in addition to colour monitors. This means things are easy to see and identify when used with all monitors. Ideally, the user should be able to choose the type of monitor, this will enable the game to adjust its colors to maximize the display for each monitor. Where games rely on colour, consider using visual differences in the tiles so they can be identified on monochrome monitors without needing to use colour but when used on colour displays they benefit from the extra colours.
  • A game should provide a high score list (if it makes sense) and save it to disc.
  • The availability of memory expansions should be investigated. And if additional memory is found the game shall use it in some way. Examples are to add additional features or to load all levels at one at the beginning.
  • If a game relies on a specific memory configuration (e.g. 128K), then the game or it's loader should check for this, report it to the user and stop them from continuing. This avoids the user not understanding why the game didn't work on their computer.