smf_tools, alpha work
Moderator: Moderators
smf_tools, alpha work
I've reached a sort of milestone with my work on a new smf/smt converter
https://github.com/enetheru/smf_tools
smt_convert is now usable, definitely a few bugs to iron out still but it should be easier(not necessarily faster) to create smt files from images, and image sequences.
basic usage would be
smt_convert --smt image[file/sequence]
smt_convert --smt --imagesize 8192x9182 image[file/sequence]
https://github.com/enetheru/smf_tools
smt_convert is now usable, definitely a few bugs to iron out still but it should be easier(not necessarily faster) to create smt files from images, and image sequences.
basic usage would be
smt_convert --smt image[file/sequence]
smt_convert --smt --imagesize 8192x9182 image[file/sequence]
Re: smf_tools, alpha work
0_0 a wild megaproject appears
I'll give this some testing once i gather enough willpower to continue Coagulation (which needs ssmf and features).
I'll give this some testing once i gather enough willpower to continue Coagulation (which needs ssmf and features).
Re: smf_tools, alpha work
I've compiled it using Ubuntu's stock libimageio (which is 1.3) and i suspect it's possibly insufficient:
That 0x0 looks pretty suspicious.
Anyway it's still siting there eating 100% of a single core and some 20% of my memory, so i assume something will eventually result. An .smt file of size 32b was created, i assume there's no smd and heightmaps are something for the future.
Code: Select all
anarchid@wormbox:~/.spring/maps/coagulation.sdd/maps$ ~/Programs/smf_tools/src/smt_convert --verbose --force --smt map_final.png
[INFO] /home/anarchid/Programs/smf_tools/src/smt.cpp(62): Resetting output.smt
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(184): adding map_final.png to tilecache.
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(187): 1 tiles in cache
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(204): no filter specified, using all tiles
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(235): tilemap generated
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(245):
Source Tiled Image:
Full size: 7168x7168
Tile size: 7168x7168
TileMap size: 1x1
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(277):
Output Sizes:
Full Size: 7168x7168
Tile Size: 7168x7168
tileMap Size: 1x1
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(285): Scale Ratio: 1x1
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(289): Pre-scaled tile: 7168x7168
[INFO] /home/anarchid/Programs/smf_tools/src/smt.cpp(62): Resetting output.smt
[INFO] /home/anarchid/Programs/smf_tools/src/smt_convert.cpp(303): Processing split (0, 0)
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(107): source window (0, 0)->(7168, 7168)
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(114): source window (0, 0)->(7168, 7168)
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(126): Point of interest (0, 0)
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(144): copy window (0, 0)->(7168, 7168)
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(150): copy window size 7168x7168
[INFO] /home/anarchid/Programs/smf_tools/src/tiledimage.cpp(155): Paste Window: 0x0
Anyway it's still siting there eating 100% of a single core and some 20% of my memory, so i assume something will eventually result. An .smt file of size 32b was created, i assume there's no smd and heightmaps are something for the future.
Re: smf_tools, alpha work
haha, hilarious, it creating an smt file that has a single tile which is sie 7168x7168, so basically all that cpy is compressing to dxt.. will probably crash
it will take the resolution of the first image supplied as the tilesize unless you specify it.
smt_convert -vf --tilesize 32x32 --smt map_final.png
it will take the resolution of the first image supplied as the tilesize unless you specify it.
smt_convert -vf --tilesize 32x32 --smt map_final.png
Re: smf_tools, alpha work
also specify -DCMAKE_BUILE_TYPE:STRING=Release
on your cmake command line to reduce the verboseity of the output, it will give you a pretty progress bar too :)
on your cmake command line to reduce the verboseity of the output, it will give you a pretty progress bar too :)
Re: smf_tools, alpha work
EDIT: fixed the slowness, should be faster with large images now than it is with lots of smaller ones!:wqa
aaand it doesnt like super large images at the moment, you will get faster results from a series of smaller ones.
easy to convert between them
smt_convert -vf --img --tilesize 1024x1024 big_img.jpg
smt_convert -vf --smt --tilesize 32x32 output_*.jpg
I will find a way to reduce the pain of large images since it shouldnt be taking so long.
aaand it doesnt like super large images at the moment, you will get faster results from a series of smaller ones.
easy to convert between them
smt_convert -vf --img --tilesize 1024x1024 big_img.jpg
smt_convert -vf --smt --tilesize 32x32 output_*.jpg
I will find a way to reduce the pain of large images since it shouldnt be taking so long.
Re: smf_tools, alpha work
Eventually it said this and quit:
So i guess that's the progress bar.
I actually specified --verbose intentionally so possibly this was not due to build type.
I'll try updated one later today, possibly with a mosaic.
Code: Select all
---------------[01:41][0%]
I actually specified --verbose intentionally so possibly this was not due to build type.
I'll try updated one later today, possibly with a mosaic.
Re: smf_tools, alpha work
YEAH The Debug output overwrites the progress bar.Anarchid wrote:Eventually it said this and quit:So i guess that's the progress bar.Code: Select all
---------------[01:41][0%]
I actually specified --verbose intentionally so possibly this was not due to build type.
I'll try updated one later today, possibly with a mosaic.
Re: smf_tools, alpha work
Oh, also output.smt is 32 mb, which is on par with what's expected. So i guess it actually did work.
How should i actually test it? Compile smf with mapconvNG and replace only the smt part?
How should i actually test it? Compile smf with mapconvNG and replace only the smt part?
Re: smf_tools, alpha work
So smt_convert actually creats two files. smt and csv. the csv is added to an smf as a map to know which tiles to place where.Anarchid wrote:Oh, also output.smt is 32 mb, which is on par with what's expected. So i guess it actually did work.
How should i actually test it? Compile smf with mapconvNG and replace only the smt part?
this is how the structure of the two files are linked.
you could rename the output.smt to something an existing map already uses just be careful of tilenumbers or spring will crash(something I want to fix).
smt_info and smf_info to check details of each file.
Re: smf_tools, alpha work
Once you get a handle of how the files work together in spring you realise that the smf file shouldnt even exist. the entire thing could be defined as separate images and some mapinfo.lua. but thats another job which i will be working on later.
Basically the only file I want to be forced to generate is the tiles.smt file and everything else is regular images and text files.
Maybe... eventually even the tiles.smt files we wont need to generate..but thats for later too.
Basically the only file I want to be forced to generate is the tiles.smt file and everything else is regular images and text files.
Maybe... eventually even the tiles.smt files we wont need to generate..but thats for later too.
Re: smf_tools, alpha work
Does that mean i can/should open the .smf in a text editor and append the csv?So smt_convert actually creats two files. smt and csv. the csv is added to an smf as a map to know which tiles to place where.
Re: smf_tools, alpha work
oh dear no.Anarchid wrote:Does that mean i can/should open the .smf in a text editor and append the csv?So smt_convert actually creats two files. smt and csv. the csv is added to an smf as a map to know which tiles to place where.
I'll describe in more details what i mean.
you want to test that your smt file works. without having to generate an accompanying smf.
get an existing map and run: smf_info existimgmap.smf
it will output what smt files it references, and how many tiles it expects.
hopefully your new smt has more tiles, check it with: smt_info newsmt.smt
ok so to test. rename the new smt to the same name as one that the smf references.
and load the map as normal, you will see texture but the tile ordering will be weird.
the smt is functional..
to test for real you need to generate an smf file using both the smt and outut.csv as inputs with smf_cc
Re: smf_tools, alpha work
these tools are pretty raw at the moment. they are quite generic and functional.
order should generally be
1. generate smt and csv using smt_conv and some input images(diffuse textures)
2. generate smf using output from smt_convert and remaining images(height, type, grass, etc)
order should generally be
1. generate smt and csv using smt_conv and some input images(diffuse textures)
2. generate smf using output from smt_convert and remaining images(height, type, grass, etc)
Re: smf_tools, alpha work
Aha! So i can basically approximate the old mapconv's one-executable behaviour by chaining these with a shell script.to test for real you need to generate an smf file using both the smt and outut.csv as inputs with smf_cc
Can i do heightmap in any way yet?
Re: smf_tools, alpha work
the height map is a part of the SMF file.Anarchid wrote:Aha! So i can basically approximate the old mapconv's one-executable behaviour by chaining these with a shell script.to test for real you need to generate an smf file using both the smt and outut.csv as inputs with smf_cc
Can i do heightmap in any way yet?
you might want to read up on the structures of the two files
http://springrts.com/wiki/Mapdev:SMT_format
http://springrts.com/wiki/Mapdev:SMF_format
the SMT only houses the diffuse tiles that make up the diffuse shading part of the terrain
height, type, grass, minimap, metal, and tilemap exist in the SMF file
features technically were included in the SMF too but thes days are placed using lua.
the tilemap defines what tiles from the smt's go in what place on the terrain. i like to export it as a csv as it makes the most sense to me.
I also hope to support this program somewhat: http://www.mapeditor.org/
Most people really cannot visualise the true power of the tile based map format, and I hope to expose it with my work. Imagine a mixure of starcraft editor and terrain sculpture
Re: smf_tools, alpha work
Ok i just realized i was merely being stupid.
I'm all set for a more proper try
I'm all set for a more proper try
Inb4 devolves into geometry cliff discussionImagine a mixure of starcraft editor and terrain sculpture
Re: smf_tools, alpha work
just a heads up, there is a bug im working on atm where the csv is not imported properly with smf_cc making the tilemap all zeroes.. i'm working on it now. edit this post when its fixed
EDIT: fixed, as usual something ultra simple
EDIT: fixed, as usual something ultra simple
Re: smf_tools, alpha work
just a heads up i successfully can compile an smt and smf file and load the game on my system.. so far its "works for me"
i would however like to get a report of it working for other people too.
here's the simplest structure to test a map with
map.sdd
- maps
-- mapdesc.smd
-- mapfile.smf
-- tilefile.smt
i know i know... smd.. lol but it works for testing this type of thing.
i would however like to get a report of it working for other people too.
here's the simplest structure to test a map with
map.sdd
- maps
-- mapdesc.smd
-- mapfile.smf
-- tilefile.smt
i know i know... smd.. lol but it works for testing this type of thing.