Very happy to see a really useful entry like this! π€
I used a P8 port of OpenSimplex in Low Mem Sky to do all my planetary procgen - so am always interested to see new/better takes on noise generation (assuming your licence for it allows, of course!).
Great idea for a test implementation too (tho alas, I never found any treasure π₯π)
Congrat again on the cool entry ππ
Play Tool
Shiplex Noise - Pico1k's itch.io pageCompressed Bytes used
1020
Source Code (OPTIONAL)
use puny mode to copy paste
--by noesis
for i=0,511do v=ord("\0@β΄\0γ’γ’γ’γ’\0π₯π₯\0γ’γ’γ’γ’\0β¬οΈπ«\0γ’γ’γ’γ’\0ww\0γ’γ’γ’γ’π±ΛπΊβ΅γ’γ’γ’γ’\0β¬οΈπ«\0γ’γ’γ’γ’\0β¬οΈπ«\0γ’γ’γ’γ’\0π₯π₯\0γ’γ’γ’γ’\0pβ·\0ββββ\0pw\0ββββ\0pwβ·ββββ\0pw\0ββββ@yβ₯β΄ββββπ₯π΅π₯π₯ββββ\0π΅π₯β΄ββββ\0\0\0\0ββββ@β΄\0\0γγγγ@π«β·β΅γγγγ@γπΈ\0γγγγ@β¬οΈw\0γγγγ\0π₯wβ΄γγγγ\0π¦β¬οΈπ₯γγγγπ±\0π₯β΄γγγγ\0\0@\0γγγγγγγγγ33γγπΆπΆγ;3;γ―[π¦π₯γ΅3γ―33[π₯π₯γ²γ―γ―γ―3[π₯π₯γ²3333[π₯π₯γ²3;;3γπ₯π₯γ;3γ―3γγγγγγ―3γ―",i\2+1)sset(i%16,i\16,v\16^(i%2)%16)end
sd="\as4i7c"
x=60y=35dx=1dy=0r=0
g="8558"gi="8?:5?"k={}
function dig(o)
l=0if(o==49)l=33r+=1
if(o==33)l=48
if(l!=0)k[flr(x+dx)..flr(y+dy)]=l ?sd
end
function fmap(x,y)
for a=0,16 do
for b=0,16 do
i=1n=sn((a+flr(x)-8)*.01,(b+flr(y)-8)*.01)
if(n>.5)i=17
if(n>.6)i=33
if(n>.75)i=49
mset(a,b,i)
l=k[(a+x-8)..(b+y-8)]
if(l!=nil)mset(a,b,l)
end
end
end
function move()
b=btn()ps=16fx=0fy=0
z=(b\2%2-b%2)
v=(b\8%2-b\4%2)
m=mget(8,8)
x+=z
y+=v
if(b&15>0)dx=z dy=v
if(abs(dy)>0)ps=0
if(abs(dx)+abs(dy)>1)ps=32
if(m==1)spr(ps,64,64+t()%2,1,1,dx>0,dy>0)
if(m!=1)?"μ",65,65,5
w,h=64+dx*8,64+dy*8rect(w,h,w+8,h+8,7)
end
function _draw()
cls()if(btnp(β))dig(mget(8+dx,8+dy))
fmap(x,y)map()move()
?"wood:"..r,8,8,2
?"μ:"..flr(x)..":"..flr(y),8,14,4
end--sn 2d
srand(678)--seed
local p={}
for i=1,512 do
p[i]=flr(rnd(256))
end
local g={{1,1},{1,-1},{-1,1},{-1,0},{-1,-1},{1,-1},{1,-1},{1,0}}
function cb(x,y,z)
local t=.5-x*x-y*y
if(t<0)return 0
return t^4*(g[z+1][1]*x+g[z+1][2]*y)
end
function sn(x,y)
local g=.2113
local s=(x+y)*.366
local i,j=flr(x+s),flr(y+s)
local t=(i+j)*g
local x0,y0=x-(i-t),y-(j-t)
local i1=0j1=1if(x0>y0)i1=1j1=0
local x1=x0-i1+g
local y1=y0-j1+g
local x2=x0-1+2*g
local y2=y0-1+2*g
local u=i&255
local v=j&255
return 70*(cb(x0,y0,p[u+p[v+1]]%8)+cb(x1,y1,p[u+i1+p[v+j1+1]]%8)+cb(x2,y2,p[u+1+p[v+2]]%8))
end
Leave a comment
Log in with itch.io to leave a comment.