Author Topic: Smooth Scrolling Tilemapper  (Read 21893 times)

0 Members and 1 Guest are viewing this topic.

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 #15 on: June 21, 2010, 11:55:59 am »
wow nice! I am surprised at how small the code is, too. Do you mind if I ever use parts of it in one of my program if I ever make a game again?

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #16 on: June 21, 2010, 01:16:19 pm »
wow nice! I am surprised at how small the code is, too. Do you mind if I ever use parts of it in one of my program if I ever make a game again?

Go ahead, thats the main reason why I shared it.
But under 1 condition: Author credits :)

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 #17 on: June 21, 2010, 01:17:42 pm »
yeah don't worry if I use it ^^

Also I noticed a bug: when you scroll up/down from each edges of the map, it scrolls twice faster than in the middle
« Last Edit: June 21, 2010, 01:19:10 pm 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 #18 on: June 21, 2010, 01:21:12 pm »
yeah don't worry if I use it ^^

Also I noticed a bug: when you scroll up/down from each edges of the map, it scrolls twice faster than in the middle

Yeh, I noticed that, dunno what's going wrong tho.
Thought it was optic trickery.

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 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 #19 on: June 21, 2010, 02:27:34 pm »
My guess would be that the number of sprites it has to draw is more/less causing the speed to change slightly.
___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 #20 on: June 21, 2010, 02:28:55 pm »
mhmm I am confused... since he draws everything each frame regardless of their position on screen. Could it be that when trying to store them on certain screen sides, they aren't drawn at all?

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #21 on: June 21, 2010, 02:32:32 pm »
I'd doubt that, my code only draws whats visible on-screen plus a right-side and bottom row.

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 #22 on: June 21, 2010, 02:39:50 pm »
really? Mhmm I didn't notice any checks x.x

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Smooth Scrolling Tilemapper
« Reply #23 on: June 21, 2010, 02:43:15 pm »
really? Mhmm I didn't notice any checks x.x

In the drawing sub, change the fors to this:
Code: [Select]
For(T,0,7)
For(S,0,11)

You'll see the difference.
« Last Edit: June 22, 2010, 05:15:04 pm by Ikkerens »

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 #24 on: June 21, 2010, 02:43:58 pm »
ok I'll check this after work

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 #25 on: June 27, 2010, 12:31:35 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:
« Last Edit: June 27, 2010, 12:32:19 pm by FinaleTI »


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 Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #26 on: June 27, 2010, 01:11:09 pm »
Wow, that is really awesome. Does it remind anyone else of George's old game that he was working on? I cant remember what it was called, but it had similar aspects with parts of the map placed on the top of the sprite. For example when he walked under an archway.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #27 on: June 27, 2010, 01:25:27 pm »
Looks really cool and a nice speed.

I did not see the Axe Parser source code to understand the method but in assembly horizontal scrolling is much slower too because shifting bits by rotating them is much more time expensive than moving entire bytes around in the graphics buffer.
Hobbing in calculator projects.

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 #28 on: June 27, 2010, 02:16:52 pm »
Wow this is awesome. Look pretty great too. You should make it scroll 2 pixels so it moves a bit faster, though. Also, I discovered why it runs faster on edges and some other portions of the map, when scrolling vertically: it's because when sprites are aligned horizontally on the screen (displayed at multiple of 8 pixels), it takes twice less time to happen. Displaying them at different locations horizontally apparently requires more processing power because of how the memory works (each byte contains 8 pixels. Imagine when you need to display parts of a byte in another for 96 sprites).

Wow, that is really awesome. Does it remind anyone else of George's old game that he was working on? I cant remember what it was called, but it had similar aspects with parts of the map placed on the top of the sprite. For example when he walked under an archway.
Probably not a lot of people around here, since they all joined long after Dys left, but I remember the project quite well. It was amazing (It used Star Ocean 1 tiles, rigth?)


Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Smooth Scrolling Tilemapper
« Reply #29 on: June 28, 2010, 01:19:24 am »
Yep that would be the one. Brings back memories of how impressive/awesome it was.