Save-Point
MGC ISO Engine - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: MGC ISO Engine (/thread-9052.html)



MGC ISO Engine - MGC - 06-05-2012

MGC ISO Engine
Version: 1.1



Introduction :

I created a first system to handle an isometric view for RMXP in summer 2006. You had to create two maps : one "classic" and the second "isometric".
This script was then reworked by Siegfried, Gubid (it was integrated in the GTBS) and clarabel.

Later I worked on an improved tile-based isometric engine : the isometric rendering was always in 2D, but this time the game engine handled three dimensions
(objects coordinates were determined by x, y, and h and not only by x and y - Siegfried's heights system doesn't really add a dimension because the altitude is fixed for a given couple (x,y)).
This script was never released.

As now I'm working on a 3D isometric engine, I decided to release the previous engine.
It was designed for RMXP, but I also ported it to RMVX and RMVX Ace.
Some parts of the are very old, so don't be chocked if you're a scripter.

[Image: 2012-03-31_162400.png]


There are an editor and an engine.
The editor is a RM project that you have to put in your main project directory.
You can create isometric maps and then export them in your project (they are added at the bottom of your maps tree), or import isometric maps from your project to do some modifications.
I wanted this editor to be as simple as possible. So no complicating GUI or keyboard input script.
The engine is the script that can load and draw isometric maps, and handle characters movements.
The DLL (MGC_ISO.dll) is here to shorten the loading time of isometric maps.
Once a map is loaded, there is no more DLL call : the performances depend only on the RM engine.


Download :

MGC ISO Engine + Editor VX
MGC ISO Engine + Editor Ace



Limits :

1. isometric maps data are huge compared to normal maps :
there are map_height * map_width * map_max_altitude blocks to store.
For each block the following elements must be saved :
-the shape
-the orientation
-the three textures (top, left, right)
And for each texture data must be saved :
-the first-layer tileset with the tile index (because you can have as many tilesets as you want for a map)
-the mask with the tile index (only tops)
-the second-layer tileset with the tile index (only tops)
Plus the passabilities, scenery, ...
What does it imply ?
It's a problem of loading time. Whereas the engine is able to handle a 100*100 map without a significant loss of framerate, the loading time is really too long, because of the time-consuming drawing of all the blocks.
So the width and heights are limited to 50 tiles.

2. The modifications due to the third dimension prevent this engine from being compatible with most scripts : movements and passabilities algorithms are modified. So don't expect this script to be magically compatible with your favorite TBS.

3. You have to create isometric tilesets and isometric resources are not that common.


Instructions :

You can set an event insensitive to the gravity by adding the comment "Floating" on its page.
In that case you can use the move route commands "incr_h" and "decr_h" to increase or decrease its altitude.

The initial altitude of an event can be set by adding the comment "Altitude X" on its page (X in blocks, not in pixels).

Events graphics are drawn on the center of their tiles, as if they were vertical. To simulate a "flat" event, adding the comment "Ground" on its page.

You can use the comment "Shadow" to add a 1-tile large shadow to your events (useful for moving platforms).

You can't move if there is an obstable in front of you. However, if it's a small obstacle (1 block in height) and you don't carry another character on your top, you can jump by pressing the [A] key.
If you carry a character on your top, you can put it down with the [A] key.
If you want an event to be able to do these jumps, add a "Jumper" comment on its page.


MGC ISO Editor Instructions


Using the MGC_ISO_Editor in a RM project :

The "MGC_ISO_Editor" folder must be placed at the root of your RM project that contains the MGC_ISO_Engine script.

[Image: MGC_ISO_Editor_01.png]

You can remove it before publishing your game.


Adding resources :

Five different types of textures sets are used by the editor to render an isometric map. Unless it is explicitly specified, all the following sets must have a width of 128 pixels.

>> Tilesets : named "TilesetXX" where XX represents two digits from 00 to 99, they contain tiles that are used to render the ground, or more precisely tops of blocks. They are placed in the "\Graphics\MGC_ISO_Tilesets" directory. Tiles are rectangles (dimensions : 64 * 32 px²) that must be arranged this way :
[Image: MGC_ISO_Editor_02.png]

Each tile has an index depending on its position in the set and this index can be used to make animated tiles and/or to define larger patterns by adding a subfile named "TilesetXX_YYY", where YYY represents the index in a 3-digits format.

>>> Larger patterns : they are a representation of multiple consecutive isometric tiles, forming a square in a normal view (dimensions of the subfile : width = 2 * height). It is mainly used to avoid patterns repetitions.

Example :
With the following tileset named "Tileset03" :
[Image: MGC_ISO_Editor_03.png]

If no file named "Tileset03_001" can be found in the same folder, when this texture is applied on the map ground, the result is :
[Image: MGC_ISO_Editor_04.png]

If there is the following file named "Tileset03_001" in the folder :
[Image: MGC_ISO_Editor_05.png]

the result is different :
[Image: MGC_ISO_Editor_06.png]
The larger pattern is drawn and repeated instead of the single tile.

>>> Animated tiles : exclusively in a 4-patterns animation format, the patterns must be concatenated this way in the subfile :

[Image: MGC_ISO_Editor_07.png]

A combination of larger patterns with animated tiles is also possible (width = 4 * 2 * height).

To summarize : for each tile from a tileset that must be drawn, if a subfile exists, the latter is used. Otherwise the graphics that appear in the set are used.

>> Left wallsets : named "Wallset_LeftXX", they are used to drawn the left sides of blocks. They are found in the "\Graphics\MGC_ISO_Wallsets" directory. Tiles are 32 * 32 px² squares, arranged this way :
[Image: MGC_ISO_Editor_08.png]

Similarly to tilesets, larger patterns can be defined. It must be the concatenation of n tiles in width, and 2 * n tiles in height.

Example : a 4 * 8 tiles² file :
[Image: MGC_ISO_Editor_09.png]

There is no animation for walls.

>> Right wallsets : named "Wallset_RightXX" and also placed in the "\Graphics\MGC_ISO_Wallsets" directory, they are used to drawn the right sides of blocks. They are similar to left wallsets.

>> Masksets : named "MasksetXX", they are placed in the "\Graphics\MGC_ISO_Masksets" directory. Masks are used to combine two ground tiles into one, mainly to create smoother transitions between two different terrains. They are also used to create autotiles. They are represented by bicolour ground tiles (black & white).

>>> Simple masks : black pixels correspond to the first ground layer, whereas white pixels correspond to the second layer. Simple masks work similarly to ground tiles, larger patterns and/or animated tiles can be associated via subfiles.

>>> Autotiles masks : they must be declared by adding a subfile named "MasksetXX_YYY_Auto". Like simple masks, black and white pixels correspond respectively to the first and the second layer. The subfile has a special format :
[Image: MGC_ISO_Editor_10.png]

Animated autotiles are also possible, by concatenating the patterns in the subfile.

When creating a tile via a mask, if several elements are animated (first layer / second layer / mask), the final number of animations is determined by the smaller number of animations found.

>> Scenerysets : named "ScenerysetXX_Z", where Z is "l" or "s", they are placed in the "\Graphics\MGC_ISO_Scenerysets" directory. They are used to draw scenery elements.
The patterns have a height of 80 pixels (Z = "l") or 48 pixels (Z = "s").
[Image: MGC_ISO_Editor_11.png]

Animated scenery elements can be created via subfiles named "ScenerysetXX_Z_YYY".

Editor :

Maps created with the editor do not appear in the parent project unless they are exported. The editor has its own internal save system. That means that you can move the editor's folder from a project to another, keeping saved maps in the editor.

Main Menu :
[Image: MGC_ISO_Editor_12.png]

>> New map : create a new isometric map. That will not generate files unless you save it.

>> Load map : load a saved map in the editor.

>> Import map : scan the parent project and allow you to import an isometric map in the editor. The map in your parent project will not be altered unless you export and overwrite it.

>> Export map : export an isometric map to the parent project.

>> Delete map : delete maps that are saved in the editor.

>> Iso Converter : launch a tool that converts resources in a isometric view.

New map :
[Image: MGC_ISO_Editor_13.png]

>> Type : only two types are available in version 1 : a classic isometric view, and an hybrid view that presents isometric tiles in a rectangular screen.
[Image: MGC_ISO_Editor_14.png]

Maps of the second types have border tiles that are not really "in map" : they are not passable, and you have limited actions on these tiles (elevate / lower ground, apply texture, add scenery element).

>> Dimensions : the width and the height of the map are limited to 50 tiles, mainly to prevent long loading times. The altitude is limited to 24 blocks, and is not fixed at the creation of the map. It will be determined when saving or exporting the map by finding the highest block.

>> "Void" : this feature adds a sub-zero altitude (-8 blocks) to the map, non passable by default, mainly used to create abyssal gaps.
[Image: MGC_ISO_Editor_15.png]

Load map :
[Image: MGC_ISO_Editor_16.png]

Select the saved map that you want to load, and then accept to launch the map edition view.

Import map :
[Image: MGC_ISO_Editor_17.png]

Select the isometric map in the parent project that you want to load and accept to launch the map edition view. The map name will be the kept.

Export map :
[Image: MGC_ISO_Editor_18.png]

Select the saved that you want to export to the parent project and accept to begin the exportation.
If there is already an isometric map in the parent project that has the same name as the one you want to export, you will be asked if you want to overwrite it or to create a new map.
All the sets that are used in the map will be copied in the parent project graphics folder.

Warning : the parent project must be closed when exporting maps.
In your project editor, the map heights will be displayed using :
- RMXP : tileset id = 51
- RMVX : tileE
- RMVXA : tileE of tileset id = 5

Delete map :
[Image: MGC_ISO_Editor_19.png]

Select the saved map that you want to delete, and then accept to delete all the files describing the map. The latter will not appear any more in the editor.

Isometric converter :

Two folders can be found in the "Iso Converter" directory : "input" and "ouput". Place your source files in the "input" folder. Isometric resources created with this tool will be placed in the "output" folder.
[Image: MGC_ISO_Editor_20.png]


Map Edition :

[Image: MGC_ISO_Editor_21.png]

1. Editor information window : map name, selected modes, cursor coordinates and selected textures.
2. Textures window : select the textures that you want to apply.
3. Menu window: select the editor mode or save the map.
4. Additional information window : depending on the current mode, information may appear here.

Commands :

A : call the textures window.
B : call the menu.
C : launch the action corresponding to the current mode. Keep pressing the C button while moving to launch consecutive actions
Down/Left/Right/Up : move the cursor in the horizontal plane.
L/R : change the altitude of the cursor.

Additional commands for X, Y, Z, depending on the current mode, will be displayed in the additional information window.

You can press F5, F6, F7 or F8 to shift quickly between the modes, without calling the menu.

If you press F9 the map visualization will change into cut mode (in X or Y). This feature is not accessible via the menu (because I don't really know where to put it).
[Image: MGC_ISO_Editor_22.png]

Textures window :

Called by the A command, it allows you to select the current textures that will be applied.
A/B :close the window.
C : select the textures at the cursor position.
L/R : switch between the sets of the current type.
X/Y : switch between the types of sets : ground, left wall, right wall, and - if the mask switch is on - second layer, mask.

The scenerysets are only available in the scenery mode.

Menu :

Heights mode :
Allow you to shape the map.

>> Add block : add a block at the cursor coordinates, applying current textures. Press X to change the block type, and Y or Z to rotate it.

>> Delete block : delete the block at the cursor coordinates.

>> Elevate ground : elevate the ground at the cursor position by adding a block, using the textures of the block below. In this mode the cursor is not floating : you can press L/R to switch between available altitudes.
If the "void" is enabled for the map, you can fill it with this command.

>> Lower ground : lower the ground at the cursor position by deleting a block.
If the "void" is enabled for the map, you can create gaps with this command.


Textures mode :
Apply textures on the map.

>> Set : apply the currently selected texture on a block face (top, left, right). When applying "ground" textures, the cursor is not floating. You can press L/R to switch between available altitudes.

>> Fill : apply the currently selected "ground" texture on consecutive blocks at the same altitude and with the same texture.

>> Fill (level) : apply the currently selected "ground" texture on consecutive blocks at the same altitude, with the same texture or not.


Passabilities mode :
Allow you to change the passabilities of the map tiles. Passabilities are automatically adjusted when blocks are added or deleted, so this mode is mainly used to set the passabilities for scenery elements.

>> Set passability : add a passability tile at the cursor coordinated, which will determine the passages in the four directions.
X : visualize the textured map. No action can be performed in this mode. Press X to return to the normal mode.
Y : rotate the passability tile.
Z : change the type of the passability tile.

>> Remove passability : remove the passability tile at the cursor coordinates. The tile became passable.

>> Reinitialize : reinitialize the passabilities by taking automatic values.


Scenery mode :

>> Add : add the selected scenery element at the cursor coordinates. To select a scenery element you have to call the textures window via the A button.
X : change the opacity.
Y : change the blend type.
Z : activate or deactivate an horizontal mirror.

>> Delete : delete all the scenery elements at the cursor coordinates.

>> Delete all : delete all the scenery elements of the map.


Events mode :
Allow you to move events created beforehand with the RM editor.

>> Move : a first call to C select the event at the cursor coordinates. Then you can move the event and release it with a new call to [C]. Unless an event is selected, you can switch between events thanks to the directional commands.


Mask mode :

>> Enable/Disable : activate or deactivate the mask for tiles drawing.


System :
Save the map, or adjust technical parameters.

>> Parameters : all the parameters but language are saved with the map, and so affect the display in the parent project when exported. The selected language affects only the editor.

>>> Language : choose the language for labels in the editor.

>>> Automatic borders : choose the automatic borders style.

>>> Automatic shadows : enable or disable automatic shadows for blocks that have another block above.

>>> Patterns offsets : affect the origin of the graphics drawing.
[Image: MGC_ISO_Editor_23.png]

>> Save the map : save the map in the editor. If the map was not already saved, this command works like "Save as a new map".

>> Save as a new map : save the map as a new map in the editor. A new arbitrary technical name is given to the map. It is also an easy way to copy maps.

>> Save a picture : create a .PNG file representing the whole map, and place it in the "/Pictures" folder.
This may be a help to create maps usable with the 6-years old isometric script (that can be found in the GTBS).

>> Back to title : back to the initial menu. All unsaved changes will be lost.