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) |
3D maze in browser controlled by Small Basic - litdev - 01-26-2025 I have been playing with 3D in a browser, simulating a maze environment that needs to be navigated by a simple controller. This was inspired by some discussions with SB user Stevan Tosic. I have openned it up to be controllable by Small Basic. To have a go you need to: 1] Get LitDev beta extension 1.2.29.15 from Extension Manager or my website (new Network command added). 2] Open the 3D maze in a browser (https://litdev.uk/apps/maze3D). 3] Get my sample SB controller program XRWF529.000. Everything should be fairly self explanatory from comments in the SB sample. The idea is to improve the navigation skills of the observer in the maze - my sample is very crude and not very good at all. Think of it like the Turtle in 3D trying to navigate a maze, maybe a control logic or AI challenge. It would be possible for multiple players to interact in this environment, but this is not implemented yet. The only information stored is the control data and your IP address to distinguish potentially different users running on the server. Question/feedback very welcome. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-26-2025 (translated by Google translator) Hi all. At the moment I don't understand anything. However, this topic is interesting. I'll be watching. RE: 3D maze in browser controlled by Small Basic - litdev - 01-26-2025 Hi, The idea is a bit similar to the AI control you were developing for rabbit and snake program. Or imagine that the 3D maze is a world where a robot is lost and you have to write a program to help navigate it. The motivation is associated with what Stevan Tosic is doing with arduinos and looking for a 3D maze that could run in a browser, but I like the idea of using SB to write the control. The idea is that there is very little data coming from the robot in the maze, just its position (posX and posZ), the direction it is looking (angle) and the distance in front of it before it sees a wall (dist). Also there is very little going back to control the robot, just a move, left and right flag (0 or 1) very similar to using keyboard keys. The SB program I shared gets and updates communication of these with the 3D maze and it is up to you to write a program with just the info above to navigate the robot. In the program you see my very simple logic (not very good). Code: 'This is where you put your simulation cotrol logic In this case all it does is keep turning left if it sees a wall in from of it (< 0.2m), otherwise it moves straight forwards. As I said in original post you need LitDev extension 1.2.29.15, then open the 3D maze (link in original post) in a browser and run the SB program (import code also in original post) and see it try to control the robot in the maze. Then try to do better logic! RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-26-2025 Okay. Now I already understand more. I will wait until the morning comes and various useful thoughts begin to come into my rested head. RE: 3D maze in browser controlled by Small Basic - z-s - 01-27-2025 When i open in browser i saw a sniper target and a beast running RE: 3D maze in browser controlled by Small Basic - litdev - 01-27-2025 Slightly better - XRWF529.000-0 RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-27-2025 (translated by Google translator) Hi all. Everything works fine for me. Now I will study the code and I will start waiting for some interesting idea to come to me. RE: 3D maze in browser controlled by Small Basic - litdev - 01-27-2025 Now we can see how stupid the robot is - XRWF529.000-1 RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 01-27-2025 Yes, I, too, first of all, wanted to teach the SB AI to create a maze map for itself. In addition, we need to be able to PERFORM AN ACTION during the game. For example, if I want to take a shot or plant a mine. RE: 3D maze in browser controlled by Small Basic - litdev - 01-27-2025 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. |