Tilemaps, etc..
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Tilemaps, etc..
Are there any good examples of tilemap systems made in Purebasic?
I am just thinking ahead to my next project, and I really want to attempt a console style 2D RPG (ala early Final Fantasy and other SNES RPG's)
Pixel artists are some of the most expensive, so I'm gonna have to rely on free assets (there are some nice ones out there) and my ability to modify them (decently, I hope).
If anyone has thoughts about these types of games I'd like to hear them. I know there are a variety of ways you could do a Tiled Map system (Character substitution seems to be really popular, i.e Letter = Tile , saved in a text file format, sometimes with the structure being the actual map in-game)
I'm more interested in the effects side of things though. I've never worked with graphics of any kind before, beyond pasting some simple stuff together for a GUI in DarkBasic..
Doing special things like fade-in/out, or other such special effects. I'm not very good with the math involved in image transformation/manipulation etc.. So any good resources I could learn from would be a helpful start.
I am just thinking ahead to my next project, and I really want to attempt a console style 2D RPG (ala early Final Fantasy and other SNES RPG's)
Pixel artists are some of the most expensive, so I'm gonna have to rely on free assets (there are some nice ones out there) and my ability to modify them (decently, I hope).
If anyone has thoughts about these types of games I'd like to hear them. I know there are a variety of ways you could do a Tiled Map system (Character substitution seems to be really popular, i.e Letter = Tile , saved in a text file format, sometimes with the structure being the actual map in-game)
I'm more interested in the effects side of things though. I've never worked with graphics of any kind before, beyond pasting some simple stuff together for a GUI in DarkBasic..
Doing special things like fade-in/out, or other such special effects. I'm not very good with the math involved in image transformation/manipulation etc.. So any good resources I could learn from would be a helpful start.
Re: Tilemaps, etc..
Tile mapping is really a very easy to do technique. I'm sure if you invest some thinking time you will figure it out yourself. I did.
To get you started:
per frame, you draw every tile that is visible on the buffer. The math is really easy.
Lets say you have a screen that is 800*600 pixels and your tile size is 20*20 (totally arbitrary) then you know you get 800/20=40 Tiles per column and 600/20=30 tile per row. So you do a loop: for 30 times, draw all 40 tiles in a line.
I store my tile indexes in a simple 2d array... you can do it by character, but i prefer to use integers and write my own editors... in the long run that is easier to work with when you actually see what you are doing.
Your "camera" on the map is just an offset in the level array by x,y.
And at that point you can already scroll per tile.
Softscrolling is done by using modulo. Divide a per pixel camera position by tilesize and you know which tiles to draw. Per pixel camera position modulo tilesize gives you how much you have to displace everything on drawing.
Hope that gives you some inspiration. I could do an example, but not before weekend as I have a couple of 12hr work days ahead of me this week.
To get you started:
per frame, you draw every tile that is visible on the buffer. The math is really easy.
Lets say you have a screen that is 800*600 pixels and your tile size is 20*20 (totally arbitrary) then you know you get 800/20=40 Tiles per column and 600/20=30 tile per row. So you do a loop: for 30 times, draw all 40 tiles in a line.
I store my tile indexes in a simple 2d array... you can do it by character, but i prefer to use integers and write my own editors... in the long run that is easier to work with when you actually see what you are doing.
Your "camera" on the map is just an offset in the level array by x,y.
And at that point you can already scroll per tile.
Softscrolling is done by using modulo. Divide a per pixel camera position by tilesize and you know which tiles to draw. Per pixel camera position modulo tilesize gives you how much you have to displace everything on drawing.
Hope that gives you some inspiration. I could do an example, but not before weekend as I have a couple of 12hr work days ahead of me this week.
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
Is an Isometric view a lot harder to achieve?
I probably will end up making my own editor in the long run, although I am not sure of the style I want to do it in yet (orthogonal, isometric, etc)
I probably will end up making my own editor in the long run, although I am not sure of the style I want to do it in yet (orthogonal, isometric, etc)
Re: Tilemaps, etc..
I still managed to figure out Isometric tilemapping with a pencil and paper(those are some of the most important tools for a programmer - pencil, paper and an eraser), so I don't think it is much harder.
It poses some slightly more difficult challenges though, like drawing order, screen to map coordinate conversion etc.
No promises, but if I find time I may write some example code this weekend on general tilemapping and isometric tilemapping. I didn't spend much time thinking about Ultima style orthogonal, though (as it makes me feel queasy for some reason) so I will definitely skip that one.
It poses some slightly more difficult challenges though, like drawing order, screen to map coordinate conversion etc.
No promises, but if I find time I may write some example code this weekend on general tilemapping and isometric tilemapping. I didn't spend much time thinking about Ultima style orthogonal, though (as it makes me feel queasy for some reason) so I will definitely skip that one.
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
No worries, I probably won't start this project for a while.
I'm just thinking ahead. I still have to finish my Text RPG Engine & Editor Tools
I'm just thinking ahead. I still have to finish my Text RPG Engine & Editor Tools
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
Another Question..
I don't know what's coming in PB 4.6, but just running on what we currently have. Could I do this with hardware acceleration? Using the Sprite3D related functions? any potential issues there?
Anyone know if there is stuff coming that allows for more/better 2D under Direct3D/OpenGL ?
I don't know what's coming in PB 4.6, but just running on what we currently have. Could I do this with hardware acceleration? Using the Sprite3D related functions? any potential issues there?
Anyone know if there is stuff coming that allows for more/better 2D under Direct3D/OpenGL ?
Re: Tilemaps, etc..
The 2D side of things is actually quite nice already. I probably wanted to do the example code with Canvas/software 2d for my convenience, though.
I wouldn't bother thinking about OpenGL/Directx, you don't need to know about those if you use Sprite3D, which works very fine.
Those shouldn't create any issues.
4.6 is supposed to have bigger improvements on the 3D engine part, which doesn't really have anything to do with the Sprite/Sprite3D side of things, but right now they are undocumented. Early this month the final version is planned for release which will bring documentation for the improved engine3d commands.
You would possibly want to use engine3d for creating a "real" 3d game. I don't care about those too much though and haven't used it so far. I don't have a lot of Math knowledge when it comes to 3d and also if you create a "real" 3d game, you also need 3d assets, which i suck at.
Also, I am an old fart and like the 2d look.
I wouldn't bother thinking about OpenGL/Directx, you don't need to know about those if you use Sprite3D, which works very fine.
Those shouldn't create any issues.
4.6 is supposed to have bigger improvements on the 3D engine part, which doesn't really have anything to do with the Sprite/Sprite3D side of things, but right now they are undocumented. Early this month the final version is planned for release which will bring documentation for the improved engine3d commands.
You would possibly want to use engine3d for creating a "real" 3d game. I don't care about those too much though and haven't used it so far. I don't have a lot of Math knowledge when it comes to 3d and also if you create a "real" 3d game, you also need 3d assets, which i suck at.
Also, I am an old fart and like the 2d look.
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
I agree with you. I very much like the old 2D look, specifically of older RPG's but even some of them from the 90's on Playstation did cool things with sprites in 3D-ish environments.
I also suck at math, and its why I haven't given serious tries to 3D, but I'm more interested in any performance benefits of using the hardware, I guess. However after playing Sacred 2:Fallen Angel, released just before Ascaron went under, I was very intrigued with making a game in 3D, and then locking the camera to a range that essentially mimics an Isometric Engine, except with Camera rotation.
Either way I suck at both 2D and 3D art of any kind.. I can't even do pixel arts
lol
I also suck at math, and its why I haven't given serious tries to 3D, but I'm more interested in any performance benefits of using the hardware, I guess. However after playing Sacred 2:Fallen Angel, released just before Ascaron went under, I was very intrigued with making a game in 3D, and then locking the camera to a range that essentially mimics an Isometric Engine, except with Camera rotation.
Either way I suck at both 2D and 3D art of any kind.. I can't even do pixel arts
Re: Tilemaps, etc..
Actually, using the
Engine3D commands to create a 3d environment and having 2D figures in it might work. You could even have all the game logic be 2d and even use Tilemapping with 3d objects. However, I'd have to look into that myself which I don't really have time for right now, so I will stick to true 2d with accelerated Sprite3ds.
As for art. Well, I'm trying to learn drawing now but so far I suck at that too. However, there is one way to get nice graphics with zero talent. There are special 3d programs with some free and a lot of rather inexpensive assets.
Have a look at DazStudio http://www.daz3d.com/i/software/daz_studio?
or http://poser.smithmicro.com/poser.html. I use the later for isometric renderings of 3d chars which are entirely made from stock content.
Engine3D commands to create a 3d environment and having 2D figures in it might work. You could even have all the game logic be 2d and even use Tilemapping with 3d objects. However, I'd have to look into that myself which I don't really have time for right now, so I will stick to true 2d with accelerated Sprite3ds.
As for art. Well, I'm trying to learn drawing now but so far I suck at that too. However, there is one way to get nice graphics with zero talent. There are special 3d programs with some free and a lot of rather inexpensive assets.
Have a look at DazStudio http://www.daz3d.com/i/software/daz_studio?
or http://poser.smithmicro.com/poser.html. I use the later for isometric renderings of 3d chars which are entirely made from stock content.
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
Thanks for the links.
I have a resource in mind, that has free to use "Chipsets" (Environment, Characters, Objects, etc) in the RPGMaker style, which I like because its basically just like old SNES RPG's.
Hopefully I can modify some of that to look a little unique. But like I said the project is off in the future for now, and I'm just collecting ideas and asking some questions.
I might experiment with 3D Env/2D assets at some point later.
I have a resource in mind, that has free to use "Chipsets" (Environment, Characters, Objects, etc) in the RPGMaker style, which I like because its basically just like old SNES RPG's.
Hopefully I can modify some of that to look a little unique. But like I said the project is off in the future for now, and I'm just collecting ideas and asking some questions.
I might experiment with 3D Env/2D assets at some point later.
Re: Tilemaps, etc..
Be careful with these resources though... a lot of them are ripped from commercial games. Now, I don't think there is a lot reason for companies to defend 15 year old sprite resources, but you never know.
-
Zach
- Addict

- Posts: 1677
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Tilemaps, etc..
I'm careful about that, and it's usually pretty obvious when things come from games, imho. But I grew up on a lot of those games so maybe its easier for me to tell..
Either way, most of the ones I have in mind are originals, released by a specific person/group.
Either way, most of the ones I have in mind are originals, released by a specific person/group.

