smf_tools, alpha work

smf_tools, alpha work

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

smf_tools, alpha work

Post by enetheru »

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]
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

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).
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

thanks Anarchid :)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

I've compiled it using Ubuntu's stock libimageio (which is 1.3) and i suspect it's possibly insufficient:

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
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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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 :)
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

Eventually it said this and quit:

Code: Select all

---------------[01:41][0%]
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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

Anarchid wrote:Eventually it said this and quit:

Code: Select all

---------------[01:41][0%]
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.
YEAH The Debug output overwrites the progress bar.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

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?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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?
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.

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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

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.
Does that mean i can/should open the .smf in a text editor and append the csv?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

Anarchid wrote:
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.
Does that mean i can/should open the .smf in a text editor and append the csv?
oh dear no.

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
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

to test for real you need to generate an smf file using both the smt and outut.csv as inputs with smf_cc
Aha! So i can basically approximate the old mapconv's one-executable behaviour by chaining these with a shell script.

Can i do heightmap in any way yet?
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

Anarchid wrote:
to test for real you need to generate an smf file using both the smt and outut.csv as inputs with smf_cc
Aha! So i can basically approximate the old mapconv's one-executable behaviour by chaining these with a shell script.

Can i do heightmap in any way yet?
the height map is a part of the SMF file.

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
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: smf_tools, alpha work

Post by Anarchid »

Ok i just realized i was merely being stupid.

I'm all set for a more proper try :P
Imagine a mixure of starcraft editor and terrain sculpture
Inb4 devolves into geometry cliff discussion
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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 :|
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: smf_tools, alpha work

Post by enetheru »

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.
Post Reply

Return to “Map Creation”