Welcome to the Shining Force Central Forums!
SFC Forums Index Shining Forums Shining Force II
Register for your free forum account now or Login to remove this advert.

SF2 Disassembly Tool Suite

General thread for quick links, status reports and support

Discussion about this classic Genesis/Mega Drive game.

Re: SF2 Disassembly Tool Suite

Postby Wiz » Mon Jun 03 2019 10:10pm

Hey RockyGateway,
I have finally been able to provide a solution for your needs (to display all animation frames of a map).

First I took the occasion to re-work the way map data was formatted, and this is what took me quite some time :
Most of map data is now formatted into ASM files for better editability, with the exception of compressed data, naturally (blockset and layout).

Tools have been updated to take the new ASM format into account as the new default format.
I insist on the "default" format :
Previous BIN format still is supported, and anybody can import their work on BIN files to export them into ASM files and go on with this new format.

Now for the animation data :
If you update you SF2DISASM workdir you'll find a new tool :
disasm\data\maps\SF2MapAnimationEditor-1.0.0.jar
This tool is a stripped-down fork of SF2MapEditor with a specific way to load map data, in order to generate images for each animation frame.
Now you can select a frame in the animation table to display it, and then export it into PNG format.

Theoretically you should also be able to edit data from this editor and see the result on the map in real time, but at the moment this is a real mess : too many use cases not properly taken into account, and I won't spend much more time on it for now. Use it at your own risk ! :shifty:
So my advice is to edit the animation data ASM file from a text editor, and then reload it in SF2MapAnimationEditor whenever you need to see the result.

Hope that will be OK for your needs.

I'll continue working on map-related tooling next I think, most probably an attempt to generate map layouts, blockets and tilesets from a simple image ... but I'm still not sure of the feasibilite, we'll see. ;)


Jordanelias, I'm sorry about not being able to help you, as I've never really made such modifications in the game engine myself. Also, I must say I don't get the assembling error ... maybe you should declare the SPELL_WEAKEN constant in sf2enums.asm first ?

In any case, hopefully more map-related news soon !
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 167
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France

Re: SF2 Disassembly Tool Suite

Postby RockyGateway » Sun Jun 09 2019 8:17am

Hey, thanks a lot for the effort. I'll give it a try sometime soon.
RockyGateway

Newbie
Newbie
 
Posts: 2
Joined: Fri Jan 31 2014 2:12am

Re: SF2 Disassembly Tool Suite

Postby Wiz » Thu Jun 27 2019 3:04pm

Great news, I am very proud to say that generating a new map from an image file now works indeed ! :)

The new tool, SF2MapCreator, opens new possibilities, but it still has quite precise requirements in terms of input image properties :
- Supported formats : PNG, GIF
- Dimensions : 1536px*1536px (64 blocks of 24 pixels each)
- Colors : 16-indexed color mode, with transparency at index 0
- Even though index 0 is transparent, it has to have a distinct color value.
EDIT :
Now managing palettes with more flexibility, with the ability to import a specific target palette file, and the ability to manage transparency color when not at index 0.

Once an image is properly imported, SF2MapCreator will generate the layout file along with the needed blocksets and tilesets.
The 5 map tilesets can be any combination of either existing ones or new ones, in order to optimize space by re-using common tiles.
Note : the data generation step is quite heavy and can take a few minutes to process :(

I've updated SF2MapEditor to be able to export both blockset and map layout image files.
This way, you can directly work from existing maps with proper color modes, either by drawing on them, or by importing the blockset into your prefered tile-base map creation software. (I highly suggest Tiled ! ;))
The export features also export two metadata files :
- Map layout flags : exploration/interaction flags.
- High priority tiles : which tiles should be displayed over mapsprites (trees, roofs etc.)
Both can be re-imported into SF2MapCreator if needed, but they are optional.

Examples :

- Exporting Granseal town and just drawing on it from GIMP. (click on image to display it with more details)
Image
After editing the image, GIMP exported it with transparency color reset at value $000000 though, so I had to fix that with another program (XnView).
I've kept map 3 tileset 0 and 4, and let SF2MapCreator put the other needed tiles into tilesets 1-2-3.
You can notice the resulting tilesets do not use the full 5 tileset space available, so there is still potential for more specific graphics here if needed.

- Importing an SF1 map.
Image
The only SF1 map rips I could find were on vgmaps.com and gamefaqs.com, and they all have mapsprites and other graphics on them, so this is not really practical.
I imported the image as a tileset into Tiled, and then reworked the map a bit to roughly overwrite non-map graphics with proper map blocks instead.
Then I used an existing SF2 map layout image file (with a properly organized 16-color palette) as the base in GIMP, then I removed the existing graphics and pasted the graphics from the Tiled map : GIMP does the job of re-assigning pixels to the nearest color in the available palette.
(once again I had to fix the transparency color value outside of GIMP)
Of course the palette colors could have been changed to match those of the original map ! I was just lazy and well, I enjoy the result anyway. Look at that blue sky :shifty:

So these two examples show new ways of editing existing maps and creating whole new maps.

However this is not the end of my work on this, as I'm only discovering the potential of Tiled, a tile-based map editor which has really powerful tools to make the map creation process as enjoyable as possible.
Most notably, rules can be declared to automatically set the proper tiles/blocks when the adequate pattern is recognized : border/corner tiles can be automatically assigned, making everything a lot easier.
More info here :
http://doc.mapeditor.org/en/stable/manu ... ight=rules
I'll see what I can do to provide some kind of base meta-blockset along with the appropriate rules, for everybody to enjoy easy map making ! :)

EDIT :
More recent attempt with a screenshot from SF1Editor's battle editor, it works very well !
Image
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 167
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France

Previous

Return to Shining Force II

Who is online

Users viewing this topic: No registered users and 1 guest