|
Post by theelf on Mar 30, 2013 18:48:49 GMT -5
Hi moon, do you think is possible to load every 512px (64tiles) a new map? to made a longer scroll area, because now is limited to 64tiles max
Thanks, and again, great example
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 31, 2013 14:54:47 GMT -5
Hi moon, do you think is possible to load every 512px (64tiles) a new map? to made a longer scroll area, because now is limited to 64tiles max It's possible .. but it's not that simple. For starters, you certainly don't want to load a entire 64 tiles wide "map" at once. The key to any scrolling engine is to only load the rows and / or columns that have scrolled into view. Also, if you want to do horizontal scrolling levels, i highly recommend changing the map format / layout to be column-based instead of row-based. That way you won't have varying address offsets for the collision checks, and it gives you the option to speed things up using DMA operations. + Just as a reminder, i made this example to show how to do Castlevania style controls & collision, not how to do scrolling
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 3, 2013 22:57:03 GMT -5
Of course, me and moon are diametrically opposed on this issue. The closer you get to interpreted and or unoptimized assembly the more reason you have to use less commands. I've made scrolling engines that load new chunks of map in 21x21 tile segments. Had to break that down and go for 16x16 tiles at a time.
This technique is great for RPGs that need large meta-tile maps to simulate big cities and dungeons.
Draw many tiles in advance so you minimize scrolling routine calls.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 4, 2013 14:51:00 GMT -5
I hate doing this .. but theloon doesn't know what he's talking about. Please ignore his post(s). Virtually all scrolling games from the 8/16-bit era use the approach i described ( for years on this forum ). Here are some tile-map debug captures from several Master System games ( since I'm not aware of any MegaDrive emulators with a tile-map debugger ). Horizontal scrolling Vertical scrolling 8-Way scrolling Obviously on the Master System the name-table is only slightly bigger then the active screen ( so it's the only way to go ), but it's still the go-to technique ( since it's fastest & most constant ) on the MegaDrive / SNES etc.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Apr 6, 2013 10:30:54 GMT -5
moon is correct, the proper way to do a scrolling engine is to only draw what's going to be visible. Sure, there are other methods, but you'll most likely run into speed issues or other various issues the more you add to it (npc's/enemies, animated backgrounds/tiles, etc).
It's more efficient to draw 1 row or 1 column (especially if you're only scrolling a few pixels at a time) rather than preloading/drawing sections that you may not even see.
|
|
|
Post by beechris on Jun 1, 2014 11:59:09 GMT -5
Moon, when you have the time would it be possible to add some comments in the code for a beginner like me, just so i could understand the process a bit better. If not don't worry I'll look up the commands etc and come back with a few questions.
Thanks Chris
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 1, 2014 12:56:32 GMT -5
Moon, when you have the time would it be possible to add some comments in the code for a beginner like me, just so i could understand the process a bit better. The Castlevania example might be a little complex for ( most ) beginners though. Is there anything specific you need help with ( in the example )? Or do you want to get a better understanding of the general structure? By the way, feel free to start your own thread when you need help with a project of your own .. since unless you're doing a Castlevania clone, it won't be all that useful anyway.
|
|
|
Post by beechris on Jun 1, 2014 13:16:58 GMT -5
Well honestly I want to make a sequel to Master Of Darkness at some point which as I'm sure you know is a castlevania clone. Although really I think I should start right at the beginning before tackling this and come back to it when I am ready for the lessons to be learned.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 1, 2014 14:21:37 GMT -5
Well honestly I want to make a sequel to Master Of Darkness at some point which as I'm sure you know is a castlevania clone. Although really I think I should start right at the beginning before tackling this and come back to it when I am ready for the lessons to be learned. Alright, in that case the Castlevania example can be a good resource to familiarize yourself with the control & collision concepts involved But as you said, you want to do this in the right order .. so i'd recommend starting with getting the main character on screen, followed by being able to walk around with it ( horizontally ). As a side-note: Master of Darkness ( but also Castlevania: Rondo of Blood* ) uses horizontal scrolling only, which makes things a bit easier compared to 8-way scrolling. I assume you'd want to keep this limitation / style? *Mostly, there are a couple vertical scrolling sections.
|
|
|
Post by beechris on Jun 1, 2014 18:33:08 GMT -5
Yeah it would be in the similar style. I am sticking with your advice and continuing with a more basic project for now. Fascinating topic though and I will surely return like count Dracula when I am ready.
|
|
|
Post by mkg on Jun 2, 2014 20:54:14 GMT -5
I hate doing this .. but theloon doesn't know what he's talking about. Please ignore his post(s). Virtually all scrolling games from the 8/16-bit era use the approach i described ( for years on this forum ). Here are some tile-map debug captures from several Master System games ( since I'm not aware of any MegaDrive emulators with a tile-map debugger ). Horizontal scrolling Vertical scrolling 8-Way scrolling Obviously on the Master System the name-table is only slightly bigger then the active screen ( so it's the only way to go ), but it's still the go-to technique ( since it's fastest & most constant ) on the MegaDrive / SNES etc. I tried to do it in bex but it ran at 10fps with no game
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 3, 2014 7:50:08 GMT -5
mkg can you post your .bex file so we can see where the performance issue is?
|
|
|
Post by mkg on Jun 3, 2014 12:33:41 GMT -5
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 3, 2014 13:39:12 GMT -5
Why not continue in that thread then, instead of hijacking this one?
|
|
|
Post by mkg on Jun 3, 2014 20:48:58 GMT -5
Why not continue in that thread then, instead of hijacking this one? recently now, i posted the same message on the post: Having perfomance issues
|
|