Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Stefan Bauwens on August 24, 2011, 04:59:41 pm

Title: Grey - zContest Entry
Post by: Stefan Bauwens on August 24, 2011, 04:59:41 pm
 I'm planning to make a axe platformer game for the zContest. I hope I'll have time enough to finish it, which I should be able to do because it's a quite simple game.

It's a port of the flash game 'Grey' which can be played here: http://armorgames.com/play/12117/grey

This will be my first game for the Ti-83+. I already have began programming on it, and am currently working on the engine(tilemapping, etc..). Unlike the game I might not have any background, but I'm not sure, because the background is a important factor in this game(color changes, etc..) Anyway the game is still in early stages. I hope to make it quite good for my first z80 game. =)
Title: Re: Grey - zContest Entry
Post by: Jim Bauwens on August 24, 2011, 05:37:00 pm
Nuuuu, stick to 68k!! :p
Seriously though, I hope it works out :)
Good luck !
Title: Re: Grey - zContest Entry
Post by: Yeong on August 24, 2011, 07:01:02 pm
Good luck! XD
Title: Re: Grey - zContest Entry
Post by: DJ Omnimaga on August 24, 2011, 11:18:03 pm
Nice. Good luck on this. Will it be in ASM or Axe?
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on August 25, 2011, 03:53:14 am
Nice. Good luck on this. Will it be in ASM or Axe?
Axe. :)
Title: Re: Grey - zContest Entry
Post by: DJ Omnimaga on August 25, 2011, 08:39:14 am
Ok cool, I can't wait for screenshots :)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on August 25, 2011, 10:44:06 am
Ok cool, I can't wait for screenshots :)
Well, I haven't done so much yet. Maybe when the tilemapping goes smoothly an correct, I can upload an animation.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 23, 2011, 02:35:49 am
Alright, time to pick this back up. My exams should be over now so...LETS DO THIS.
Title: Re: Grey - zContest Entry
Post by: Wellen on September 23, 2011, 05:04:44 am
Yay !

We all want scrennies ! :D

How will you work on the differents colours of the original game ? Grayscales ?
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 23, 2011, 10:40:43 am
Yup I'll try grayscales and maybe perhaps patterned sprites that give a graylike-feeling.
I'm still in early stages so no screenshots yet. But I do have this for you:
On the one side is the original player sprite from the flash game and on the right side is my version.
Title: Re: Grey - zContest Entry
Post by: LincolnB on September 24, 2011, 11:21:46 pm
That menu screen looks fantastic! Great job. I hope the graphics for the rest of the game are this great. :)
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on September 25, 2011, 12:58:45 am
Wow, that's one of the best logos I've seen on a calc screen so far :)

Good luck with the rest of the game!
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 25, 2011, 07:10:01 am
Eh, that isn't a menu screen. I just photoshoped a picture so you could see the difference between the orignial sprite and mine.
Title: Re: Grey - zContest Entry
Post by: Hayleia on September 25, 2011, 07:13:03 am
That doesn't prevent you from using it as a Menu screen ;)
Anyway, good luck on it ! I'd really like to play that game
(saw videos on youtube (can't play the flash version ???))
And the sprite is really nice ;D(http://www.omnimaga.org/Themes/default/images/gpbp_arrow_up.gif)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 26, 2011, 09:55:03 am
Ok, I was having a little problem today. I ran out of memory. But I fixed it, thanks to Josjuice. I just had to take a simple ram reset. :)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 27, 2011, 10:44:55 am
Alright. Yesterday, because of my own fault I caused my program to do an infinite loop which crashed my calc. I took out a battery and when I put it back in my files were GONE. This was really bad luck because it was the only time I didn't archive my source before starting it. But I didn't think this so bad because I though I had a backup. It appears I was mistaken. So I'll have to start again. I wasn't THAT far in programming but still... Anyway, I still got a lot of time to reprogram it. I hope I don't get banned for not taking a backup :P
Title: Re: Grey - zContest Entry
Post by: ztrumpet on September 27, 2011, 06:05:51 pm
If you haven't GarbageCollected recently, your previous files should still be in the archive.  You can recover them with an Archive Undeleter.
If you need more info, just ask. :)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 28, 2011, 03:11:45 am
I tried it but apparently they're all REALLY gone.
I'll just rewrite it.
Title: Re: Grey - zContest Entry
Post by: p2 on September 28, 2011, 11:49:17 am
That guy on your pic looks sweet!!
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on September 28, 2011, 01:07:23 pm
Thanks. The one on the right is the one I'm gonna use. Just to be sure.
Title: Re: Grey - zContest Entry
Post by: Jim Bauwens on September 28, 2011, 02:16:49 pm
*jimbauwens hugs his brother
Title: Re: Grey - zContest Entry
Post by: boot2490 on October 02, 2011, 05:59:07 pm
Wow! The grey things will be gray once you collect the unique gray items. Grey is depressing, so you want to change it to gray.

P.S. Is there like a screamer at the end of the original or something? Something isn't quite right...
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 03, 2011, 03:59:41 am
If you played the original game, which only takes about 10 minutes, you will know the end.
Title: Re: Grey - zContest Entry
Post by: boot2490 on October 03, 2011, 11:38:43 am
Oh my god! I want to know if it is like a screamer or something. I am scared to play it :'(
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 03, 2011, 07:21:16 pm
Alright. Yesterday, because of my own fault I caused my program to do an infinite loop which crashed my calc. I took out a battery and when I put it back in my files were GONE. This was really bad luck because it was the only time I didn't archive my source before starting it.
Ahh... Sounds familiar :(
Oh my god! I want to know if it is like a screamer or something. I am scared to play it :'(
No, there isn't. It's actually kinda sad :(
Title: Re: Grey - zContest Entry
Post by: leafy on October 03, 2011, 07:23:05 pm
Spoiler For The game:
The game revolves around giving various items to your girlfriend, who promptly turns around just as you vanish in a puff of logic :P
Title: Re: Grey - zContest Entry
Post by: Chockosta on October 04, 2011, 01:26:43 pm
I really love this game.
I just hope you'll succeed to create the same atmosphere. (Dont really know if it's the good english word)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 04, 2011, 02:22:48 pm
Yeah, I know what you mean Chocosta. I hope so too.
I hope I can make it fast enough and in time for the contest.
Title: Re: Grey - zContest Entry
Post by: boot2490 on October 04, 2011, 07:31:49 pm
Chockosta: that is a better english word than I would have picked. Perfectly descriptive.
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 04, 2011, 10:37:03 pm
Yeah, I know what you mean Chocosta. I hope so too.
I hope I can make it fast enough and in time for the contest.
I hope so too. I'm looking forward to it.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 06, 2011, 12:46:25 pm
Alright, I'm busy with making the sprite move smooth left and right. It was, but I didn't like it so I'm going to change it.
Anyway it's still gonna take a while before you guys are going to see a screenshot. Sorry.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 09, 2011, 11:31:28 am
I still don't like how I move. See, my blocks are 8*8, but to scroll smooth I actually have to move max. 4 pixels. I must think how to do this properly and make acceleration work with it eventually.
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 09, 2011, 12:02:06 pm
Inflate by 256? Or you could just have him move one pixel the first frame, two the next, and so on to four.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 09, 2011, 02:30:22 pm
Inflate by 256? What's that?
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 09, 2011, 02:36:13 pm
It's where you multiply your X- and Y-values by 256, so you can have greater precision in dealing with them. For example, if you draw the sprite with Pt-On(X/256,Y/256,Pic0), you can add 128 to X every frame and it'll look like your sprite is moving "half a pixel" per frame.

Hope that makes sense. I'm writing a tutorial on it as we speak :D
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 09, 2011, 02:37:49 pm
It's where you multiply your X- and Y-values by 256, so you can have greater precision in dealing with them. For example, if you draw the sprite with Pt-On(X/256,Y/256,Pic0), you can add 128 to X every frame and it'll look like your sprite is moving "half a pixel" per frame.

Hope that makes sense. I'm writing a tutorial on it as we speak :D
Thank you. I'll try this tomorrow.
Title: Re: Grey - zContest Entry
Post by: LincolnB on October 09, 2011, 02:39:47 pm
Would it useful if I wrote a smooth-scrolling tutorial for Axe?

EDIT: Deep, is your tutorial on smooth-scrolling or inflation?
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 09, 2011, 02:47:11 pm
Mine's on smooth movement, so if you're writing about shifting the entire screen, go ahead :)
Title: Re: Grey - zContest Entry
Post by: leafy on October 09, 2011, 03:03:52 pm
One word of warning - 256 will be too large for a map the size of grey, and unless you use 4-byte positional values you'll get overflow.
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 09, 2011, 03:06:45 pm
Oh, that's a good point. Maybe you could have one variable for position and another whole variable for precision? 16 bits is overkill, but it should be fast.
Title: Re: Grey - zContest Entry
Post by: LincolnB on October 09, 2011, 06:25:13 pm
You could have the player's X and Y coordinates inflated by 256, and then for each iteration of the main game loop, divide it by 256 to calculate the offset needed to display the tilemap, so the offset isn't inflated at all, but the player's coordinates are.
Title: Re: Grey - zContest Entry
Post by: Darl181 on October 09, 2011, 07:06:11 pm
What might work is having the large map and the large inflation, then after you divide it by 256 (or whatever the inflation is) you could artificially increase the value, based on its position in the tilemap.  Not sure how practical that would be, tho.

(myself, I haven't inflated by 256, even *64 seems like more precision than you need with such a small screen :P)
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 09, 2011, 11:09:14 pm
(myself, I haven't inflated by 256, even *64 seems like more precision than you need with such a small screen :P)
The reason everyone inflates by 256 is because *256 and /256 are two of the simplest operations on a Z80 processor. They're several times more optimized than 64.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 10, 2011, 04:23:11 am
Well thanks guys. I'm planning that my player is on a fixed spot on the screen and that only the map moves. But since I'm just a  beginner to AXE, maybe this isn't the best solution? I wouldn't like no scrolling.
Title: Re: Grey - zContest Entry
Post by: Deep Toaster on October 10, 2011, 09:44:10 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.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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
Title: Re: Grey - zContest Entry
Post by: aeTIos 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.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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
...
Title: Re: Grey - zContest Entry
Post by: LincolnB 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)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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?
Title: Re: Grey - zContest Entry
Post by: LincolnB on October 12, 2011, 09:27:51 pm
Yeah, except make sure you don't actually go off the edge of the screen.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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?
Title: Re: Grey - zContest Entry
Post by: LincolnB 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.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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. :(
Title: Re: Grey - zContest Entry
Post by: Wellen 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
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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?
Title: Re: Grey - zContest Entry
Post by: Hayleia 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.
Title: Re: Grey - zContest Entry
Post by: Wellen 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
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens 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?
Title: Re: Grey - zContest Entry
Post by: Hayleia on October 14, 2011, 02:33:37 pm
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?

Appvars tutorial (http://ourl.ca/8294/152571) by FinaleTI
I learnt everything here, so it should explain better than me. Give him a lot of +1s.
By graph function I mean Y-Var (Y0-Y9)

? the problem with my method is that you need another program to create the appvar.
Or you give that prog with the game so we can create it, or you directly give the appvar with the game. But if you have the appvar creator in the game then you have the map in the game so my method is useless -.-°
? the advantage of my method is that if the map never changes, it "stays in archive" (well, it is copied to RAM but it doesn't increase the size of the game).

Spoiler For the interesting part of the tutorial:
If you simply want to read data from an archived appvar, then you could copy it to a file.

GetCalc("appvAPPVAR",File)

Where File is the token for a Y-Var (Y0-Y9).

Once the appvar is copied to a file, you can read from it like a pointer.

GetCalc("appvAPPVAR",Y0)
{Y0}?A
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 14, 2011, 02:48:30 pm
Well, since my map will be so huge that it's bigger than 32k I'll have to have a file archived already that I'll add with the game.
But what kind of file?
Title: Re: Grey - zContest Entry
Post by: Hayleia on October 14, 2011, 02:59:41 pm
bigger than 32k
??? If it is bigger than 32k, you can't create it (it won't fit in your RAM). But you can split into 2 appvars ;).

But what kind of file?
An appvar is a .8xv file that contains only data.
The appvar creator should look like this (it is an example that I got from my Pokemon):

Spoiler For Spoiler:
.GETTYPE
[050000]→GDB1
[000000]
[060400]
[030A00]
[020A00]
[060000]
[0A0000]
[080200]
[070800]
[010A00]
[030807]
[020A00]
[090000]
[060500]
[040A00]
[060500]
[000000]
[070000]
[020600]
[080304]
.60 bytes of Data

.create the appvar
GetCalc("appvPokeType",60)->A

.fill it with the data
For(r1,0,59)
{GDB1+r1}→{A+r1}
End
But you'll not name your appvar PokeType -.-°
Then, at the beginning of the game you do
GetCalc("appvGreyMap",Y0) (you can name your appvar otherly, and use Y1 as well ;))
Then you access your map with the pointer Y0, so the first byte of your map is at {Y0}
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 15, 2011, 06:46:19 am
bigger than 32k
??? If it is bigger than 32k, you can't create it (it won't fit in your RAM). But you can split into 2 appvars ;).

But what kind of file?
An appvar is a .8xv file that contains only data.
The appvar creator should look like this (it is an example that I got from my Pokemon):

Spoiler For Spoiler:
.GETTYPE
[050000]→GDB1
[000000]
[060400]
[030A00]
[020A00]
[060000]
[0A0000]
[080200]
[070800]
[010A00]
[030807]
[020A00]
[090000]
[060500]
[040A00]
[060500]
[000000]
[070000]
[020600]
[080304]
.60 bytes of Data

.create the appvar
GetCalc("appvPokeType",60)->A

.fill it with the data
For(r1,0,59)
{GDB1+r1}→{A+r1}
End
But you'll not name your appvar PokeType -.-°
Then, at the beginning of the game you do
GetCalc("appvGreyMap",Y0) (you can name your appvar otherly, and use Y1 as well ;))
Then you access your map with the pointer Y0, so the first byte of your map is at {Y0}
How do you edit such a file? Trough the computer or do you let an axe program create it?
Title: Re: Grey - zContest Entry
Post by: Hayleia on October 15, 2011, 07:12:43 am
How do you edit such a file? Trough the computer or do you let an axe program create it?
With an Axe prog. In the spoiler of my previous post, I gave you an example of how to create an appvar filled with data.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 15, 2011, 08:45:03 am
How do you edit such a file? Trough the computer or do you let an axe program create it?
With an Axe prog. In the spoiler of my previous post, I gave you an example of how to create an appvar filled with data.
Yes, but when I run an axe prog it must be unarchived right? And my map is so big...
Maybe I should do it like this:
First send maphalf1 to your calc. This runs and creates the appvar and archives it. Then you delete maphalf1.
Then You sent maphalf2 to your calc and do the same.
Then I sent Grey itself to the calc?
Title: Re: Grey - zContest Entry
Post by: Hayleia on October 15, 2011, 09:14:30 am
Yes, but when I run an axe prog it must be unarchived right? And my map is so big...
Maybe I should do it like this:
First send maphalf1 to your calc. This runs and creates the appvar and archives it. Then you delete maphalf1.
Then You sent maphalf2 to your calc and do the same.
Then I sent Grey itself to the calc?
Or you run maphalf1 on Wabbit, then delete it and run mapahlf2 then delete it, and extract the two appvars from Wabbit.
Then, when you release the game, you give us the game and the two appvars and say in the readme that we must archive it ;)
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 15, 2011, 10:27:18 am
Aha! Thank you! I'll do it like that I think.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 18, 2011, 03:02:05 am
Okey I scroll at 1 pixel left and right, but I think it goes too slow because drawing the whole screen EVERY frame is just slow./me wonders if everybody draws the whole srceen every frame?
Title: Re: Grey - zContest Entry
Post by: DJ Omnimaga on October 18, 2011, 03:50:02 am
Usually if you got a tilemap, you just draw the needed row/column of tiles. I do not know how to do that, though. Redrawing the entire screen every frame is indeed slow. Just redrawing one col/row if you got complex physics might be tricky, though, although I doubt in Grey you need to fall down/move at speeds higher than 8 pixels per frame.
Title: Re: Grey - zContest Entry
Post by: Wellen on October 18, 2011, 06:17:38 am
Oooh great ! That's the problem I have with Lost : my maps get bigger and bigger and the game also slower because I draw the entire map every frame...

I'm currently searching for a way to draw just the rows and columns I need (so 8*12), the most tricky part is to calculate the position of the top-left corner, compared with the pointer of the map...
For the row-position : simple :
Code: [Select]
Y(incremented or decremented with getkeys 1 and 4) * (the number of columns of the entire map)->BFor the column-position : a little bit harder, I think something like
Code: [Select]
(number of columns) - X(incremented or decremented with getkeys 2 and 3)->A
and finally the location compared with the pointer could be this

Code: [Select]
{B+A+GDB0}
But I'm not sure at all, I haven't tried this on my calc yet, but you can ;)

Title: Re: Grey - zContest Entry
Post by: Yeong on October 18, 2011, 06:20:45 am
What do you mean by drawing the whole map? Do you mean by drawing entire tilemap data instead of only displaying 12x8 portion of the map?
Title: Re: Grey - zContest Entry
Post by: Wellen on October 18, 2011, 06:26:14 am
What do you mean by drawing the whole map? Do you mean by drawing entire tilemap data instead of only displaying 12x8 portion of the map?
I think so, and that's what I was doing, too ^^
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 18, 2011, 06:34:40 am
What do you mean by drawing the whole map? Do you mean by drawing entire tilemap data instead of only displaying 12x8 portion of the map?
I mean drawing the part of the map visible on the screen(something like 13*8). But I'll see if I can use 'horizontal' and 'vertical'.
Title: Re: Grey - zContest Entry
Post by: LincolnB on October 19, 2011, 09:56:39 am
I just display the 13*9 portion of the screen (not 12*8 for various reasons relating to smooth scrolling) every frame, and it works fine. There are different things you can do to optimize for aggressive speed at the expense of size, found here: http://ourl.ca/8520
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on October 19, 2011, 10:46:35 am
Oh, thanks. I'll look at that.
Title: Re: Grey - zContest Entry
Post by: Stefan Bauwens on November 04, 2011, 07:46:59 am
I've decided to delay programming on this till after the contest. I was having some difficulties(a lot of stuff to do, etc..).
The good news is I've something else in mind. Hopefully I can finish that before 1 december. :)