Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Tilemap Editor

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Tilemap Editor
23yrold3yrold
Member #1,134
March 2001
avatar

Tilemap Editor (105KB source, binary, and makefile)

Just to show you I do actual work between posts ....

This is an Win32/Allegro tilemap editor I'm making for my game. I plan on adding quite a bit more (main.cpp has a to-do list) but I'm throwing it out now just for kicks. Firstly, while it's not as general purpose as it will be in the future, it's pretty simple, so maybe someone can hack around in the source and make one for their own purposes faster than starting from scratch. I've already brought this post to SSC's attention ;) The code is pretty decently laid out, though it definitely needs cleaning up. I got my hands dirty in it all weekend ...

Secondly, I'm open to further suggestions as to what to do with it. Functionality-wise.

Thirdly, it still doesn't draw the border and scroll bars (entirely) in the main window. This is a problem I posted about in the Programming Forum a while ago, but never managed to fix. First person to nail it gets ... um, renown, I suppose ...

There's not a whole lot to it. The left mouse button draws, the right has several secondary functions available from a drop-down on the left. You can zoom in on both the map window and the tile window using + and -. It has some cute tricks, like easy importing and exporting of tilesets. Cut, copy, paste, and delete are all in there. Plus a floodfill. Many keyboard shortcuts are to come; clicking around in the menu gets tedious. One cute feature is if you select an area which is longer than it is wide (or vice versa), then try to Insert Rows/Columns. See? It can read your mind if you let it ;D

The main to-do's include an undo (naturally), layers, plus stamps (self-explanitory) and something I call clone-stamps. Say you have one of a hill going up, leveling out, and going down again. Like the clone tool found in most image editors, you can clone bits of it where you need them, instead of drawing a repetetive pattern over and over, but without making a zillion stamps for all occasions. Not sure if any other editors do that, but I'm interested in seeing how useful it might be.

Plus it needs to make more versatile tilemaps. Right now it uses bitmasks for collision detection, but there should be an option to just make walkable/non-walkable tiles, among other things. Bitmasks would be overkill for a Final Fantasy clone ;) Plus things like variable sized tiles, and color depth, and a decent default project, all of which I'll implement when I get around to File->New. No sweat.

Comment away.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

kazzmir
Member #1,786
December 2001
avatar

why was it written for win32? pure allegro not good enough for you?

23yrold3yrold
Member #1,134
March 2001
avatar

No, actually :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Bob
Free Market Evangelist
September 2000
avatar

Segfaults on me, apparently performing an array overrun inside a Win32 call, called from within Allegro, called by a function in your program.

Can you supply a debug version, linked with the debug version of Allegro?

--
- Bob
[ -- All my signature links are 404 -- ]

MiquelFire
Member #3,110
January 2003
avatar

When hitting the X to close (File->Exit don't work) it complains about an area not writible

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

23yrold3yrold
Member #1,134
March 2001
avatar

Crashes!? :o

Quote:

Can you supply a debug version, linked with the debug version of Allegro?

I would have no clue how. You have the source, no?
Modify my makefile to do it and I'll compile it, no sweat ...

Quote:

File->Exit don't work

Yeah, I hadn't bothered yet since the X works fine. For me, anyway. This is weird; I can understand if I missed some stuff, but it should at least run fine for the most part. No crashes or anything for me ...

The bald alien down there said:

yep crashes here too...

AAARRGGHHHH!!!!
>_<

Would your OS's (W2K, XP, Win98) matter? Feel free to mention them if there's this many problems ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Steve Terry
Member #1,989
March 2002
avatar

yep crashes here too... it just shows the drmingw32 exception window but with no output... just a blank window...

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Ultio
Member #1,336
April 2001

Definitely crashes upon startup. Can't really give you more than that. I'm on an XP box. Also, try to include the dll in that acrhive, or at least at a separate location. It's a pain when I don't have a specific allegro.dll when I'm going to test someone's program :) Much more convenient for the user if they don't have to go searching for the dll. ;)

---
"It's nice knowing that someday, the software I write will just be pirated by millions of people." :-/
http://loomsoft.net | Zep's Dreamland | Allegro Newbie Tutorials

X-G
Member #856
December 2000
avatar

Yay for segfaults!
Yes, I got one too. And the Dr. MinGW window is indeed empty upon debugging.
WinXP Home, gcc 2.95.3-5, Allegro 4.0.0.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Dark
Member #749
November 2000
avatar

Can't even connect to get it.. :-/

EDIT

Runs perfectly. :)

Win98Se
AMD Duron 1.1ghz
128mb pc100
Geforce2MX 400

__________________________________
Posting from outside Spellcaster's window...

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Runs perfectly.

THANK YOU!!!

I was beginning to think I forgot a vital file. Even though there aren't any ::)

Wh47 sI Wr0n6 Wi7H j00r C0mpU74r5!!!``11~! >:( ;)

What about compiling your own versions? That work?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

SonShadowCat
Member #1,548
September 2001
avatar

Works perfectly for me as well.

Win2k
AMD athlon 1.1ghz
324mb SDRAM
TNT2

Ultio
Member #1,336
April 2001

I haven't tried compiling it myself, as I never usually compile stuff on my own.

It seems like people who aren't on XP are having no problems running the code. Maybe it's a XP thing with NTFS file format? Are you doing any specific directory finding stuff?

---
"It's nice knowing that someday, the software I write will just be pirated by millions of people." :-/
http://loomsoft.net | Zep's Dreamland | Allegro Newbie Tutorials

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Are you doing any specific directory finding stuff?

The only file it comes with is the tileset, and that's the only one it loads. You can also save/load maps/tilesets, but from the sound of it you guys aren't getting that far ;)

Bob requested a debug version for some reason; anyone wanna tell me how to do that? Never bothered with how to do that ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Thomas Fjellstrom
Member #476
June 2000
avatar

23 said:

Never bothered with how to do that ...

Really? w0w. Just how do you debug then?

compile the program with the alld (allegro debug) lib, and add -ggdb3 or -gstabs to the compile line of your makefile (where is makes the object files). also make sure not to include -s :)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

Okay. Now what's so special about a debug version?

Quote:

Really? w0w. Just how do you debug then?

I find de bug, I fix de bug ....

EDIT:

   g++ -o Main.o -c Main.cpp -gstabs
   g++ -o TilemapEditor.exe CTilemap.o Main.o rsrc.o -Wall -O2 -s  -ffast-math -fom
it-frame-pointer -funroll-loops -mwindows -lalld
   C:\DEV-CPP\BIN\..\lib\gcc-lib\mingw32\2.95.3-6\..\..\..\..\mingw32\bin\ld.exe: cannot find -lalld
   C:\DEV-CPP\BIN\MAKE.EXE: *** [TilemapEditor.exe] Error 1

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Thomas Fjellstrom
Member #476
June 2000
avatar

You need to compile the debug lib :) as in DEBUGMODE=1 on the make command when making allegro.

also in regards to 'i find de bug, I fix de bug....' Its alot easier to find out exactly whats going wrong with a real debugger. like Dr.Mingw or gdb. (though I could never get gdb to work on windows...) Seriousloy, with gdb on linux, it pin points me to the exact line the SIGSEGV (segfault) occured on. Mind you it gets harder when debugging a threaded application but still easier than trying to find out what happened by staring at the code til I find the error...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Ultio
Member #1,336
April 2001

Well, when the program crashed, I had the option to debug it, as I have MSVC. However, it turned up for the worse. MSVC totally funked out and stopped responding. This is either one HUGE bug, or something was just clunky with my computer at the time :)

Good luck debugging.

---
"It's nice knowing that someday, the software I write will just be pirated by millions of people." :-/
http://loomsoft.net | Zep's Dreamland | Allegro Newbie Tutorials

Matthew Leverton
Supreme Loser
January 1999
avatar

It crashes here on XP for me:

UpdateWindow(mainwindow);

from within WinMain (right after the classes are registered).

I created my own binary using MinGW32. It worked sometimes, sometimes it didn't.

Flecko
Member #566
August 2000
avatar

WinXP w/ service pack here and *boom*...crash.

Haven't had time to skim the source yet, but I'll try if I get some free time tomorrow.

-Flecko

ben's drivel
A shark on whiskey is mighty risky, but a shark on beer is a beer engineer. This message brought to you by Old Kentucky Shark of Kentucky Nightmare Whiskey Co.

MiquelFire
Member #3,110
January 2003
avatar

??? Am I the only XP user who can run this???

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

23yrold3yrold
Member #1,134
March 2001
avatar

Apparently :P ...

Quote:

as in DEBUGMODE=1 on the make command when making allegro.

So:

   fix mingw32
   make DEBUGMODE=1
   make install

Like that? Isn't there a third library; profiling or some such?

Quote:

It crashes here on XP for me:
UpdateWindow(mainwindow);
from within WinMain (right after the classes are registered).

Well that's just queer ??? Nothing fancy or error-prone going on there, or in WM_CREATE of WndProc or anything else relevent ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

MiquelFire
Member #3,110
January 2003
avatar

Unless I'm building a static version of Allegro, I just use

make installall

installs all three versions (one of which I don't understand, profiling)

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Thomas Fjellstrom
Member #476
June 2000
avatar

It doesn't crash on my machine...

[edit]
Though I did find a problem, the tiles don't fully load, and I can only use the 'place tile' tool. None else work.[/edit]

p.s. Don't mention me being in windows, I neded to get something with shareaza ;) Its the only client that supports the Gnutella 2 network...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

How do they not "fully" load? And if the left mouse button works, the right one should too ??? The default behavior is to erase tiles ....

I was hoping for more in line of the three reasons I had for "throwing it out" ::) I'm at a loss as to why this thing isn't working right for everyone. Did anyone have problems running Bola? I don't recall any ....

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

 1   2 


Go to: