![]() |
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) |
RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-17-2025 (02-17-2025, 07:10 PM)litdev Wrote: AB, Thank you for the hint. I'll start testing this. ![]() RE: 3D maze in browser controlled by Small Basic - litdev - 02-17-2025 AB, Note that the rotate command is relative to current direction, so -90 is turn left and 90 is turn right - more like the Turtle commands. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-17-2025 Hooray! My robot control code works fine! ![]() The pause after sending a network request is 1000 ms. Now I can start working on creating AI. ![]() RE: 3D maze in browser controlled by Small Basic - litdev - 02-18-2025 On the point that the current position is not updated to the server until an animation is fully completed. This isn't actually true, it is updated regularly (so that the Observer and other multi-player systems can see each other's movement). Of course you can only be sure you have the final animated position of your robot when it is completely finished animating. However, new commands can be sent and exist on the server until an animation is completely finished and it is used, but only then so it is generally best to wait fully. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-18-2025 Now I want to teach the robot to create a maze map for itself. Monsters change the value of the "Distance" parameter. Do you plan to add new objects to the maze that will also be able to change the value of the "Distance" parameter? Thank you. ![]() RE: 3D maze in browser controlled by Small Basic - litdev - 02-18-2025 Currently if there is a monster in view a distance of 1000 is returned. You can get rid of the monsters by using a maze (set in settings) with none seeded. I guess at some point it would be good to just report distance and say if it is a wall, monster or other player. Not sure how to do this with a single distance value as it is now, probably another return data flag? I don't plan to add anything more, except I may just report the distance to the monster instead of 1000 and find some other way to say it is a monster using a flag for example. If there is a monster or other player there, then the distance cannot be the distance to the wall behind it since the engine doesn't actually know what is not shown behind another object. I am open to suggestions on this! EDIT I will change so it reports the distance to whatever is there, it will also return a string describing what it saw - this will be the internal object name which will be a wall, enemy or player label. Hopefully thats it where dist is always the distance to whatever is directly infront of you, and there is also a distLabel string returned saying what it is you see - a little trickier than I thought so hopefully nothing broken - the distance was used to prevent passing through walls and 1000 used for enemies and other players to let us pass throughthem - logic had to change a bit. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-18-2025 (02-18-2025, 05:30 PM)litdev Wrote: ... This will be equivalent to the robot having the ability to recognize images. ![]() This will greatly increase the robot's AI capabilities. ![]() RE: 3D maze in browser controlled by Small Basic - stevantosic - 02-19-2025 Hi, This is the code in C# for maze solving based on Sub animateCone in LD3DMazeGame.sb, litdev's SendWebRequest and AB's post #19 (Hand on The Wall strategy): Code: using System; Compiling: C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /r:LitDev.dll maze.cs Run: maze Newtonsoft.Json is located in LitDev.dll. st RE: 3D maze in browser controlled by Small Basic - litdev - 02-19-2025 Works well for me, tried it on the 'Visit all cells' game with default maze and it got 94% before returning to start, it will miss some cells between islands or big open areas, but it does navigate the full maze as we would hope. RE: 3D maze in browser controlled by Small Basic - stevantosic - 02-19-2025 Yes, the problem is "some cells between islands or big open areas ". Hope will be progress regarding it. |