Author Topic: Smoothscrolling tilemapper  (Read 35640 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #90 on: November 15, 2010, 02:15:04 pm »
Same here squidgetx :) Unless i was absolutely forced to use nibble maps, i would go full byte every time ^^

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #91 on: November 15, 2010, 02:17:48 pm »
Thanks ;) That little bit of support has now convinced me to change it around. Ironically this will lessen the amount of free RAM I need since I will be changing map sizes from 100x100 to 50x50, and even with the change from nibbles to bytes that still means we're going from 5000 bytes per map to 2500 :)

edit: actually maybe I'll make it 64x64 instead...
« Last Edit: November 15, 2010, 02:18:17 pm by squidgetx »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #92 on: November 15, 2010, 02:28:54 pm »
yeah powers of 2 make things a lot faster and simpler in some of the tile detection code

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #93 on: November 15, 2010, 06:53:43 pm »
About preserving the back-buffer: there are 3 saferam areas designated for saving the screen. They are plotSScreen (default buffer used w/ drawing bcalls, also is the buffer in Axe, L6), appBackUpScreen (back-buffer in Axe, L3), and saveSScreen (L1 in Axe). This is obviously all well and good, but Quigibo used the first 56 bytes for the A-Z+THETA vars. If you don't mind overwriting those, or don't mind adding free mem in-program to use as vars, you can use saveSScreen as a backup-back-buffer (it's L1-56).
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





SirCmpwn

  • Guest
Re: Smoothscrolling tilemapper
« Reply #94 on: November 15, 2010, 06:56:41 pm »
I'm trying to figure out how best to RLE my maps for an upcoming game of mine, since I have little motivation to work on HL2.  Any suggestions?  The maps could get quite large, and tilemapping should be fast.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #95 on: November 15, 2010, 09:32:43 pm »
RLE? HL2? (Sorry, I'm bad with acronyms)
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #96 on: November 15, 2010, 09:37:15 pm »
Run Length Encoding (Compression scheme)
Half-Life 2 (Video game)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #97 on: November 15, 2010, 09:40:01 pm »
Are you looking for a method or an explanation?

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Smoothscrolling tilemapper
« Reply #98 on: November 15, 2010, 10:06:13 pm »
Thanks calcdude. Here would be my suggestion for RLE, (I'll refer to the leftmost bit as bit 7), bit 7 will be 0 if that byte will include the data, or 1 if the next byte will give the length.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





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: Smoothscrolling tilemapper
« Reply #99 on: November 15, 2010, 10:12:05 pm »
Didn't Nemo write a compression/decompression routine for tilemaps? You might want to ask him or run a search on the forums to see if you can find it. Maybe he just had compression, though.
* DJ Omnimaga thinks this is when we need a !call function on the forums.

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: Smoothscrolling tilemapper
« Reply #100 on: November 15, 2010, 11:44:00 pm »
http://ourl.ca/7818
Look for "RLE". ;D

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: Smoothscrolling tilemapper
« Reply #101 on: November 16, 2010, 12:25:25 am »
Ah, right, decompression was done, too. I wasn't sure anymore. :)

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Smoothscrolling tilemapper
« Reply #102 on: February 16, 2011, 01:23:41 am »
Okay, I'm having a problem with one.
It has a few display glitches...
Still can't figure out the tilemapper though.
When scrolling both horizontally and vertically, there's display issues.
To test: make a tio level using any of the versions, then run this.  It uses the Tio map for data.


attached is (non-playable) level that really shows the graphical problems...yay :P

EDIT have some code
Code: (STILEMPR) [Select]
:.DTILEMPR
:[F0F0F0F000000000]?Pic0N
:[A0A0505000000000]?Pic1J
:[6040206000000000]?Pic1S
:[6040604000000000]?Pic1F
:[9000009000000000]?Pic1R
:[A050A05000000000]?Pic1D
:[000C030000000000]?Pic1W
:DiagnosticOff
:"vTIOLVL"?Str1
:GetCalc(Str1)?P
:Return!If P
:conj(P,L1,384
:0?N?O?I?J-1?E
:.I and J are coordinates of top left corner
:.N and O are tile offsets
:
:ClrDraw
:.draw init image
:For(Y,0,15
:Y*4?T
:For(X,0,23
:X*4?S
:E+1?E
:sub(DRW
:End
:End
:DispGraph
:Repeat getKey(15)
:Repeat getKey(0):End
:If getKey(54)
:ClrHome
:.display stuff
:Disp "random info",i,"I",I?Dec," J",J?Dec,i,"N",N?Dec," O",O?Dec
:While getKey(54):Pause 10:End
:End
:
:If getKey(1) xor (getKey(4))
:.vert movement
:
:If getKey(4)
:Vertical +
:O+1?O
:If O>>3
:J-1?J
:O-4?O
:For(A,0,23
:A*4-N?S
:0-O?T
:J*24+I+A?E
:sub(DRW
:End
:End
:End
:
:If getKey(1)
:Vertical -
:O-1?O
:If O<<1
:J+1?J
:O+4?O
:For(A,0,23
:A*4-N?S
:64-O?T
:J*24+I+A+360?E
:sub(DRW
:End
:End
:End
:
:End
:
:If getKey(2) xor (getKey(3))
:.horiz movement
:If getKey(2)
:Horizontal +
:N+1?N
:If N>>3
:N-4?N
:I-1?I
:For(A,0,15
:0-N?S
:A*4-O?T
:J*24+I+(A*24)?E
:sub(DRW
:End
:End
:End
:If getKey(3)
:Horizontal -
:N-1?N
:If N<<1
:N+4?N
:I+1?I
:For(A,0,15
:96-N?S
:A*4-O?T
:J*24+I+(A+1*24)?E
:sub(DRW
:End
:End
:End
:
:
:
:End
:DispGraph
:End
:
:
:Lbl DRW
:Pt-On(S,T,Pic0N
:Pt-Change(S,T,Pic0N
:.pt-on stuff
:!If {L1+E}-1
:Pt-On(S,T,Pic0N
:Else!If {L1+E}-2
:Pt-On(S,T,Pic1J
:Else!If {L1+E}-3
:Pt-On(S,T,Pic1S
:Else!If {L1+E}-4
:Pt-On(S,T,Pic1F
:Else!If {L1+E}-5
:Pt-On(S,T,Pic1R
:Else!If {L1+E}-6
:Pt-On(S,T,Pic1D
:Else!If {L1+E}-7
:Pt-On(S,T,Pic1W
:End
:.Return
See this post for screenshot and attachments
« Last Edit: February 16, 2011, 02:27:49 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Smoothscrolling tilemapper
« Reply #103 on: February 17, 2011, 02:49:25 pm »
Ok, that's been taken care of since, and I have a pretty good idea of how it works.
A random idea I got was to make simply written, heavily commented source code, so other people can learn from them.
So far, I have basic 8*8 tilemapping (no scrolling) covered.

Quick question: there's a type of scrolling, not smoothscrolling, but it scrolls like 8 pixels at a time.  Kind of like, say, pyyrix did scrolling.  What's that called?

btw yes, i'm still working on Tio, I'm just trying to learn more on how to do this so i don't screw up big time then i try to add it.
Vy'o'us pleorsdti thl'e gjaemue