Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualHappyCoder

Posted 07 January 2013 - 12:42 PM

When making your game editor try to reuse as much code that makes sense. The core of your game should be the core of your editor, do the design well enough and your editor could allow you to play sections of your level right in the editor. With a lot of code overlap you will have a lot less code you need to write. Now to address some of your questions.

  • Having a easy to use interface is important. Try to keep things simple and flexible. If any part of your editor is difficult to use think of ways to improve its use
  • In the editors I have built I start with getting the editor to draw a game scene (with mostly the same code used in the actual game), then work on adding the menus and buttons used to add objects to the scene, get the scene to save, get the scene to load, then proceed to add additional menus and tools used to manipulate the scene as needed. You may have to jump between these steps as some features may add new data that needs to be saved and loaded.
  • Probably will be bigger but the media content to your game will far outweigh the size increase an editor will add
     
  • I am not sure if I understand the question but your editor wont have to use the compiler. If you want to be able control game logic with your editor then I would use a scripting language, my personal preference is lua
  • Are you talking about being able to add game logic and game flow, such as menus, using the editor? A good way to control transitioning from one piece of the game to the next is to break up the game into scenes. Each scene is edited separately and you can add transition points, for example. If the player passes through section X of your map, transition to scene Y. I also would not recommend trying to allow every aspect of your game, such as menus or in game huds, to be edited with the editor. A game editor should speed up the production of a game, not complicate it.
  • There is no way to lock your resources entirely. The best you can do is make it hard enough that it wont be worth it to the average person. You could also package your resources in some custom file format, unencrypted. It could be as simple as a short header with some file information followed by the data from the image file. Somebody could still figure out your format, but most people wont.
  • Don't try to do too much right away. You may have to sacrifice features you want to allow you to complete the project. Start simple, get things working, then expand your game with features later. You shouldn't, for example, be adding particle effects, cool animations, and cutscenes until you have your map, basic character movement, and object interaction done.

And a simple suggestion when you start adding different tools to your editor is to create a separate class for each tool. You should have a tool base class that all of the other tools extend. A simple example could look something like this.
 

abstract class Tool
{
public MouseDown(Point position, ButtonState buttonState);
public MouseMove(Point position, ButtonState buttonState);
public KeyDown(KeyCode keyCode);
/// any other methods a tool should need
}

class TileTool extends Tool
{
/// here you have the code for drawing tiles and such
}

class GameObjectTool
{
/// here you have the code for adding, removing, and modifying objects in a scene
}

 
This makes it easy to change tools and will allow to add additional tools to your editor as needed


#1HappyCoder

Posted 07 January 2013 - 12:38 PM

When making your game editor try to reuse as much code that makes sense. The core of your game should be the core of your editor, do the design well enough and your editor could allow you to play sections of your level right in the editor. With a lot of code overlap you will have a lot less code you need to write. Now to address some of your questions.<br />&nbsp;<ul class="bbc bbcol decimal"><br /><li>Having a easy to use interface is important. Try to keep things simple and flexible. If any part of your editor is difficult to use think of ways to improve its use.</li><li>In the editors I have built I start with getting the editor to draw a game scene (with mostly the same code used in the actual game), then work on adding the menus and buttons used to add objects to the scene, get the scene to save, get the scene to load, then proceed to add additional menus and tools used to manipulate the scene as needed. You may have to jump between these steps as some features may add new data that needs to be saved and loaded.</li><li>Probably will be bigger but the media content to your game will far outweigh the size increase an editor will add</li><li>I am not sure if I understand the question but your editor wont have to use the compiler. If you want to be able control game logic with your editor then I would use a scripting language, my personal preference is lua</li><li>Are you talking about being able to add game logic and game flow, such as menus, using the editor? A good way to control transitioning from one piece of the game to the next is to break up the game into scenes. Each scene is edited&nbsp;separately&nbsp;and you can add transition points, for example. If the player passes through section X of your map, transition to scene Y. I also would not&nbsp;recommend&nbsp;trying to allow every aspect of your game, such as menus or in game huds, to be edited with the editor. A game editor should speed up the production of a game, not complicate it.</li><li>There is no way to lock your resources entirely. The best you can do is make it hard enough that it wont be worth it to the average person. You could also package your resources in some custom file format, unencrypted. It could be as simple as a short header with some file information followed by the data from the image file. Somebody could still figure out your format, but most people wont.</li><li>Don't try to do too much right away. You may have to sacrifice features you want to allow you to complete the project. Start simple, get things working, then expand your game with features later. You shouldn't, for example, be adding particle effects, cool animations, and cutscenes until you have your map, basic character movement, and object interaction done.</li></ul>And a simple suggestion when you start adding different tools to your editor is to create a&nbsp;separate&nbsp;class for each tool. You should have a tool base class that all of the other tools extend. A simple example could look something like this.<br /><pre class="_prettyXprint _lang-CODE _linenums:NaN">
abstract class Tool
{
  public MouseDown(Point position, ButtonState buttonState);
  public MouseMove(Point position, ButtonState buttonState);
  public KeyDown(KeyCode keyCode);
  /// any other methods a tool should need
}

class TileTool extends Tool
{
  /// here you have the code for drawing tiles and such
}

class GameObjectTool
{
  /// here you have the code for adding, removing, and modifying objects in a scene
}
</pre><br />This makes it easy to change tools and will allow to add additional tools to your editor as needed

PARTNERS