Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CptnRoughnight

Pages: 1 [2] 3 4 ... 8
16
Then it takes a little longer, I'll try anyway! :)

17
Nice! I'm waiting for it, to port it to Pandora! :) Thank you!

18
Really great!

Would you release it for Pandora too? Can you play via net? Would be a awesome game for pandora!  :nw:

19
Math / Re: Perlin Noise implementation
« on: 2013-Dec-16 »
Perlin is indeed intended for textures, but for example, Minecraft uses this algorhythm for the terrain generation.
First, it will determine the level of landscapes, then, in several passes the "Dungeons".


20
Math / AW: Perlin Noise implementation
« on: 2013-Dec-16 »
:D very nice!

My PI value o.O, thats a strange mistake. .. thanks for it! :D

21
Math / Re: Perlin Noise implementation
« on: 2013-Dec-14 »
Ahhh my fault!

for seeding, there are two arrays in the Perlin Type, with

Code: (glbasic) [Select]
perlin.InitNoise( seed )

you can access them!

22
Math / Perlin Noise implementation
« on: 2013-Dec-14 »
Hi,

here is my Perlin Noise implementation. Feel free to use in your projects!

Code: (glbasic) [Select]
//****************************************
//** Perlin Noise Implementatio
//** Date: 14.12.2013
//****************************************

TYPE TPerlin
d%
f#
result#
fracX#
fracY#
total#
octaves
pnum%
    per_Prim_1%[]
    per_Prim_2%[]

FUNCTION InitNoise:num%
self.d% = 0
self.f# = 0
self.result = 0
self.fracX = 0
self.fracY = 0
self.total = 0
self.octaves = 0
self.pnum% = num%

DIMDATA self.per_Prim_1%[],15731,15733,15737,15739,15749,15761,15767,15773,15787,15791,15797,15803,15809,15817,15823
DIMDATA self.per_Prim_2%[],789221,789227,789251,789311,789323,789331,789343,789367,789377,789389,789391,789407,789419,789443,789473
ENDFUNCTION


FUNCTION Noise#:n%,octave
self.d = bXOR(ASL(n,13),n)

RETURN (1.0 - (bAND((self.d * (self.d * self.d * self.per_Prim_1%[self.pnum] + self.per_Prim_2%[self.pnum]) + 1376312627),2147483647)) / 1073741824.0)
ENDFUNCTION

FUNCTION Cos_Interpolate#:a#,b#,x#
self.f# = COS(PI * x#)

self.f# = (1-self.f#) * 0.5;
RETURN a# *(1-self.f#)+b# *self.f#;
ENDFUNCTION


FUNCTION Noise2D#:x%,y%
RETURN self.Noise(x * 46349 + y * 46351, 1)
ENDFUNCTION


FUNCTION Smooth_Noise2D#:x%,y%
self.result = (self.Noise2D(x-1,y-1) + self.Noise2D(x+1,y-1) + self.Noise2D(x-1,y+1) + self.Noise2D(x+1,y+1)) / 16
self.result = self.result +( (self.Noise2D(x-1,y) + self.Noise2D(x+1,y) + self.Noise2D(x,y-1) + self.Noise2D(x,y+1)) / 8)
self.result = self.result +( self.Noise2D(x,y) / 4 )
RETURN self.result;

ENDFUNCTION


FUNCTION InterpolatedNoise2D#:x%,y%
self.fracX# = x - INTEGER(x)
self.fracY# = y - INTEGER(y)

RETURN self.Cos_Interpolate(self.Cos_Interpolate(self.Smooth_Noise2D(INTEGER(x#), INTEGER(y#)), self.Smooth_Noise2D(INTEGER(x#) + 1, INTEGER(y#)), self.fracX#),self.Cos_Interpolate(self.Smooth_Noise2D(INTEGER(x#), INTEGER(y#)), self.Smooth_Noise2D(INTEGER(x#) + 1, INTEGER(y#)), self.fracX#), self.fracY#)

ENDFUNCTION

FUNCTION GetPerlinNoise2D#:x#,y#,pers#,freq#,amp#,oct
self.total# = 0

FOR self.octaves = 0 TO oct
freq# = freq*2
amp# = amp*pers
self.total# = self.total# + (self.InterpolatedNoise2D(x#*freq#,y#*freq#)*amp#)
NEXT
RETURN self.total
ENDFUNCTION
ENDTYPE

edit:

and the test program :

Code: (glbasic) [Select]
// --------------------------------- //
// Project: Perlin
// Start: Tuesday, September 10, 2013
// IDE Version: 11.171


GLOBAL map[]
GLOBAL x,y
GLOBAL p AS TPerlin

DIM map[10001]

CONSTANT PI = 3.141593
p.InitNoise(4)

FOR x= 0 TO 99
FOR y = 0 TO 99
map[x+y*100] = (p.GetPerlinNoise2D(x,y,0.8,0.1,1,5)+1)/255 * 255
DEBUG "map: "+map[x+y*100]+"\n"
NEXT
NEXT

FOR x= 0 TO 99
FOR y = 0 TO 99
DRAWRECT x*4,y*4,4,4,RGB(map[x+y*100]*200,0,0)

NEXT
NEXT

SHOWSCREEN

MOUSEWAIT

Edit : Strange PI Bug :D

23
GLBasic - de / Re: PND startet nicht
« on: 2013-Dec-12 »
Here is my entry : http://repo.openpandora.org/?page=detail&app=cptngames.crapcopter

Special thanks to Ian Price! PND works fine!

24
Welche PND benutzt du? Du musst die pandora-exe.pnd auf der Pandora ausführen.
Mfg

25
GLBasic - de / Re: PND startet nicht
« on: 2013-Dec-05 »
Thanks Ian Price,  :good:

but i will try it by myself first. There is no reason that I could not learn that! ;)

If I have problems, I'll report back.


26
GLBasic - de / PND startet nicht
« on: 2013-Dec-05 »
Hi Leute,

Ich bin gerade in der Endphase für mein Beitrag zum "Crap Game Coding Competition 2013" und wollte nun anfangen das Spiel als einzelne PND auf der Pandora zu testen.
Sonst benutze ich immer den Umweg über die pandora-exe.pnd, weil ich weiß das die eigtl. PND nicht geht.

Jetzt die Frage: Wenn ich die PND erzeuge, was muss noch mitgeliefert werden? Im Terminal steht immer der Fehler :

Code: (glbasic) [Select]
Starting the application ( ./pandora-exe.pnd  )           [ failed ]

Habe ich Einstellungen vergessen? Ich habe auch versucht den ganzen "distribute/pandora" Ordner zu kopieren, mit dem gleichen negativen Effekt.

Bitte um Hilfe, komme hier echt nicht weiter allein.

p.s. benutze aktuellstes GLBasic und Firmware SZ R1.55/Kernel 3.2.52


MfG

27
Very cool software, just what i need! Thanks!

28
GLBasic - en / AW: Returning User's IP
« on: 2013-Nov-23 »
First simple games with high score management. But I have ideas for a kind of online game. I'll play around a bit with the possibilities once I have fully understood the network functionality ;)

29
GLBasic - en / Re: Returning User's IP
« on: 2013-Nov-22 »
The Rapsberry Pi is used as a server for my games.

This idea I wanted to implement for competition (Crap Game Competition 2013), but I've not enough time i guess.

I have many other ideas for which the Pi is suitable as a server.

Maybe i will learn html/css/php to write a homepage by myself! ;)

30
GLBasic - en / Re: PLAYSOUND wav on Pandora
« on: 2013-Nov-21 »
It was really the wrong format. The first file that was not playable, has 2304 kbit / s
I did not pay attention. With the second File that only 88kbit / s, it works.

I was afraid it would not work at all.

BTW Audacity is a super sound editing tool! ;)

Thanks for the tip.

 =D

Pages: 1 [2] 3 4 ... 8