Free your creativity - IOMBCC

Página 22/29
15 | 16 | 17 | 18 | 19 | 20 | 21 | | 23 | 24 | 25 | 26 | 27

Por dvik

Prophet (2200)

Imagen del dvik

21-04-2005, 21:53

I've made a little list of our variable use. Its kindof a spoiler maybe but its good
to know when we want to optimize it more:

A = FREE
B = turn
C = turn duration
D = turn offset
E = opponent car distance
F = turn
G = mountain scroll
H = Loop var in setup, used as 32 in game
I = Loop var in setup, FREE in game
J = Loop var
K = Loop var, temp var
L = FREE
M = Temp var (for car offset) in game
N = opponent car distance
O = Loop var, temp var in setup, Temp var for stick in game
P = Grass scroll color array
Q = FREE
R = Temp var in setup, track length in game
S = FREE in setup, speed in game (need to be 0 at game start)
T = Track offset
U = Constant 255
V = Constant 14
W = Loop var
X = Car position (left-right)
Y = Temp var
Z = Float variable used for time calculation at the end demo

Por wolf_

Ambassador_ (10037)

Imagen del wolf_

21-04-2005, 22:00

"spoiler" ? as if I can read all that enigma-code anyway Smile

Por NYYRIKKI

Enlighted (5982)

Imagen del NYYRIKKI

21-04-2005, 22:14

I also made a quite a cute looking 6bit decoder, that is used in "Sourcered Forces" but I also learned, that it's not very small to write. Smile

The new thing in this packing (that is still 4bit) is, that RLE counter is optional, so there are no fixed positions, where RLE counter needs to be. The data can be either 2 byte HEX number or 1 byte RLE counter and the special thing in this data is, that sometimes that very same byte represents both HEX number and RLE counter!!!

Por NYYRIKKI

Enlighted (5982)

Imagen del NYYRIKKI

21-04-2005, 23:16

I was just thinking, that how about throwing away the "Please wait" and replace that with simple screen disable?

Por dvik

Prophet (2200)

Imagen del dvik

21-04-2005, 23:24

Yes that saves some characters. I'm working on an even more efficient compression of the sprite data. I think I can save another 25 characters or so.
Its quite simple actually. I just store the data in for example base 96. Then you can fit both the RLE length and value in two characters. It saves a few characters in the actual compressed array but the big save is in the decompression algorithm. I'll see if it works out as I think it will.

Por dvik

Prophet (2200)

Imagen del dvik

21-04-2005, 23:48

It worked and saved another 33 characters. It is not as obfuscated as NYYRIKKIs
compression algorithm though. But at least it gave some more characters to do
other fun things with.

*EDITED*

1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:COLOR15,5,1:V=14:SCREEN2,3,0:FORX=0TO2:FORY=0TO31:R=16-Y\2:LINE(R-(X-1)*((SIN(Y^.8/6)-(Y<16))*6-R-2)+(X<2),X*32+Y)-STEP(Y+1,0):NEXTY,X
2 N=14336:U=255:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*32+(IAND48)\2+(IAND448)*8):NEXT:SCREEN1:KEYOFF:FORO=0TO32:Y=0:FORR=RTOR+1:Y=Y*96+(ASC(MID$("3##B#C#c$B'r$B&s3#%##C#3%S';%S&s;##2#3#B#R#B#<=c'##c'#@C#)#2#,s##&",R))-35)
3 NEXT:FORK=KTOK+Y\256:VPOKEK+N+I,YANDU:NEXTK,O:LOCATE8,1:PRINT"PLEASE WAIT!":R=N\2:FORI=256TO1023:VPOKE7952+I,85:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279:O=IAND32:VPOKE6432+(IAND63),228+8*(IAND3)-O
4 W=2^(IAND7):J=O*127\W\32:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WANDU:J=8-O\8:VPOKEI,(JANDI)*U\J:NEXT:FORK=1TO13:FORH=0TO31:VPOKE6464+H+K*32,-(K<9ORH0:-:D=D*D\96:PRINTUSING"SPEED:##0kmh    RANK:###";S;N\128-82:-:F=B:IFC<TTHENC=V+T+TMOD99:B=(R-T>99)*(1-CMOD3)
6 S=S-(S<18ANDSTRIG(0))*2+(S>0):-:FORW=3TO4:PUTSPRITEW+1,(F*10+W*H,95),V,4*B+W+1:PUTSPRITE3+W,(W*H,127),V,4*F+3+W:NEXT:-:T=T+S-1:PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),-6*(T0)*(N\4-V):SOUND8,O:SOUND9,O:PUTSPRITE0,(116-(36-X)*D\126,68+D),-(D>0),S-D\24:LOCATE6,4:PRINTMID$(Z$+"Race Over   Time ="+STR$(Z/10)+"s"+Z$,NMOD42+1,S):-:NEXT:SCREEN0

Por snout

Ascended (15187)

Imagen del snout

21-04-2005, 23:52

I think the 'Please wait' notice can be removed in favor of new features as well... heck, you don't even have to enable/disable the screen as far as I'm concerned! Smile

Por dvik

Prophet (2200)

Imagen del dvik

22-04-2005, 00:12

I really want to get a center line in there. We have 75 free characters now but I think it will require a little bit more.

Por Sonic_aka_T

Enlighted (4130)

Imagen del Sonic_aka_T

22-04-2005, 01:24

well, the locate/please wait crap would be like 30 chars extra...

Por dvik

Prophet (2200)

Imagen del dvik

22-04-2005, 03:20

Well, I did a little try on the center line. The code is not that optimized but I wanted to see what's possible to do.

The center line code slows down the game a bit and I'm not sure it is worth it.
Maybe we should try to get some other features into the game instead.

What do you think?

1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8193+W,A(W+K):VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:V=14:SCREEN2,3,0:FORX=0TO2:FORY=0TO31:R=16-Y\2:LINE(R-(X-1)*((SIN(Y^.8/6)-(Y<16))*6-R-2)+(X<2),X*32+Y)-STEP(Y+1,0)
2 NEXTY,X:COLOR15,5,1:FORY=-1TO1:FORX=0TO14:PRESET(16+Y*X\4,64+32*Y-X):NEXTX,Y:N=14336:U=255:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*32+(IAND48)\2+(IAND448)*8):NEXT:SCREEN1:KEYOFF:FORO=0TO32:Y=0:FORR=RTOR+1
3 Y=Y*96+(ASC(MID$("3##B#C#c$B'r$B&s3#%##C#3%S';%S&s;##2#3#B#R#B#<=c'##c'#@C#)#2#,s##&",R))-35):NEXT:FORK=KTOK+Y\256:VPOKEK+N+I,YANDU:NEXTK,O:R=N\2:FORI=256TO1023:VPOKE7952+I,85:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279
4 O=IAND32:VPOKE6432+(IAND63),228+8*(IAND3)-O:W=2^(IAND7):J=O*127\W\32:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WANDU:J=8-O\8:VPOKEI,(JANDI)*U\J:NEXT:FORK=1TO13:FORH=0TO31:VPOKE6464+H+K*32,-(K<9ORH<13ORH>18)*(ASC(MID$("i=67'6&7/'6.&",K))+90)
5 P(H\4)=50-15*(H\12AND1):NEXTH,K:VPOKE8192,V:FORJ=1TO3:FORI=0TO7:A(I)=238+(IAND1):VPOKE64*J+I,254:VPOKE64*J+8+I,31:VPOKE64*J+16+I,0:VPOKE64*J+24+I,0:FORK=0TO1:VPOKE6671+32*I+K,ASC(MID$("KSKSIQIQ",I+1))-65+K:NEXTK,I,J
6 SOUND3,V:FORW=8TO9:PUTSPRITEW,(80+64*W,159),V,W-2:SOUNDW,V:NEXT:VPOKE1209,U:TIME=0:FORT=7TOR:LOCATE1,1:D=96-(NAND127):Y=D>0:-:D=D*D\96:PRINTUSING"SPEED:##0kmh    RANK:###";S;N\128-82:-:F=B:IFC<TTHENC=V+T+TMOD99:B=(R-T>99)*(1-CMOD3)
7 S=S-(S<18ANDSTRIG(0))*2+(S>0):-:FORW=3TO4:PUTSPRITEW+1,(F*10+W*H,95),V,4*B+W+1:PUTSPRITE3+W,(W*H,127),V,4*F+3+W:NEXT:-:T=T+S-1:PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),-6*(T0)*(N\4-V):SOUND8,O:SOUND9,O:PUTSPRITE0,(116-(36-X)*D\126,68+D),-(D>0),S-D\24:LOCATE6,4:PRINTMID$(Z$+"Race Over   Time ="+STR$(Z/10)+"s"+Z$,NMOD42+1,S):-:NEXT:SCREEN0
Página 22/29
15 | 16 | 17 | 18 | 19 | 20 | 21 | | 23 | 24 | 25 | 26 | 27