Omnimaga

Calculator Community => Other Calculators => Topic started by: shmibs on August 02, 2010, 06:07:02 pm

Title: random stuffs
Post by: shmibs on August 02, 2010, 06:07:02 pm
just a few things i've made while bored this summer and wanted input on:
(oh, and if anyone's interested i can post source code/s)

first: 4level grayscale in axe using interrupts
(http://img.removedfromgame.com/imgs/1280784606-4gray.gif)

second: a tilemapping method which could potentially reduce map sizes considerably
(http://img.removedfromgame.com/imgs/1280784624-mrphdraw.gif)
this routine checks the tiles around each tile that's being drawn and draws a different sprite accordingly. this could potentially be very useful because it would make maps much easier to read. i.e.:
normally, sprite data for a house would have to be stored like this:
[000000
[012230
[045560
[000000
using this method, though, it would look like this:
[000000
[011110
[011110
[000000
making things much simpler. furthermore, if you're using the half-byte compression method(i forget who's idea that was, but im sure you all know) then you could boost 16 tiles at your disposal to 192! alternatively you could use the first 6 bits for tile storage(boosting your total number of tiles to 768, i believe :o) and save the last two bits to indicate if that tile is a warp point or if it triggers some event, etc.(taking away the need for a second data structure for this data) of course, this mapping method is a bit slower than others, but it's still fast enough for a zelda-esque mapping system, or even a low action scroller like FF or pkmn  ;D!

third: the beginnings of my pokemon overworld walking routine with animated steps and the ability to turn in place(you guys are probably very familiar with this type of thing, but can have the code if you want nonetheless)
(http://img.removedfromgame.com/imgs/1280784648-pkwalk.gif)
due to a bug in wabbitemu part of the wall seems to be missing  :P

fourth:a cute little gray drawing 'screensaver'
(http://img.removedfromgame.com/imgs/1280784582-graydraw.gif)
a free cookie for the first person to guess how i managed that without using the backbuffer ;D
Title: Re: random stuffs
Post by: meishe91 on August 02, 2010, 06:19:20 pm
Wow, those are really cool! I would love to see the source code :) Would like to see if I can understand it. Great job though :)
Title: Re: random stuffs
Post by: Builderboy on August 02, 2010, 06:30:12 pm
Those are all really neat!  The second one reminds me a bit of my PortalX tilemapping engine :) I do a similar thing where the tilemapper dynamically generates the correct tiles based on the surrounding tiles.  The 4Greyscale tilemapper looks really nice, and as well as the walking engine, although i cant quite figure out how the screensaver would work without the back buffer... Perhaps you are shifting the screen around in a circle every couple frames?
Title: Re: random stuffs
Post by: meishe91 on August 02, 2010, 06:33:11 pm
That's kinda what I thought at first too, or at least in some kind of shape :P
Title: Re: random stuffs
Post by: shmibs on August 02, 2010, 06:45:46 pm
/\/\bingo/\/\ ;D
it draws to the backbuffer and then displays shifted up, down, left, and right in sequence
here's the same thing sans gray
(http://img.removedfromgame.com/imgs/1280788602-nogray.gif)
this system actually looks pretty good on still frame pics: dithering displays as midlevel gray, resulting in psuedo 3 layer

as for the 4level that just draws two different sprites on the buffer and back buffer and then alternates between them without any of quigibo's fancy pants algorithms
Code: [Select]
:.A
:ClrDraw:DispGraph:Full:DiagnosticOff
:[5FEB7DAFF5BED7FAAF7DEB5FFAD7BEF57E83858B95ABD57EFF83878F9FBFFFFFBD7EEFD7EBF7EBFF7EFFF7EBD7EFD7FF→Pic1
:[54C025A401BC032A2A03A425803DC054→Pic2
:[7EFFFFFFFFFFFF7E→Pic3
:ClrDraw
:[01010101010101010100000000000001010000000000000101000000000000010100000000000001010000000000000101000000000000010101010101010101→Str1
:conj(Str1,L5,64:2→{rand^64+L5}:"FREQ:→Str9:0→F→C+8→A→B:Repeat getKey(54):Text(0,0,Str9:Text(20,0,F►Dec
:Pause 50:F+(2*(getKey(3))*(F<6))-(2*(getKey(2))*(F>0))→F:End
:FnInt(A,F
:FnOn :Repeat getKey(15)
:If getKey(3):A+1→AStop:End
:If getKey(2):A-1→AStop:End
:If getKey(1):B+1→BStop:End
:If getKey(4):B-1→BStop:End
:End
:FnOff :LnReg
:Return
:Lbl A
:C+1→C
:ClrDraw:For(M,0,7:For(L,0,7
:Pt-On(8*L,8*M,{8*M+L+L5}*16+(8*(C=2))+Pic1
:End:End
:Pt-On(A,B,Pic3:Pt-Change(A,B,(C=2)*8+Pic2
:DispGraph:If C=3:0→CEnd


the other one is fairly simple to make; it was the idea that i really liked

and the walking engine:
Code: [Select]
:.A
:DiagnosticOff:Full:‾1→X+1→Y→B+1→D+19→S→T
:[3C7EFFFFFF7F7EFC3C7EFFFFFFFE7E3F3C7EFFFFFFFF7EFF3C7EFFFFFFFF7EFF003C7E003A1A2058003C7E005C58041A003C423C5A5A005A003C7E0000001842→Pic2
:[FC7E1C00000000003F7E380000000000FF7E660000000000FF7E660000000000FE7C3800000000007FFE6C00000000007F7E6000000000007F7E600000000000FE7F3600000000007F3E1C0000000000FE7E060000000000FE7E060000000000400C000000000000023000000000000042240000000000005A000000000000000430000000000000026400000000000002200000000000001A000000000000004026000000000000200C00000000000040040000000000005800000000000000→Pic3
:[00000000000000000050200A04A04A04208C123A4C6A308400030F3BEBABABABFF7EBDDBE7DBBD7E00C0F0FCFFFFFFFFABABABABABABABAB7EBDDBE7DBBD7EFFFFFFFFFFFFFFFFFFABABACB0E020302A00FF708999A9700000FFEE113355EE00FFFF3F0F07040C5420202020302A3D1F7EB9C5CDD5BB8381EE113355EE0055FF040404040CB45CF83C42C3BFA7A7A77E→Pic1
:[0101010101010101010101010101010101010101→GDB1
:[0101010101010101010101010101010101010101
:[0101010101010101010101010101010101010101
:[0101010111111111111111111111111101010101
:[0101010111010101010101010101011101010101
:[0101010111010100000000000001011101010101
:[0101010111010000000000000000011101010101
:[0101010111000000000000000000001101010101
:[0101010111000202030404050202001101010101
:[0101010111000202060707080202001101010101
:[0101010111000202090A0B0C0202001101010101
:[01010101110002020D0E0F100202001101010101
:[0101010111000000000000000000001101010101
:[0101010111000000000000000000001101010101
:[0101010111111111111111111111111101010101
:[0101010101010101010101010101010101010101
:[0101010101010101010101010101010101010101
:[0101010101010101010101010101010101010101
:Repeat 0
:For(L,0,12:For(M,0,9
:{M+Y*S+L+X+GDB1}→A
:Pt-Off(8*L-4,8*M-4,8*A+Pic1
:End:End
:Pt-On(44,25,D-1*8+Pic2
:Pt-Change(44,25,D*8+24+Pic2
:Pt-On(44,33,32*B+(D-1*8)+Pic3
:Pt-Change(44,33,32*B+(D-1*8)+96+Pic3
:DispGraph
:For(L,0,6000
:If getKey(15):Goto Q:End:0→C
:If getKey(3):1→D→CEnd
:If getKey(2):2→D→CEnd
:If getKey(1):3→D→CEnd
:If getKey(4):4→D→CEnd
:End
:If getKey(3) and (D=1)
:If {Y+4*S+X+7+GDB1}<3
:X+1→XEnd:End
:If getKey(2) and (D=2)
:If {Y+4*S+X+5+GDB1}<3
:X-1→XEnd:End
:If getKey(1) and (D=3)
:If {Y+5*S+X+6+GDB1}<3
:1+Y→YEnd:End
:If getKey(4) and (D=4)
:If {Y+3*S+X+6+GDB1}<3
:Y-1→YEnd:End
:If C
:(B<2)+1→B
:Else:0→BEnd
:End
:Lbl Q
im pretty clueless when it comes to axe optimization and i made this a while ago, so tell me if you see anything obvious

EDIT: 50POSTS! IMOFFTOTHEARCADENAO!
Title: Re: random stuffs
Post by: meishe91 on August 02, 2010, 07:03:20 pm
Did you mean to say it draws to the back-buffer? Because I thought you said it doesn't use the back-buffer ???
Title: Re: random stuffs
Post by: shmibs on August 02, 2010, 07:05:30 pm
nice catch there, thanks =D
it draws to the buffer and then shifts
EDIT: ok, it looks like i tricked myself here... that specific screenshot is from a prog which DOES draw to the backbuffer  ::)
i made one afterwards which did not(and because of that couldnt draw on the outside rim of pixels) specifically to see if people could guess and then posted the wrong one...
also, i dont think i've posted a single thing today without going back and editing it afterwards :P
Title: Re: random stuffs
Post by: FinaleTI on August 02, 2010, 07:12:25 pm
Nice! I would love the source for the 4-level grey, it would be extremely helpful for Pokemon TI.
The mapping engine is pretty awesome too! I might have to reference that code for a future project I have in mind. Gotta finish Nostalgia first, of course.
Title: Re: random stuffs
Post by: Raylin on August 02, 2010, 08:00:38 pm
What version of Axe are you using for the animation and are you using PT-Mask()?
Title: Re: random stuffs
Post by: shmibs on August 02, 2010, 08:01:53 pm
.4 and no
EDIT:HAHA, i posted without having to go back and edit it... wait... DAMNIT =D
Title: Re: random stuffs
Post by: Raylin on August 02, 2010, 08:02:40 pm
Oh. Okay then. Just wondering.
Really nice grayscale though.
Title: Re: random stuffs
Post by: Hot_Dog on August 02, 2010, 08:34:52 pm
Those are sweet
Title: Re: random stuffs
Post by: DJ Omnimaga on August 06, 2010, 11:19:54 pm
Wow that's AMAZING! Nice job on that!

Also I especially like this:

Quote
(http://img.removedfromgame.com/imgs/1280784624-mrphdraw.gif)
I've been thinking about writing a tilemapper in Axe that works with individual bits, either with the upcoming bit reading command or by copying portions of the map data to L3/back-buffer and pxl-testing them. It would pxl-test each side of each tile and draw the appropriate wall or floor tile in the middle. Illusiat 12, Mana Force 2, Illusiat 2004 and ROL series actually use some primitive form of what I am talking about. In their case, when drawing a wall, it checks if the map tile below is a floor then draws a different wall tile than the rest of the walls.
Title: Re: random stuffs
Post by: nemo on August 06, 2010, 11:32:03 pm
that tilemapping program looks really cool. can you post the source code for that?
Title: Re: random stuffs
Post by: FinaleTI on August 06, 2010, 11:49:59 pm
Wow that's AMAZING! Nice job on that!

Also I especially like this:

Quote
(http://img.removedfromgame.com/imgs/1280784624-mrphdraw.gif)
I've been thinking about writing a tilemapper in Axe that works with individual bits, either with the upcoming bit reading command or by copying portions of the map data to L3/back-buffer and pxl-testing them. It would pxl-test each side of each tile and draw the appropriate wall or floor tile in the middle. Illusiat 12, Mana Force 2, Illusiat 2004 and ROL series actually use some primitive form of what I am talking about. In their case, when drawing a wall, it checks if the map tile below is a floor then draws a different wall tile than the rest of the walls.

Like what I did for Nostalgia?
Title: Re: random stuffs
Post by: DJ Omnimaga on August 06, 2010, 11:54:57 pm
You did too? Nice. And yeah it was a similar method in ROL series back in the days
Title: Re: random stuffs
Post by: shmibs on August 07, 2010, 02:33:39 am
that tilemapping program looks really cool. can you post the source code for that?
there's really no need, it's very simple
just store your twelve different sprites for each tile type one after the other and then check the surrounding tile values and add 1, 2, 4, 8(1 for each surrounding tile) multiplied by whether that tile is the same as the tile being drawn, multiply that number by eight to get the right spot in the sprite set, and draw the sprite pointed to. i'll attach the code if you really want to look at it, though

oh, and there's going to be a single bit reading code? that could be really helpful with my contest entry; it does a LOT of pixel testing on the back buffer
*shmibs should really be finishing that, but is looking for reasons to procrastinate :P
Title: Re: random stuffs
Post by: ztrumpet on August 07, 2010, 07:10:05 pm
Wow, excellent job!  Those look great.  Wonderful! ;D
Title: Re: random stuffs
Post by: DJ Omnimaga on August 07, 2010, 07:17:47 pm
Yeah I figured it wouldn't be too hard to create. I should really attempt a tilemapper using such way to draw maps at one point.