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
Part of the problem with the delays is that we don't know exactly how long it will be and the limitations of my ISP webhosting doesn't allow sockets.  Without sockets we can only send a request and get a response from the server.  The server cannot directly send a message (unsolicited) to us. 

When you start addding intelligence you can use this delay time for 'thinking'.  You may also use the 'speed' multiplier setting, but this will give you less thinking time!
Reply
Hi all.  Shy

So, I managed to remove all unnecessary pauses in the program.

Now, I will be interested in "opening the robot's eyes".  Smile
I want the robot to know what object it is currently looking at.
[-] The following 1 user Likes AbsoluteBeginner's post:
  • litdev
Reply
Been tinkering a bit and added new LDNetwork.SendWebRequestAsync method (beta 1.2.29.20).  With this method we can receive an event message when all animations are completed - also improved some associated stuff to make the async stuff as robust as I can.

My test code, PTSV104.000 - should be self explanatory - I tested with speed setting set up to 10.
[-] The following 2 users Like litdev's post:
  • AbsoluteBeginner, stevantosic
Reply
In all these days I have not written a single letter of code.  Blush

I spent all my free time to improve my interaction with ChatGPT.

Now I will test my achievements by examining the PTSV104.000 code.  Smile
Reply
The code works fine on my computer too.  Shy
The robot moves very quickly.
It's a good thing I haven't written any code the last few days. The latest update to the LD expansion significantly changes the robot's capabilities.
It is very good that these opportunities are now available to us.

Cool
Reply
Hi,
Looking at https://litdev.uk/apps/maze3D/settings.html async command links (bold+italic) and backend server code maze3Dasync.php (on github) there is only action 'isReady' which is valid for async request (https://litdev.uk/apps/maze3D/maze3Dasyn...on=isReady). Other async commands do not work (Unknown action message). Maybe a typing issue.

st
Reply
ST,

Yeh thanks, that was a copy/paste typo

The async command only has the isReady action, an additional php is used for this due to issues of non-concurency/non-reentrancy etc for the main php server commands that would be harmed by internal delays since this same maze3D.php is called from js client and web user.  I could split the client and web user calls to the server to use different server php calls and allow some web user calls to have delays in them, but may get confusing if a user makes another call wile a previous one is waiting - hence the non-concurency mutex lock currently used.

PS, I have updated but there seems some latency or other issue with my upload - my ISP recently moved server so I will wait a bit and investigate later.
Reply
Following line of simplification we can imagine a code snippet (for better understanding of actions):

// SendWebRequest(urlSet + "&rotate=90"); waitTillReady();
SendWebRequestAndWaitActionEnd(urlSet + "&rotate=90");
// SendWebRequest(urlSet + "&forward=4"); waitTillReady();
SendWebRequestAndWaitActionEnd(urlSet + "&forward=4");

Just a thoughts. User can write a procedure or function to encapsulate a chunk of actions. Or even:
Rotate(90);
Forward(4);

Looks like turtle.
Reply
Yes this change could work, but...

The main objective is a platform to write 'AI' robot control to perform tasks in a maze.

There are probably 3 people interested in this (you, me and AB who doesn't want constant change of the API).  So I guess at this point, although I quite like the challenge, I don't want to tinker endlessly changing it.  If we get to the point where there are people struggling with issues that cannot be solved with the current API (as there were previously with the move, animation and required delays), then definitely time to reconsider, but I don't in principle like an API that has many ways of doing the same thing.
Reply
I agree. Current API is well defined and finite, I guess. My previous comment was just a hint to a users to imagine 3D maze as a turtle moving. Something like pseudo code, not as an additional API. A user by itself can decide about implementation of custom procedures or functions for a reason.
Reply


Forum Jump:


Users browsing this thread: 30 Guest(s)