We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D maze in browser controlled by Small Basic
#61
Very useful! "Think of it like the Turtle in 3D" from #1.  Smile
[-] The following 1 user Likes stevantosic's post:
  • AbsoluteBeginner
Reply
#62
The project is developing so quickly that I don’t even have time to come up with a plan of my actions.  Big Grin
[-] The following 1 user Likes AbsoluteBeginner's post:
  • stevantosic
Reply
#63
Very simple test:
Open:
1.  https://litdev.uk/apps/maze3D/empty.html
In a separate window:
2. https://litdev.uk/apps/maze3D/maze3D.php...&rotate=45
Wait a seconds, and then new command:
3. https://litdev.uk/apps/maze3D/maze3D.php...&forward=2

That's it.

PS. Other commands:
https://litdev.uk/apps/maze3D/maze3D.php...t=0&move=0
https://litdev.uk/apps/maze3D/maze3D.php...animate=90    (0,90,180,270)
https://litdev.uk/apps/maze3D/maze3D.php?action=get
The last one:
https://litdev.uk/apps/maze3D/maze3D.php?action=getAll
[-] The following 2 users Like stevantosic's post:
  • AbsoluteBeginner, litdev
Reply
#64
Updated again to improve small angle rotation accuracy (a few degrees), added a 'game' label to isolate different groups of robot players within a specific game, and added an Observer 'fly' user that can visualise a game from above the maze.  These setting features now mean the environment is ready to start thinking about how to turn it into an AI challenge 'game' where AIs written in SB or indeed C# can compete.

The idea I have is a simple 'tag' game, where one robot is chasing and the others evade capture (both present in the same cell).  When a robot is captured it will become the chaser with some simple scoring system.  Only robots joining a named 'game' will take part in that game, and special human Observer users can see what is happening. The game bit is not written yet, but the infrastructure is ready for it I think.  To run different robots on the same PC I use a different browser for each (e.g. Firefox, Chrome, Edge etc).

Hopefully there will be some robot AIs at some point - of course once we have at least one, more than one instance of it can be run at the same time in the same 'game'.

Any other game/objectives (single or multiple AIs) ideas welcome.

PS

Also added (action=getAll) that will return basic data about all users present in your 'game' - QRHC107.000
[-] The following 2 users Like litdev's post:
  • AbsoluteBeginner, stevantosic
Reply
#65
Hi all.  Smile

I am very interested in everything related to artificial intelligence.
It's great that we will be able to create our own robots.
It’s great that our Small BASIC is so easy to use that it allows ordinary people to create their own AI for themselves.  Rolleyes
Reply
#66
Today I felt like I could try to continue my robot control tests.  Rolleyes

I think that there will be no significant changes in the robot control protocol.
Therefore, I started to feel confident.

See you.  Wink
Reply
#67
AB, Yes I have finished setting up the controls and basic infrastructure and only intend to fix any bugs etc.

Sorry for changing the goal posts as you work, but I can't help tinkering!

I do intend to add some activities, challenges or games for the robots, but not change the data they get or the controls they have.
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply
#68
Regarding maze solving, there is "wrt current direction" in LD3DMazeGame.sb. Using this part of code could lead to a simple scenario.
Reply
#69
Sometimes animation action takes two or three (cell) steps in a chunk instead of single one.
Reply
#70
(02-14-2025, 09:26 AM)stevantosic Wrote: Sometimes animation action takes two or three (cell) steps in a chunk instead of single one.

Hi, I assume this is using the 'animate' command with an angle direction input and not the 'forward' command.  Also I assume it appears like repeating an animation command rather than being jumpy but ending up in the right place.  

If it is as I assume then it looks like the commands are being sent too quickly from your controller code, first would be to put much longer delays in your code to be sure each command completes before the next is sent.  If you can then create a simple example that show the issue I would like to see it.

On the client side I take care not to poll for or receive the next command until all animations have fully completed.

On the server side, the next request sent to the client is its current state, not previous commands queued as I may have suggested in an earlier post.

So, my thinking is perhaps you are sending animate=0, then animate=90, then animate=0 for example.  The first animate=0 starts and say takes 1.05 sec (total time including some latency), you send the second command at 0.5 sec and the 3rd after 1 sec.  Therefore the next command the client receives is command 3 and it moves forward again in the same direction.
Reply


Forum Jump:


Users browsing this thread: 24 Guest(s)