Author Topic: Grey - zContest Entry  (Read 13732 times)

0 Members and 3 Guests are viewing this topic.

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #45 on: October 10, 2011, 10:46:41 am »
That shouldn't be too bad -- you just need to decide what the X and Y values mean. They might represent the X and Y coordinates of the top-left corner of the screen in terms of the larger map, in which case the player would be about 44 pixels to the right of that and 28 pixels down, or they might represent the actual position of the player.
Well, normally in my game Y and X are the coordinates of the top left corner of the map itself. I draw my sprite at 24,40(I think it was that). It should actually have been 40,24 to have been in the middle of the screen, but I just kept it like this.
I also plan on posting my source code here later(Don't worry, it shouldn't be too long and complex.)

EDIT: My code(I removed unnecessary stuff out of it: like stuff that I'm still working on). Anyway:
Code: [Select]
.GREY
DiagnosticOff
[FCACACFC007C3828]→Pic1
[3F35353F003E1C14]
[FCACACFC007C3848]
[3F35353F003E1C12]
[FCACACFC007C3818]
[3F35353F003E1C18]
[FCACACFC007C3824]
[3F35353F003E1C24]

[0000000000000000]→Pic2
[FFFFFFFFFFFFFFFF]

[010101010101010101010101010101]→GDB1
[010000000000000000000000000001]
[010000000100000000000000000001]
[010000000101000000000000000001]
[010000000000000000000101000001]
[010000000000000000000000000001]
[010000000000000000000000000001]
[010101010101010101010101010101]
0→X
0→Y
1→C
0→M
0→N
ClrDraw
sub(H)
Pt-On(24,40,Pic1)
DispGraph
Repeat getKey(15)
If getKey(2)
1→M
If C<4
C+1→C
Else
1→C
End
End
If getKey(3)
1→N
If C<4
C+1→C
Else
1→C
End
End

If M=1
0→M
For(A,1,8)
sub(P)
Lbl T
If (C=1)
Pt-On(24,40,Pic1)
End
If (C=2)
Pt-On(24,40,Pic1+16)
End
If (C=3)
Pt-On(24,40,Pic1+32)
End
If (C=4)
Pt-On(24,40,Pic1+48)
End
DispGraph
End
Y-1→Y
End
If N=1
0→N
For(A,1,8)
sub(Q)
Lbl U
If C=1
Pt-On(24,40,Pic1+8)
End
If C=2
Pt-On(24,40,Pic1+24)
End
If C=3
Pt-On(24,40,Pic1+40)
End
If C=4
Pt-On(24,40,Pic1+56)
End
DispGraph
End
Y+1→Y
End

.MAPDRAW
End
.STARTDRAW
Lbl H
ClrDraw
For(J,0,8)
For(I,0,13)
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}*8+Pic2
End
End
Return

.RIGHT
Lbl Q
Pt-Off(24,40,Pic2)
Horizontal -
For(J,0,8)
Pt-On((12*8)-A,(J*8)+R,{(J*15)+12+Y+GDB1}*8+Pic2
End
Return

.LEFT
Lbl P
Pt-Off(24,40,Pic2)
Horizontal +
For(J,0,8)
Pt-On(–8+A,J*8,{(J*15)-1+Y+GDB1}*8+Pic2
End

Return
« Last Edit: October 10, 2011, 11:11:58 am by Stefan Bauwens »


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #46 on: October 11, 2011, 06:42:50 am »
I don't think I just can divide the coordinates of the map itself by 256. But I'm not sure.
Also, if you read my post here above you can see I move one block at the time but I do it smoothly.
But I''l have to change it. It would be nice if someone that is familiar with smooth scrolling could explain how I must do this?
Thanks a lot. :D


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Grey - zContest Entry
« Reply #47 on: October 12, 2011, 05:09:28 am »
Its not too hard. You need to have the map data (which you have). then you should have a 'scrolling factor' (number) which you increase when a key is pressed (getkey(2) or getKey(3)). you can check the tile you're on by doing x/8 and y/8 and then getting the tile from the map with those values. I hope this helps, if not, ask more.
I'm not a nerd but I pretend:

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #48 on: October 12, 2011, 05:47:40 am »
Thanks aeTIos. MAybe this will help.
Also, I contacted the maker of Grey.
This is what he replied to me:
Code: [Select]
Stefan,
Correct me if I'm wrong, but a TI83 would be unable to include the music, color, or transparent ghosting effects that Grey depends on. Without those I don't see how it is possible to tell the game's story.
I replied and told him this:
Code: [Select]
You are correct about the music. But I don't think thats so important. I think Grey without sound still is good.
I'm using AXE PARSER(http://www.ticalc.org/archives/files/fileinfo/428/42813.html) to make this. With it stuff go a lot faster than the original language and I am able to have some greyscale(see the screenshots in the link). I would use different sprites and greyscales to make it look more 'lively' every time, in stead of colour. The ghosty effect will probably work with greyscale too.
You can let me try, can you?

Stefan
...


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Grey - zContest Entry
« Reply #49 on: October 12, 2011, 02:50:14 pm »
Basically the concept of smooth scrolling is that you have two variables for the X and Y offset of the map, and two variables for the characters X and Y position, so four variables in total. To handle movement, just do it normally by changing the character's X and Y values. Like, getkey(3)+X-(getkey(2))->X or whatever. You don't have to do it like that, but just remember to change the character's X and Y, not the offset. Then, every iteration of the main game loop, you center the character on the screen (unless he's at the edge of the map, he should go to the side of the screen to signify the edge) and calculate the offsets accordingly. At least, that's how I do it. And this way, you can have smooth movement (*256 coordinate inflation) and a big map, because you calculate the offset based on the nearest pixel (/256)
« Last Edit: October 12, 2011, 02:51:28 pm by buttsfredkin »
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #50 on: October 12, 2011, 03:11:28 pm »
Basically the concept of smooth scrolling is that you have two variables for the X and Y offset of the map, and two variables for the characters X and Y position, so four variables in total. To handle movement, just do it normally by changing the character's X and Y values. Like, getkey(3)+X-(getkey(2))->X or whatever. You don't have to do it like that, but just remember to change the character's X and Y, not the offset. Then, every iteration of the main game loop, you center the character on the screen (unless he's at the edge of the map, he should go to the side of the screen to signify the edge) and calculate the offsets accordingly. At least, that's how I do it. And this way, you can have smooth movement (*256 coordinate inflation) and a big map, because you calculate the offset based on the nearest pixel (/256)
Thanks for the answer. :D
So if you are on the right edge of the screen and you press right y+1(or a bigger number)->y?


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Grey - zContest Entry
« Reply #51 on: October 12, 2011, 09:27:51 pm »
Yeah, except make sure you don't actually go off the edge of the screen.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #52 on: October 13, 2011, 02:02:16 pm »
But how do I make that when I move the X and Y of the map it moves smoothly?


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Grey - zContest Entry
« Reply #53 on: October 13, 2011, 10:03:59 pm »
Hmm...if you check the IRC logs for earlier today, I explained it to the Bridged One, and I posted some code too, so you might want to go check that out. It was earlier today.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #54 on: October 14, 2011, 08:30:08 am »
Yeah. Thanks. I think that I must just play still a bit with my code to get it right. XP

The author of the game replied and gave me the map. It's 190*99(!)
I'll have to reduce the size of the map some way.
Now I do:
Code: [Select]
:[010101010101]->GDB1 etc...If I could get it to this:
Code: [Select]
:[111111]->GDB1 etc...I would have it reduced by two. But I don't know. Also I probably have to rewrite my whole mapdrawer. :(


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Grey - zContest Entry
« Reply #55 on: October 14, 2011, 09:57:35 am »
You can, but you would have to draw two sprites per byte :
Spoiler For Spoiler:
Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}/16*8+Pic2
Pt-On(I*8+8,J*8,{(J*15)+I+Y+GDB1}^16*8+Pic2

Instead of doing this

Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}*8+Pic2

Am I right ? That's what I personnaly do for big maps
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #56 on: October 14, 2011, 11:18:23 am »
You can, but you would have to draw two sprites per byte :
Spoiler For Spoiler:
Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}/16*8+Pic2
Pt-On(I*8+8,J*8,{(J*15)+I+Y+GDB1}^16*8+Pic2

Instead of doing this

Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}*8+Pic2

Am I right ? That's what I personnaly do for big maps
How does my GDB look like then?


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Grey - zContest Entry
« Reply #57 on: October 14, 2011, 12:06:27 pm »
Or you can put the map in an archived appvar and access it with GetCalc("appvGreyMap",Y0) (where Y0 is the graph function). This is how I made my huge Pokemon map.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Wellen

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +7/-2
    • View Profile
Re: Grey - zContest Entry
« Reply #58 on: October 14, 2011, 12:48:43 pm »
You can, but you would have to draw two sprites per byte :
Spoiler For Spoiler:
Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}/16*8+Pic2
Pt-On(I*8+8,J*8,{(J*15)+I+Y+GDB1}^16*8+Pic2

Instead of doing this

Code: [Select]
Pt-On(I*8,J*8,{(J*15)+I+Y+GDB1}*8+Pic2

Am I right ? That's what I personnaly do for big maps
How does my GDB look like then?

Like u said :
One line of 12 tiles
[010101010101010101010101
becomes
[111111111111

Instead of having [XX](understand [03],[10],...) for one tile, you'll have [XX] for two tiles. It reduce the number of different tiles from 255 ([00] to [FF]) to 16 ([0] to [F]) ; so that's if you don't have too much different tiles and you want to optimize the space.
If you have >16 different sprites, Hayleia's method is cool too.

Tell me if you didn't understand my bad english, but I think I'm right :P
« Last Edit: October 14, 2011, 12:53:45 pm by Wellen »
-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot ;)
Spoiler For Feat. Loulou54:
Spoiler For Projects:
Spoiler For Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler For Ti-Basic:
Spoiler For Soko-Ti, a sokoban game in Ti-Basic:

Spoiler For Memory:

Downloads here.

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Grey - zContest Entry
« Reply #59 on: October 14, 2011, 02:20:04 pm »
Okay thanks. I think i'll have more thann 16 sprites. Normal block, white block, ladders, items blocks(quite some) and the quite some background sprites. Hayleia, what do you mean with graph function. This? :
Code: [Select]
Pt-On((12*8)-A,(J*8)+R,GetCalc("appvGreyMap",{(J*15)+12+Y+GDB1}*8+Pic2)Also which kind of  appvar? I'm not so used to the 83+. A GDB?


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me