### Author Topic: Line/circle collision  (Read 368 times)

#### Marcus

• Hero Member
• Posts: 542
##### Line/circle collision
« on: May 05, 2017 »
Experimented some with collision handling between a user controlled circle and some static and rotating lines. Was just making a test of how to handle some things in a 3D game. Usually I handle collisions WHILE moving an object, but here I do tests AFTER moving by "pushing" the circle away if there's an intersection.

Code: [Select]
`import "Keycodes.lib"import "Math.lib"lines#[4][4]lines[1][0] = 100.0lines[1][1] = 100.0lines[1][2] = 500.0lines[1][3] = 300.0lines[2][0] = 100.0lines[2][1] = 100.0lines[2][2] = 132.0lines[2][3] = 400.0circleX# = 100.0circleY# = 200.0circleR# = 32.0set redraw offlineA# = 0.0do dx# = 0.0 dy# = 0.0 if keydown(VK_LEFT) then dx# = dx# - 4.0 if keydown(VK_RIGHT) then dx# = dx# + 4.0 if keydown(VK_UP) then dy# = dy# - 4.0 if keydown(VK_DOWN) then dy# = dy# + 4.0 circleX = circleX + dx circleY = circleY + dy lineA = lineA + 1.0 lines[0][0] = 360.0 - cos(lineA)*160.0 lines[0][1] = 240.0 - sin(lineA)*160.0 lines[0][2] = 360.0 + cos(lineA)*160.0 lines[0][3] = 240.0 + sin(lineA)*160.0 lines[3][0] = 400.0 - cos(lineA*0.5)*100.0 lines[3][1] = 300.0 - sin(lineA*0.5)*100.0 lines[3][2] = 400.0 + cos(lineA*0.5)*100.0 lines[3][3] = 300.0 + sin(lineA*0.5)*100.0 ' draw. set color 0, 0, 0 cls set color 255, 255, 255 for i = 0 to sizeof(lines, 0) - 1 draw line int(lines[i][0]), int(lines[i][1]), int(lines[i][2]), int(lines[i][3]) dx# = lines[i][2] - lines[i][0] dy# = lines[i][3] - lines[i][1] next steps = 0 do collision = false for i = 0 to sizeof(lines, 0) - 1 if CLInt(circleX, circleY, circleR, lines[i][0], lines[i][1], lines[i][2], lines[i][3]) collision = true endif next steps = steps + 1 until collision = false or steps = 4 set color 255, 255, 0 draw pixel int(circleX), int(circleY) for i = 0 to 12 a1# = float(i)*360.0/12.0 a2# = float(i + 1)*360.0/12.0 x1 = int(circleX + cos(a1)*circleR) y1 = int(circleY + sin(a1)*circleR) x2 = int(circleX + cos(a2)*circleR) y2 = int(circleY + sin(a2)*circleR) draw line x1, y1, x2, y2 next redraw wait 16until keydown(27, true)function CLInt(&cx#, &cy#, cr#, lx1#, ly1#, lx2#, ly2#) c#[] = [cx - lx1, cy - ly1] l#[] = [lx2 - lx1, ly2 - ly1] lineLen# = V_Size(l) param# ' p is the clost point ON the line to c. p#[] = V_ProjectGet2(c, l, param) ' is the projection on the line? if param >= 0.0 and param <= lineLen dv#[] = V_SubGet(c, p) if V_Size(dv) < cr ' dv is actually the normal of the line in the correct direction. ' so we can get the corrected position. _V_Normalize dv cx = lx1 + p[0] + dv[0]*cr cy = ly1 + p[1] + dv[1]*cr return true else return false endif ' check closest distance to vertices. else ' closest to first vertex? if param < 0.0 ed# = DistanceF(cx, cy, lx1, ly1) if ed < cr ' push out. dv#[] = [cx - lx1, cy - ly1] _V_Normalize dv cx# = lx1 + dv[0]*cr cy# = ly1 + dv[1]*cr return true else return false endif ' cosest to second vertex. else ed# = DistanceF(cx, cy, lx2, ly2) if ed < cr dv#[] = [cx - lx2, cy - ly2] _V_Normalize dv cx# = lx2 + dv[0]*cr cy# = ly2 + dv[1]*cr return true else return false endif endif return false endifendfuncfunction V_ProjectGet2#[](&u#[], &v#[], &p#) n#[] = V_NormalizeGet(v) s# = V_Dot(u, n) p = s return [n[0]*s, n[1]*s]endfunc`
« Last Edit: May 05, 2017 by Marcus »
.\\\opz

#### Rick3137

• Sr. Member
• Posts: 341
• May the Force be with You
##### Re: Line/circle collision
« Reply #1 on: May 05, 2017 »
Wow!

It might take me awhile to figure out what you just did, but it works good.

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #2 on: May 05, 2017 »
It might take me awhile to figure out what you just did, but it works good.

Not too complicated   I calculate the minimum distance between a circle's center and a line, and if the distance is less than the radius of the circle I move the circle out to the desired distance. It doesn't care where the circle or the line "came" from (movement or rotation) but only looks at the current positions. I'm actually surprised it works
« Last Edit: May 07, 2017 by Marcus »
.\\\opz

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #3 on: May 09, 2017 »
Just another example of the same thing but using the polystuff library for fancier transformations and a polygon from the polyeditor.

Code: [Select]
`import "Keycodes.lib"import "Math.lib"import "PolyStuff.lib"circleX# = 100.0circleY# = 200.0circleR# = 32.0set redraw off' polygon created with the polygon editor.pf#[][] = [[-40.0, -180.0], [40.0, -180.0], [20.0, -20.0], [180.0, -40.0], [180.0, 40.0], [20.0, 20.0], [40.0, 180.0], [-40.0, 180.0], [-20.0, 20.0], [-180.0, 40.0], [-180.0, -40.0], [-20.0, -20.0], [-40.0, -180.0]]' angles for rotation and scaling.angle# = 0.0scaleAngle# = 0.0do ' control sircle. dx# = 0.0 dy# = 0.0 if keydown(VK_LEFT) then dx# = dx# - 4.0 if keydown(VK_RIGHT) then dx# = dx# + 4.0 if keydown(VK_UP) then dy# = dy# - 4.0 if keydown(VK_DOWN) then dy# = dy# + 4.0 circleX = circleX + dx circleY = circleY + dy ' update polygon angles. angle = angle + 0.5 if angle >= 360.0 then angle = angle - 360.0 scaleAngle = scaleAngle + 1.5 if scaleAngle >= 360.0 then scaleAngle = scaleAngle - 360.0 ' make a copy of the original polygon and transform it some. pft#[][] = pf _ClearTransformation _Translate 320.0, 240.0 _Rotate angle _Scale 1.0 + sin(scaleAngle*2.0)*0.25, 1.0 - sin(scaleAngle*1.0)*0.25 _TransformPolygon pft _ClearTransformation ' perform collision tests. ' the goal is ofcourse to do keep calling CLInt until there are no collisions, ' but some more tweaks need to be made for that to work; sometimes after a ' "vertex push" a collision is still reported which would hang the loop. also ' it would be desirable to test the lines and let them push in some order, ' maybe based on the size of the intersections. steps = 0 do collision = false for i = 0 to sizeof(pft, 0) - 2 if CLInt(circleX, circleY, circleR, pft[i][0], pft[i][1], pft[i + 1][0], pft[i + 1][1]) collision = true endif next steps = steps + 1 until collision = false or steps = 4 ' draw. set color 0, 0, 0 cls set color 255, 255, 255 _DrawPolygon pft, true set color 255, 255, 0 draw pixel int(circleX), int(circleY) for i = 0 to 12 a1# = float(i)*360.0/12.0 a2# = float(i + 1)*360.0/12.0 x1 = int(circleX + cos(a1)*circleR) y1 = int(circleY + sin(a1)*circleR) x2 = int(circleX + cos(a2)*circleR) y2 = int(circleY + sin(a2)*circleR) draw line x1, y1, x2, y2 next redraw wait 16until keydown(27, true)function CLInt(&cx#, &cy#, cr#, lx1#, ly1#, lx2#, ly2#) c#[] = [cx - lx1, cy - ly1] l#[] = [lx2 - lx1, ly2 - ly1] lineLen# = V_Size(l) param# ' p is the clost point ON the line to c. p#[] = V_ProjectGet2(c, l, param) ' is the projection on the line? if param >= 0.0 and param <= lineLen dv#[] = V_SubGet(c, p) if V_Size(dv) < cr ' dv is actually the normal of the line in the correct direction. ' so we can get the corrected position. _V_Normalize dv cx = lx1 + p[0] + dv[0]*cr cy = ly1 + p[1] + dv[1]*cr return true else return false endif ' check closest distance to vertices. else ' closest to first vertex? if param < 0.0 ed# = DistanceF(cx, cy, lx1, ly1) if ed < cr ' push out. dv#[] = [cx - lx1, cy - ly1] _V_Normalize dv cx# = lx1 + dv[0]*cr cy# = ly1 + dv[1]*cr return true else return false endif ' cosest to second vertex. else ed# = DistanceF(cx, cy, lx2, ly2) if ed < cr dv#[] = [cx - lx2, cy - ly2] _V_Normalize dv cx# = lx2 + dv[0]*cr cy# = ly2 + dv[1]*cr return true else return false endif endif return false endifendfuncfunction V_ProjectGet2#[](&u#[], &v#[], &p#) n#[] = V_NormalizeGet(v) s# = V_Dot(u, n) p = s return [n[0]*s, n[1]*s]endfunc`
.\\\opz

#### Rick3137

• Sr. Member
• Posts: 341
• May the Force be with You
##### Re: Line/circle collision
« Reply #4 on: May 11, 2017 »
Works good.
There ought to be some way to use this stuff on a rpg maze type game.

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #5 on: May 12, 2017 »
Works good.
There ought to be some way to use this stuff on a rpg maze type game.

If you look at the attached program (sourcecode and image attached in a zip), I'm doing a raycasting experiment with moving walls defined by arbitrary lines and collision handling using the stuff above. Not using the Raycaster library. Move and turn with the arrow keys.

Edit  This would ofcourse get incredibly slow with a big maze. I'll see what happens if I combine this with regular raycasting but for storing information in every cel about which walls pass through it. That way you don't need to check every ray against all walls. A quadtree would be perfect here, but implementing one in naalaa would be pretty hard

Code: [Select]
`import "Speed.lib"import "Math.lib"import "Keycodes.lib"constant: GLOOM_TEXMODE_MIRROR 1 GLOOM_TEXMODE_STRETCH 2 GLOOM_TEXMODE_REPEAT 4visible: rc_Width = 320 rc_Height = 240 rc_Unit# rc_AngleOffset#[] rc_AngleOffsetCos#[] rc_Distance#[][] rc_ZBuffer#[] rc_FOV# = 50.0 rc_Walls#[16][7] rc_WallInfo[16][4] rc_WallCount = 0hidden:set window 64, 64, 320, 240, false, 2load image 0, "wall.bmp"_GLOOM_InitView 60.0, width(primary), height(primary)_GLOOM_AddWall 0, 0.0, 0.0, 16.0, 0.0, 16.0, 0_GLOOM_AddWall 0, 16.0, 0.0, 16.0, 16.0, 16.0, 0_GLOOM_AddWall 0, 16.0, 16.0, 0.0, 16.0, 16.0, 0_GLOOM_AddWall 0, 0.0, 16.0, 0.0, 0.0, 16.0, 0starPoly#[8][2]starPoly[0][0] = 0.0; starPoly[0][1] = -4.0starPoly[1][0] = 1.0; starPoly[1][1] = -1.0starPoly[2][0] = 4.0; starPoly[2][1] = 0.0starPoly[3][0] = 1.0; starPoly[3][1] = 1.0starPoly[4][0] = 0.0; starPoly[4][1] = 4.0starPoly[5][0] = -1.0; starPoly[5][1] = 1.0starPoly[6][0] = -4.0; starPoly[6][1] = 0.0starPoly[7][0] = -1.0; starPoly[7][1] = -1.0starWall[8]for i = 0 to 7 j = (i + 1)%8 starWall[i] = GLOOM_AddIndexedWall(0, 8.0 + starPoly[i][0], 8.0 + starPoly[i][1], 8.0 + starPoly[j][0] , 8.0 + starPoly[j][1], 2.0, 0)nextplayerX# = 14.5playerZ# = 14.5playerA# = 230.0starWallAngle# = 0.0shouldDraw = trueset redraw offdo ' update rotating star shaped wall. starWallAngle = starWallAngle + 0.1 for i = 0 to 7 j = (i + 1)%8 a#[] = [starPoly[i][0], starPoly[i][1]] b#[] = [starPoly[j][0], starPoly[j][1]] _V_Rotate a, starWallAngle _V_Rotate b, starWallAngle _GLOOM_PositionWall starWall[i], 8.0 + a[0], 8.0 + a[1], 8.0 + b[0] , 8.0 + b[1] next if keydown(VK_LEFT) playerA = playerA - 2.0 endif if keydown(VK_RIGHT) playerA = playerA + 2.0 endif if keydown(VK_UP) playerX = playerX + cos(playerA)*0.05 playerZ = playerZ + sin(playerA)*0.05 endif if keydown(VK_DOWN) playerX = playerX - cos(playerA)*0.05 playerZ = playerZ - sin(playerA)*0.05 endif ' collision handling for player. _GLOOM_PushOut playerX, playerZ, 0.3 ' draw. if shouldDraw set color 0, 0, 0 cls set color 255, 255, 255, 0 _GLOOM_Render playerX, playerZ, playerA redraw endif shoulDraw = SPD_HoldFrameDraw(60)until keydown(27, true)' copied from Raycaster.txt.procedure GLOOM_InitView(fov#, renderW, renderH) rc_FOV = fov rc_Width = renderW rc_Height = renderH w = rc_Width h = rc_Height hw = w/2 hh = h/2 rc_Unit = float(hw)/tan(fov*0.5) rc_AngleOffset#[w] rc_AngleOffsetCos#[w] rc_ZBuffer#[w] for x = 0 to hw - 1 rc_AngleOffset[hw + x] = atan(float(x)/rc_Unit) rc_AngleOffset[hw - 1 - x] = -rc_AngleOffset[hw + x] rc_AngleOffsetCos[hw + x] = cos(rc_AngleOffset[hw + x]) rc_AngleOffsetCos[hw - 1 - x] = cos(rc_AngleOffset[hw - 1 - x]) next rc_Distance[w][hh] for x = 0 to w - 1 dconv# = 1.0/cos(rc_AngleOffset[x]) for y = 0 to hh - 1 d# = rc_Unit/float(h - 2*y) d = d*dconv rc_Distance[x][y] = d next nextendprocprocedure GLOOM_AddWall(img, x1#, z1#, x2#, z2#, repeat#, id) rc_Walls[rc_WallCount][0] = x1 rc_Walls[rc_WallCount][1] = z1 rc_Walls[rc_WallCount][2] = x2 rc_Walls[rc_WallCount][3] = z2 rc_Walls[rc_WallCount][4] = x2 - x1 rc_Walls[rc_WallCount][5] = z2 - z1 rc_Walls[rc_WallCount][6] = repeat rc_WallInfo[rc_WallCount][0] = img rc_WallInfo[rc_WallCount][1] = id rc_WallCount = rc_WallCount + 1 if rc_WallCount >= sizeof(rc_Walls, 0) then _GLOOM__ExpandWalls 8endprocfunction GLOOM_AddIndexedWall(img, x1#, z1#, x2#, z2#, repeat#, id) index = rc_WallCount _GLOOM_AddWall img, x1, z1, x2, z2, repeat, id return indexendfuncprocedure GLOOM_PositionWall(index, x1#, z1#, x2#, z2#) rc_Walls[index][0] = x1 rc_Walls[index][1] = z1 rc_Walls[index][2] = x2 rc_Walls[index][3] = z2 rc_Walls[index][4] = x2 - x1 rc_Walls[index][5] = z2 - z1endprocprocedure GLOOM__ExpandWalls(num) tmpWalls#[][] = rc_Walls tmpWallInfo[][] = rc_WallInfo rc_Walls[sizeof(tmpWalls, 0) + num][7] rc_WallInfo[sizeof(tmpWalls, 0) + num][4] for i = 0 to sizeof(tmpWalls, 0) - 1 for j = 0 to 7 rc_Walls[i][j] = tmpWalls[i][j] next for j = 0 to 3 rc_WallInfo[i][j] = tmpWallInfo[i][j] next nextendprocprocedure GLOOM_Render(xPos#, zPos#, angle#) for x = 0 to rc_Width - 1 a# = rc_AngleOffset[x] + angle rayX# = cos(a) rayZ# = sin(a) colX# colZ# rayParam# wallParam# minWallParam# hit = false minDistance# = 100000.0 for i = 0 to rc_WallCount - 1 if GLOOM__LLInt(xPos, zPos, rayX, rayZ, rc_Walls[i][0], rc_Walls[i][1], rc_Walls[i][4], rc_Walls[i][5], rayParam, wallParam dx# = rayX*rayParam dz# = rayZ*rayParam d# = dx*dx + dz*dz if d < minDistance hit = true wallHit = i minDistance = d minWallParam = wallParam endif endif next if hit ' scale according to minDistance d = sqr(minDistance)*rc_AngleOffsetCos[x] h = int(0.5*rc_Unit/d) u# = minWallParam*rc_Walls[wallHit][6] u = u - float(int(u)) draw vraster 0, x, rc_Height/2 - h, rc_Height/2 + h, u, 0.0, u, 1.0 endif next endprocfunction GLOOM__LLInt(Ux#, Uy#, ux#, uy#, Vx#, Vy#, vx#, vy#, &u#, &v#) wx# = Ux - Vx wy# = Uy - Vy ' D# = perp(ux, uy, vx, vy) D# = ux*vy - uy*vx if abs#(D) < 0.00001 then return false ' u = perp(vx, vy, wx, wy)/D u =  (vx*wy - vy*wx)/D ' v = perp(ux, uy, wx, wy)/D v = (ux*wy - uy*wx)/D if u < 0.0 then return false if v < 0.0 or v > 1.0 then return false return trueendfuncprocedure GLOOM_PushOut(&x#, &z#, r#) steps = 0 do collision = false for i = 0 to rc_WallCount - 1 if CLInt(x, z, r, rc_Walls[i][0], rc_Walls[i][1], rc_Walls[i][2], rc_Walls[i][3]) collision = true endif next steps = steps + 1 until collision = false or steps = 4endprocfunction CLInt(&cx#, &cy#, cr#, lx1#, ly1#, lx2#, ly2#) c#[] = [cx - lx1, cy - ly1] l#[] = [lx2 - lx1, ly2 - ly1] lineLen# = V_Size(l) param# ' p is the clost point ON the line to c. p#[] = V_ProjectGet2(c, l, param) ' is the projection on the line? if param >= 0.0 and param <= lineLen dv#[] = V_SubGet(c, p) if V_Size(dv) < cr ' dv is actually the normal of the line in the correct direction. ' so we can get the corrected position. _V_Normalize dv cx = lx1 + p[0] + dv[0]*cr cy = ly1 + p[1] + dv[1]*cr return true else return false endif ' check closest distance to vertices. else ' closest to first vertex? if param < 0.0 ed# = DistanceF(cx, cy, lx1, ly1) if ed < cr ' push out. dv#[] = [cx - lx1, cy - ly1] _V_Normalize dv cx# = lx1 + dv[0]*cr cy# = ly1 + dv[1]*cr return true else return false endif ' cosest to second vertex. else ed# = DistanceF(cx, cy, lx2, ly2) if ed < cr dv#[] = [cx - lx2, cy - ly2] _V_Normalize dv cx# = lx2 + dv[0]*cr cy# = ly2 + dv[1]*cr return true else return false endif endif return false endifendfuncfunction V_ProjectGet2#[](&u#[], &v#[], &p#) n#[] = V_NormalizeGet(v) s# = V_Dot(u, n) p = s return [n[0]*s, n[1]*s]endfunc`
« Last Edit: May 13, 2017 by Marcus »
.\\\opz

#### Rick3137

• Sr. Member
• Posts: 341
• May the Force be with You
##### Re: Line/circle collision
« Reply #6 on: May 13, 2017 »
Nice work.

Looks like a good start for a game. May take awhile.

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #7 on: May 13, 2017 »
I implemented what I wrote and have attached an example. I temporarily removed collision handling (because I haven't adjusted it to the new system yet), but you can still move around in a pretty vast maze. I created the maze in a silly editor that's also included.

It runs pretty slow for now, but lots can be done about that.

I realize I've left the original topic and transformed it into raycasting.

Edit:  Fixed the collision handling.
« Last Edit: May 14, 2017 by Marcus »
.\\\opz

#### Rick3137

• Sr. Member
• Posts: 341
• May the Force be with You
##### Re: Line/circle collision
« Reply #8 on: May 13, 2017 »
Wow!
I like the new map editor.

Here's a quick map I made...

Code: [Select]
`1232 5 3 27 1 3 27 1 9 49 4 11 511 5 13 213 2 16 116 1 20 220 2 22 522 5 25 425 4 27 127 1 30 230 2 31 531 5 29 829 8 27 727 7 24 724 7 23 923 9 24 1224 12 26 1226 12 29 1029 10 30 1131 14 30 1131 14 30 1730 17 27 1827 18 26 2026 20 28 2328 23 30 2430 24 31 2831 28 29 3029 30 25 3125 31 21 3021 30 18 2818 28 15 2915 29 12 3112 31 10 3010 30 9 289 28 8 268 26 10 2310 23 13 2213 22 12 2012 20 10 1910 19 7 207 20 8 228 22 7 247 24 6 266 26 7 297 29 5 305 30 3 273 27 4 234 23 2 202 20 4 164 16 7 157 15 8 148 14 6 126 12 4 134 13 1 111 11 3 82 5 3 87 4 6 56 5 5 75 7 6 96 9 8 108 10 11 911 9 12 712 7 9 69 6 7 416 3 15 415 4 16 816 8 14 1114 11 11 1211 12 10 1510 15 12 1712 17 15 1615 16 15 1215 12 18 1018 10 20 720 7 19 418 6 19 418 6 17 517 5 16 321 13 23 1423 14 26 1426 14 27 1627 16 24 1924 19 22 1722 17 20 1520 15 18 1618 16 17 1917 19 16 1816 18 17 1417 14 20 1120 11 22 1122 11 23 1223 12 21 1314 24 12 2412 24 11 2611 26 12 2812 28 15 2815 28 17 2617 26 18 2418 24 17 2115 20 17 2115 20 16 2314 24 16 2323 22 20 2420 24 19 2619 26 23 2923 29 25 2825 28 23 2623 26 22 2522 25 24 2424 24 26 2626 26 28 2528 25 25 2125 21 24 2024 20 23 2228 27 27 2827 28 27 2927 29 29 2829 28 28 2720 17 19 1919 19 20 2120 21 22 2022 20 20 17`

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #9 on: May 14, 2017 »
I'll probably rewrite this stuff in C to speed it up. Anyhow, the name GLOOM is from a first person shooter that was relased on Amiga many, many years ago. Amiga users were so jelly of Doom on the PC That's probably what could be expected if I make a library of it.

.\\\opz

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #10 on: May 19, 2017 »
Here's another one where I've rewritten some of the "hard work" in C and made an extension.

Floor, ceiling and sprites/billboards coming soon.
« Last Edit: May 19, 2017 by Marcus »
.\\\opz

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #11 on: May 20, 2017 »
Floor and ceiling added, just modifications of the original raycaster stuff for taller walls. Couldn't translate it to C easily, since it was written in pure bytecode
.\\\opz

#### Rick3137

• Sr. Member
• Posts: 341
• May the Force be with You
##### Re: Line/circle collision
« Reply #12 on: May 21, 2017 »
Pure Inspiration...
Works good.
I like your gloom.dll idea. Some day I need to learn how to do that. Could take awhile.
I think I would have to use Microsoft's free CSharp compiler. I managed to get it installed on my computer I think it makes DLLs. I have tried to install the c++ compiler, but I did something wrong and got stuck.
I have a Code Blocks C compiler but I doubt it is compatible with NaaLaa.

#### Marcus

• Hero Member
• Posts: 542
##### Re: Line/circle collision
« Reply #13 on: May 21, 2017 »
Pure Inspiration...
Works good.
I like your gloom.dll idea. Some day I need to learn how to do that. Could take awhile.
I think I would have to use Microsoft's free CSharp compiler. I managed to get it installed on my computer I think it makes DLLs. I have tried to install the c++ compiler, but I did something wrong and got stuck.
I have a Code Blocks C compiler but I doubt it is compatible with NaaLaa.

Yeah, I haven't updated the "extension builder stuff" in a while, sorry. Will do when I get the time. I don't think it's possible to use anything but Visual Studio and C/C++   You have to link to a library written in C and include a header filled with macros and stuff.

I'll create a new thread for what I've been posting here.
.\\\opz