Just a little video I done up of the progress I am making on my level editor for my new Deluxe Pacman 2 game I am working on. This is compiled with Code::Blocks + MinGW-TDM and Allegro 5.0.7. Many thanks to the people of these forums for putting up with my many questions. As you can see, it's coming along. My GUI is almost non-existant, just a few functions to handle button clicks, but it works rather well, for just C code. I can add any button I wish with a simple function call, no global variables at all in this either I am proud to say (an accomplishment for me as I was always bad for that).
In my old editor you had to click on each tile piece you wanted to place, then click on the map. You could repeat the same tile, but come to a corner and you had to manually select it. Now as you can see in this video, you can simply draw it naturally and it will automatically connect up the lines as one would expect. With a turn of the mouse wheel you change the background tile. I still may add in a feature to fill the level up with pills to avoid clicking each one. Still lots of work to do.
My microphone was on when I done this. Yes, my mouse really is that noisey.
Pretty slick, although I doubt most people would have the patience to learn how to make a sensible level.
Actually, in my older version of the game, I had a couple people that made up a total of 180 levels, and that is only two people that sent them to me! And with the older editor that wasn't as easy. heheh
This one is much easier, and has a new Validate button that will (eventually) check your level for you and tell you where any errors occur.
Congratulations man. I really like how the walls seems to follow the mouse, you don't need to select if it has to turn left, right or up and down.
What I did was code it so it remembers the last position your mouse was at. Also, the event system of Allegro 5 made tracking whether the mouse button had been raised or not an easy task.
I ordered them so the tile number matched the connection it made. The connection to the top is 1, to the right is 2, bottom is 4, and left is 8. Tile #0 has no connections, just a dot. Tile #3 connects to the top and right |_ . Tile #11 connects to the left, top and right _|_ etc. THEN, when I check the current tile you click on, then if say the last tile you just moved from was to the right, I simply logically OR the tile to the right of the current one with 8 (8 connects to the left) and whatever tile # might be there will be adjusted to have a connection to it's left (it is right of the current tile remember). The current tile gets OR'd with 2 (connection to the right).
It makes it very easy. I originally checked ALL surrounding tiles to the one you are currently on (which was easier to code as you don't have to remember your last position) but then as you moved along, if you had parallel lines, they would all get connected rather than just connecting where you just came from.
I wanted a better way to make levels, selecting a tile and placing it on the map was so tedious. Now to make a pill fill function to save me from placing a million pills.
I got this idea by the way, by looking at how the Simcity 2000 level editor worked, it auto-connected roads. I actually made an isometric level editor where you could draw mountains and roads this way.
{"name":"606511","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f13da963440af235ccb67dbd9250e581.jpg","w":546,"h":36,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f13da963440af235ccb67dbd9250e581"}
Here's one of the line sets. First tile #0, no connections. tile 1, top only, 2, right, 3 top and right (1+2), 4 bottom, 5 top and bottom (1+4) etc. If I have a tile that connects to the left (8) and want to connect it to the right, I simply take the current number (8) and OR it with 2 (8|2=10), tile number 10 is a straight line as expected. Works well with a lot of map styles.
Edit: and erasing the tiles is the easiest, if you right click to erase a tile, it simply checks the surrounding tiles and &'s them to disconnect them from the current tile. So if you were checking the tile to the left (x-1) you would & it with 13 and it would disconnect it from the right of it (15 which is all sides, minus 2 which is the right side = 13, so & with 13 means all other sides that are connected are unaffected, but the right connection). You can see when I erase a couple tiles that the surrounding tiles are adjusted accordingly.
Edit2: oh, and I clicked each pill because I like them spaced apart, but you can just as easily drag your mouse and draw the pills in.
Is the sped up 5x or something? Jeeze man, you could play Quake competitively and win big with that mouse speed.
No, that was playing at normal speed. ... I just didn't want to move too slow and bore people too badly.
That's a very nice editor.
p.s. The past tense of done is did.
You're level editor...it's beautiful!
Your skill is beyond comprehension.
Since many maps are going to be designed as symmetrical (walls and pills), you may want to add a checkbox that causes symmetry on the x axis. Then for every click at x,y you repeat the action at (width-x),y.
I would say perfect. Man, if i knew that much!
Nice job!
Since many maps are going to be designed as symmetrical (walls and pills), you may want to add a checkbox that causes symmetry on the x axis. Then for every click at x,y you repeat the action at (width-x),y.
Actually, when editing a level the other day with it, I thought about that! It wouldn't be difficult to implement. I Could even add in switches to choose X and/or Y. I have actually had a few other ideas for this, but it's interesting how something seems better on paper than in action.
The next part of the editor I will be adding is a function to select which pills are powerpills. I want it so you can make any pill a powerpill in order to make some interesting levels I have in mind. I figure I may just draw a red blended, square over the map for pills that are selected, a square that is only 25% visible maybe. I need to get this level editor done so I can start on the game and get it finished so I can move on. I am determined not to get side tracked on other projects like I have done in the past and end up with a dozen unfinished games.
Thanks for the comments anyhow, I've been having fun with this project after being away from programming for SO long!
EDIT:
Ladies and gentlemen, I give you... SYMMETRY!! I added in two Symmetry buttons, one for X (vertical) and one for Y (horizontal), either or both can be selected. I done up a short video (better quality this time, took longer to upload but is worth it). Doesn't take long to make a level now!
Thats uber awesome! I'm inspired!
Thanks for that description of how the tiles work, thats worth mulling over.
Looks nice. Symmetry might be easier to visualize if additional half-opaque cursors showed up.
Seems like it's missing an undo feature.
Maybe you could experiment with randomnly generated levels. You can generate just one quadrant and then mirror them to the other quadrants using the symmetry x/y thing you already have.
Looks nice. Symmetry might be easier to visualize if additional half-opaque cursors showed up.Seems like it's missing an undo feature.
Nice idea on the opaque cursor, I may just do that. I found I wasn't really looking at that side while drawing, just suddenly I looked over and it was all drawn.
I was thinking about adding an undo, it's on a features list I made up a while ago. I was thinking that you could undo between when you last pressed the mouse and released it (right or left). Perhaps up to a certain amount or just once. It's not like it's a huge level or anything. Takes like 2 mins to make a level with this now.
Maybe you could experiment with randomnly generated levels. You can generate just one quadrant and then mirror them to the other quadrants using the symmetry x/y thing you already have.
Hmmm, I never thought of doing that, which is strange because I have been thinking about how to have a program that creates randomly generated 3D levels and it never once occurred to me to apply that idea to this. I'm not entirely sure how I would do it, but I like the idea. Not sure I have enough room to add much more to this.
Attached is a 7z with the program as you seen it in the video. I have no save or load dialog yet, it's not finished and simply saves and loads a fixed file named "level001.map". Validate doesn't work yet.
This is programmed with CodeBlocks + MinGW-TDM 4.6.1 and Allegro 5.0.7 premade binaries I downloaded from this website. Linked statically (so you won't have any problems with missing DLLs) and compressed with UPX (which does an awesome job, the exe is something like 37% of it's original size once compressed!!!)
EDIT: Wait, did I just see Mathew use an actual SMILE?! (marks this on the calender)
EDIT2: Oops, no instructions in that zip.
- LEFT CLICK to draw
- RIGHT CLICK to erase
- MIDDLE CLICK switches between PILL and LINE drawing modes. You can also just select a pill to draw and it will automatically select PILL drawing, or click on the line area and it will select LINE drawing.
- Mouse Wheel selects background.
- X and Y will select X and Y Symmetry
- G will toggle grid on/off
Not much else yet. It's a work in progress. That executable should run on all supported versions of Windows. If it works on Windows 8 (and probably does) it isn't because I wanted it to
EDIT3: I should detect Windows 8 with it and bring up a huge blue warning about running on a potentially dangerous operating system.