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 - Insorak
31
« on: December 15, 2009, 02:10:21 pm »
Because the TI-BASIC parser is idiotic. Okay, I've attached the files. Theta-G is the main file for the movement engine, and theta_G.txt is the source code for that file. Thanks a bunch, guys! Appreciate it!
32
« on: December 15, 2009, 11:29:30 am »
Lunch was extraordinarily hectic, so I will be posting code after school. I'm on one of my school's pathetic Macs right now (which, incidentally, doesn't have TI-Connect - imagine that!) so I can't transfer code right now. (I suppose I could just type it out, but I have better things to do with my time. ) Never use Y variable. Some TI-OS glitches causes it to be reset to 0 from time to time. You'll run into problems later. I think ztrumpet is right - the Y variable automagically gets set to zero whenever you display the graph screen. However, I don't display the graph screen while I'm moving except if I go into the menu (during which I temporarily save the value of Y somewhere else). I've already run into problems with that in which I moved up a screen whenever I exited the menu. It was fixt rather fast. ztrumpet, it made sense. I need to test that. If it's true (and not that I'm doubting you, but I like to test these things. There should be documentation for that somewhere, or else I can't read), then it would be an interesting speed-for-memory tradeoff (and a good excuse not to use xlib). Okay, thanks for xcopy syntax.
33
« on: December 14, 2009, 07:16:58 pm »
I need to do that particular check every turn, actually - the counter ticks down once per turn
34
« on: December 14, 2009, 06:19:37 pm »
@ztrumpet: Not according to TI-BD, it isn’t: http://tibasicdev.wikidot.com/timings#toc3The If:X structure is only considerably (20-fold) slower if one uses a For( loop, of which there are none in my movement engine. Otherwise, the speed is comparable (and even slightly faster). And aahhh... xcopy uses the X variable. This could be slightly problematic, as my movement is stored (temporarily) in the variables X and Y before these variables are copied to L4(8 ) and L4(9). (Justification for this is the enormous toll saved on memory – X and Y take up one byte each, while L4(n) takes up an enormous five bytes. The default list variables take up TWO bytes each, which is extremely irritating.) Does xcopy have deletion capabilities for the programs as well, or will I have to use another ASM library, since I don’t think I can manage otherwise? This is quite the interesting collection of ASM code I’m assembling (pun completely intended) I just tried it without xlib, and it didn't seem to run any faster. When I counted pixels there was a tiny difference, but not really enough to matter. I would love some help with this devilish piece of code, builderboy I'll post it tomorrow (when I hijack my friend's link cable) but I'll just give some background information now (he brings his laptop to school and we only have lunch to do this, so I won't have time to type it out then): - In [A] is the "world" map for each portion of the game, and the element stored in a place in [A] gives you what map loads. For example, in the first zone, [A] is a 2x4 matrix with [[4,5][3,6][2,7][1,8]]. You start in room 1, and which room you progress to after that depends on which side you exit from. (i.e. if you exit to the up direction your y-coordinate in the matrix increases 1).
- I'm not going to include the menu or teacher mode programs - only the map file, the event file, and some other necessary stuff. So don't press 2nd unless you want an error.
- All the checks for stuff in L6 are completely necessary. (They're your status ailments.)
- Whether you can move or not is determined directly from the string, seeing if sub(Str1,16(Y-1)+X,1 returns a valid string that you can move on. This is probably the slowest part, but I couldn't think of anything else unless you want me to store everything to a 128-element list which is extremely memory-inefficient.
- You need xlib enabled. (Duh. )
Thanks for all the help and support so far, guys - I'm going to take a break (and do my homework) tonight! See you all tomorrow at noon E - wait, do you guys just want the code or the actual files themselves to see how fast it runs? Code would be harder to do (my friend doesn't have a program editor on his computer).
35
« on: December 14, 2009, 05:27:02 pm »
Lists are fun. They’re like arrays, but better. I swear, I became a better programmer overnight. I don’t even know how I thought of it – I had a brain flash or something like that! Well, I managed to rewrite almost my entire movement engine without leaving anything out. (It wasn’t as tricky as I thought it would be.) The problem is, even though the program is smaller than the old one (730-odd bytes as opposed to 760-odd bytes), it runs at about 2/3 the speed and is almost painfully slow. It’s really frustrating, and I’m pretty sure it’s as optimized as it can be. That’s also the problem with not using xlib. If I use xlib, I can get away with lots of If L6(1:real(5,0,2 statements. But without xlib, I need to use If L6(1:Then:2:Asm(prgmZ:End. Obviously, that consumes a lot more memory and is significantly slower. I’ve realized that it’s not just about those 200-odd bytes of RAM anymore – xlib affects the speed of your entire program considerably. The problem is made worse when this code occurs three times in your movement engine’s main loop. But maybe without xlib it will run marginally faster since xlib slows down the whole OS. *looks up hexcode for contrast change on TI-BD and goes to test* Tomorrow, I’ll stealborrow my friend’s link cable and see if I can get xcopy for a test run.
36
« on: December 14, 2009, 02:38:47 pm »
Yeah, seq( is fun. I forget many times the second argument and skip it. Or put without wanting the last optional argument for increase. Whoops! Much headdesking happened there? Unfortunately, I found a problem - a very major problem - that does not require the use of the seq( command. While writing my movement engine, I somehow neglected to check for wall collisions. Basically, if a wall collision occurred, you would just get your x and y coordinates moved backwards and nothing else would happen. This would not be a problem, except when I implemented my code to call a fight, to take damage from poison, etc. you would still get poison damage and your blindness counter would still tick if you tried walking into a wall as well as regular movement. There's also the chance that you can get a fight after opening your menu. Obviously, this sucks. I need to re-do my entire movement system, and being extremely busy right now (teachers like giving stuff before break ) it's probably going to take me a few days. On the bright side, I drew out all the equipment (56 in total) and finished the inventory screen. It also uses some fancy list manipulations to prevent lots of If statements (I believe the code is H+sum(Ans{100,1000,99999,0,0,0,99999-->H. Basically Ans is a list containing which item you used, and the list it's multiplied by is the amount each item heals). More to come later! After I get this mountain of homework out of the way, that is.
37
« on: December 12, 2009, 11:49:38 pm »
Oh yeah. Doesn't the TI83 glitch and RAM clear if you try to do Rcl on an empty string?
38
« on: December 12, 2009, 10:44:46 pm »
Sorry, guys - no progress today except for laying out inventory screen (items are visible but you can't use any of them yet). I was super busy - had a concert this morning, made about $300, took a friend (and my page turner) to lunch/dinner, and had to do homework. I hate weekends Anyways, the functionality of the binomcdf( command can be improved by the cumSum command. I forget the exact syntax, but I believe it gives a list of {1,2,3,...N}. DJ, just think of seq( like a For loop - you enter a seq(function,variable,start,end) and it iterates with the variable the exact same way it would with a For loop. :For(X,1,5 :X^2 -> L1(X :End :L1 would do the same thing as :seq(X^2,X,1,5 I like seq( since it doesn't actually change the variable. And it's easier to write, and it's probably faster. Also, with seq(, you have your output directly in Ans, whereas with the For( loop you need to either store the elements to some list or use the augment( command. I'm just not going to try to explain the binomial commands, though. That's a whole semester of Stats right there. E: aargh, right - superscript tags don't work in code boxes. Silly me.
39
« on: December 12, 2009, 07:06:56 pm »
After downloading an emulator, I found out that I have no idea how to get my ROM off of my TI84+ SE.
How might I go about doing this? (After I find my link cable, of course.)
40
« on: December 12, 2009, 12:01:43 pm »
Wow, nice. My opinion of TI went up a little. Yeah, I learned about the binomial model in Stats last year and am pretty familiar with the mathematics of binomcdf( and binompdf( - they're probability density functions. But my problem with that was that you couldn't use them to manipulate list elements without a For( loop, and seq( is faster and easier to program than a For( loop, so I used seq( instead.
41
« on: December 12, 2009, 11:49:29 am »
Yeah, seq( is relatively slow but it was the best solution I could find to my problem. The first idea was to do ALL the comparisons inside the Repeat:getKey loop, but that would make the loop itself take about 2 seconds per iteration and take up like 2 or 3 screens of code. (I backed up my files in a group and tried it that way afterwards. MUCH less efficient.) The entire code to upgrade a skill, then loop back to the beginning and display the upgrade screen again, takes about one and a half seconds. (This is with xlib still, since I haven't found my cable yet.) So on the whole it's not bad. But it took forever to get my logic right. That -.5 you see in the first augment( has to do with the re-spec code and figuring out if you have enough gold to re-spec or not, simply because my brain was already too contorted to think of a better solution. How is the speed of augment(?
42
« on: December 11, 2009, 08:45:05 pm »
Loliloli! -Wait what? I'm looking forwards to playing this... and finding my link cable...
43
« on: December 11, 2009, 08:18:07 pm »
(try to keep from doubleposting btw)
Sorry. I got excited. *blush* TI's default list commands that no ordinary calculator user would ever dare to look at are actually really useful here. This also provides the advantage that anyone looking at the code wouldn't dare press anything remotely close to the clear button - after writing it, even I have no idea what half of it does lol. :Augment(seq(L3(X),X,3,15,2),{-.5,1})>=augment(20seq(L3(X),X,2,14,2)^2,{-L1(5)>=(10L1(6)^2)),1 --> LT2 That was the worst of it. I basically tried to minimize the amount that would be executed in the Repeat:getKey loop. I wrote it so that it would generate three temporary lists, T1, T2, and T3, full of 0s and 1s, and in the Repeat:getKey loop, it would look at the inputs and decide if one of the buttons were pressed and the conditions were met. (The code there looks something like Repeat sum(Ans:getKey:Ans={92,93,94,82,83,84,72,45,31} and LT1 and not(LT2) and LT3:End.) I have a concert tomorrow. I'll call it a day.
44
« on: December 11, 2009, 07:40:25 pm »
Epiphany! I managed to make it non-buggy, relatively fast, and awesome, while using only 1/3 the code I used before. (seq( and augment( commands abound, as well as some complicated boolean thingies.) Second time's the charm.
45
« on: December 11, 2009, 06:24:18 pm »
I currently have a section of code that's just like End:End:End:End:End.
I think I might actually have to rewrite it. I made a critical flaw in logic (can't re-spec with zero skill points remaining, that was supremely stupid). Aargh.
|