Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Builderboy

Pages: 1 ... 287 288 [289] 290 291 ... 375
4321
ASM / Re: ASM Delvar - Clean and free up from BASIC variables
« on: April 18, 2010, 01:49:28 pm »
I'm with ztrumpet on this one, custom Lists are almost always highscores or save files O.O and i'm not sure if Strings should be deleted,  I know some games use them to store data.  I say just leave them out :)

4322
OmnomIRC Development / Re: OmnomIRC
« on: April 18, 2010, 01:42:36 pm »
I also noticed :( It makes me sad

4323
TI Z80 / Re: Tetris in TI basic
« on: April 18, 2010, 01:09:21 am »
Okay i switched the code to this instead to get rid of any discrepancy:

Code: [Select]
StartTmr->A
Repeat checkTmr(A
End
For(F,0,9001
C
End
Output(1,1,checkTmr(A)/F

and

Code: [Select]
StartTmr->A
Repeat checkTmr(A
End
For(F,0,9001
123
End
Output(1,1,checkTmr(A)/F

and i got .002888 seconds for the first code and .002332 seconds for the second code.  Somehow, even merely storing the result to Ans is slower when accessing a variable.


And as for matrices, i understand how they are so much faster for line clearing, but they are not faster when being accessed for collision, even if put into a seq() command.  And i would much rather have fast gameplay and a half second slower line clearing than slower gameplay and blazing fast line clearing.
 

4324
TI Z80 / Re: Tetris in TI basic
« on: April 17, 2010, 11:09:19 pm »
But wait, I was Using real variables, not immaginary ones.  The OS does know the difference, and even groups them diffeently in the memory menu.

4325
TI Z80 / Re: Tetris in TI basic
« on: April 17, 2010, 09:54:16 pm »
In TI basic the varibles a-z and Theda are indexed using an array and the calculator doesn't have to do anything more then *(arry_ptr+var_name-'a') to retrieve the value. where as the resolution of a number is a far more complex task because It has to do a conversion form a char array to a float which If you've ever implemented that in c is not pretty and a rather complex loop even when optimized.

While it makes sense in theory, the TiOS is fairly weird, try these programs: (Note you need an 84)

Code: [Select]
StartTimer->A
For(F,0,9001
123+456
End
Output(1,1,CheckTimer(A)/F

Code: [Select]
StartTimer->A
For(F,0,9001
C+C
End
Output(1,1,CheckTimer(A)/F

This is my old code tester program, it tells you how many seconds it takes for any given piece of code to execute.  It is very useful for comparing two pieces of code.  It works by starting the timer, running the code for over 9000 iterations (more if needed) and then finding the ratio.  The first program evaluates to about .00279 Seconds, and the second evaluates to .00365 seconds.  Of course this isnt completely accurate because of the presence of the for loop, but it does give a good way to compare, and for some strange reason Variables take longer then Numbers o.O and accessing Lists takes longer than both variables or numbers, at

As for matrices, while they do make for line testing to be quite faster, everything else becomes quite slower.  Reading from a matrix of that size takes about .00411 seconds, while using a PixelTest takes .00322 seconds.  As for storage, storing to a matrix takes .00444 seconds, and storing to the screen... you already did it when you updated the screen ;) so it takes no extra time.  I focused on getting the main loop as fast as possible, and since it needs at least some form of collision, i decided for pixel-tests instead of matrices.


4326
General Calculator Help / Re: TI Nspire OS Downgrade
« on: April 17, 2010, 07:30:14 pm »
Oops  ::) Heh, silly things that are usually helpful but can be misleading under certain circumstances   ;D

4327
General Calculator Help / Re: TI Nspire OS Downgrade
« on: April 17, 2010, 07:14:43 pm »
http://ourl.ca/4626

This should clear up any confusion

4328
TI Z80 / Re: Tetris in TI basic
« on: April 17, 2010, 07:13:41 pm »
Yeah, i find that Lists tend to be a lot slower because then you need to use loops to iterate through the 4 elements of the piece, and while the interpreter might be slow, running a loop if definetaly slower than expanding it all the way out.  For example:

Code: [Select]
Pt-On(0,0
Pt-On(1,0
...
Pt-On(94,0

is always going to be faster than

Code: [Select]
For(F,0,95
Pt-On(F,0
End

because even though it might look like you are cutting down on parser time, the OS is still parsing Pt-On(F,0 96 times, and now you are both using the variable F, but also having to go through the loop 96 times.

As for controling the speed of the falling, i use this piece of nifty code:

Code: [Select]
C(C!=V)+1->C
Which when looped over and over, will make C loop from 1 to V-1 over and over.  When C=1 i move the piece down, and so changing V changes the speed at which the piece falls.  Or more accurately, V is the number of frames between drops of the piece.

For removing lines, I retrieve the Y values of the piece that just dropped (since those are the only ones that could possible clear lines) and i loop through them top to bottom.  I loop across the entire screen, and if every block is filled, i move onto the clear line set of code.  The clear line set of code copies lines from the line above, to the current line, and moves upward until there are no more blocks to be copied.  After the program does this for all 4 possible Y values, the code exits.

Generating block patterns is easy, I merely store all possible block patterns in the beginning of the program to 2 lists (the storing is a bit weird because i was trying to cut down on memory) and they are accessed with Random numbers.

This Tetris clone is not perfect, but the main loop is so minimal that i see very little ways for it to be sped up.  One way would to be to do as you suggested and only switch the pixels that change, although calculating which pixels is often going to take longer than just turning them off to begin with.  Right now the main loop consists of only this:

Turning on the piece
Incrementing the counter
Getting the Keypress
turning Off the piece (not always done
Moving the piece
Checking for collision

And as every single one of these pieces of code is needed, the only way i can see to make it faster is to improve on the methods used.  However, there might be an alternative method that i am overlooking, often times thinking out of the box can yield impressive results, with creative code :) Tetris in Ti Basic is definetaly one of the greatest challenge for a Basic programmer, as is many real time puzzle/action games

4329
S.A.D. (Seek and Destroy) / Re: [S.A.D.] Progress 2010
« on: April 17, 2010, 06:04:47 pm »
Wooo wow a demo release?  That sounds awesome :) glad you are releasing this to the public, cant wait to try it out! ^^

4330
I know there is a Flash version of Doom somwhere on the internet...  I'll see if i can find it...

*runs off*

4331
Miscellaneous / Re: Darkmod theme
« on: April 17, 2010, 05:58:29 pm »
Wow, i like it a lot :) Its like the dark side of Omnimaga ;D

4332
TI Z80 / Re: Tetris in TI basic
« on: April 17, 2010, 05:57:57 pm »
Yeah, its not very well documented.  Try this

Pt-On(0,0,2

or

Pt-On(0,0,3

and you can get a block and a plus :)

4333
The Axe Parser Project / Re: Axe Parser
« on: April 17, 2010, 01:16:13 am »
Hey I was wondering, if you are usig memory locations as variables, is it any faster to say A than {L1+12}?  Because I have already run out of variables in Portal and I have had to seep into memory locations.

4334
Portal X / Re: Portal X
« on: April 16, 2010, 08:00:37 pm »
Yeah, the puzzles were never really based upon stacking them, more about getting the boxes from here to there, which was such a big part of the original that i knew i had to include it one way or the other ^_^

4335
Portal X / Re: Portal X
« on: April 16, 2010, 07:49:09 pm »
Yeah, im looking into implementing crates that you can pick up and move.  However, it will not support full physics, as trying to get physics and forces to work through Portals would be a nightmare.  Whats going to end up happening is there will be little 2x2 black crates that you will be able to pick up with 2nd, and then carry around and place onto buttons and things.  However, they will not stack, collide with other boxes, and you will not be able to stand on them.  They will have velocity and momentum however, so you will be able to drop them through portals and watch them fly ;)

Pages: 1 ... 287 288 [289] 290 291 ... 375