Jump to content


Photo

GMare


  • Please log in to reply
68 replies to this topic

#21 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2611 posts
  • Version:GM:Studio

Posted 21 February 2011 - 05:38 AM

If this would have just been around when I was still workin on Slime OnlineČ ^^,

Great work!
  • 0

#22 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 04 March 2011 - 07:07 PM

Glad you liked it. Sorry it couldn't help you. :lol:

Just wanted to update a bit. I have changed things around for the upcoming release. I decided the selection tool should be able to make brushes through it, that can also be saved. As well as changing the blend color and tile flipping. The normal brush tools will also support flipping. There is a wheel zoom option now as well. The program will now support dragging the room around by pressing the "H" key for the hand tool. I also hooked some shortcut keys for all the tools in GMare. That way advanced users can edit with some added speed. I also made a separate eraser tool, since the brushes have right click context menus to flip, select, and edit brushes now. While in tile edit mode I will also have a "Show Objects" toggle button.

New selection options.
http://www.pyxosoft....re/gmare_30.png

Brush save editor.
http://www.pyxosoft....re/gmare_31.png

The saved brush in the brush tool menu.
http://www.pyxosoft....re/gmare_32.png

The blend color changed. (Orange)
http://www.pyxosoft....re/gmare_33.png

Mouse zoom option.
http://www.pyxosoft....re/gmare_34.png
  • 0

#23 Vich

Vich

    GMC Member

  • New Member
  • 29 posts

Posted 03 April 2011 - 03:06 AM

Firstly,this is a nice piece of software! I am currently using this as an integral part of my zelda project actually and I gotta give my thanks. Hopefully I would see more updates from you.

But as I am making use of this, I was wondering whether or not you can load a specific layer at once? In the scr_load_room script, rather than load all layers at once, can you just load one specified layer?

Edited by Vich, 03 April 2011 - 03:07 AM.

  • 0

#24 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 03 April 2011 - 11:21 PM

You could just load the layer of a specific depth.

Example Code:
// Iterate through layers.
repeat (_layer_count)
{
    // Get layer depth.
    _layer_depth = scr_read_bytes(_stream, 4, true);
    
    // If the layer depth matches the desired layer.
    if (_layer_depth == <layer to load depth>)
    {
        // Load layer normally, as per the example.
    }
    else
    {
        // Skip over non-targeted layer data...
        
        // If the layer uses the sector method, instead of the tile method.
        if (file_bin_read_byte(_stream) == 0)
        {
            file_seek(file_bin_position(_stream) + (_columns * _rows * 2));
        }
        else
        {
            _tile_count = scr_read_bytes(_stream, 4, true);
            file_seek(file_bin_position(_stream) + (_tile_count * 10));
        }
    }
}

Edited by xfixium, 03 April 2011 - 11:24 PM.

  • 0

#25 Vich

Vich

    GMC Member

  • New Member
  • 29 posts

Posted 05 April 2011 - 01:19 AM

Forgive me, but I am not entirely sure about where to place this, or what else I should add into the code. I tried to make the game check if the layer is equal to the layer desired, but I always get the game freezing and getting an error.
  • 0

#26 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 05 April 2011 - 01:37 AM

Sorry, I didn't test it, it was originally just supposed to be pseudo code. I did test this script though, and it works.

NOTE: I do have a test project with this code in it if you need it.


scr_load_room_layer(_file, _room, _background, _layer);

_file = argument0;        // STRING: The GMare .bin file path.
_room = argument1;        // STRING: The name of the room to load.
_background = argument2;  // REAL:   The background to use for the room.
_layer = argument3;       // REAL:   The desired layer.

// If the file does not exist, exit.
if (!file_exists(_file))
{
    // Show error.
    show_message("ERROR: The GMare binary file: " + _file + " does not exist.");
    exit;
}

// Open the .bin file to read.
_stream = file_bin_open(_file, 0);

// The GMare binary file id
_file_id = "";

// Read four character bytes.
repeat (4)
{
    _file_id += chr(file_bin_read_byte(_stream));
}
    
// If not a valid GMare binary file, exit.
if (_file_id != "GBIN")
{
    // Show error, close file stream.
    show_message("ERROR: The file is not a valid GMare .bin file.");
    file_bin_close(_stream);
    exit;
}

// The offset to the actual room data beyond the header.
_data_offset = -1;

// The amount of rooms in the file.
_room_count = scr_read_bytes(_stream, 2, true);

// Iterate through rooms in the GMare binary file header.
repeat (_room_count)
{
    // Read room name.
    _search = scr_read_string(_stream, 1);

    // Read the room data offset.
    _offset =  scr_read_bytes(_stream, 4, true);
    
    // If the search string matches the desired room string.
    if (_search == _room)
    {
        // Set data offset, and break loop.
        _data_offset = _offset;
        break;
    }
}

// If the desired room was not found, exit.
if (_data_offset == -1)
{
    // Show error, close file stream.
    show_message("ERROR: The room: " + _room + " was not found.");
    file_bin_close(_stream);
    exit;
}

// Seek, to the desired room data.
file_bin_seek(_stream, _data_offset);

// Room data:
_columns = scr_read_bytes(_stream, 2, true);          // The number of tile columns in the room.
_rows = scr_read_bytes(_stream, 2, true);             // The number of tile rows in the room.
_tile_offset_x = file_bin_read_byte(_stream);         // the horizontal tile offset of the background.
_tile_offset_y = file_bin_read_byte(_stream);         // The vertical tile offset of the background.
_tile_separation_x = file_bin_read_byte(_stream);     // The horizontal separation of the background.
_tile_separation_y = file_bin_read_byte(_stream);     // The vertical separation of the background.
_tile_width = file_bin_read_byte(_stream);            // Width of a single tile in the background.
_tile_height = file_bin_read_byte(_stream);           // Height of a single tile in the background.
_tile_columns = scr_read_bytes(_stream, 2, true);     // The number of columns of the background.
_layer_count = scr_read_bytes(_stream, 4, true);      // The number of layers in the room.     
_instance_count = scr_read_bytes(_stream, 4, true);   // The number of instances in the room.
_collision_count = scr_read_bytes(_stream, 4, true);  // The number of collisions in the room.
    
// Iterate through layers.
repeat (_layer_count)
{
    // Get layer depth.
    _layer_depth = scr_read_bytes(_stream, 4, true);
    
    // If the layer depth matches the desired layer.
    if (_layer_depth == _layer)
    {
        // If the layer uses the sector method, instead of the tile method.
        if (file_bin_read_byte(_stream) == 0)
        {
            // Iterate through rows.
            for (_row = 0; _row < _rows; _row += 1)
            {
                // Iterate through columns.
                for (_column = 0; _column < _columns; _column += 1)
                {
                    // Get source tile id from file.
                    _tile_id = scr_read_bytes(_stream, 2, true);

                    // Calculate tile destination position.
                    _dest_x = _column * _tile_width + _tile_offset_x;
                    _dest_y = _row * _tile_height + _tile_offset_y;

                    // If the tile id is not empty.
                    if (_tile_id != -1)
                    {
                        // Calculate tile source position.
                        _src_x = (_tile_id - (floor(_tile_id / _tile_columns)) * _tile_columns) * _tile_width;
                        _src_y = floor(_tile_id / _tile_columns) * _tile_height;

                        // Adjust with tile offsets and separations.
                        _src_x += (floor(_src_x / _tile_width) * _tile_separation_x) + _tile_offset_x;
                        _src_y += (floor(_src_y / _tile_height) * _tile_separation_y) + _tile_offset_y;
                    
                        // Add tile to room.
                        tile_add(_background, _src_x, _src_y, _tile_width, _tile_height, _dest_x, _dest_y, _layer_depth);
                    }
                }
            }
        }
        else  // Tile mode.
        {
            // The number of tiles in tile mode.
            _tile_count = scr_read_bytes(_stream, 4, true);
        
            // Iterate through tiles.
            repeat (_tile_count)
            {
                // Get source tile id from file.
                _tile_id = scr_read_bytes(_stream, 2, true);
            
                // Read destination position.
                _dest_x = scr_read_bytes(_stream, 4, true);
                _dest_y = scr_read_bytes(_stream, 4, true);
            
                // Calculate tile source position.
                _src_x = (_tile_id - (floor(_tile_id / _tile_columns)) * _tile_columns) * _tile_width;
                _src_y = floor(_tile_id / _tile_columns) * _tile_height;

                // Adjust with tile offsets and separations.
                _src_x += (floor(_src_x / _tile_width) * _tile_separation_x) + _tile_offset_x;
                _src_y += (floor(_src_y / _tile_height) * _tile_separation_y) + _tile_offset_y;
                    
                // Add tile to room.
                tile_add(_background, _src_x, _src_y, _tile_width, _tile_height, _dest_x, _dest_y, _layer_depth);
            }
        }
    }
    else
    {
        // Skip over non-targeted layer data...
        
        // If the layer uses the sector method, instead of the tile method.
        if (file_bin_read_byte(_stream) == 0)
        {
            file_bin_seek(_stream, file_bin_position(_stream) + (_columns * _rows * 2));
        }
        else
        {
            _tile_count = scr_read_bytes(_stream, 4, true);
            file_bin_seek(_stream, file_bin_position(_stream) + (_tile_count * 10));
        }
    }    
}

// Iterate through instances.
repeat (_instance_count)
{
    _object = scr_read_bytes(_stream, 4, true);  // Instance object id.
    _x = scr_read_bytes(_stream, 4, true);       // Horizontal coordinate.
    _y = scr_read_bytes(_stream, 4, true);       // Vertical coordinate.
    _code = scr_read_string(_stream, 4);         // Instance creation code.

    // If the object does not exist.
    if (object_exists(_object) == false)
    {
        // Show error, continue.
        show_message("ERROR: The object with id: " + string(_object) + " does not exist.");
        continue;
    }

    // Create a new instance of the object.
    _inst = instance_create(_x, _y, _object);
    
    // If there is creation code, execute it.
    if (_code != "")
    {
        // A hack to make sure the code executes within the instance.
        // Problem being is this executes after the creation event.
        // Solution is needed to emulate native behavior.
        _code = string_insert("with (_inst) {", _code, 1);
        _code = string_insert("}", _code, string_length(_code));
        execute_string(_code);
    }
}

// Close file stream.
file_bin_close(_stream);

Edited by xfixium, 05 April 2011 - 01:41 AM.

  • 0

#27 Vich

Vich

    GMC Member

  • New Member
  • 29 posts

Posted 05 April 2011 - 02:14 AM

Thanks! It works now!
  • 0

#28 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 12 April 2011 - 03:44 AM

A new version of GMare has been released: http://gmare.codeplex.com/

Main changes:
Added shortcuts, for a more image editor type feel. Hand dragging tool (H). The mouse wheel zooms in and out on point. Color blending and tile flipping. Custom brushes.

Release notes:
- Main interface disables collision options for now
- 'Show instances always' button added
- When in instance editing mode, tiles are drawn darkened
- Most tools now have short-cut keys. Hovering over a button reveals it's shortcut
- The mouse wheel now zooms the room on mouse position
- Tile flipping options and short-cut keys on all tile tools
- Color blend options on all tile tools
- Hold shift and left click to erase tiles now when using brushes
- Set a selection as a brush
- Save a selection as a custom brush
- Brushes editor to rename, move, and delete saved brushes
- Holding the 'H' button now allows for room panning
- GM export tree now includes the main room folder
- GM export tree disables the room name field when overwriting an existing room
- Binary exporter includes scaling and color blend options
- Binary exporter disables collision data for now
- Fixed image exporter

Notes:
Color blending is only available in a pro version of Game Maker. Also, color blending data and scaling
data will not export to a Game Maker project file. The format does not support it.

The gmare_binary_examples.bin file uses color blending. So you will have to comment out the blend color line in the Game Maker project if you don't have a pro version of Game Maker. It is documented in the script: scr_read_tile_attributes.

Edited by xfixium, 12 April 2011 - 03:46 AM.

  • 0

#29 mrpeanut188

mrpeanut188

    GMC Member

  • GMC Member
  • 811 posts
  • Version:GM8

Posted 12 April 2011 - 04:13 AM

A new version of GMare has been released: http://gmare.codeplex.com/

I haven't tried it, but I've seen some videos, and it seems descent.

- The mouse wheel now zooms the room on mouse position

Nice job, it is one of the most common hot keys.
  • 0

#30 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 16 April 2011 - 11:53 PM

I haven't tried it, but I've seen some videos, and it seems descent.


There are videos of GMare? You'll have to put up a link of them. There aren't any that I'm aware of.

Next release:

- Collisions editor will be functional. I'm going to offer 2 options for it. One that is object based, and another that uses lines.
- Make one more tool for painting. A repeating pattern tool.
- Fix a few small errors.

This will mark GMare's first Beta release. Thanks to all that have been interested in it, and have tried it.
  • 0

#31 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 30 April 2011 - 10:42 AM

Ok, like I said earlier, 2 options will be available for collision editing. I will describe the first one at this time:

Simple Object Based Collisions:
This is basically the way that block collisions are commonly done in Game Maker. An object that represents an invisible wall. For most, this method seems wasteful as a room could have hundreds of instances whose only job is to stop another instance from moving through it. In GMare, this is at least made to be easier for simple object based collisions. As there is an editor that works somewhat like RPG Maker. You import objects from your project, and then you place those objects on the desired tiles within the object collision editor. Those tiles will automatically get an instance of that object placed over them. As the WIP image shows:

Posted Image

This could potentially cut down on object based block collision editing.
NOTE: I also have added GM 8.1 support for the next release.

Edited by xfixium, 30 April 2011 - 10:58 AM.

  • 0

#32 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 12 July 2011 - 12:30 AM

Haven't worked on GMare due to personal life issues, but finally an official beta of GMare is being completed.
The new version will contain:

* Support for Game Maker 8.1
* Room creation code now has been added
* The selected instance(s) has been inverted for better selection clarity
* Multi-Instance selection
* Multi-Instance editing
* Simple instance block editor, for faster block placement
* Projects now don't need a tileset image
* Path collisions, and scripts
* Object import swap tool is more robust and helps more visually

The release should come soon. Thank you for the support, and feedback thus far.

Posted Image
Posted Image
Posted Image
  • 0

#33 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1848 posts
  • Version:GM:Studio

Posted 12 July 2011 - 12:34 AM

Awesome. Can't wait ;)
  • 0

#34 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 28 July 2011 - 08:34 AM

A new minor updated release. Mainly in response to a small issue when exporting to a Game Maker project file. I also updated some other things as well.

Download: http://gmare.codeplex.com/

- Fixed an issue on GM room export, with the instances not exporting when a new room was being added to a Game Maker project.
- Added Game Maker 8.1 support.
- Added new instance replace form.
  • 0

#35 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 30 July 2011 - 03:58 PM

Minor update GMare Alpha 3.2:

Download: http://gmare.codeplex.com/

- Fixed the scaling and blending windows that keep appearing, even after the "Do not show me this message in the future" check box has been clicked
- Fixed an issue when updating room properties, instances disappear from the editor
- Added inverted color blending to the selected instance when editing instances, to make it pop out a bit more
  • 0

#36 jobro

jobro

    GMC Member

  • New Member
  • 1247 posts
  • Version:GM8

Posted 30 July 2011 - 07:47 PM

It is a nice tool, I loaded an example to get something to start with, but whenever I use the brush, rectangle, or the fill tool to paint some tiles then nothing shows up. Is it this programs standard to paint below the topmost layer, or is the examples protected somehow? For the time being I'm stuck to GM's on-board room editor, but it is a nice attempt to get some competition going no less.

Edited by jobro, 30 July 2011 - 07:54 PM.

  • 0

#37 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 30 July 2011 - 08:37 PM

Did you select a layer to paint on?

EDIT: Perhaps I should change that. Do something like Game Maker, and change the edit mode based on tab selected.

Edited by xfixium, 30 July 2011 - 08:39 PM.

  • 0

#38 aplus

aplus

    GMC Member

  • New Member
  • 15 posts

Posted 03 August 2011 - 12:20 AM

from the screen shots to the features list this looks real nice , but when i try to start a new project, the green check mark wont light up, i cant create a room to do anything
  • 0

#39 xfixium

xfixium

    GMC Member

  • GMC Member
  • 91 posts

Posted 03 August 2011 - 04:51 AM

Yes, you need to pick an image (Click the picture icon) to use as your tileset, before you can begin editing. This seems to be confusing to more than I would have thought. In the next version you will not be required to do so.

Also new screens, as a new alpha version is almost done:
Posted Image
Posted Image

Edited by xfixium, 03 August 2011 - 04:52 AM.

  • 1

#40 aplus

aplus

    GMC Member

  • New Member
  • 15 posts

Posted 03 August 2011 - 11:42 AM

Yes, you need to pick an image (Click the picture icon) to use as your tileset, before you can begin editing. This seems to be confusing to more than I would have thought. In the next version you will not be required to do so.

Also new screens, as a new alpha version is almost done:
Posted Image
Posted Image


ahh ok, i got it thanks, yeah maybe create the room first then import your tile set, just add a "properties" tab next to "collisions" to tweek the room size, tile size etc., yeah just a suggestion but 9/10
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users