Author Topic: Terror in the hypermaze  (Read 4888 times)

0 Members and 1 Guest are viewing this topic.

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Terror in the hypermaze
« on: April 05, 2021, 05:22:21 pm »
Hi ! I'm building a game for the 4d maze. The main elements are there, it can only be expanded according to the scheme. It will include strategy, action, lots of enemies, lots of unique movement enemies, and more.
That's all for now. Everything still has 4 coordinate points. To objects, to enemies, to me. Since it is scientifically interesting to change the projection, I left the space button in it to change perspective, although the same maze remains. The enemies and I can come and go in the hyperspace corridor.

If you just want a simple 3D maze, write so that one of the planes is 0 at the beginning of the program, for example:

street_x = 3 'street in plan X
street_y = 3 'street in plan Y
street_z = 3 'street in plan Z
street_a = 0 'street in plan A

If you want a 2D maze, let 2 planes be 0, e.g.

street_x = 3 'street in plan X
street_y = 3 'street in plan Y
street_z = 0 'street in plan Z
street_a = 0 'street in plan A

Have fun !



download:
https://drive.google.com/file/d/1uPjm2AkZTN1yf3IgcO3SWEmXajIrYV4m/view?usp=sharing

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #1 on: April 05, 2021, 06:08:49 pm »
just a piece of advice: if you are averse to your situation being opaque in 4d or 3d, write:

street_x = 9 'street in plan X
street_y = 9 'street in plan Y
street_z = 0 'street in plan Z
street_a = 0 'street in plan A

If program write "In this perspective, the exit leads through a hyper corridor", press space! So simple and enjoyable and playful, easy to get out in 2d.
or press space until you see a maze in 2d projection

funny..my :) set to 2d, give her or 600 enemies and find the exit
« Last Edit: April 05, 2021, 06:51:43 pm by MasterGy »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Terror in the hypermaze
« Reply #2 on: April 06, 2021, 12:37:23 am »
Man I can barely handle 2D, nice work!

And this is extremely interesting image (I cut and rotated):
  [ You are not allowed to view this attachment ]  

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #3 on: April 07, 2021, 09:03:10 pm »
355 / 5000
Fordítási találatok
The thing is built. I can’t jump on a modern high-quality display with maptriangle, but I try to balance it with mood, spin, physics. I am completely addicted to development. I’m experiencing a lot of things that must have been experienced by many in the ’90s. I will include its usability and a few more ideas, but I will show you until then.


Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #4 on: April 07, 2021, 09:14:15 pm »

Fordítási találatok
Bplus, thank you! There are so many discoveries! Math is the most beautiful thing in the world for me! I'm not clever, I just have a lot of time! Sometimes 2 things are not understood and then the two things meet at the same time and everything becomes clear :) 1 good wine and everything becomes clear! :) If I didn’t bring myself to the level, I couldn’t solve a few things!

Offline Raven_Singularity

  • Forum Regular
  • Posts: 158
    • View Profile
Re: Terror in the hypermaze
« Reply #5 on: April 09, 2021, 07:16:41 am »
This is pretty crazy looking.  I have no idea what's going on.  Why are hoards of emoticons attacking you?

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #6 on: April 09, 2021, 04:09:43 pm »
I've only been dealing with this for days.
There were a lot of things that could go unnoticed.
-from the start surface you can set what kind of maze we want (2d / 3d), how many enemies.
-physics: bullets bounce off the wall and zigzag for a while, if we shoot a big fireball, it throws back
-Moving enemies is also somewhat strategic
- If you are aiming from one direction and attacking, you will hear a sound
I want even smarter enemies, more varieties. So far, I've got it.
I want you to give it a try and write about it, maybe if you notice a mistake.



download
https://drive.google.com/file/d/1LzGKvr5KhcELjNv1Jie_njQR4cTcK3wC/view?usp=sharing
« Last Edit: April 09, 2021, 04:39:25 pm by MasterGy »

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #7 on: April 10, 2021, 07:56:17 am »
I fixed the "emenies" slider because it was out of proportion to the difficulty. It was unfortunate that they attacked strongly even on a small level. It can now be adjusted as required.

https://drive.google.com/file/d/1RtL2xE3wW-063YyTZXQPibD7_CwJeJiY/view?usp=sharing

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #8 on: April 10, 2021, 10:35:15 pm »
He won't let you rest!
With the appearance of a modern game, I can’t compete, but this _maptriangle is a miracle in qb64. I try to give as much to ergonomics, manageability and physics as possible.
-If the enemy comes close, I'll move away
-if you bite into it, you will have your eyesight for a moment (fisheye)
-what you shoot a bullet and bounce back will hurt you too
-if many people hurt at the same time, you have a harder time moving at first, you feel the pain




« Last Edit: April 10, 2021, 10:39:36 pm by MasterGy »

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #9 on: April 12, 2021, 10:58:36 am »
there will also be tasks in the game, for this it is good to have a compass. I'm having trouble with that. i can't put a nice texture with maptriangle3d on the screen because depending on where i put it, it shows it in perspective as well. An older problem is that I can't clip a hardware image and then delete it with _freeimage because memory is overflowing. Therefore, I am forced to draw the 3d compass in a simpler way. I'll expose you if it's interesting.

Code: QB64: [Select]
  1. monx = 600: mony = 600: mon = _NEWIMAGE(monx, mony, 32): SCREEN mon: _DEST mon
  2.  
  3.  
  4. cp(0) = 1 'arrow height
  5. cp(1) = .5 'arrow width
  6. cp(2) = .5 'arrowhead height
  7. cp(3) = cp(1) * .3 'bottom width
  8. cp(4) = .2 'Z-size
  9.  
  10.  
  11. '-------------------------------------------------------------------
  12. cpp(0, 0) = cp(1) / 2: cpp(0, 1) = 0: cpp(1, 0) = 0: cpp(1, 1) = cp(2): cpp(2, 0) = (cp(1) - cp(3)) / 2: cpp(2, 1) = cp(2)
  13. cpp(3, 0) = cp(1) - cpp(2, 0): cpp(3, 1) = cp(2): cpp(4, 0) = cp(1): cpp(4, 1) = cp(2): cpp(5, 0) = cpp(2, 0): cpp(5, 1) = cp(0)
  14. cpp(6, 0) = cpp(3, 0): cpp(6, 1) = cp(0)
  15.  
  16.  
  17. DIM dp(13, 5), textq(13, 1)
  18. FOR ap = 0 TO 6: FOR ap2 = 0 TO 1
  19.         dp(ap2 * 7 + ap, 0) = cpp(ap, 0) - cp(1) / 2
  20.         dp(ap2 * 7 + ap, 1) = cpp(ap, 1) - cp(0) / 2
  21.         dp(ap2 * 7 + ap, 2) = (ap2 * 2 - 1) * cp(4) / 2
  22. NEXT ap2, ap
  23.  
  24.  
  25.  
  26. mc$ = "a0a1 a1a2 a2a5 a5a6 a6a3 a3a4 a4a0 b0b1 b1b2 b2b5 b5b6 b6b3 b3b4 b4b0 a0b0 a1b1 a2b2 a3b3 a4b4 a5b5 a6b6 " 'lines
  27.  
  28. zoom_x = 4800
  29. zoom_z = 10
  30.  
  31.  
  32.  
  33.     angle1 = _WIDTH(mon) / 2 - _MOUSEX / 50
  34.     angle3 = _HEIGHT(mon) / 2 - _MOUSEY / 50
  35.  
  36.     'rotating
  37.     FOR ap = 0 TO 13
  38.         px0 = dp(ap, 0): py0 = dp(ap, 1): pz0 = dp(ap, 2)
  39.         px1 = px0 * COS(angle1) - py0 * SIN(angle1)
  40.         py1 = py0 * COS(angle1) + px0 * SIN(angle1)
  41.         px2 = px1 * COS(angle2) - pz0 * SIN(angle2)
  42.         pz1 = pz0 * COS(angle2) + px1 * SIN(angle2)
  43.         py2 = py1 * COS(angle3) - pz1 * SIN(angle3)
  44.         pz2 = pz1 * COS(angle3) + py1 * SIN(angle3)
  45.         dp(ap, 3) = px2: dp(ap, 4) = py2: dp(ap, 5) = pz2
  46.     NEXT ap
  47.  
  48.     FOR amc = 0 TO LEN(mc$) / 5 - 1
  49.         FOR ap = 0 TO 1
  50.             apx = VAL(MID$(mc$, 2 + ap * 2 + amc * 5, 1)) + ((ASC(MID$(mc$, 1 + ap * 2 + amc * 5, 1))) - 97) * 7
  51.             zc = (dp(apx, 5) + 2) * zoom_z
  52.             p(ap, 0) = dp(apx, 3) * zoom_x / zc + monx / 2
  53.             p(ap, 1) = dp(apx, 4) * zoom_x / zc + mony / 2
  54.         NEXT ap
  55.         LINE (p(0, 0), p(0, 1))-(p(1, 0), p(1, 1))
  56.     NEXT amc
  57.     _DISPLAY: CLS
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #10 on: April 13, 2021, 03:48:26 pm »
Hello !
Unfortunately, there has been no work since Easter, so I had a lot of time to play. Now comes a lot of ideas, inspiration (you know, when you buy a cigarette in the store and have to talk to someone and get annoyed and look at something like a UFO, and while he’s talking about his life, you can’t wait to code the idea). Unfortunately work from tomorrow, construction, 400km a day, and I’m the driver, so it would be nice not to be up until morning. And there are a lot of ideas and floods of ideas. I’m exposing what’s going on now because I don’t know when I can continue. (I come home at the end of the day, happy to live and get up in the morning). COMPASS! (I finally managed not with LINE, but with MAPTRIANGLE, I suffered for 3 days to point in the right direction. I had to do what I did recently, for example, Earth revolves around the maze and the compass position ultimately comes from Bplus’s game, so that if you suddenly turn back, the compass should not “suddenly,” slowly, “get in the right position.” Because I don’t know when I can continue, I will unload, although there will be key gates, enemies, fire-throwing enemies, etc. saj but unfortunately I will mix concrete from tomorrow and so on. path-cube without losing the role of the maze, thus larger spaces), physics.

sorry, I did not turn back the adjustability of the enemies. here's the good demo

https://drive.google.com/file/d/1pUpsK_mwQY_FVknwB6Egh6XE1YSvfI_F/view?usp=sharing
« Last Edit: April 13, 2021, 10:54:03 pm by MasterGy »

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #11 on: April 15, 2021, 03:36:46 pm »
I just show it interestingly. in order to build a key-gate system into the maze, I need to know the path of passage because of the arrangement of the gates. I experimented in 2d to understand and see.

Code: QB64: [Select]
  1.  
  2. maze_x = 140 'maze size X
  3. maze_y = 40 'maze size Y
  4.  
  5. 'preparation -------------------------------------------------------------------------------------------------------------------------------------------
  6. IF maze_x / 2 = INT(maze_x / 2) THEN maze_x = maze_x + 1
  7. IF maze_y / 2 = INT(maze_y / 2) THEN maze_y = maze_y + 1
  8. monx = (maze_x + 10) * 8: mony = (maze_y + 5) * 16: kep = _NEWIMAGE(monx, mony, 32): SCREEN kep: _SCREENMOVE 0, 0
  9. d(0, 0) = 0: d(0, 1) = -1: d(1, 0) = 0: d(1, 1) = 1: d(2, 0) = -1: d(2, 1) = 0: d(3, 0) = 1: d(3, 1) = 0
  10. k$(0) = "±" 'fal / adjustable wall
  11. k$(1) = " " 'nem bejart ureg / non walked road
  12. k$(2) = "W" 'lehetoseg / possible way
  13. k$(3) = "Ű" 'szilard fal / standard wall
  14. k$(4) = "." 'bejart ureg  / walked road
  15. k$(5) = "." 'belepesi pont  / entry point
  16. DIM maze(maze_x - 1, maze_y - 1) AS _BYTE '0-fal 1-ureg 2-lehetoseg
  17.  
  18.  
  19. 'create empty maze --------------------------------------------------------------------------------------------------------------------------------------
  20. FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: k = 0
  21.         IF tx = 0 OR ty = 0 OR tx = maze_x - 1 OR ty = maze_y - 1 THEN k = 3
  22.         IF tx AND 1 AND ty AND 1 THEN k = 1
  23. maze(tx, ty) = k: NEXT ty, tx
  24.  
  25. 'start position -----------------------------------------------------------------------------------------------------------------------------------------
  26. DO: sx = INT(maze_x * RND(1)): sy = INT(maze_y * RND(1)): LOOP WHILE maze(sx, sy) <> 1: maze(sx, sy) = 4
  27.  
  28.  
  29. 'way searching ------------------------------------------------------------------------------------------------------------------------------------------
  30. DO: REDIM way(9999, 2): wdb = 0
  31.     FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1
  32.             IF maze(tx, ty) = 4 THEN
  33.                 van = 0
  34.                 FOR t = 0 TO 3
  35.                     vpx1 = tx + d(t, 0): vpy1 = ty + d(t, 1): vpx2 = tx + d(t, 0) * 2: vpy2 = ty + d(t, 1) * 2
  36.                     f = (vpx2 > maze_x - 1 OR vpx2 < 0) OR (vpy2 > maze_y - 1 OR vpy2 < 0)
  37.                     IF NOT f THEN
  38.                         IF maze(vpx1, vpy1) = 0 AND maze(vpx2, vpy2) = 1 THEN
  39.                             FOR t2 = 0 TO 3: vpx3 = vpx2 + d(t2, 0): vpy3 = vpy2 + d(t2, 1): IF maze(vpx3, vpy3) = 4 THEN GOTO kovi
  40.                             NEXT t2
  41.                             maze(vpx1, vpy1) = 2: way(wdb, 0) = tx: way(wdb, 1) = ty: way(wdb, 2) = t: wdb = wdb + 1
  42.                             kovi:
  43.                         END IF
  44.                     END IF
  45.                 NEXT t
  46.             END IF
  47.     NEXT ty, tx
  48.  
  49.     IF wdb THEN
  50.         aw = INT(wdb * RND(1))
  51.         FOR t = 0 TO 2
  52.             hovax = way(aw, 0) + d(way(aw, 2), 0) * t: hovay = way(aw, 1) + d(way(aw, 2), 1) * t
  53.             IF (maze(hovax, hovay) = 2) OR (maze(hovax, hovay) = 1) THEN maze(hovax, hovay) = 4
  54.         NEXT t
  55.  
  56.         FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: IF maze(tx, ty) = 2 THEN maze(tx, ty) = 0
  57.         NEXT ty, tx
  58.     END IF
  59.  
  60.  
  61. 'entry point 1
  62. sx = 0: sy = 3: IF maze(sx + 1, sy) <> 4 THEN sy = sy + 1
  63. maze(sx, sy) = 4: start_x = sx: start_y = sy
  64.  
  65.  
  66.  
  67. 'entry point 2
  68. sx = maze_x - 1: sy = maze_y - 3: IF maze(sx - 1, sy) <> 4 THEN sy = sy - 1
  69. maze(sx, sy) = 4
  70. exit_x = sx: exit_y = sy
  71.  
  72. ' it has taken so far to build the maze. contained in the maze array ------------------------------------------------------------------------------------------------
  73. FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1
  74.         IF maze(tx, ty) <> 4 THEN maze(tx, ty) = 0
  75. NEXT ty, tx
  76. 'drawing
  77. sy = INT((mony / 16 - maze_y) / 2) + 1: sx = INT((monx / 8 - maze_x) / 2) + 1
  78. FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: LOCATE sy + ty, sx + tx: PRINT k$(maze(tx, ty)): NEXT ty, tx
  79.  
  80.  
  81.  
  82.  
  83. DIM dj1(tx - 1, ty - 1), dj2(tx - 1, ty - 1): dj1(start_x, start_y) = 1
  84. FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: sum_way = sum_way + ABS(maze(tx, ty) = 4): NEXT ty, tx
  85.  
  86.  
  87. actual = 1
  88.  
  89.     FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1
  90.             IF maze(tx, ty) = 4 AND dj1(tx, ty) = 0 THEN
  91.                 FOR t = 0 TO 3
  92.                     noway = 0
  93.                     IF tx + d(t, 0) < 0 OR tx + d(t, 0) > maze_x - 1 THEN noway = 1
  94.                     IF ty + d(t, 1) < 0 OR ty + d(t, 1) > maze_y - 1 THEN noway = 1
  95.                     IF noway = 0 THEN
  96.                         nei = dj1(tx + d(t, 0), ty + d(t, 1))
  97.                         hel = maze(tx + d(t, 0), ty + d(t, 1))
  98.                         IF nei = actual AND hel = 4 THEN dj1(tx, ty) = actual + 1: find_way = find_way + 1
  99.  
  100.                     END IF
  101.  
  102.                 NEXT t
  103.             END IF
  104.     NEXT ty, tx
  105.  
  106.     actual = actual + 1
  107.     sy = INT((mony / 16 - maze_y) / 2) + 1: sx = INT((monx / 8 - maze_x) / 2) + 1
  108.     FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: LOCATE sy + ty, sx + tx: PRINT k$(maze(tx, ty)): NEXT ty, tx
  109.  
  110.     sy = INT((mony / 16 - maze_y) / 2) + 1: sx = INT((monx / 8 - maze_x) / 2) + 1
  111.     FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: LOCATE sy + ty, sx + tx
  112.             ert = dj1(tx, ty)
  113.  
  114.             '            IF ert > 0 THEN PRINT CHR$(97 + ert)
  115.     NEXT ty, tx
  116.  
  117.     LOCATE 1, 1: PRINT find_way, sum_way
  118. LOOP UNTIL find_way = sum_way - 1
  119.  
  120.  
  121. 'atlagolas
  122. ave = 1
  123. FOR tx = 0 TO maze_x - 1: FOR ty = 0 TO maze_y - 1: sum = 0: c = 0
  124.         FOR q0 = -ave TO ave: FOR q1 = -ave TO ave
  125.                 IF tx + q0 < 0 OR tx + q0 > maze_x - 1 OR ty + q1 < 0 OR ty + q1 > maze_y - 1 THEN _CONTINUE
  126.                 IF maze(tx + q0, ty + q1) = 4 THEN c = c + 1: sum = sum + dj1(tx + q0, ty + q1)
  127.         NEXT q1, q0
  128.         dj2(tx, ty) = sum / c
  129. NEXT ty, tx
  130.  
  131. 'celrajz
  132. actx = exit_x: acty = exit_y
  133.  
  134.     LOCATE sy + acty, sx + actx: PRINT "Ű"
  135.  
  136.     max = 999999
  137.     FOR t = 0 TO 3
  138.         IF actx + d(t, 0) < 0 OR actx + d(t, 0) > maze_x - 1 OR acty + d(t, 1) < 0 OR acty + d(t, 1) > maze_y - 1 THEN _CONTINUE
  139.         IF dj2(actx + d(t, 0), acty + d(t, 1)) < max AND maze(actx + d(t, 0), acty + d(t, 1)) = 4 THEN max = dj2(actx + d(t, 0), acty + d(t, 1)): need = t
  140.     NEXT t
  141.  
  142.     actx = actx + d(need, 0): acty = acty + d(need, 1)
  143.  
  144. LOOP UNTIL start_x = actx AND start_y = acty
  145.  
  146.  
  147.  
  148.  
  149.  

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Terror in the hypermaze
« Reply #12 on: April 15, 2021, 08:22:49 pm »
Amazing stuff. Devilishly hard to orient yourself and stay that way. Does it have an off switch?

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Terror in the hypermaze
« Reply #13 on: April 15, 2021, 10:38:55 pm »
what do you mean, switch off?

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Terror in the hypermaze
« Reply #14 on: April 15, 2021, 11:48:43 pm »
He means an escape key.

If all else fails there is Alt+F4.