Author Topic: Anti-RPG RPG  (Read 60945 times)

0 Members and 4 Guests are viewing this topic.

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Anti-RPG RPG
« Reply #45 on: December 11, 2009, 11:36:09 pm »
wow, that is quite a coding... I usually don't use seq(, since I never found an incident where I would need a list of 1s and 2s.
Good job! I love your classes too! I was thinking of similar thing in TLM


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

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: Anti-RPG RPG
« Reply #46 on: December 12, 2009, 11:03:15 am »
Nice! That's a piece of work.  It's great to know commands llike seq and augment; they come in handy quite often.   How is the speed for that section of code? (seq is slow)

Offline Insorak

  • LV3 Member (Next: 100)
  • ***
  • Posts: 76
  • Rating: +4/-0
  • Omnimaga n00b
    • View Profile
Re: Anti-RPG RPG
« Reply #47 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.  :o

How is the speed of augment(?
« Last Edit: December 12, 2009, 11:52:26 am by Insorak »
(re)working on Anti-RPG: 3% completion

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Anti-RPG RPG
« Reply #48 on: December 12, 2009, 11:59:35 am »
There seems to be almost no speed loss due to Augment.  I was able to augment two 400 element lists and it took less than a fraction of a second.

I think binocmpf()or something has some slight speed advantage to seq (and can do the same thing kindof) but i don't know how to use it.

Offline Insorak

  • LV3 Member (Next: 100)
  • ***
  • Posts: 76
  • Rating: +4/-0
  • Omnimaga n00b
    • View Profile
Re: Anti-RPG RPG
« Reply #49 on: December 12, 2009, 12:01:43 pm »
Wow, nice. My opinion of TI went up a little. :P

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.
(re)working on Anti-RPG: 3% completion

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: Anti-RPG RPG
« Reply #50 on: December 12, 2009, 12:52:17 pm »
Yeah seq( is very slow, but unfortunately, like Builderboy and despite Galandros trying desesperately to help me and force me to switch, I still could not understand Binomcdf(. In fact, I have troubles understanding Seq( too. In Illusiat 13, I pretty much just copied some code and trial and errored by changing each Seq( parameters and experiment what it does until it does what I want. I still couldn't get it afterward. (I use it for list compression, btw).

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: Anti-RPG RPG
« Reply #51 on: December 12, 2009, 01:39:48 pm »
You can use binomcdf to make a list of 1s.  However, this dosn't help when you need to manipulate list elements, as Insorak stated above. :)

Offline Insorak

  • LV3 Member (Next: 100)
  • ***
  • Posts: 76
  • Rating: +4/-0
  • Omnimaga n00b
    • View Profile
Re: Anti-RPG RPG
« Reply #52 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 :P

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.
Code: [Select]
:For(X,1,5
:X^2 -> L1(X
:End
:L1
would do the same thing as
Code: [Select]
: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. :P


E: aargh, right - superscript tags don't work in code boxes. Silly me.
« Last Edit: December 12, 2009, 10:45:38 pm by Insorak »
(re)working on Anti-RPG: 3% completion

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: Anti-RPG RPG
« Reply #53 on: December 12, 2009, 11:54:26 pm »
Yeah I still have trouble figuring and remembering all the arguments for Seq everytime, especially when I got no for equivalent. Also, in my case, my list of 100 elements contains 2-digits numbers

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Anti-RPG RPG
« Reply #54 on: December 14, 2009, 03:40:14 am »
Yeah I still have trouble figuring and remembering all the arguments for Seq everytime, especially when I got no for equivalent. Also, in my case, my list of 100 elements contains 2-digits numbers
I forget many times the second argument and skip it. Or put without wanting the last optional argument for increase.

seq( must be the most used command with many arguments...
Hobbing in calculator projects.

Offline Insorak

  • LV3 Member (Next: 100)
  • ***
  • Posts: 76
  • Rating: +4/-0
  • Omnimaga n00b
    • View Profile
Re: Anti-RPG RPG
« Reply #55 on: December 14, 2009, 02:38:47 pm »
Yeah, seq( is fun. :D

Quote
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? :-X

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 x.x) 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.
« Last Edit: December 14, 2009, 02:45:16 pm by Insorak »
(re)working on Anti-RPG: 3% completion

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: Anti-RPG RPG
« Reply #56 on: December 14, 2009, 02:50:30 pm »
ouch this sucks, I hope you can get some free time during Christmas break to code. Glad this is still progressing, though.

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: Anti-RPG RPG
« Reply #57 on: December 14, 2009, 03:49:57 pm »
I forget many times the second argument and skip it.
I don't know how many times I've done that. Too many!

Nice progress! Again I'm happy that you can program with such great lines of code.  I'm glad I can understand it, though.  Code like that both reduces the size of your code and makes it faster.  Great job!

As for the movement engine, I'm currently on the third or fourth version for Elmgon. :) Just keep recoding it and eventuallt it will work.

Offline Insorak

  • LV3 Member (Next: 100)
  • ***
  • Posts: 76
  • Rating: +4/-0
  • Omnimaga n00b
    • View Profile
Re: Anti-RPG RPG
« Reply #58 on: December 14, 2009, 05:27:02 pm »
Lists are fun. They’re like arrays, but better. :P

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! :D

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.
(re)working on Anti-RPG: 3% completion

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: Anti-RPG RPG
« Reply #59 on: December 14, 2009, 05:46:18 pm »
Xcopy's syntax:
PrgmA to Xtemp001
1->X:"A":Asm(prgmXCOPY
Deleete prgmXcopy001
1->X:Asm(prgmXCOPY
It's pretty simple.

Please Note: You said it was slower, but due to the nature of the basic parser, If:Then:line(s):End is faster than If:line by quite a bit (2x faster I think).  But you make a good point. If you think it's better to use xLib then go for it!  There are pros and cons both ways.

Do you want us to look at the engine? If you post it here, I'm pretty sure there is speed to be found.
« Last Edit: December 14, 2009, 05:47:14 pm by ztrumpet »