Jump to content
  • Advertisement
Sign in to follow this  

Project: Gorgon

Editor v3

Sign in to follow this  




So, the radio silence is now over, at least for this post. I’ve been toiling away on creating an editor for Gorgon so people can edit sprites, and images (somewhat).


A little about the editor

The editor is similar to the one in v2 in that it is completely plug in driven. That is, almost all functionality is based on plug ins, and without any plug ins the editor is nothing more than a file manager.

The advantage of this is that end users can write their own plug ins for their own content. For example, if you’re making a game that uses a tile map, you’ll likely want a tile map editor. Instead of writing your own full fledged editor, and trying to make it work with the Gorgon file system, you could write a plug in for the Gorgon editor that allows you to create tile maps. All file system manipulation is taken care of, and with default plug ins, even sprite creation and image handling is all in the same place as your tile editor.

Where this version differs from 2.0 is … well, pretty much everything else. The previous incarnation opened up a packed file and copied the contents to a temp folder, and when you worked on the content, it’d alter the file in the temp directory. When you saved the project, it’d repack the file with the updated content. This has proven to be less than performant.

The new editor works more like Unity now, in that you pick a folder on your hard drive and you use that for editing your content. The folder is no longer temporary, so you can use it directly in your applications, or, should you want a packed file, you can export it as a packed file using the Gorgon packed file format (a plug in, a developer could create one that writes zip files if they so choose). You can also import packed files using the default plug ins for the Gorgon packed file format, or zip files.

Plug ins

Obviously, the editor is useless without plug ins. So, Gorgon (as of this writing) comes with 2 plug ins out of the box. The image editor, and the sprite editor. As time and energy allow, more will be added as development continues.

Image Editor

Image EditorThe image editor, with a volume texture loaded. It even has a volume rendering preview.

The image editor is a bit of a misnomer. You don’t actually paint on the image/texture like you would in Paint.Net or Photoshop. It’s mostly a viewer, but there is some editing functionality like changing the image type, image format, updating array slices, mip levels and, if you have a 3D (volume) texture: depth slices. As you can see in the screenshot above, there’s a volume texture loaded with Perlin noise (and some alterations done by me – that’s the black line) with a nifty volume rendering preview to show how the texture will look. I’ve yet to see any image editor handle volume textures, so this is particularly handy.

Adding array index data, mip data, and depth data is easily done by dragging an image into the image area on the screen. You can drag from the file explorer on the right hand side, or you can drag from Windows Explorer. If you have a texture cube, it will even change the view to the typical cross format and you can drop an image into each face, and it will also support multiple image cubes in the same texture (by having an array count that is a multiple of 6).

If you want to edit the image data (i.e. paint some pixels), then Gorgon will take the current array index/mip level/depth slice and export it as a PNG file and load it into the editor associated with PNG files. When you are done editing, the image will automatically update in the editor.

When images are imported into the editor, they are converted to DDS format. Why? Well:

  • DDS is a ubiquitous format and has been around forever and designed for textures exclusively.
  • It supports every texel format.
  • It supports DXt compression – This is very useful when you have a lot of image data to load into the GPU.
  • And it’s just easier to deal with one file format instead of trying to guess which format should be used when loading/saving image data.

Now, with that said, images imported into the editor will be converted from their native format into DDS. So you can import any image file format supported by Gorgon, and, of course, by any image codec plug in you supply (this is supported, but no image codec plug in management is available in the editor yet – soon).

Sprite Editor

Sprite EditorThe sprite editor.

The sprite editor allows you to clip out sprites from image/texture files and save those clipping coordinates, and other metadata into a file that can be read back and used. This saves a lot of grief if you’re trying to build up a bunch of sprites by not having to copy them out by hand.

Sprites can be clipped in the usual way by dragging and resizing a rectangle around on the screen. And if you need pixel level accuracy, you can bring up the Manual Input window and enter the coordinates in by hand. You can also clip sprites by using a fixed size selection rectangle.

But, you’re not limited to just drawing a rectangle to get at your sprite data. You can also use the sprite picker to click on a sprite in the image, and the sprite editor will do its best to determine the bounds for that sprite and surround it with a tight fitting rectangle. Or, if you want some spacing, you can also pad the rectangle by a specified number of pixels.

The picker works by using a masking color/alpha value as means to locate the boundaries. When you click on the sprite it starts sampling the image in multiple directions and if it hits the masking color/alpha value, it stops and takes that as a minimum/maximum bound area. It then continues this process until the full extents are found (it’s basically a dumb flood fill). This masking color/alpha value can be modified by the user.

Sprites can also have their corners (vertices) moved independently to allow skewing of the sprite using a corner offset editor.

Other functions like altering the sprite color (or individual sprite corner/vertex color), and anchor point editing are also available. And the texture wrapping functionality changes the view to show what each wrapping mode along the X and Y axes would look like, and allows you to apply wrapping to the sprite (be aware though, that if you’re using a texture atlas, then the results will differ from the editor view).

Sprites can also be imported into the editor like images, and by using plug ins, external formats can be loaded and converted into the Gorgon sprite file format. Currently this import process supports Gorgon v1, v2 and v3 sprite files.

What’s next

Well, there’s a few things that need to go in. Such as plug in management support for sprites and images so users can bring in other formats not supported natively by Gorgon. Also, a tool to clip multiple sprites from a texture atlas using a grid, and a sprite atlas creation utility.

Ideally, I’d like to have a Font editor and Animation editor in there. But those will take some time to get off the ground. And the Animation editor is higher priority for me, so that one would be tackled first.

Anyway, that’s it. The most current commits on the v3.0 branch on Github have the updated editor code, so feel free to check it out. And report any bugs you find on the Github issues page.


View the full article


Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By rogerdv
      Im doing some tests with new Unity3d networking APi and Im moving from sending integers to sending more complex stuff, like coordinates (3 floats). The problem is that Im forced to use fixed byte as the data container for my packets (byte[] doesnt works, must be unmanaged and blittable) and I havent found a way to put my values (floats, strings, etc) into that array of bytes and also get them back. How can I do this?
    • By vvoodenboy
      My name is... nobodycaresbecauseitsnotimportant.
      I'm working on my own card game. I'm just in a stage of connecting some 'dots' of game's mechanics.
      I'm looking for a concept / 2D artist - because its time to give it some shape - I've a concept of a dark fantasy world where I want to place the plot but there is a lot of space for creativity.
      If you are interested please shout here or on discord (vvoodenboy#3207) or vvoodenboy@gmail.com.
      Have a nice day!
    • By Onions.ILikeOnions
      My top down character movement script aint working, only the screen moves.
      Mere is the tutorial https://www.youtube.com/watch?v=whzomFgjT50&t=41s
      And here is my Script
      using System.Collections; using System.Collections.Generic; using UnityEngine;   public class waw : MonoBehaviour {        public float moveSpeed = 5f;      public Rigidbody2D rb;   Vector2 movement;     // Update is called once per frame     void Update()     {       movement.x = Input.GetAxisRaw("Horizontal");       movement.y = Input.GetAxisRaw("Vertical");     }   void FixedUpdate (){ //movment rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime); }   }
    • By Ahrakeen
      Hi we are two people working on a 2d beat em up game called hot chick and cool girl.
      We are looking for a sprite artist to create our key characters for the game.
      Here is some concept art for two of the characters and we will have more in  time.
      Let me know if interested
      We got a rough outline and a intention o something close to 15 stages for the game.

    • By RoKabium Games
      Lelantos enemies – ”Riverine” is a venomous and poisonous creature that is slow but still very dangerous.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!