Author Topic: Smoothscrolling tilemapper  (Read 35678 times)

0 Members and 2 Guests 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: Smoothscrolling tilemapper
« Reply #30 on: November 07, 2010, 06:33:21 pm »
Wow thats amazing, i tried to do that approach myself but i got a max of 18 FPS and the code looked horrible, i second the request for the source :D

Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #31 on: November 07, 2010, 06:45:29 pm »
That is awesome Runer, incredibly fast.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #32 on: November 07, 2010, 06:47:24 pm »
Some notes about this test program:
  • It uses a 32x32 tilemap, with each tile being 1 byte. For testing purposes, the value of each tile is the sum of its x and y positions in the tilemap.
  • For testing purposes, each tile is an 8x8 tile displaying its base-10 tile number with the left half (tens digit) inverted.
  • Arrow keys to scroll, CLEAR to quit.

EDIT: By the way, sorry if the lowercase comments don't look right. I wrote this program with TI's Program Editor, which turns any lowercase letters that are also statistics variables into those special tokens instead of just treating them as lowercase letter tokens.
« Last Edit: November 07, 2010, 06:55:50 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #33 on: November 07, 2010, 06:52:54 pm »
Thats very impressive, awesome work on this! 

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #34 on: November 07, 2010, 07:41:14 pm »
I didn't comment it much, but hopefully it's still understandable. If not, just ask me about it.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Smoothscrolling tilemapper
« Reply #35 on: November 07, 2010, 08:27:22 pm »
:!Ifθ+1→θ-10
:→θ

so... if, after being incremented, θ=10 then 1→θ?

runer, your optimisation is incredible.

EDIT: i just realised that i've been storing data to GDB1 or whatever, using another variable as the offset, and then calling GDB1 plus the variable (habit carried over from BASIC) when this whole time i could have just stored GDB1 to the variable initially. see, i'm learning already ;D

DOUBLE EDIT:0→θ, eh? so answer isn't carried from if statements. i should really learn the syntax BEFORE messing around with a code.
« Last Edit: November 07, 2010, 08:34:42 pm by shmibs »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #36 on: November 07, 2010, 08:28:55 pm »
:!Ifθ+1→θ-10
:→θ

so... if, after being incremented, θ=10 then 1→θ?

runer, your optimisation is incredible.

Increment θ, and then if it equals θ=10, then 0→θ :P
« Last Edit: November 07, 2010, 08:29:13 pm by Runer112 »

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: Smoothscrolling tilemapper
« Reply #37 on: November 07, 2010, 08:31:03 pm »
Darn, I think you should maybe put this (and the sprite editor that came out a while ago) in the downloads section, that really could be useful in the future, and it might get lost in the Axe sub-forum. Nice job! :)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #38 on: November 07, 2010, 09:07:23 pm »
This isn't a project or anything, I just whipped this up as an example in all of 30 minutes or something. :P
« Last Edit: November 07, 2010, 09:07:41 pm by Runer112 »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #39 on: November 07, 2010, 10:59:44 pm »
Wow, you're source is wonderful.  I like the optimizations... wow... ;D
I must learn to code like you in Axe! >:D

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #40 on: November 07, 2010, 11:02:34 pm »
I wonder if this can be modified to scroll in arbitrary distances... (up to 8 pixels of course)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #41 on: November 07, 2010, 11:02:35 pm »
DOUBLE EDIT:0→θ, eh? so answer isn't carried from if statements. i should really learn the syntax BEFORE messing around with a code.

The answer is carried from if statements, but that was an !If statement which activates when the expression following it equals zero, so zero carries to the next line.

Wow, you're source is wonderful.  I like the optimizations... wow... ;D
I must learn to code like you in Axe! >:D

I've been debating making a super-optimization guide for Axe. Should I?


I wonder if this can be modified to scroll in arbitrary distances... (up to 8 pixels of course)

I'll try my best :P
« Last Edit: November 07, 2010, 11:05:13 pm by Runer112 »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #42 on: November 07, 2010, 11:04:00 pm »
Wow, you're source is wonderful.  I like the optimizations... wow... ;D
I must learn to code like you in Axe! >:D

I've been debating making a super-optimization guide for Axe. Should I?
Please do. :)  I'd love to learn to coding like this. :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #43 on: November 07, 2010, 11:05:16 pm »
Yes, definitely.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #44 on: November 07, 2010, 11:08:41 pm »
I wonder if this can be modified to scroll in arbitrary distances... (up to 8 pixels of course)

I'll try my best :P

I've deduced that scrolling more that 1 pixel per frame means that you would have to display more than 1 column of sprites per scroll, so it would be slower for sure, but i don't think the speed difference would be that large hopefully.