Thanks man, I was having a little bug with it, but I sorted it out.
Now I'm kinda updating the engine here and there.
I got it now on a 32x32 grid instead of 16x16 which means GRAPHICS OVERHAUL I need some new resources, so I'm gonna rip some shit for now.
Here's what I got planned...
For my editor I want the ability to place ground tiles and also object tiles which would take care of the rendering order like a virtual z-buffer if you will. (got the idea from this guy's editor on YouTube really cool shit).
Only problem is, I wanna have a GUI intense fucking editor and shit but like I cannot for the life of me get SDL working in Qt on my Mac.
So I was thinking about switching to OpenGL instead and trying to get that rendering? So like switch my engine from SDL to OGL.
But basically the ground tiles are ju... Here let me organize the shit out of this post.
GROUND TILES
Could also just be called terrain but whatever. These tiles are the ones that sit there being all ground like and are going to always be under the player no matter what so you step on shit and be like fuck your shit bitch I'm a mother fucking Hero trying to save the day 'n shit and you're just being in my way.
The ground tiles are going to be their own separate sheet 256px by 256px image with 32px by 32px tiles making 8x8 tiles so 64 tiles total.
So from there you can just place the fuck out of these tiles and set the ground without and fancies on it.
On the editor when you chose to draw with the ground tiles, the properties section on the right or whatever will populate with the ground tiles of the specific tile sheet you associated with this map file (this is where the GUI stuff really needs to come into play).
OBJECT TILES
Object tiles are really cool because they're just bad ass and shit. Basically you have an object image for each object you wanna place in the game.
So lets say you made some bad ass looking map but it's just grass and it's not bad ass at all you dirty liar. So you wanna spice things up like Emeril does and throw some shit in the pan and go BAM like a retard. So what you would do is create a new object tile. Basically what that does is you pick an object resource like a damn tree or something cool like that. Now it opens up in a preview window which you can set the layering of it. Basically there's a virtual grid drawn over the object so you can see each tile more clearly. Now what you would do is click on the spots that are supposed to be above everything else, and that will put those above the player and also above other stuff too so you don't have to worry about layering.
Okay so now you got your bad ass tree all tree like and you're ready to tree the fuck out of your new map. So all you gotta do is go to the object drawing tool and open up the object panel which shows all your little objects being all object like and stuff. You simply select the object you wanna draw and then you place it on the damn map and bam you got yourself a tree. But wait, if you put a tree right below it the mother fucker does some z-buffering like shit and puts the top of the tree on top of the last tree so you don't have to worry about layers or anything.
AUTO TILE
These guys are really cool cause they know what the hell you're drawing like magic and miracles or something I don't even know anymore. So pretty much you set up the auto tiles just like you do object tiles, the only difference is that you don't stamp them down like you do normal tiles or object tiles. You draw them and they fill in the area you want automatically fixing the problem of drawing edges and corners and all that stupid shit no one wants to hand draw themselves you know?
So you open up a new auto tile and you set the special auto graphic tile which is just a 3x4 tile sheet. The top left is the preview tile that will be in the editor so you don't see a huge ass tile in the thing. Then the tile on the top right are the inside corner tiles which are actually broken into half the regular tile size so in this case 16x16 but that doesn't matter. Then the bottom 9 tiles are the corners and sides and middle. So here you can also set what will be above the player just by clicking on the tiles that you want to float above everything else.
So now you got your auto tile, all you gotta do is select it and then draw and bam the shit just works.
This is used for things like water, pathways with dirt, roofs and houses anything like that to make life easier for map making.
COLLISION TILES
This is pretty simple to explain... it's just collision...
EVENTS
This is where the cool shit comes into play.
I still need to iron this shit out more, but whatever.
Basically you just give a few parameters to the event.
First you give it an identifier to reference it from.
Then you chose what graphic you want. The editor/engine will know if it's a static image or a NPC character sheet based on dimensions.
Then that's pretty much it for the event, it just goes somewhere on the grid in the map.
Sorry for posting all this shit here, it's just easy for me to put it here for later heh.
Also, I'm trying to get tile based movement down, and for whatever reason, I'm having some problems with that haha.
So like my guy will move and I say...
If he's NOT moving then check his position and keep the accel going until your position modulus the tile size (32x32) is zero then you're on a tile.
My guy updates something like player postion += accel and the accel is basically if you're moving in some direction set the velocity to that direction with a speed of 5.0f.
Now what happens is, it tries to stop on (32x32) even section. So it stops not on 32 but instead 160 because if you keep adding 5 over and over again to position you wont hit a 32 mod until then. So what I wanna do is change that so it will work basically...
Does anyone have a good site that has good like old school Final Fantasy movement stuff so I can model my movement off of it?
Thanks, sorry for such a long post that I'm sure most of you wont read.
A lot of this I've said in previous posts but I kind of just channel all my ideas here and then yeah...
But here's the major thing though.
You guys think I should switch to OpenGL? I started to but then I didn't know how to use it very well...
OR if anyone knows how to get SDL in Qt that would be great too.
Thanks.