Menu

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.

Show posts Menu

Topics - nabz32

#21
Hallo, bin grade dabei Musik für mein
Projekt auszuwählen.

Gibt es ein Kommando mit der man den jetzigen Wiedergabepunkt ausgeben kann, bzw. setzen kann?

Habe auch schon das Forum durchwühlt, aber nichts weiterführendes dazu gefunden.

Wenn GLBasic keine solche Funktion hat, kann man dann vlt. mit inline Kommandos die Abspielposition bearbeiten oder ausgeben lassen ( so dass es auf der Pandora auch läuft) ?

#22
Hello,
I tired to catch a bug in my collision routine, where the player was moved by way to large numbers, when collision sets in.

I shortened the code as much as I could, but just couldn´t find an error leading to this.
I debugged the code and noticed, that in collision case, sometimes the coordinates of movement where way to large ( ca. 7000 units instead of the 2.5 units I tested the collision with ).
I compared the coordinates from the point they where before they where given to the function and inside the function itself and noticed, that the coordinates given where allways what I assumed, but the coordinates after where sometimes screwed up.

The type I used to pass the coordinates to the function was rather simple:

Code (glbasic) Select
type coord
x# as float
y# as float
z# as float
endtype


As I didn´t know where the distorted coordinates came from,
I changed the functions parameters from 2 coord objects to 6 normal floats instead.
( I just copied i.e. startX for start.x in the code)
After this I never experienced a distortion of those coordinates again.
( Whats really strange is that the function later calls another function and passes it 4 3d coordinate sets of the same type, the numbers passed to this function where not corrupted [ only if they where passed falsely to my collision function allready )

I never experienced this in my sample code though ( had the exact same collision function ) , maybe its caused by having to much types defined.
The other difference to my example code, the example used only 2D coordinates, whereas the real function used 3D coordinates.




#23
hallo,

bei Abstürzen aller Art habe ich bis jetzt immer mit dem Debugger die entsprechende Stelle eingrenzen können,
diesmal habe ich einen schwer zu findenden Absturz, der aber mysteriöser Weise nicht im
debug Modus auftritt.

Hat jemand von euch schon einen crash gehabt der im debug modus nicht auftrat?
#24
I tried to modify a sprite on the run,
I loaded the sprites data with SPRITE2MEM and stored it
in an array.

On the Pandora SPRITE2MEM didn´t gave me any sprite data for my array.

Got around this by resaving the image into a file on the PC using SPRITE2MEM once
and now I am loading it everytime using openfile on the Pandora.

Anyone else had this trouble also?

Edit: Good that MEM2SPRITE works on the Pandora :good:
#25
Hallo, ich habe mich an shadow mapping versucht.

Dafür habe ich einfach die erstellten plains ( aus 2 Triangeln ) erneut mit anderer Textur und aktiviertem Alpha Testing über die alten noch einmal gezeichnet.

Funktioniert auch ganz gut, nur bekomme ich weiße Ränder an den nochmals gezeichneten Schatten plains.

Auf diesem Bild sollte man es gut erkennen können:
https://www.dropbox.com/s/37czyqknomsyf0e/Screenshot%202014-07-27%2014.35.42.png

Das Format der Schatten Texturen ist 64x64.

Je tiefer ich diese plains auf das Terrain lege, desto weniger fallen die Ränder auf, jedoch
brauche ich mehr Distanz zu dem Terrain in der Pandora Version, da anscheinend der Pandora Z-Buffer nicht so empfindlich ist, wie auf dem PC.



#26
Hello,

I am currently writing an algorythm for sliding non tile based collision for unrotated rectangles.

Here is my testing code:

Code (glbasic) Select

CONSTANT maxBox = 5

TYPE coord
x AS float
y AS float
z AS float
ENDTYPE


TYPE cBox
xl AS int // smaller
xr AS int // greater
yd AS int // lower
yu AS int // higher
zf AS int // more near
zb AS int // more far
frict AS float
exist AS int
ENDTYPE

GLOBAL box[] AS cBox

drawSimulation()

FUNCTION drawSimulation:
LOCAL mx% , my% , b1% , b2%
LOCAL l1S AS coord , l1E AS coord , get AS coord
DIM box[10]
FOR i = 0 TO maxBox - 2 // fill Boxes ( 2D only for simulation )
box[i].xl = 50 * i
box[i].xr = 50 + 50 * i
box[i].yd = -50
box[i].yu = 50
box[i].zf = 50
box[i].zb = 125
box[i].exist = 1
sortCube( i )
NEXT
box[4].xl = 125
box[4].xr = 175
box[4].yd = -50
box[4].yu = 50
box[4].zf = 125
box[4].zb = 175
box[4].exist = 1
X_MAKE2D
WHILE TRUE
FOR i = 0 TO maxBox - 1
DrawCube(i)
NEXT
MOUSESTATE mx , my , b1 , b2
l1S.x = mx ; l1S.z = my
l1E.x = mx - 10 ; l1E.z = my - 10
l1E.y = 0 ; l1S.y = 0
DRAWLINE l1S.x , l1S.z , l1E.x , l1E.z , RGB( 122 , 122 , 122 )
get = checkinters( l1S , l1E )
SHOWSCREEN
WEND
ENDFUNCTION

FUNCTION checkinters AS coord: l1S AS coord , l1E AS coord
LOCAL cPnt AS coord , temp AS coord , tempE AS coord , cpNear AS coord , smDist# AS float , iSm AS int , l1EO AS coord , l1SO AS coord
l1SO = l1S
l1EO = l1E
FOR iG = 0 TO 1 // goes through two times, to make shure that all collisions apply correctly after the collision vector has been altered
FOR i = 0 TO maxBox - 1
iSm = -1 ; smDist = 50000.0
l1S = l1SO
IF box[i].exist = 1
FOR i2 = 0 TO 3
IF i2 = 0
temp.x = box[i].xl ; temp.z = box[i].zf ; tempE.x = box[i].xr ; tempE.z = box[i].zf // face along zfront ( 0 )
ENDIF
IF i2 = 1
temp.x = box[i].xl ; temp.z = box[i].zf ; tempE.x = box[i].xl ; tempE.z = box[i].zb // face along xl ( 1 )
ENDIF
IF i2 = 2
temp.x = box[i].xr ; temp.z = box[i].zb ; tempE.x = box[i].xl ; tempE.z = box[i].zb // face along zb ( 2 )
ENDIF
IF i2 = 3
temp.x = box[i].xr ; temp.z = box[i].zb ; tempE.x = box[i].xr ; tempE.z = box[i].zf // face along xr ( 3 )
ENDIF
cPnt = intersection( l1S , l1E , temp , tempE )
IF cPnt.x > -1
IF SQR( ( cPnt.x - l1SO.x ) * ( cPnt.x - l1SO.x ) + ( cPnt.z - l1SO.z ) * ( cPnt.z - l1SO.z ) ) < smDist
// also check if cut point is not between two near faces of different boxes
IF pointbetweenFaces( cPnt , i2 , i ) = 0
smDist = SQR( ( cPnt.x - l1SO.x ) * ( cPnt.x - l1SO.x ) + ( cPnt.z - l1SO.z ) * ( cPnt.z - l1SO.z ) ) ; cpNear = cPnt ; iSm = i2
ENDIF
ENDIF
ENDIF
NEXT
IF iSm = 0 OR iSm = 2 // here transformation of movement has to be calculated and applyed for line inters checking with the next rectangle ( by using the collision point with the smallest distance TO players old position )
l1E.z = cpNear.z // block z ( sides 0 and 2 )
ENDIF
IF iSm = 1 OR iSm = 3
l1E.x = cpNear.x // block x ( sides 1 and 3 )
ENDIF
ENDIF
NEXT
NEXT
DRAWLINE l1S.x , l1S.z , l1E.x , l1E.z , RGB(255 , 0 , 0 )
l1E.x = l1E.x - l1EO.x
l1E.z = l1E.z - l1EO.z
RETURN l1E
ENDFUNCTION

FUNCTION pointbetweenFaces: point AS coord , side AS int , boxCh // checks if the point is in a space which adjacts with another cubes face.
LOCAL fChS AS coord , fChE AS coord , fTChS AS coord , fTChE AS coord
IF side = 0
fTChS.z = box[boxCh].zf
ENDIF
IF side = 1
fTChS.x = box[boxCh].xl
ENDIF
IF side = 2
fTChS.z = box[boxCh].zb
ENDIF
IF side = 3
fTChS.x = box[boxCh].xr
ENDIF
FOR i = 0 TO maxBox - 1
IF i <> boxCh AND box[i].exist = 1
IF side = 0 // get opposite face of another object to the checked faces direction
fChS.x = box[i].xl ; fChS.y = box[i].yd ; fChS.z = box[i].zb
fChE.x = box[i].xr ; fChE.y = box[i].yu ; fChE.z = box[i].zb
IF ABS( fChS.z - fTChS.z ) <= 25
IF point.x > fChS.x AND point.x < fChE.x AND point.y >= fChS.y AND point.y <= fChE.y
RETURN 1
ENDIF
ENDIF
ENDIF
IF side = 1
fChS.x = box[i].xr ; fChS.y = box[i].yd ; fChS.z = box[i].zf
fChE.x = box[i].xr ; fChE.y = box[i].yu ; fChE.z = box[i].zb
IF ABS( fChS.x - fTChS.x ) <= 25
IF point.z > fChS.z AND point.z < fChE.z AND point.y >= fChS.y AND point.y <= fChE.y
RETURN 1
ENDIF
ENDIF
ENDIF
IF side = 2
fChS.x = box[i].xl ; fChS.y = box[i].yd ; fChS.z = box[i].zf
fChE.x = box[i].xr ; fChE.y = box[i].yu ; fChE.z = box[i].zf
IF ABS( fChS.z - fTChS.z ) <= 25
IF point.x > fChS.x AND point.x < fChE.x AND point.y >= fChS.y AND point.y <= fChE.y
RETURN 1
ENDIF
ENDIF
ENDIF
IF side = 3
fChS.x = box[i].xl ; fChS.y = box[i].yd ; fChS.z = box[i].zf
fChE.x = box[i].xl ; fChE.y = box[i].yu ; fChE.z = box[i].zb
IF ABS( fChS.x - fTChS.x ) <= 25
IF point.z > fChS.z AND point.z < fChE.z AND point.y >= fChS.y AND point.y <= fChE.y
RETURN 1
ENDIF
ENDIF
ENDIF
ENDIF
NEXT
RETURN 0
ENDFUNCTION


FUNCTION intersection AS coord: l1S AS coord , l1E AS coord , l2S AS coord , l2E AS coord // standart line line intersection point function
LOCAL x1 AS float , y1 AS float , x2 AS float , y2 AS float , x3 AS float , y3 AS float , x4 AS float , y4 AS float  , d AS float , pre AS float
LOCAL post AS float , x AS float , y AS float
LOCAL fail AS coord , ret AS coord
fail.x = -1 ; fail.z = -1 ; fail.y = -1 // assumes that coordinates are always positive values!
x1 = l1S.x ; x2 = l1E.x ; x3 = l2S.x ; x4 = l2E.x
y1 = l1S.z ; y2 = l1E.z ; y3 = l2S.z ; y4 = l2E.z // I will use z for y in the later game, y collision is a whole other story.
d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
IF d = 0 THEN RETURN fail
pre = (x1*y2 - y1*x2) ; post = (x3*y4 - y3*x4)
x = ( pre * (x3 - x4) - (x1 - x2) * post ) / d
y = ( pre * (y3 - y4) - (y1 - y2) * post ) / d
IF ( x < MIN(x1, x2) OR x > MAX(x1, x2) OR x < MIN(x3, x4) OR x > MAX(x3, x4) ) THEN RETURN fail
IF ( y < MIN(y1, y2) OR y > MAX(y1, y2) OR y < MIN(y3, y4) OR y > MAX(y3, y4) ) THEN RETURN fail
ret.x = x ; ret.z = y
RETURN ret
ENDFUNCTION

FUNCTION sortCube: i AS int
IF box[i].xl > box[i].xr THEN SWAP box[i].xl , box[i].xr
IF box[i].zf > box[i].zb THEN SWAP box[i].zf , box[i].zb
IF box[i].yd > box[i].yu THEN SWAP box[i].yd , box[i].yu
ENDFUNCTION

FUNCTION DrawCube: i AS int
DRAWLINE box[i].xl , box[i].zf , box[i].xr , box[i].zf , RGB( 122 , 255 , 55 + i * 20 )
DRAWLINE box[i].xl , box[i].zf , box[i].xl , box[i].zb , RGB( 122 , 255 , 55 + i * 20 )
DRAWLINE box[i].xr , box[i].zb , box[i].xl , box[i].zb , RGB( 122 , 255 , 55 + i * 20 )
DRAWLINE box[i].xr , box[i].zb , box[i].xr , box[i].zf , RGB( 122 , 255 , 55 + i * 20 )
ENDFUNCTION


My Problem is, that this won´t work when the vector starts inside or at the very edge of the cube.
So the Player will run through walls sometimes.
#27
Hallo, wollte für mein RPG Projekt Objekte testen, welche mit einem Licht verknüpft wurden.

Ich benutze die Nummern 1 - 7 für meine x_spot_lt Aufrufe

Die Position der Lichter sowie ihre Richtung ändern sich nicht
(sie bekommen beim Laden fixe Positionen und Richtungen zugewiesen ).

Wenn die Kamera sich nun von der Lichtquelle entfernt, so scheint sich die Lichtposition auch zu verändern.

Sowohl .ddd, als auch Nutzer generierte Objekte weisen dieses Problem auf.

Hier mal ein Video von dem Verhalten:

#28
So the Server went down 
and all my Posts are gone:'(

But this GLBasic Project won´t die  =D

3D RPG Engine

Videos:
Latest Version:

I Tested this with 12 Enemys, collision with statics was always correct, but when the Player pushes towards the enemy crowd, some Enemys switched their places with adjactant enemys. I hope this sorts itself, once pushing non static objects is handled correctly.


This just Shows the circle collision with static objects, also the 0.2 rain Version, which has been updated already ( the Problem with rain was getting it nice looking without loosing to much Frames on the Pandora ).


This Demos the Day Night cycle and the 0.1 rain Version, which behaviour is closer to the updated 0.3 rain


Here are the first steps I have done on the Event Editor, a very early Version of it.
Since then many more Actions and conditions have been implemented.
Like animating objects, moving the camera, adding Items to Inventory and set Variables.
Also ANDing up to 5 different conditions for one Action.

The following Videos are very early phases I went through with the Level Editor:


( Multi Textured Walls )


( connected tiles, like a path )


( First real Editor Setup )


( Only a simple, undeveloped Engine test on the Pandora )

Current Status ( This will be updated as the game Progresses )

Collision Engine: roughly 4/5 done ( works good, but has some issues when non static Objects let themself push themselves away without a proper weight handling )

Vegetation Engine: DONE ( Stomping down grass and rainy grass work, but I Need to make some new BMPs to really Show it off )

Level Engine: DONE ( Scrolling is calculated ressource greedy and works at any movement rate, diagonal Tiles, Multi textured walls, create new tiles... )

Static Object Engine: DONE ( Animateable rotateable, almost freely positionable and tilebased )

Enemy Engine : roughly 1 / 5 done ( Spawning Enemys, calculating enemys to some extend )
-> Next here is the Enemy Kind Editor.

Item Engine : roughly 3 / 5 done ( Create new Items, rename them, select an item-sprite, edit the stats they will alter and set them to usable, equipable or just to carryable ( for keys etc. ) )
- > Next is designing and drawing the Inventory.

currently working on
Item Engine.

Thanks to

All People who are posting on this great board, despite its unstableness.

Extra thanks to the super moderator Kanonet who got me to rethink some of my strategies for the better, by giving the right hints.


An extra extra thanks goes to Gernot, who spended and spends so much time for developing this awesome Piece of Software called GLBasic.