• Portal Prelude 5 1
Currently:  

Author Topic: Portal Prelude  (Read 251909 times)

0 Members and 2 Guests are viewing this topic.

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #210 on: May 15, 2010, 01:41:02 am »
Yeah im not using SMC for data storage, but more as a way to get past the memory limitation imposed by hardware.  And im having the program itself count bytes so that i dont have to anticipate byte numbers myself :)

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Portal X
« Reply #211 on: May 15, 2010, 05:19:25 am »
Smart as always BuilderBoy.

Save data on the program itself is not that bad idea because it is self contained in the program. But external variables are more practical to do backups of save files.
Hobbing in calculator projects.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Portal X
« Reply #212 on: May 15, 2010, 07:27:13 pm »
Yeah im not using SMC for data storage, but more as a way to get past the memory limitation imposed by hardware.  And im having the program itself count bytes so that i dont have to anticipate byte numbers myself :)
Well, data does not count for the execution limit because the data is not executed. If you program for ION or Mirage, you can have programs as big as you want as long as the code itself does not exceed 8KB or so.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Portal X
« Reply #213 on: May 15, 2010, 07:30:39 pm »
Does storing stuff to vars count as data too?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Portal X
« Reply #214 on: May 15, 2010, 07:32:33 pm »
Does storing stuff to vars count as data too?
The actual act of storing is code. The data that was stored is data.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Portal X
« Reply #215 on: May 15, 2010, 07:39:51 pm »
ok thanks

Offline Ti-newb

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 180
  • Rating: +3/-0
    • View Profile
Re: Portal X
« Reply #216 on: May 18, 2010, 06:51:55 pm »
Builderboy, im currently working on a Lunar Lander prgm, but since i cant get decimals, my acceleration (gravity or moving up) is always 1 or more (accelerating downwards). 1 meaning 1 pixel per frame.. How did u get ur Acceleration to be so smooth.. is there a way to make the graph screen 1000x1000 or something? if theres another way u see, plz share it with me =D

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Portal X
« Reply #217 on: May 18, 2010, 06:56:49 pm »
You use 256 times more than the regular values for the points.  Only when you go to display them do you divide again by 256.  That gives you a precision of 1/256th of a pixel which is more than 2 decimal places.  I'm pretty sure this is what builderboy uses, its a common strategy.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Ti-newb

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 180
  • Rating: +3/-0
    • View Profile
Re: Portal X
« Reply #218 on: May 18, 2010, 07:22:29 pm »
uhh.. im not quite sure i understand..  for example instead of Pt-On(X,Y,Pic1 do.. Pt-On(256X,256Y,Pic1 ?

if that doesnt make sense, il give u more detail about my prgm (idk how everyone else does their gravity and such but..)

basically my prgm subtracts 1 from acceleration every single time it repeats, and then i add acceleration onto my Y coordinate (so up and downs) ect.

so with that strategy, do i do .. idk.. lol if u can, id like some examples =D. Btw ty for making AXE.

luuuuuvvvvvv itttt

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Portal X
« Reply #219 on: May 18, 2010, 09:13:46 pm »
Well what I think Quigibo is saying is that during the calculations and such to determine the point you are multiplying something by 256. Then when you go to display it's something like Pt-On(X/256,Y/256,Pic1. I'm not sure but that is what it sounded like to me.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Portal X
« Reply #220 on: May 18, 2010, 09:40:46 pm »
Well what I think Quigibo is saying is that during the calculations and such to determine the point you are multiplying something by 256. Then when you go to display it's something like Pt-On(X/256,Y/256,Pic1. I'm not sure but that is what it sounded like to me.
That's basically what it is.  If I were to explain, I'd say it's stored as a big number, 256 times what you've got it at now. (ex: (0,0) is (0,0) but (1,2) is stored as (256, 512) ) You calculate on it with those large numbers to give you 256 times the precision.  When you display it, you divide be 256 just as Meishe showed.  Did this make sense?
« Last Edit: May 18, 2010, 09:41:16 pm by ztrumpet »

_player1537

  • Guest
Re: Portal X
« Reply #221 on: May 18, 2010, 09:43:46 pm »
meishe, yes that sounds right.  Basicly, what you need to do is, have the upper 8 bits be your real X or Y, then have the lower 8 bits be your x and y decimals.  So to add 100/256 to your Y, you would do:
Y+100-->Y
Then when you go to display it, do as Meishe said and:
Pt-On(X/256,Y/256,Pic1
and that will give you the "whole numbers" of your X and Y.  Does that make sense?

Offline Ti-newb

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 180
  • Rating: +3/-0
    • View Profile
Re: Portal X
« Reply #222 on: May 18, 2010, 11:20:43 pm »
im not sure why it works, but thank youuuuu.   cause wouldnt say.. 100/90 = 1.111? which is decimal? hmmmmm uh actually, idk if it works OO" it doesnt seem to be working atm. oh well
« Last Edit: May 18, 2010, 11:22:50 pm by Ti-newb »

Offline Builderboy

  • Physics Guru
  • Project Author
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Portal X
« Reply #223 on: May 18, 2010, 11:27:19 pm »
Well Axe works in integers, so the decimal is not calculated and you are left with 1.  The concept is basically this:  You store the coordinates to a screen that is 256 times bigger than the calculator one, and when you display your character you zoom out by dividing by 256.  This means you have 65536x the positions of a normal screen, so you have much more precision.

Offline Ti-newb

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 180
  • Rating: +3/-0
    • View Profile
Re: Portal X
« Reply #224 on: May 18, 2010, 11:31:58 pm »
Nvm=D I divided the wrong waylol. It works

EDIT: wow thanks, my ship is running very smoothly =D
« Last Edit: May 18, 2010, 11:39:06 pm by Ti-newb »