Author Topic: Tilemap optimization  (Read 5486 times)

0 Members and 2 Guests are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Tilemap optimization
« on: February 06, 2011, 08:20:48 pm »
Can anyone make a faster tilemapping engine than this? It can display a full map in approximately a tenth of second.



The engine has to have a rudimentary object collection system, some sort of object display screen, complete collision detection, and full screen map display...

... in pure BASIC.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Tilemap optimization
« Reply #1 on: February 06, 2011, 10:23:45 pm »
HOLY! How in the heck did you do that!?!?
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Tilemap optimization
« Reply #2 on: February 06, 2011, 11:30:07 pm »
I imagine you are storing the string directly in your program, displaying it with output, and then using sub() for collision?

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: Tilemap optimization
« Reply #3 on: February 07, 2011, 12:31:35 pm »
Well, the string is stored externally and there's a lot of math surrounding that Sub( command, but close enough :P
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: Tilemap optimization
« Reply #4 on: February 07, 2011, 12:34:44 pm »
that's actually what I got to.  I don't think you can really make it much faster than that, but there are ways to compress the strings (though I forget the method, and it's a bit slow)

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: Tilemap optimization
« Reply #5 on: February 07, 2011, 03:04:42 pm »
I think the only way to make it faster is to have the map stored in a string and a second copy in a pic (where solid tiles are all white), then do pxl-test collision detection. I think Builderboy did that in Trapped.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Tilemap optimization
« Reply #6 on: February 07, 2011, 03:54:01 pm »
I think the only way to make it faster is to have the map stored in a string and a second copy in a pic (where solid tiles are all white), then do pxl-test collision detection. I think Builderboy did that in Trapped.

Almost right.  I had the strings stored in my program, and then instead of Output()ing them onto the homescreen, i Text()ed them onto the graph screen.  It took longer to display maps, but i was able to use pxl-test() for collision, which made movement faster

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: Tilemap optimization
« Reply #7 on: February 13, 2011, 02:58:42 pm »
Oh ok the pxl-test was directly on the displayed chars. I assume this must not work with many chars, right, though?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Tilemap optimization
« Reply #8 on: February 13, 2011, 02:59:44 pm »
Yeah, i was very limited to the characters I was able to use, since they all had to have the same pixel on

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Tilemap optimization
« Reply #9 on: February 13, 2011, 03:01:16 pm »
Can anyone make a faster tilemapping engine than this? It can display a full map in approximately a tenth of second.



The engine has to have a rudimentary object collection system, some sort of object display screen, complete collision detection, and full screen map display...

... in pure BASIC.

TI-Basic? It looks so fast! With Correlation it could be improved, but Pure Basic! It looks really fast ;D