Posts: 559
Threads: 40
Likes Received:
445 in 307 posts
Likes Given: 213
Joined: Aug 2023
Reputation:
20
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!
Posts: 559
Threads: 40
Likes Received:
445 in 307 posts
Likes Given: 213
Joined: Aug 2023
Reputation:
20
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.
Posts: 559
Threads: 40
Likes Received:
445 in 307 posts
Likes Given: 213
Joined: Aug 2023
Reputation:
20
03-06-2025, 10:31 AM
(This post was last modified: 03-06-2025, 10:55 AM by litdev.)
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.
Posts: 30
Threads: 3
Likes Received:
14 in 11 posts
Likes Given: 51
Joined: Jan 2024
Reputation:
5
03-06-2025, 08:50 PM
(This post was last modified: 03-06-2025, 09:23 PM by stevantosic.)
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.
Posts: 559
Threads: 40
Likes Received:
445 in 307 posts
Likes Given: 213
Joined: Aug 2023
Reputation:
20
03-06-2025, 11:22 PM
(This post was last modified: 03-06-2025, 11:23 PM by litdev.)
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.
Posts: 30
Threads: 3
Likes Received:
14 in 11 posts
Likes Given: 51
Joined: Jan 2024
Reputation:
5
03-07-2025, 05:27 AM
(This post was last modified: 03-07-2025, 05:39 AM by stevantosic.)
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.