Small Basic Forum
3D maze in browser controlled by Small Basic - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Discussion (https://litdev.uk/mybb/forumdisplay.php?fid=4)
+--- Thread: 3D maze in browser controlled by Small Basic (/showthread.php?tid=223)

Pages: 1 2 3 4


RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-27-2025

(01-27-2025, 12:45 PM)litdev Wrote: HaHa,

This is not a "FPS game", this is a "write some code to navigate a maze thing".  However, if we do get a few 'robots' that can navigate reasonably I will turn it into a multi player game, with maybe bombs and bullets.

I got it.  Shy

I thought that the AI would move through the maze with some specific goal. For example, he will have to shoot all the monsters that live there.
Or he will have to skillfully place mines so that no monster can move through the maze without being blown up by a mine.
To do this, the AI itself will have to study the maze well. And he must be able to PERFORM THE ACTION.

Rolleyes


RE: 3D maze in browser controlled by Small Basic - litdev - 01-27-2025

Absolutely, but if it can't navigate (just goes in circles randomly), then it can't hope to achieve any goal - it needs to be able to move about sensibly before we can ask it to do anying more complex.  So literally one step at a time.


RE: 3D maze in browser controlled by Small Basic - litdev - 01-27-2025

In this one we see how to maybe 'have a look about', there are issues with latency in communication to be considered.  The robot is still nowhere near as smart as a very stupid blind goldfish and shouldn't be given a gun! - VXFD236.000.


RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-28-2025

Hi all.

This is a very interesting topic.  Rolleyes
Now I will again look for free time to solve an interesting problem.

I love feeling that kind of creative excitement.  Tongue


RE: 3D maze in browser controlled by Small Basic - stevantosic - 01-28-2025

Hi,
It could be useful to have an empty room (web page) just for movement training purposes.


RE: 3D maze in browser controlled by Small Basic - litdev - 01-28-2025

(01-28-2025, 09:02 PM)stevantosic Wrote: Hi,
It could be useful to have an empty room (web page) just for movement training purposes.

Here you go, just load this instead and the rest the same:

https://litdev.uk/apps/maze3D/empty.html

I have some more (hopefully better ideas for how to code the SB), but am way from home for a couple days and will have a go and post whatever I come up with when back.  It's good for anyone interested to have a go, rather than just trust what I do as the way to do it - as I say I'm fairly sure its not (especially the Timer).

PS, you can use the arrow keys to control during testing - also I changed it so angle is 0 to 360, (not -180 to 180) so 0 or 360 is Z+, 90 X+, 180 Z-, 270 X- (not -90).


RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-29-2025

Hello everyone.  Smile

I haven't had a chance to write code yet.
But this morning my first version of the robot’s action algorithm was fully formed in my head.

I want to tell you about this. But I don't know if you want me to tell you this right now.
Perhaps you also enjoy solving this problem yourself.

I will wait for your reply.  Shy


RE: 3D maze in browser controlled by Small Basic - litdev - 01-29-2025

Hi AB,

Please share any ideas or code as you write it.  Hopefully we can all learn from different ideas and perspectives.  I will share mine when get time to work on it.


RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-30-2025

Hi everyone.  Shy

I gave my thoughts another day to mature. None of you objected to me expressing these thoughts here. Therefore, I begin.

Any maze is a long corridor.
Therefore, if you move along one wall, for example the left one, you will inevitably come back to the starting point if the maze is closed.

This means that if you first walk the entire labyrinth along the entire left wall, and then walk it along the entire right wall, you will visit every point of this maze. If you need, you can create a map of this maze.

What do you feel about it?  Rolleyes


RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-31-2025

A very interesting task.  Rolleyes
I get real pleasure.
There's just one little problem that's bothering me a bit.

When I stop the game, I first close the SB window, and then I close the game page in the browser.
But when the SB window is closed, the robot in the browser starts to constantly turn to the right.

If I launch the game in the browser again, without running the SB code, the robot immediately starts rotating to the right.
I have to restart the browser so that the robot does not rotate until it receives a command from the SB code.

It doesn't bother me much. I am reporting this just for information.

I wish everyone good luck.  Shy