MapSlapper
23yrold3yrold

Download MapSlapper for Windows (125KB)

My Win32/Allegro tilemap editor is finally ready to be unveiled :D It's a bit plain, but quite functional. Also quite plain are the docs (just open index.html), which are included in the zip. Hopefully the cause of all the crashing last time has been done away with. Another problem was people who didn't quite understand the interface cough*TF*cough, so RTFM this time ;) Now that there is one.

Something the docs bring up are ideas on that whole general, do-all tilemap editor we were all discussing a few days ago. Any thoughts would be appreciated, if only so I can make a better editor for my purposes (even if no one else is interested). Also feel free to make suggestions for MapSlapper's interface; I find it quite intuitive but maybe someone has some ideas that I missed. I should probably figure out how to static-link so no one needs the dll ...

Uh, I guess that's it. I'm all types out from the docs :P G'night.

BTW, for those who remember my registry thread; that code has been commented out, so this isn't going to leave annoying little presents in your Windows registry.

EDIT: link didn't work for me, but copying & pasting the url into the address bar did. I hate when that happens! >:( ;D

Thomas Fjellstrom

Your link works fine for me :) I'll try it out after I get a new release of Dr. Strange out. (almost ready... just a bug to squash)

Derezo

yeah, link worked fine for me.. but I'm having troubles running allegro programs for the moment >:(

(See allegro 4.0.3 thread for details :P)
Should be remedied shortly.

[edit]
Upon running MapSlapper.exe, I get the following error:

The instruction at "0x77f67f25" referenced memory at "0x00000000". The memory could not be "written".

In other words.. you can't write to NULL Chris! ;)

[edit2]
Btw, this happens right away - before I can see anything on the screen. I tried to look through your source but I got lost very, very, very easily :P

23yrold3yrold

Wanna be a little more specific? ;) AFAIK I'm doing nothing out of the ordinary. Someone who knows Win32 and gets crashes is going to have to look at it, because it runs perfectly for me here (which means I can't fix it :().

Flecko: I'm running Win98.

Flecko

Aye, I'm running WinXP chris, and I get the same error as Derezo. IIRC, you said you run WindowsME or something similar(of the 9x variety at least?) Perhaps you need someone who knows what they're doing(not me ;D) look into it.

Really looking forward to checking this out though.
-Flecko

EDIT: I tried enabling 9x compatibility under WinXP, no dice. Sorry I can't help further Chris, but I know absolutely zero about win32 programming. Best of luck though, its a huge step to take(win32 programming that is.)

Derezo

I am running WinXP as well. I can't really be more specific than that :P

Matthew Leverton

[url http://www.allegro.cc/forums/view_thread.php?_id=233605#post_233801]

Of course, that was then. I just tried it on Windows 2000 and XP, and it works fine (so far).

23yrold3yrold

Yes, I noted that post before starting this thread. I didn't find it too helpful :) But I checked the docs and apparently that call shoudn't be essential, so I commented it out and recompiled and it still works. I'm uploading an updated zip now; it will be interesting to see if this makes a difference ...

Quote:

I just tried it on Windows 2000 and XP, and it works fine (so far).

Oh, okay. Good :) I'm still uploading the non-UpdateWindow() version though, since others still seem to be having troubles (which sucks). Flecko, try it again ...

Flecko

Got the new version, still no go. Really sucks for you since you don't have WinXP to test on. I'm really in the dark here. I eventually got your animation editor working before(still have it, and it works fine) so I don't get what the big problem is.

Hopefully you can get it worked out so in the future, people will know, because honestly, it should work regardless of windows version.

Good luck,
-Flecko

Derezo

I tried again as well, but I still get the error.

I see an UpdateWindow() in the source still, too. Perhaps you didn't add that to the zip though?

23yrold3yrold
Quote:

it should work regardless of windows version.

Tell me about it ::) I couldn't believe the last thread; crash after crash ...

Does seem odd that it's more or less exclusive to the XP guys. I'm happy Matthew got it working though :)

Derezo: the binary is updated; but I guess I forgot to update main.cpp (oops). I'll take care of that now ...

DanielH

Got an error, something about needing Alleg40.dll. :P

Actually I wiped my comp and am now setting it up. So I installed the alleg40.dll and then got the error 'MSVCR70.DLL missing'. Had to hunt that one down on the net.

Finally up and running and it looks good.

23yrold3yrold
Quote:

Finally up and running and it looks good.

Hallelujah! What's your OS?

Surt

I found what appears to be a minor bug.
When one places a tile where (x == -1) and/or (y == -1) a tile is placed at (x == 0) and/or (y == 0) and that tile doesn't draw fully, have to pass cursor over tile to redraw it.

23yrold3yrold

I thought I fixed that. Okay, thanks. I reproduced it; should be easy to fix. EDIT: fixed. :)
Any other feedback? It rocks, it sucks, what? Anyone?

X-G

I get the same crashes as the others when I try to run it (Windows XP Home). I have no problems with other Allegro apps. I tried compiling it, but that didn't work at all, either. See this for more info.

23yrold3yrold

Interesting errors, X-G:

Quote:

CTilemap.cpp:213: `blit' cannot be used as a function

Heh :)

I'm adding a "using namespace std;" in the CTilemap header (I always forget the namespace); that should fix most of that. Some of those errors are weird, but I'll assume it's just getting confused by the namespace scope. Uploading new version now (though it shouldn't affect the crashing) ...

X-G
23yrold3yrold

That's pretty picky O_O AFAIK, those functions should be able to convert a vector element to an iterator.

I changed the code so that I convert to an iterator first before passing the iterator to the function. Hopefully that file at least will compile fine now. New version uploaded ... maybe I should upgrade MinGW so I catch this stuff earlier ::) ...

X-G
Trumgottist

I tried to run it using XP. It crashed. Then I checked the box in the compability settings that inactivates the visual themes. Now it runs.

X-G

Hey, it works for me too if I do that. Thanks. :D

Matthew Leverton

Well, I thought it might have to do with Themes, so I tried running it yesterday with Themes enabled - and it still worked.

23yrold3yrold
Quote:

Try again ...

Right, that's it. Your compiler sucks :) Well, perhaps not, though how I'm supposed to get an iterator to the right elements without iterating through the whole stupid vector is beyond me. Frankly, I don't even know why the vector class can't include insert/erase that takes index numbers. Makes life so much easier.

Anyway, now that some people can actually run the friggin' binary (yay!), does anyone have any thoughts on the actual program?

X-G

A few thoughts.

1) Make the tile window automatically "wrap" the tiles when you resize it, and only use scrollbars if necessary.
2) Add keys for next/previous tile.
3) Where are my layers? :o

23yrold3yrold

1) Yes, I've thought of that. I just haven't gotten around to it (wasn't a priority for this release).

2) Good idea; which ones? PgUp/PgDown (on second thought, that seems unintuitive)? I was actually thinking of one idea; clicking and dragging on the current tile would select other tiles, so dragging right would bring up the next tile, then the tile after that. Up and down would skip tiles by 20 or something.

3) I wrote about those in the Future Plans docs. Didn't read that, didja? ;)

Thomas Fjellstrom
Quote:

Make the tile window automatically "wrap" the tiles when you resize it, and only use scrollbars if necessary.

I made a widget like that for Icons...

X-G

Don't do it the dragging way ... that can get REALLY frustrating. You could have Pgup/Pgdn, or maybe use the scroll wheel for that? You could also add up/down buttons next to the tile.

23yrold3yrold

Keyboard shortcuts for next/prev are a good idea, I just need intuitive keys for it. I can add it in five minutes after that :)

I think A for previous and S for next would work. Left hand there, right hand on the mouse. Maybe make a previous and next for the secondary tile too (Q and W?). I'm not a fan of using PgUp/Down for this for some reason :-/ I don't have a mouse wheel, so I won't attempt that yet :) Up/Down buttons would be slow; almost as slow as just clicking back and forth in the tile window ...

X-G

I'm not coming up with alternatives; you should use ALL of them. ;)
The more ways of doing the same thing you can cram in there, the better. At least when they're as trivial as this.
A/S and Q/W sound good, by the way. :)

Thomas Fjellstrom

23: Want the phunky widget? ITs sorta useless to me right now ;)

23yrold3yrold

TF: What widget? What's it do? The auto-wrapping one? Sure; I'd like to see how to set the window to a certian area. Never got the hang of that ...

Anyway, new version up.

A - Previous left tile.
S - Next left tile.
Q - Previous right tile.
W - Next right tile.

I'm glad I added that; it works great :D

Mike Vox

It did not work with alleg41.dll so I needed to switch to alleg40.dll. After that, it worked fine and I'm using XP. Good stuff, I was slapp'n and map'n, baby! At first I was like "how do you select another tile" so I was forced to read the instructions and found out the tile selector was under "View".

Quick question, seeing how it runs under a window, is the code portable to other platforms? I'm working on a map editor specifically for my project, and I'm using a hacked up version of the Allegro gui. I'm eventually going to have to swap out the gui with something faster and better. If I want a version to run under Windows, that means I need to re-code a version just for Windows, correct?

Mike_Vox

23yrold3yrold
Quote:

is the code portable to other platforms?

Not this; it's heavy Win32 code here.

Thomas Fjellstrom

I coded this little widget for a windows program to associate files with programs, select the icon, and optionally add to the send to menu... but In XP that was really useless as XP includes that... And noone was interested in it :)

#SelectExpand
1HICON *big_list = NULL; 2int icon_count = 0, icon_selected = 0; 3 4LRESULT CALLBACK icon_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 5{ 6 static int xPos = 0, yPos = 0, xChar = 32, yChar = 32, icon_x = 0, icon_y = 0, mx = 0, my = 0, md = 0, ox = 0, oy = 0, i = 0; 7 int j = 0, k = 0, icon_xy = 0; 8 RECT rect; 9 static SCROLLINFO si; 10 PAINTSTRUCT ps; 11 12 switch (message) 13 { 14 case WM_CREATE: 15 GetClientRect(hwnd, &rect); 16 17 icon_x = (rect.right / xChar); 18 icon_y = (rect.bottom / yChar); 19 20 icon_xy = icon_x * icon_y; 21 22 if(icon_xy <= icon_count) { 23 SetScrollPos(hwnd, SB_VERT, 0, FALSE); 24 SetScrollRange(hwnd, SB_VERT, 0, 0, TRUE); 25 } else { 26 SetScrollRange(hwnd, SB_VERT, 0, icon_y, TRUE); 27 ShowScrollBar(hwnd, SB_VERT, TRUE); 28 } 29 return 0; 30 31 case WM_SIZING: { 32 LPRECT lprc = (LPRECT)lParam; 33 int oyPos = 0; 34 35 GetClientRect(hwnd, &rect); 36 37 icon_x = (rect.right / xChar); 38 icon_y = (rect.bottom / yChar); 39 40 //lprc->right = ((lprc->right % xChar < xChar)? lprc->right -= lprc->right % xChar : lprc->right); 41 //lprc->bottom = ((lprc->bottom % yChar < yChar)? lprc->bottom -= lprc->bottom % yChar : lprc->bottom); 42 icon_selected = 0; 43 ox = oy = md = 0; 44 45 oyPos = yPos; 46 yPos = (((lprc->bottom-lprc->top) / yChar) < i) && yPos ? i - ((lprc->bottom-lprc->top-1) / yChar) : 0; 47 if(yPos && yPos != oyPos) { 48 SetScrollRange(hwnd, SB_VERT, 0, (lprc->bottom-lprc->top) / yChar, FALSE); 49 } else if(yPos != oyPos) { 50 SetScrollPos(hwnd, SB_VERT, 0, FALSE); 51 SetScrollRange(hwnd, SB_VERT, 0, 0, FALSE); 52 } 53 } return 0; 54 55 case WM_PAINT: 56 GetClientRect(hwnd, &rect); 57 58 icon_x = (rect.right / xChar); 59 icon_y = (rect.bottom / yChar) - ((rect.right % xChar)?1:0); 60 icon_xy = icon_x * icon_y; 61 62 //printf("xy:%i, %i,%i, %%:%i\n", icon_xy, icon_x, icon_y, rect.bottom % yChar); 63 64 BeginPaint(hwnd, &ps); 65 //warn("Paint:"); 66 i = 0; 67 while(k <= icon_count) { 68 if(j >= icon_x) { i++; j = 0; } 69 DrawIconEx(ps.hdc, (j*xChar)-(xPos*xChar), (i*yChar)-(yPos*yChar), big_list[k], 32, 32, 0, NULL, DI_NORMAL); 70 71 if(icon_selected == k) { 72 rect.left = (j*xChar)-(xPos*xChar); 73 rect.right = (j*xChar)-(xPos*xChar)+32; 74 rect.top = (i*yChar)-(yPos*yChar); 75 rect.bottom = (i*yChar)-(yPos*yChar)+32; 76 DrawFocusRect(ps.hdc, &rect); 77 } 78 79 j++; 80 k++; 81 } 82 83 if(i <= icon_y) { 84 SetScrollPos(hwnd, SB_VERT, 0, FALSE); 85 SetScrollRange(hwnd, SB_VERT, 0, 0, FALSE); 86 xPos = 0; 87 yPos = 0; 88 } else { 89 SetScrollRange(hwnd, SB_VERT, 0, i-icon_y, FALSE); 90 } 91 92 //printf("Draw: x:%i, y:%i\n", xPos, yPos); 93 EndPaint(hwnd, &ps); 94 return 0; 95 96 case WM_LBUTTONDOWN: { 97 mx = LOWORD(lParam); 98 my = HIWORD(lParam); 99 md = 1; 100 } return 0; 101 102 case WM_LBUTTONUP: { 103 int fwKeys = wParam; // key flags 104 int x = LOWORD(lParam); // horizontal position of cursor 105 int y = HIWORD(lParam); // vertical position of cursor 106 md = 0; 107 ReleaseCapture(); 108 109 GetClientRect(hwnd, &rect); 110 111 icon_x = (rect.right / xChar); 112 icon_y = (rect.bottom / yChar) - ((rect.right % xChar)?1:0); 113 icon_xy = icon_x * icon_y; 114 115 x /= xChar; 116 y /= yChar; 117 x += xPos; 118 y += yPos; 119 120 if(x + y * icon_x <= icon_count && x + y * icon_x != icon_selected) { 121 rect.left = (ox*xChar)-(xPos*xChar); 122 rect.right = (ox*xChar)-(xPos*xChar)+32; 123 rect.top = (oy*yChar)-(yPos*yChar); 124 rect.bottom = (oy*yChar)-(yPos*yChar)+32; 125 InvalidateRect(hwnd, &rect, TRUE); 126 127 rect.left = (x*xChar)-(xPos*xChar); 128 rect.right = (x*xChar)-(xPos*xChar)+32; 129 rect.top = (y*yChar)-(yPos*yChar); 130 rect.bottom = (y*yChar)-(yPos*yChar)+32; 131 InvalidateRect(hwnd, &rect, TRUE); 132 133 icon_selected = x + y * icon_x; 134 //printf("MB: %ix%i %ix%i\n", ox, oy, x, y); 135 UpdateWindow (hwnd); 136 ox = x; 137 oy = y; 138 } 139 } return 0; 140 141 case WM_MOUSEMOVE: { 142 int fwKeys = wParam; // key flags 143 int x = LOWORD(lParam); // horizontal position of cursor 144 int y = HIWORD(lParam); // vertical position of cursor 145 146 if(md) { 147 SetCapture(hwnd); 148 149 GetClientRect(hwnd, &rect); 150 151 icon_x = (rect.right / xChar); 152 icon_y = (rect.bottom / yChar) - ((rect.right % xChar)?1:0); 153 icon_xy = icon_x * icon_y; 154 155 x /= xChar; 156 y /= yChar; 157 x += xPos; 158 y += yPos; 159 160 if(x + y * icon_x <= icon_count && x + y * icon_x != icon_selected) { 161 rect.left = (ox*xChar)-(xPos*xChar); 162 rect.right = (ox*xChar)-(xPos*xChar)+32; 163 rect.top = (oy*yChar)-(yPos*yChar); 164 rect.bottom = (oy*yChar)-(yPos*yChar)+32; 165 InvalidateRect(hwnd, &rect, TRUE); 166 167 rect.left = (x*xChar)-(xPos*xChar); 168 rect.right = (x*xChar)-(xPos*xChar)+32; 169 rect.top = (y*yChar)-(yPos*yChar); 170 rect.bottom = (y*yChar)-(yPos*yChar)+32; 171 InvalidateRect(hwnd, &rect, FALSE); 172 173 icon_selected = x + y * icon_x; 174 UpdateWindow (hwnd); 175 //printf("Move: %ix%i %ix%i\n", ox, oy, x, y); 176 ox = x; 177 oy = y; 178 } 179 180 } else { 181 //x /= xChar; 182 //y /= yChar; 183 //ox = x; 184 //oy = y; 185 } 186 187 } return 0; 188 189 case WM_HSCROLL: 190 // Get all the vertial scroll bar information 191 si.cbSize = sizeof (si); 192 si.fMask = SIF_ALL; 193 // Save the position for comparison later on 194 GetScrollInfo (hwnd, SB_HORZ, &si); 195 xPos = si.nPos; 196 switch (LOWORD (wParam)) 197 { 198 // user clicked left arrow 199 case SB_LINELEFT: 200 si.nPos -= 1; 201 break; 202 203 // user clicked right arrow 204 case SB_LINERIGHT: 205 si.nPos += 1; 206 break; 207 208 // user clicked shaft left of the scroll box 209 case SB_PAGELEFT: 210 si.nPos -= si.nPage; 211 break; 212 213 // user clicked shaft right of the scroll box 214 case SB_PAGERIGHT: 215 si.nPos += si.nPage; 216 break; 217 218 // user dragged the scroll box 219 case SB_THUMBTRACK: 220 si.nPos = si.nTrackPos; 221 break; 222 223 default: 224 break; 225 } 226 // Set the position and then retrieve it. Due to adjustments 227 // by Windows it may not be the same as the value set. 228 si.fMask = SIF_POS; 229 SetScrollInfo (hwnd, SB_HORZ, &si, TRUE); 230 GetScrollInfo (hwnd, SB_HORZ, &si); 231 232 // If the position has changed, scroll the window 233 if (si.nPos != xPos) { 234 ScrollWindow(hwnd, xChar * (xPos - si.nPos), 0, NULL, NULL); 235 xPos = si.nPos; 236 InvalidateRect(hwnd, NULL, TRUE); 237 UpdateWindow(hwnd); 238 239 } 240 return 0; 241 242 case WM_VSCROLL: 243 // Get all the vertial scroll bar information 244 si.cbSize = sizeof (si); 245 si.fMask = SIF_ALL; 246 GetScrollInfo (hwnd, SB_VERT, &si); 247 // Save the position for comparison later on 248 yPos = si.nPos; 249 switch (LOWORD (wParam)) 250 { 251 // user clicked the HOME keyboard key 252 case SB_TOP: 253 si.nPos = si.nMin; 254 break; 255 256 // user clicked the END keyboard key 257 case SB_BOTTOM: 258 si.nPos = si.nMax; 259 break; 260 261 // user clicked the top arrow 262 case SB_LINEUP: 263 si.nPos -= 1; 264 break; 265 266 // user clicked the bottom arrow 267 case SB_LINEDOWN: 268 si.nPos += 1; 269 break; 270 271 // user clicked the shaft above the scroll box 272 case SB_PAGEUP: 273 si.nPos -= si.nPage; 274 break; 275 276 // user clicked the shaft below the scroll box 277 case SB_PAGEDOWN: 278 si.nPos += si.nPage; 279 break; 280 281 // user dragged the scroll box 282 case SB_THUMBTRACK: 283 si.nPos = si.nTrackPos; 284 break; 285 286 default: 287 break; 288 } 289 290 // Set the position and then retrieve it. Due to adjustments 291 // by Windows it may not be the same as the value set. 292 si.fMask = SIF_POS; 293 SetScrollInfo (hwnd, SB_VERT, &si, TRUE); 294 GetScrollInfo (hwnd, SB_VERT, &si); 295 // If the position has changed, scroll window and update it 296 if (si.nPos != yPos) { 297 ScrollWindow(hwnd, 0, yChar * (yPos - si.nPos), NULL, NULL); 298 yPos = si.nPos; 299 InvalidateRect(hwnd, NULL, TRUE); 300 UpdateWindow (hwnd); 301 } 302 return 0; 303 304 case WM_COMMAND: 305 break; 306 307 case WM_CLOSE: 308 309 DestroyWindow( hwnd ); 310 return 0; 311 } 312 313 return DefWindowProc (hwnd, message, wParam, lParam); 314}

I doubt its bug free ;) I tried to make it as functional as possible... Make it a top level resizeable window, and have fun ;)

DanielH

I'm using win98. What is MSVCR70? I just got that error again running another allegro program.

23yrold3yrold

I thought it was a standard DLL ???

Anyway, the code in CTilemap.h has been updated now that I have been schooled :) So hopefully that'll help anyone trying to compile this bugger. I don't know if it'll fix the crashing; I should think it would only affect compilation. Plus I added the tilemap from my old game demo just for fun :) ...

Matthew Leverton
Quote:

I'm using win98. What is MSVCR70? I just got that error again running another allegro program.

If you downloaded the original 4.0.3 end-user DLL, I accidently put the MSVC7 version in there. I have since replaced it with the MSVC6 version. You can either download the new DLL from the files section, or you can download the msvcr70.dll file and place it in your system32 folder.

Now, for some general comments on the program itself. The native Win32 feel is nice; that is reason alone to use an editor. I'm not a fan of these universal non-native GUI toolkit libs, nor am I fan of a full screen Allegro GUI. Having a dual monitor setup and being able to have multiple windows open is very nice.

That said, the interface definately feels "primitive", but I know working with Win32 is tedious. (But at least under Windows a primitive Win32 is better than a non-Win32 app.) As long as all the features (layers, etc) make there way in, it shouldn't be an issue.

You should use the scroller on the mouse to select between tiles. It would actually be nice if it were configurable...

How simplistic is the file format? It would be nice to have a really simple "CVS export" format available in case someone wanted to use MapSlapper to create the map, but didn't want to use its native format.

23yrold3yrold
Quote:

How simplistic is the file format?

Very. You can see it pretty plainly just by reading CTilemap::Save() (which is well commented).

Quote:

That said, the interface definately feels "primitive", but I know working with Win32 is tedious.

What would be needed to make it feel less "primitive"? It's just a tilemap editor ;) If you mean it needs more bells and whistles like animation and stuff, then, yeah ... but if that's not what you meant, could you elaborate?

Quote:

It would be nice to have a really simple "CVS export" format available in case someone wanted to use MapSlapper to create the map, but didn't want to use its native format.

Unless someone can spell this out for me or just downright code it for me, I'm not sure its worth the bother. :P It would be much easier for someone to write code to load a MapSlapper file into their tilemap structures than to make MapSlapper handle all instances IMHO. It'll be even nicer for the do-all tilemap editor, but I don't think anyone's commented on the plans for that yet :-/ ...

Thanks for the feedback though :)

Derezo

Disabled themes and it ran fine :)

I agree with Matthew: Scrolling should change tiles :) Allegro can handle that pretty nicely - I use that in my own tile map editor.

Looks alright thus far. I love the copy/paste functions. Customizability of the tile blitting operations is pretty kewl too.

Good job :)

X-G

I dunno if you have this already, but ...

Go download RPG Maker 2000. That tile editor has a sweet feature where you can select large portions of a tileset or map and just paste it in a "pattern" kind of way wherever you want it. Try Drawing a wall, selecting it, and then drawing a large area with that brush.
You should have that. :)

23yrold3yrold
Quote:

I agree with Matthew: Scrolling should change tiles

The mouse wheel? DIdn't X-G propose that first? ;)

I'm going to have to pick up a mouse with 3 buttons and a wheel this paycheck ... oh, and Win32 can handle the wheel as well :)

Quote:

That tile editor has a sweet feature where you can select large portions of a tileset or map and just paste it in a "pattern" kind of way wherever you want it.

*cough*Clone Tool*cough* :) Did anyone fully read the docs? ::)

Quote:

Go download RPG Maker 2000.

Ooooh, feature plagarism! I love it! :D

X-G

It's more of a combination between the Stamp and Clone tools. Clicking once places ALL OF IT, like a Stamp, but if you keep placing, it won't place the whole Stamp again at the same position.

23yrold3yrold

Can you give me a reliable link for RM2K? A lot of the sites I found on Google either don't have it or give me the runaround :P

I see what you're saying; that's an interesting idea. A Pattern Brush; could come in handy ...

aybabtu

I can't give you a link, but after trying your "MapSlapper", a lot of good could come from you seeing RM2K's editor. I'm not saying yours is bad...because it's not...it's just that I have very high standards after using RM2K (for way too many hours!)...my map editor pales in comparison to yours, yet. Good job!

EDIT: Here's the support site for it by the guy that translated it: http://rpgmaker2000.narod.ru/

MiquelFire

When compiling with MingW, it complains about there not being a newline at the end of the file.
(Was just trying to have an icon for the exe file :P)
Just so you know

And nothing happens when you choose Help->About either. (And I mean NOTHING!)

[edit] Just found this. On the 'Edit Tile Blit Style' If you hold down on a mouse button and move the mouse left and right a few times, it crashes.

23yrold3yrold

End of what file? I wasn't aware this was something the compiler cared about ...

Quote:

And nothing happens when you choose Help->About either. (And I mean NOTHING!)

This is noted in the docs :)

kazzmir

i havent attempted to compile it for linux, it probbaly has windows specific things in it, but if you want to write portable happy code, gcc will also complain about newlines at the end of every file. its quite annoying to see such things.

MiquelFire

main.cpp, Sorry, thought I said that...

And I should read the docs shouldn't I?

23yrold3yrold
Quote:

i havent attempted to compile it for linux, it probbaly has windows specific things in it

Oh yes, oh yes ...

Quote:

it complains about there not being a newline at the end of the file.

....

gcc will also complain about newlines at the end of every file.

So there should be one or there shouldn't be one? ??? This is totally news to me ...

Quote:

Just found this. On the 'Edit Tile Blit Style' If you hold down on a mouse button and move the mouse left and right a few times, it crashes.

I'll be buggered; you're right. I thought I took care of all that >:( ...

MiquelFire

There should be a newline there.

Derezo

Yeah, I never got the "missing new line" warning until I used linux. I wasn't aware it gave a warning in any windows-based compiler. Doesn't even make sense, really.

23 said:

I'm going to have to pick up a mouse with 3 buttons and a wheel this paycheck

Just so you know, on most mice the wheel is also the middle button :)

Thomas Fjellstrom

If you want to be really pedantic, the wheel is the third, fourth, and fifth buttons.

Derezo

...straying OT, but fourth and fifth? You can only press it in one direction. ::)

Thomas Fjellstrom

Dezero, the wheel? You press it down, and you scroll it up and down :P

Ultio

Wow. Can't see how I missed this thread at all. I just downloaded MapSlapper and tried it out. (I'm on a computer at my workstudy job at school right now, so it was a little clunky and slow.. stupid machine)

Anyways, I like the feel. It's really nice. When I use it I want to shed tears because my editor for ZD is so ugly looking. :) Kudos to that. The only thing I find really weird and awkward is how there are two separated windows, one that contains the map and another that contains the selectable tiles. If anything I would say put them together? Maybe this is something people don't like, but I for one find it very weird to switch to a new window to select a tile. I was thinking the tiles would either be shown in some kind of side pane, or horizontal pane along the bottom of the editor. Whatever floats your boat, however. This is just mere preference. Everything else (that I was able to check out in the short amount of time I have left before class starts) works pretty much perfectly. I like the scrollbars. It's annoying to use arrow keys to scroll around in a map, you know?

Good job on this. I'd like to play around with it just a little more, but alas, I don't have much time. You don't happen to have a little binary of an engine that runs these puppies, do you? (Well, one that's available to the public?)

X-G

Yes, let us dock the tile window to arbitrary positions in the main window! ;D
I kinda like it that way, too. I'm not much for the whole tile window thing.

Ultio

Ooooh. Docking would be really sweet. Then I could put my tiles wherever I wanted. Left, right, top, bottom... Oooh. :) Docky goodness. That's a really neat idea. I'd love to see that.

Flecko

Update for chris: Disabling themes did the trick for me, very nice work. You've made an entire toolset in win32 for your game, very nice indeed.

Keep up the good work,
-Flecko

23yrold3yrold

Flecko: I did? What's a "toolset"? :P

Okay, dockable windows and such, that's not bad. Unfortunately I have no clue how to do that :) but I'll note the idea for future development. If anyone's wondering, the reason tilesets are 20 tiles wide is because that's how KQ works, and I thought it was easy to add new tiles to a tileset (and it is :)). I guess in the future a tileset should be skinnier. I only say this because I can't picture a tileset that wide being in a side panel. But I guess that's just an old idea that can be done away with now; I can make the program use different sized tilesets now. So, yeah. I'll note it for later.

(actually, I'm starting to get some new ideas ;D runs off)

X-G: can you compile it now? Maybe I should upgrade MinGW (using 2.95.3-6 right now)

X-G

Yup. :)
Add a newline at the end of main.cpp, though ...

23yrold3yrold

I did; I guess I didn't upload that one yet ...

Flecko

Toolset...I guess that means your animation editor and your tile editor. Debatable, but I think it means all the tools needed outside of your game to make it work.

Impressive to say the least.
-Flecko

Thomas Fjellstrom

23: "Toolset" <-> "Set of tools".... :P

23yrold3yrold

Aw, fug :P I did fix that blit type window too; I just forgot to change one line that was referencing the wrong variables :) Okay, hopefully it a) runs for everyone now and b) the crashes are gone. I'm going to add a note to the docs that XP users might have to Disable Themes; I guess that covers it then?

Is it a rare thing to have to Disable Themes to get a program to run? Matthew says it runs with Themes on for him (maybe now that I'm not fudging my iterator code :P)

Cage

If you don't have a clue what's happenin',
let MapSlapper do the slappin'.
It'll whip you up a great map in no time flat.

It's better than its cousin Mappy
(well of course, it's a lot more slappy)
and its map format isn't all bloated and fat.

Feel free to add more, anyone ;). I had another verse but I forgot it ::).

Steve Terry

23.. I don't think it has anything to do with your map code but rather the windows API code you are using. There's a reason why there are XP only downloads for most products and that's probably a main reason. For some reason XP needs some special code or something to deal with themes, it's kinda stupid, but as long as you put it in the docs to disable themes everything should be OK. That or you could have someone e-mail you an executable with themes pre-disabled in the executable (unless XP uses some strange config file for it) and it should run carry over... maybe not...

Derezo

Cage: Too much time. That's what you've got. Way too much time. ;D

23 said:

Is it a rare thing to have to Disable Themes to get a program to run?

This is a first for me. :P

Mike Vox
Cage said:

Feel free to add more, anyone . I had another verse but I forgot it .

This is the MapSlapper rap,
cause I can't hold back,
when the tiles are stack'in,
no, I'll never stop mapp'in,
as long as I'm slapp'in :P

Mike_Vox

Trumgottist

Edit: Oooh! Note the time and date!
Edit2: I just like when the clock turns 22.22. And when it was the 22nd, even better! :) But now I realised that only people in my timezone will actually see the time stamp of this post as 22.22, and thus miss the fun. Ah, well.

Quote:

This is a first for me.

Me too, and I have run many both old and weird programs. You must be doing something strange.

spellcaster

The file doesn't do anything for me. I get a wait cursor, and that's it. No window, no msg box, nothing.

Oh, I'm running XP as well.

23yrold3yrold

SC: Did you Disable Themes?

Trum: What about the time and date? Lots of two's and three's? :)

Cage: Get help.

Cage
23yrold3yrold said:

Cage: Get help.

I asked for help, but only Mike Vox would submit some :P.

spellcaster
Quote:

SC: Did you Disable Themes?

No, and you can be sure that I won't disable them just to run a program.

X-G

Spellcaster: You can disable them for just that prog. Click properties, and there's a compatibility option that disables themes for that program only.

spellcaster

X-G, I know.
But I'd prefer if 23 could simply fix the bug ;)

Trezker

I've tested the Slapper and likes it a little.
Didn't run on XP, but I'll try the themes-off thing when I get home if I remember.

Has run it on 98, works well.

I've read every word of the docs.

23yrold3yrold
Quote:

But I'd prefer if 23 could simply fix the bug

So would 23. But I have no idea what the problem is.
What if you compile it from scratch?

X-G

Compiling from scratch didn't help when I tried it, so I doubt it's going to work for SC. :-/

Matthew Leverton

Ok, I just tried it on my "out-of-the-box" laptop with Windows XP SP1. Nothing happens after double-clicking on the program. If I look at the task manager, I can see that the process starts. It dies without any warning a few seconds later.

Upon disabling the visual themes for the executable, it loaded right up. I may play around with the source if I feel up to it.

Trumgottist

I've played around a bit with the Compability Administrator for XP and MapSlapper, and I think I've narrowed down the reason for the crash. Applying the compability fix called AliasDXDC allows MapSlapper to run without disabling themes. This is the description of the fix:

MS Compability Administrator said:

Windows 9x and Windows 2000 internally cache DirectDraw DC handles. This guarantees that the same DC would be returned for a particular surface regardless of how many times it was released and acquired. This compatibility fix aliases DCs returned by DirectDraw and then de-aliases them when GDI functions are called.

I hope that helps.

23yrold3yrold

Thanks Trumgottist! So is this something I need to do or is this something the end user needs to do?

BTW, I just picked up a mouse w/ scroll wheel, so I get to code the tile scrolling now :)

Trumgottist

It's something you need to do if it is to work nicely in XP, but I've narrowed down the problem for you. Exactly how to fix it I leave to you to figure out. :)

23yrold3yrold

Sounds like I either need to give windows their own DC or stop doing so :P Either someone will have to narrow it down for me or I release 50 versions which you try until it works ;D

I'll see if I'm using any CS_OWNDC messages or anything later.

EDIT: I added mouse wheel functionality; scrolling with it while drawing with the left or right button moves through the tiles now. Details are at the bottom of tour.html. Works great; I love it :D

Google turns up nothing on AliasDXDC, so heck if I know what to do with this info :P I don't have XP so I can't check "this" compatability fix ("this" like Trumgottist already has it?), and I'm not doing anything special with the DC's that I can see :-/ ... anyone wanna be a little more specific?

Trumgottist

I don't know C++, so I haven't even looked at your source, but what the quote above says is that you shouldn't count on a DC for a particular surface to stay the same. Exactly what that means, I don't know since I know nothing about DCs. However, if you want to throw test versions at me, feel free. :)

You shouldn't worry about AliasDXDC, it's just a part of the Compability Administrator - a tool I used to get your program running. What's intresting is only that your program runs with that fix loaded = that's where the trouble is. Sorry if I confused you.

23yrold3yrold

Okay, I think I found something like that. I have a "double-buffering" HDC that's static and updated in WM_SIZE for the main tile-drawing window. I've now restrained it's creation and destruction to WM_PAINT (which I didn't do initially since I thought it might be slower). It still works for me, so let's see if it works for you :) I may also be doing this in other dialogs, but it should at least run now.

On the scroll wheel stuff; you may find tile scrolling while drawing messes up the Undo. It seems to work okay for the left button but not the right; I'm working on fixing this :) ...

Trumgottist

Still the same.

(Btw: Tried to compile it with VC 6... tons of errors and warnings. _argc and _argv for example)

23yrold3yrold

So what should I use for VC6? _argc and _argv work fine in MinGW ???

I made a minor change or two; any difference?

Trumgottist

Crash, boom, bang.

GetCommandLine() - (That's what the Allegro sources use.)

23yrold3yrold

Yeah, I guess Roxette would be big in Sweden ;) I tried GetCommandLine() once but had problems (old thread); I could try again ...

Okay, this one comments out the main message pump and just displays a friggin' MessageBox(). Does that at least come up!?

Any other XP users are free to jump in and give Trrumgotist a break ;)

Trumgottist

Nope. Still crash.

Edit: This one crashes with disabled themes aswell. And with AliasDXDC. Weird.

23yrold3yrold

You gotta be kidding! >:( You are downloading the zip anew, right? ;)

I removed the _argv/_argc and wrote up some code to do the equivalent using GetCommandLine(), plus I added some MessageBox()'s to the initialization code. Any difference this time?

EDIT: Funny; still works just fine for me ...

Trumgottist

"hello world"
"Registering classes!"
"Creating Window!"
Boom!

23yrold3yrold

Well at least it's getting past the loading now ::)

Try now; I added a check to see if CreateWindow fails. That was the command right after "Creating Window!" ...

Trumgottist

Dies immediately.

Derezo

Odd.
I run it, it says "Bummer."
Then the window loads, without XP skins.. I clicked on it, xp skins appeared, and it crashed ::)

[edit]
That was with themse OFF.. With themes on it does pretty much the same thing, but it shows the XP skins all the time. Shouldn't it not show XP skins at all the first time? That's weird.

23yrold3yrold

Well I hate to cry uncle, but I honestly have no idea what else I can do :( Does it at least work with Disabled Themes for you again?

EDIT: "Bummer" means "GetCommandLine() didn't work" :P I'm not going to change the uploaded file for a while; I want to hear if the behavior has changed for anyone and I don't want to get confused as to what version you're running :) So if Matthew/Spellcaster/X-G/whoever wants to try it again, go for it.

Derezo

no, it no longer works with themes disabled. It shows the window and crashes both ways for me.

[edit]
With themes on it's a step up from when I first tried it... so, it's getting there :P

Trumgottist

And for me it crashed right away, no matter what I do.

Derezo

There must be something about this on the msdn site or gamedev or something.

23yrold3yrold

Well I'm leaving it for a while like I said. The main.cpp is mostly C-ish anyway (basic Win32) so if anyone wants to poke around in there, go for it.

Derezo: did it bring up "Bummer" just by running the program? Because it shouldn't even be loading a tilemap unless you double click on a file, and you can't because the registry-editing code has been removed. Very odd you saw that ...

I'm going to go work on something else; this thing is starteing to be a nightmare :P I was supposed to be done with it last week ::) And I made a post on the GameDev forum; haven't got an answer yet ...

Derezo

I took a look at the source before, got lost easy :P I know very little about Win32.

It does say 'bummer' when I run the executable. Perhaps that's why it's crashing? ???
It crashes after the window is drawn. If I'm fast enough, I can even click stuff. ;D

23yrold3yrold

No, the "Bummer" shouldn't matter, it just shouldn't be appearing at all :)

I lied; I'm updating the zip one more time. This time I'm just getting rid of the code that says "Bummer", since you can't open files by double-clicking right now anyway ::) This is what, version 1.32098432 now? ;) We'll call it version 1 when XP users can run it :P ...

Trumgottist

No, I'm just running the same program and making up new error messages, just to mess with you. ::) Anyway, I redownloaded it, just in case, and all your crash are belong to us.

I might take a look at the source later, but not right now.

Edit: I've got it to compile (despite lots of compiler warnings) and have (not surprisingly) narrowed it down to the creation of TilemapWindow. I'll continue the search for the problem... (I like bughunts like this.:))

Edit again: It's this line
buffer = create_bitmap(winwidth, winheight);
in WM_SIZE that crashes. Changing that to create a bitmap where w > 0 and h > 0 cause the program to continue (and crash later).

Richard Phipps

I did have a problem in the first version of Stylepaint where I was creating a bitmap of width 0 and height 0 (for an empty brush). Worked perfectly in 95/98 (which I have on my old pc), but crashed everytime in XP.

Perhaps this problem is something similar?

Rich.

Derezo

Very very interesting.
I downloaded again. I still get the bummer message.... (???).

However, I sort of pinned down why it's crashing a little (on my system, anyway :-/).
If I move my mouse away from the window, and use enter to open the app.. then it runs ok. I can move the window around, and what not, but if I move the mouse anywhere inside the window other than the title bar, it crashes.

Could this have something to do with your scroll mouse routines? :)

23yrold3yrold
Quote:

Could this have something to do with your scroll mouse routines?

No. ;) And there should be no excuse for the bummer message now, because that function isn't even being called! >_< Unless you're selecting File->Open ...

I suspect moving all the double buffer stuff into WM_PAINT might help except a) while I can see why that would help for the DC, there should be no need for the BITMAP, and b) it could cause immense slowdown to recreate and destroy all the bitmaps and stuff every repaint. I'll try narrowing down the dirty rectangle system so it's no longer a subbitmap of a window-sized buffer, but a buffer the size of the dirty rectangle. Might help.

Rich: Dat so? Wasn't that problem solved? If not, maybe we've got us a bug here?

EDIT: A GameDever gave me a lead ...

null_pointer said:

A quick guess is that your program relies on some measurements that are only the values you expect when the "old" Windows "look" is being used, but it could be something more complicated.

The main editing window keeps track of its size like this:

   case WM_SIZE:
      winwidth  = LOWORD(lParam);
      winheight = HIWORD(lParam);
      ....

Shall I do it another way?

X-G

What kind of error checking/verifying are you doing on the values you receive?

23yrold3yrold

You're looking at it :P Should I have the program log the values in a file for you XP guys?

X-G

That might be a good idea - and so may things like checking that they are both > 0 and so on.

23yrold3yrold

They are both initially 0, then the sizes are about the values you'd expect (642 x 449). Isn't there some function for getting a client rectangle's dimensions? Would that be appropriate there for getting the width and height (and would it give me the same numbers I'm getting now?)

EDIT: Okay, the reason I got zeros is because the windows are initially 1x1; the size doesn't get set until I know the size of the main window, so I set it in WM_SIZE using MoveWindow. I gave them initial sizes of 10x10 this time, and the log said 8, 8. Also, I get the size like this in WM_CREATE for the main window:

  winwidth  = ((LPCREATESTRUCT)lParam)->cx;
  winheight = ((LPCREATESTRUCT)lParam)->cy;

Anything wrong with that?

Richard Phipps

So if they were being set 1 x 1 before, but really (according to the log) being set as -1 x -1 that might well be it. XP seems to be a lot more strict on stuff like this than 95/98.

BTW: I fixed the bug in stylepaint long ago. :)

23yrold3yrold

New version up which seems to have nailed it. Any more problems?

MiquelFire

Remember that bug I stated with the "Edit tile blit style"? It seems to crash the program when you close it now... After doing the thing that crashed it before however (at least that part is fixed)

BTW, I'm using XP Home Themes off (not going to turn them on... waste of my 1280x1024 screen space :P)

edit: skip the part about the log thing, so here's mine:

/*
541, 457
522__438
523, 439
522__438
515, 393
514__392
904, 636
903__635
904, 652
903__651
920, 652
919__651
*/

And are you ever going to have your binary have the icon? ???

23yrold3yrold

The files use the icon; they just don't do it for you because the program skips the registry ... um, registering :) I haven't designed a program icon yet.

I don't think the log matters anymore :)

So now when you click the 'X' close button in the Blit Type editing dialog, the program crashes? Odd; I just played with it and it gave me no problems ...

MiquelFire

About the icon, not the files, the exe itself (the second to last line in the rsrc.rc file) And you have an icon in the zip file, use that for now.

And it seems I can get two different errors for that, one with a debug button and a close button. Another with the OK/Cancel combo... Anyway, it's only if you click and hold the mouse button and move the mouse side to side quickly... then close. Odd case thing, not anything to worry about... until more major bugs are taken care of first... with a shotgun! ;D

23yrold3yrold

The icon in the zip is for the files :P And the second-last line in the rsrc.rc file is just a leftover from the project I copied it from :) It'll get an icon one day; that's low-priority ...

Your bug report is a bit criptic; what's a "debug button"? This is probably the most major bug at the moment ...

Thomas Fjellstrom

I don't think this will have anything to do with it... but maybe it will.. I used to have problems when giving a window a too small size... ie 0x0 or 1x1 etc... Even if a explicitly called MoveWindow/ShowWindow the window would still be hidden. It was weird. Try starting off with 100x100 or something?

Quote:

what's a "debug button"?

You never seen the window that says "Program caused an error: Would you like to debug?" And it has a "Debug button" on it?

Cage

I've never seen that, save for a few weird crashes on obscure programs... :P

Thomas Fjellstrom

the window is actually an 2k,XP feature, or you might have it if VC++ comes with it... I've heard people call it Dr. Watson. And Dr.Mingw integrates with it.

spellcaster

That window pops up if an app registers itself to be interested in the debug info.
Dr. Watson does this. Dr. MinGW does this. Visual C does this.

Matt Smith

Minor UI whines

  • The map could auto-scroll when the mouse is near the edge.

  • The window could have visual hint that it is resizable (e.g. // in bottom right corner)

  • The Tileset window could be dockable.

otherwise praises be heaped upon ye ;D

23yrold3yrold

First point: Oh yeah; good idea. I'll see if I can do that without the map moving at warp speed :) Second point: does Windows provide a way to do that easily? Third point: already mentioned ;)

Spellcaster: does it work for you now?

And I understand what MB was saying now :)

Surt

Auto-scroll in a windowed app is nasty!

Chris Amos

nice. needs support for paint brushes (or atleast copy/pasting regions), multiple layers, and vector collision.

looking good.

EDIT: O yeah, and i dont know if you have this already because I didnt look it over very well, but it should let you define the size of your tiles.

23yrold3yrold

Everything you mentioned is in there or planned :)

CO: that's what I'm thinking. The fact you can zoom out so far should make that less necessary anyway IMHO.

Thomas Fjellstrom

23: Auto scroll is bad... But how bout if you press the middle button (or one that isn't being used), then when you move the mouse arround the map scrolls?

23yrold3yrold

A pan button? Not bad :) If all else fails the Space Bar could do that (I think PhotoShop uses Space for panning, so there's precedence :)) but the middle mouse button could work too.

jots it down

Thomas Fjellstrom

Well, I find it to be quite usefull in IE ;)

Thread #260903. Printed from Allegro.cc