Author Topic: Smooth Scrolling Tilemapper  (Read 21982 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #30 on: June 28, 2010, 01:20:34 am »
Is there still a copy/demo of it around anywhere?  I would like to just play around with it ^^

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #31 on: June 28, 2010, 03:59:00 am »
Unfortunately, nope :(

No demo were ever released

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #32 on: June 28, 2010, 05:07:07 pm »
I was playing with this program yesterday and I modified it so that it masks a sprite over the map, then masks a forground over the entire screen.

Screenie and source (Credit for the original engine goes to Ikkerens of course :)) attached:

Well done, kinda like that effect.
Could always be nice when creating cinematics or sumthing.

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Smooth Scrolling Tilemapper
« Reply #33 on: June 28, 2010, 05:19:26 pm »
Or for mapping Chrono Trigger style... *cough*
Actually Chrono Trigger is what inspired my mod of your engine.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #34 on: June 28, 2010, 10:55:41 pm »
I was playing with this program yesterday and I modified it so that it masks a sprite over the map, then masks a forground over the entire screen.

Screenie and source (Credit for the original engine goes to Ikkerens of course :)) attached:

Well done, kinda like that effect.
Could always be nice when creating cinematics or sumthing.
One idea I had using his trick would be to have a second tilemap displayed on top of the first that is smaller, but scrolls 2x faster. Example: when you are in a forest, leafs could scroll faster. That tilemap could just loop. Another use could be in a side scrolling game where you are in a cavern and you see stalagmites/stalacites in front of the game map, scrolling 2x faster when you move around. You could even add a background that scrolls much slower. Keep in mind this would become rather slow, though, especially if you had to use sprite masking.

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #35 on: June 29, 2010, 03:45:31 am »
I was playing with this program yesterday and I modified it so that it masks a sprite over the map, then masks a forground over the entire screen.

Screenie and source (Credit for the original engine goes to Ikkerens of course :)) attached:

Well done, kinda like that effect.
Could always be nice when creating cinematics or sumthing.
One idea I had using his trick would be to have a second tilemap displayed on top of the first that is smaller, but scrolls 2x faster. Example: when you are in a forest, leafs could scroll faster. That tilemap could just loop. Another use could be in a side scrolling game where you are in a cavern and you see stalagmites/stalacites in front of the game map, scrolling 2x faster when you move around. You could even add a background that scrolls much slower. Keep in mind this would become rather slow, though, especially if you had to use sprite masking.

Im doubting that, doesn't sound too difficult in my head.
Might try it out once, if no one else does.

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #36 on: June 29, 2010, 03:49:14 am »
well, the thing that could slow things down is the fact you would have to draw like 5 13x9 maps every frame (first, the background, scrolling every two frame, secondly, the middleground (where your character walks) mask, third, the middleground tilemap itself, fourth the foreground mask, scrolling 2 pixel by 2 pixel and finally the foreground tilemap. If all your tiles are sqares, then you don't need masks, though.
« Last Edit: June 29, 2010, 03:50:52 am by DJ Omnimaga »

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #37 on: June 29, 2010, 03:53:04 am »
I'd say, 2 extra lines in my for loop, optimized not more than 100 bytes extra. (excl. Graphics)

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #38 on: June 29, 2010, 03:57:47 am »
I guess you should prbly try it, then, since you seems to find the idea pretty easy (I have a clue how, but I am not too sure how I would manage over 16 fps on a regular 83+ with it. I mean, it's between 351 and 585 tiles per frame you need to draw, after all)
« Last Edit: June 29, 2010, 03:58:04 am by DJ Omnimaga »

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #39 on: June 29, 2010, 04:21:39 am »
I guess you should prbly try it, then, since you seems to find the idea pretty easy (I have a clue how, but I am not too sure how I would manage over 16 fps on a regular 83+ with it. I mean, it's between 351 and 585 tiles per frame you need to draw, after all)

Well, the main slowdown is DispGraph, not the Pt- functions.
But DispGraph still has to draw 768 bytes, no matter how many tiles.

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #40 on: June 29, 2010, 04:25:03 am »
I know, but drawing an incredible amount of tiles eventually adds a slow down. Trust me, I tried it myself. I got an engine right now that draws 14 sprites+tiles per frame. It's blazing fast! If I add a background of 96 tiles, regardless of their content, the speed drops by almost half.

Please show me proof that you can achieve similar speed between a tilemapper where 96 tiles are displayed every frame (unaligned horizontally) and one with 300-500.
« Last Edit: June 29, 2010, 11:21:14 am by DJ Omnimaga »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #41 on: June 29, 2010, 04:25:45 am »
Well, the foreground layer would be sparse, so it wouldn't be that many tiles.  Its 117 tiles for the background.  I'll give a conservative estimate of 20 tiles in the foreground and lets say for sake of argument that all 20 tiles are masked.  Plus maybe a 4 tile character, that's 161 tiles per frame, which should be around 16 fps in 15MHz mode, but probably laggy at normal speeds.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #42 on: July 02, 2010, 03:10:52 am »
I found a trick to make parralax scrolling much faster for when you use a background filled with the same 8x8 tile:

Instead of doing
Code: [Select]
X^16->Q/2->Q
Y^16->R/2->R
For(Z,0,12)
For(O,0,8)
Pt-On(Z*8-Q,O*8-R,Pic1)
End
End

I did
Code: [Select]
X^16->Q/2->Q
Y^16->R/2->R
For(Z,0,12)
For(O,0,1)
Pt-On(Z*8-Q,O*8-R,Pic1)
End
End
For(Z,1,7)
Copy(L6,Z*96+L6,96)
End

It's 77 bytes larger, but see the huge speed difference below! (the later code doesn't need as much processing power because only 24 tiles needs to be displayed unaligned). Note that due to the nature of the engine I am using in my game, the speed increase is much higher than it would be with a regular tilemapper. If your tilemapper is very complex, it's up to you to decide if the speed increase vs size increase is worth it
« Last Edit: July 02, 2010, 03:15:32 am by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #43 on: July 02, 2010, 03:23:28 am »
Thats ingenious :D I wonder if any Tilemapper Axioms will be written, because i hear there are mucho optimizations that are involved with displaying smooth tilemaps instead of just looping a sprite routine.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Smooth Scrolling Tilemapper
« Reply #44 on: July 02, 2010, 03:32:46 am »
yeah same here. I would kinda prefer if it was implemented in Axe, though, so it can be used in the contest. I assume this is not a priority, though. Also I wonder how he would handle smooth scrolling?

I got the idea of Copying the buffer top content when working with unaligned tiles. I saw it was 2x slower and thought: hey, if I just draw enough tiles to fill the top 8 rows, why wouldn't I just copy the rest below afterward? It would need to draw 4x less tiles unaligned.