Author Topic: Grammer 2-The APP  (Read 146915 times)

0 Members and 1 Guest are viewing this topic.

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #270 on: March 03, 2012, 11:58:23 am »
Yes... But what if you wanted to make the tiles not tiles, but pixel-by-pixel?

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #271 on: March 03, 2012, 02:46:32 pm »
It would take a lot more memory, but if you wanted it to still be speedy, too, you could make several buffers containing the data in layers. For example, 3 buffers could make each pixel in 8 different states. To better save on memory, you could store the location of a few pixels and what they do in memory and just check to see if the region does anything. You could still use tilemaps and not the command. For example, I made a maze like program that used 6x6 tiles and a buffer that contained the values for those regions. The program would manually draw the stuff, but it was easy to see if you were on a warping tile or a tile that would kill the player or whatnot.

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #272 on: March 12, 2012, 03:39:07 pm »
Just wondering, exactly how long does it take to use pxl-test in Grammer?

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #273 on: March 12, 2012, 04:02:16 pm »
I just ran this code and it took 8 seconds to pixel test 10 000 times:
Code: [Select]
0→X→Y
For(A,0,9999
pxl-Test(X,Y
End
Stop
That was in 6MHz, too :D

EDIT:40 seconds to do 60 000, so about 1500 pxl-tests per second

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: Grammer 2-The APP
« Reply #274 on: March 12, 2012, 04:05:07 pm »
I just ran this code and it took 8 seconds to pixel test 10 000 times:
Code: [Select]
0→X→Y
For(A,0,9999
pxl-Test(X,Y
End
Stop
That was in 6MHz, too :D
therefore about 5 seconds to check the entire contents of the screen(not as if that's actually needed)

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #275 on: March 12, 2012, 04:10:53 pm »
I just tested on my real calc and all the pixel commands are that fast O.O
EDIT:
it takes about 4 seconds to fill the whole graph screen using Pxl-On( which is 6144 pixels (also at 6MHz)
Using math is what will slow it down, though D: It takes 7 seconds if I use Pxl-On(X+1,Y+1

And about 10 to 11 seconds when multiplying by 65535 (the slowest multiplication)

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #276 on: March 12, 2012, 04:53:40 pm »
Wow, so it takes about 1.25 milliseconds to do pxl-test.
On a similar thing for pxl-test on my NXT, it takes around .48 milliseconds. How fast does it go running at 15 Mhz?

EDIT: On my NXT it takes 1.221 seconds to fill the screen with going just pixel by pixel.

EDIT2: So how does PARTEX2 run so fast with so many particles??
« Last Edit: March 12, 2012, 04:57:37 pm by nxtboy III »

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #277 on: March 12, 2012, 08:20:20 pm »
It takes about 1.70 seconds to fill the screen at 15MHz. As for Partex2, I just wrote the code to be fast. It reads the coordinates from an array and pixel tests as needed. To update a particle, it just changes the coordinates and draws accordingly. I am actually going to rewrite it to be faster, hopefully. I made a grayscale version over spring break, but at 2000 particles, it definitely could not do grayscale XD It did not look bad at all, actually, but I still want to see if I can speed up the process :)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer 2-The APP
« Reply #278 on: March 12, 2012, 10:12:50 pm »
* TBO_Yeong thought new Grammer came out D:
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #279 on: March 12, 2012, 10:38:54 pm »
Sorry D: I am trying to think of what I can easily tackle or fix for now :/

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #280 on: March 13, 2012, 07:50:32 am »
So it reads from a map and an array? Why not just one?

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #281 on: March 13, 2012, 08:27:59 am »
I am confused... D: A tilemap is an array...

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #282 on: March 13, 2012, 08:30:03 am »
oops....  :banghead: I meant to say that it reads from the screen (pixel data) and an array?
« Last Edit: March 13, 2012, 08:30:35 am by nxtboy III »

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 2-The APP
« Reply #283 on: March 13, 2012, 08:37:58 am »
Oh, for the particles. Yes, it has to read from both so that it can interact with the environment. There is a particle buffer and screen buffer. The particle buffer interacts with the screen buffer :) That is how it flows around static objects :D

EDIT: I refer to the particle array as a particle buffer.

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Grammer 2-The APP
« Reply #284 on: March 13, 2012, 08:47:32 am »
So are the particle location's stored in a variable (array of locations)?