Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Tile Extraction and Mapping Utility

This thread is locked; no one can reply to it. rss feed Print
Tile Extraction and Mapping Utility
Neil Walker
Member #210
April 2000
avatar

Hello,
Not the most dynamic and exciting of releases, but it does a worthy job ;)

Tile Extracter's purpose is to take a map of game, extract the unique tiles and give it to you in numerous formats for using in a game or just simply to see the tile graphics in the game.

The extracted graphics are stored in both individual bitmap files and a sheet graphic file. They can also be resized during the extraction (e.g. for using as placeholders for a remake of an old game). The map is saved as both a csv file and a byte based file. The byte file can be imported with the sheet file into Mappy Editor to produce a full map of the game.

Link:
http://retrospec.sgn.net/game-overview.php?link=tiler

Screenies:

{"name":"tiler.f.screen1.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/3\/a34f1258b3ccadf26b96b56132bca3ed.gif","w":646,"h":512,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/3\/a34f1258b3ccadf26b96b56132bca3ed"}tiler.f.screen1.gif

{"name":"tiler.f.screen2.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/d\/cdbfbc948331d4db2a472b65a48782a1.gif","w":646,"h":512,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/d\/cdbfbc948331d4db2a472b65a48782a1"}tiler.f.screen2.gif

You can download the full version which includes a windows binary and msvc/devcpp/mingw library files or the source code only version with various make files.

It also includes a map of a great old game for the ZX-Spectrum called Marauder (a top down shooter)

The external libraries tinyxml and Adime are required. The source for tinyxml is also supplied. Adime has instructions for downloading and building.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Kikaru
Member #7,616
August 2006
avatar

Wow... :o

This is a really neat program! Could be very useful

Richard Phipps
Member #1,632
November 2001
avatar

Neil Walker
Member #210
April 2000
avatar

Well, attached is something that took about a minute. Can you guess ;)

The bitmap is a sheet graphic and the fmp is a map file for Mappy if you have it.

[edit]Hey rich, do you always post at the same second as me ;)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Richard Phipps
Member #1,632
November 2001
avatar

OICW
Member #4,069
November 2003
avatar

Just one question. From which map formats can it rip/extract tiles?

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Neil Walker
Member #210
April 2000
avatar

if you mean the input file - .bmp I didn't want to overload the program with too many external libraries. If you mean the export, a csv and a byte based format.

there's actually a bug somewhere, it's definitely not my code, it seems as if it's my bitmap<>bitmap comparison - I'm looping the pixels of tiles and using _getpixel.

Actually, If you check out my attached mario fmp (if you have mappy) against the gif, you'll see that a few tiles are being missed but I don't think it's my code, there's a pattern to the errors but I can't see it. They are all those that don't follow the pattern of the other tiles, e.g. do not have adjacent edges to other tiles with different colour pixel edges. You can see this in the mappy file (.fmp) - the flag at the end of mario has the middle tile missing, as does the green circle beside it and some of the gumbas that are only in the map because of the screen grabbing. Very strange.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Makefile doesn't work in Linux. After editing it and fixing the obvious Windowsisms I get this:

g++ -c src/tile_extracter/extract_program.cpp -o obj/extract_program.o
src/tile_extracter/../axl/axl_animations.h:231: error: extra qualification ‘AXL_Projects::AnimationLibrary::’ on member ‘LogEntry’
src/tile_extracter/../axl/axl_animations.h:238: error: extra qualification ‘AXL_Projects::AnimationLibrary::’ on member ‘GetLoopTypeFromChar’
src/tile_extracter/extract_program.cpp: In function ‘bool ProgramLogic():
src/tile_extracter/extract_program.cpp:165: warning: passing ‘doublefor argument 1 to ‘BITMAP* create_bitmap(int, int)’
src/tile_extracter/extract_program.cpp:165: warning: passing ‘doublefor argument 2 to ‘BITMAP* create_bitmap(int, int)’
make: *** [obj/extract_program.o] Error 1

After fixing the errors and creating the obj directory, it compiled. I also had to add the included TinyXml source files to the makefile and remove the reference to -ltinyxml.

Surprisingly the program actually runs. I'll read the documentation to figure out how it is used.

Btw, here's the makefile that eventually worked for me:

1# Project: TileExtracter
2# Makefile created by Dev-C++ 4.9.9.2, edited by miran
3 
4CPP = g++
5CC = gcc
6OBJ = obj/extract_program.o obj/extract.o obj/extract_menu.o obj/axl_animations.o obj/axl_config.o obj/axl_framework.o obj/tinystr.o obj/tinyxml.o obj/tinyxmlerror.o obj/tinyxmlparser.o
7LINKOBJ = obj/extract_program.o obj/extract.o obj/extract_menu.o obj/axl_animations.o obj/axl_config.o obj/axl_framework.o obj/tinystr.o obj/tinyxml.o obj/tinyxmlerror.o obj/tinyxmlparser.o
8LIBS = -ladime `allegro-config --libs`
9INCS =
10CXXINCS =
11BIN = bin/TileExtracter.exe
12CXXFLAGS = $(CXXINCS)
13CFLAGS = $(INCS)
14RM = rm -f
15 
16.PHONY: all all-before all-after clean clean-custom
17 
18all: all-before $(BIN) all-after
19 
20 
21clean: clean-custom
22 ${RM} $(OBJ) $(BIN)
23 
24$(BIN): $(OBJ)
25 $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
26 
27obj/extract_program.o: src/tile_extracter/extract_program.cpp
28 $(CPP) -c src/tile_extracter/extract_program.cpp -o obj/extract_program.o $(CXXFLAGS)
29 
30obj/extract.o: src/tile_extracter/extract.cpp
31 $(CPP) -c src/tile_extracter/extract.cpp -o obj/extract.o $(CXXFLAGS)
32 
33obj/extract_menu.o: src/tile_extracter/extract_menu.cpp
34 $(CPP) -c src/tile_extracter/extract_menu.cpp -o obj/extract_menu.o $(CXXFLAGS)
35 
36obj/axl_animations.o: src/axl/axl_animations.cpp
37 $(CPP) -c src/axl/axl_animations.cpp -o obj/axl_animations.o $(CXXFLAGS)
38 
39obj/axl_config.o: src/axl/axl_config.cpp
40 $(CPP) -c src/axl/axl_config.cpp -o obj/axl_config.o $(CXXFLAGS)
41 
42obj/axl_framework.o: src/axl/axl_framework.cpp
43 $(CPP) -c src/axl/axl_framework.cpp -o obj/axl_framework.o $(CXXFLAGS)
44 
45obj/tinystr.o: src/tinyxml/tinystr.cpp
46 $(CPP) -c src/tinyxml/tinystr.cpp -o obj/tinystr.o $(CXXFLAGS)
47 
48obj/tinyxml.o: src/tinyxml/tinyxml.cpp
49 $(CPP) -c src/tinyxml/tinyxml.cpp -o obj/tinyxml.o $(CXXFLAGS)
50 
51obj/tinyxmlerror.o: src/tinyxml/tinyxmlerror.cpp
52 $(CPP) -c src/tinyxml/tinyxmlerror.cpp -o obj/tinyxmlerror.o $(CXXFLAGS)
53 
54obj/tinyxmlparser.o: src/tinyxml/tinyxmlparser.cpp
55 $(CPP) -c src/tinyxml/tinyxmlparser.cpp -o obj/tinyxmlparser.o $(CXXFLAGS)

Note though that this is not the right way to write makefiles...

--
sig used to be here

Neil Walker
Member #210
April 2000
avatar

Thanks.

I have absolutely no idea how to create make files, the one I supplied came directly from Dev-CPP and I mentioned in the readme that it needs changing :) I'll try it out on mingw and see if it works.

Quote:

fixing errors

Was the solution simply to remove AXL_Projects:: ? I suspect this was a throwback to an earlier bug with namespaces. I can then update the files. Though oddly this compiles with mingw

Quote:

Surprisingly the program actually runs.

Glad you have confidence in me ;) in a post above I posted a mario world 1. Try that out and set the tile size to be 8.

Quote:

and creating the obj directoryp

Sorry, I'm that used to ide's creating the directories for me...

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Quote:

and I mentioned in the readme that it needs changing

Yeah, I noticed that 2 minutes ago when I read the readme. :P

Quote:

I'll try it out on mingw and see if it works.

It most certainly won't. Usually you need to put some if/else clauses in the makefile to make it work on different systems.

Quote:

Was the solution simply to remove AXL_Projects:: ?

Yes.

--
sig used to be here

Neil Walker
Member #210
April 2000
avatar

Miran,
Did you by any chance download my previous version of AXL? I've just checked the download file and that line of code has already been changed, i.e. it doesn't exist in the download!

As for the makefile, that's fine. The makefile I supplied works with mingw so I can simply ship both. btw, how do you get make to recognise a file other than 'makefile'. When I was first creating them I called it 'makefile.win' but typing 'make makefile.win' came back with 'no files to make'

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Quote:

Did you by any chance download my previous version of AXL?

No. I just downloaded TileExtracterSrc.zip fro your site half an hour ago.

Quote:

btw, how do you get make to recognise a file other than 'makefile'

make -f makefile.win

But I suggest you use something like this makefile here:

1#######################################################################
2#
3# Instructions:
4#
5# make
6# Compiles all .c and .cpp files in the src directory to .o
7# files in the obj directory, and links them into an
8# executable named 'game' or 'game.exe' in the currect directory.
9#
10# make clean
11# Removes all .o files from the obj directory.
12#
13# make veryclean
14# Removes all .o files and the game executable.
15#
16# Optional parameters:
17#
18# STATICLINK=1
19# Compiles/removes a statically linked version of the game without
20# DLL dependencies. The static object files are put in obj/static
21# and the executable has '_static' appended to the name.
22#
23# NAME=game_name
24# Sets the name of the game executable. By default the game
25# executable is called 'game' or 'game.exe'.
26#
27# If you use add-on libraries, add them to the lines starting with
28# 'LIBS='. Make sure you enter the libraries in both lines, for the
29# normal and static version!
30#
31#######################################################################
32 
33CC = gcc
34CXX = g++
35LD = g++
36CFLAGS = -Iinclude -O3 -s -W -Wall
37 
38# Add-on libraries go here
39ifdef STATICLINK
40 LIBS =
41else
42 LIBS =
43endif
44 
45 
46ifndef NAME
47 NAME = game
48endif
49 
50ifndef WINDOWS
51ifdef MINGDIR
52 WINDOWS = 1
53endif
54endif
55 
56ifdef WINDOWS
57 RM = del /q
58 CFLAGS += -D__GTHREAD_HIDE_WIN32API
59 LFLAGS = -Wl,--subsystem,windows
60 ifdef STATICLINK
61 CFLAGS += -DSTATICLINK
62 LIBS += -lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound
63 OBJDIR = obj/static
64 BIN = $(NAME)_static.exe
65 else
66 LIBS += -lalleg
67 OBJDIR = obj
68 BIN = $(NAME).exe
69 endif
70else
71 RM = rm -f
72 ifdef STATICLINK
73 LIBS += `allegro-config --libs --static` -lXrender
74 OBJDIR = obj/static
75 BIN = $(NAME)_static
76 else
77 LIBS += `allegro-config --libs`
78 OBJDIR = obj
79 BIN = $(NAME)
80 endif
81endif
82 
83OBJ_CPP := $(addprefix $(OBJDIR)/, $(subst src/,,$(patsubst %.cpp,%.o,$(wildcard src/*.cpp))))
84OBJ_C := $(addprefix $(OBJDIR)/, $(subst src/,,$(patsubst %.c,%.o,$(wildcard src/*.c))))
85
86all: game
87
88$(OBJDIR)/%.o: src/%.c
89 $(CC) $(CFLAGS) -o $@ -c $<
90
91$(OBJDIR)/%.o: src/%.cpp
92 $(CXX) $(CFLAGS) -o $@ -c $<
93
94game: $(OBJ_C) $(OBJ_CPP)
95 $(LD) -o $(BIN) $(OBJ_C) $(OBJ_CPP) $(LIBS) $(LFLAGS)
96
97clean:
98ifdef WINDOWS
99ifneq ($(OBJ_C),)
100 -$(RM) $(subst /,\,$(OBJ_C))
101endif
102ifneq ($(OBJ_CPP),)
103 -$(RM) $(subst /,\,$(OBJ_CPP))
104endif
105else
106ifneq ($(OBJ_C),)
107 -$(RM) $(OBJ_C)
108endif
109ifneq ($(OBJ_CPP),)
110 -$(RM) $(OBJ_CPP)
111endif
112endif
113
114veryclean: clean
115 -$(RM) $(BIN)

This is this year's SpeedHack template makefile I wrote. It automatically compiles everything in the src directory using headers from the include directory, puts the object files in the obj directory and the final executable in the top level directory. I guess if you want to have multiple subdirectories under src it gets a little more complicated, but then again you might want to consider putting all cpp files in one dir and all h files in another. Then the above makefile just works, both with MinGW and in Linux. You only need to add references to 3rd party libraries in the relevant places (only -ladime in your case).

--
sig used to be here

Go to: