Small Basic AI Championship - 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: Small Basic AI Championship (/showthread.php?tid=9) |
RE: Small Basic AI Championship - litdev - 09-02-2024 AB, LDInline doesn't especially speed anything. What makes SB slow is mainly the Primitive type, especially with arrays. To really speed up you would need to write in C# or similar. However, careful use of LDList and other optimisations depending on the code (e.g. there may be things that can be done with large number of moving shapes). The first thing to do is to simplify the code trying to identify cause of bottleneck (which bits are slow - array manipulations, graphics update, file operations, expensive extension commands ...). If you then get a small sample program that is running slow I can have a look. RE: Small Basic AI Championship - AbsoluteBeginner - 09-02-2024 Well. Then, let this be my current plan of action. Thank you very much. RE: Small Basic AI Championship - AbsoluteBeginner - 09-07-2024 (translated by Google translator) Hi all. Finally the main mechanical part of my Retro Football code worked. Now I will make the code formatting decent and post it on my cloud for viewing and discussion. Be healthy everyone. I wish you all the very best. RE: Small Basic AI Championship - AbsoluteBeginner - 09-08-2024 (translated by Google translator) Hi guys! I have uploaded an intermediate version of the game "Retro Football" to my OneDrive. https://1drv.ms/f/s!AnoSlTzMqlL6jNwEee_QXwbgFFlbAg?e=bLsytu In discussing this version, I am interested in your advice and tips. Here I first tried to use an asynchronous subroutine call. I'm interested in advice and comments on the topic of using variables shared between the main and temporary computation threads. What rules should I follow to avoid program crashes? How to properly organize the work of threads so that they do not interfere with each other when using shared variables? Also, I would appreciate your advice on how to improve the gameplay. Now, left clicking on the "cursor sensor" turns the game Pause on and off. The human controls the right players, and the Robot controls the left. The Y coordinate of the cursor corresponds to the midpoint of the rectangles of human-controlled players. The speed of the ball and the accuracy of the Robot's movement can be changed at the beginning of the program's source code. I want to add the ability for football players to RE-DIRECT the ball as it moves towards the opponent's goal. At the moment, football players can only hit the ball when it flies towards their goal. Well, that's all for now. I hope you find this game fun to work on. After all, the most interesting thing is yet to come. This is the creation of a Robot Football Player who will SEE the ball on the field with his "eyes". RE: Small Basic AI Championship - AbsoluteBeginner - 09-09-2024 Hi guys. I updated the game "Retro Football" in my cloud (link in the previous post). Added the ability to redirect the ball that is flying towards the opponent's goal. Only a forward footballer has this ability. In addition, the game is paused for 3 seconds if one of the teams scores a goal. Let's have fun further... RE: Small Basic AI Championship - AbsoluteBeginner - 09-09-2024 New update of the game "Retro Football". Counting of goals scored has been implemented. More precise settings for object movement parameters have been made. How are things going with you? RE: Small Basic AI Championship - AbsoluteBeginner - 09-10-2024 (translated by Google translator) Hi all. Today I tried playing football with a robot that detects the position of the ball on the field using vision. On my tablet, the "LDImage.FindImageInImage()" function clearly does not have time to find even one white pixel in the required area of the graphics window. If the game loop becomes shorter than 100 milliseconds, then the robot loses sight of the ball. Since, probably, the "LDImage.FindImageInImage()" function searches for an image in an image by checking each pixel, then I hope to achieve my goal using the "LDGraphicsWindow.GetPixel()" function. The ball has a diameter of 20 pixels. So I think if I search for a white pixel of the ball on the playing field with a step of 10 pixels horizontally and vertically, the program will have to check 100 times fewer pixels. I hope this will allow us to find the ball quickly enough. ( if anyone is interested, I can post the current version with the big-eyed robot so you can try your ideas or find my mistakes ) RE: Small Basic AI Championship - AbsoluteBeginner - 09-13-2024 (translated by Google translator) An incredibly fun process. For example, making such a game in C# would not be interesting at all. But here in Small Basic, you'll need all your ingenuity to make the game work well even on a slow tablet. I've used everything I've learned about Small Basic so far. It seems to me that I have already used all the technical capabilities to achieve a sufficient speed of the game. But, I still lack a little speed. At first I thought it was already a dead end. But then a new idea comes to mind again - and the feeling of enthusiasm returns. I thought that in case of mechanical resources running out, using AI elements could help. In conditions where the hardware does not have time to calculate everything necessary, the program can try to "look into the future" and predict where the ball WILL BE at the moment when the hardware finishes the calculations (!). Now I have the current version of the game, in which I think I have used all the possibilities of technique. If anyone is interested, I can improve the code formatting and post it on my OneDrive. And now I will begin to add to the program the ability to predict the future... RE: Small Basic AI Championship - AbsoluteBeginner - 09-14-2024 (translated by Google translator) Dear Small Basic fans, I just put the latest version of the game "Retro Football" into my OneDrive. ( Retro Football v0_0401 with AI.sb ) This version is notable because I used a ball search by image and parallel operation of two computation threads (asynchronous subroutine call). These were unexplored topics for me. In addition, this version of the game gives the opportunity to organize AI Football matches BETWEEN TWO ROBOTS. Now, the right team of football players is controlled by a person, moving the mouse across the graphic window. The left team is controlled by a robot that determines the position of the ball on the field using "vision". (on my slow tablet, the robot takes up to 4 game cycles to make its decision) But (!)... Thanks to the LitDev extension, not only a person can move the cursor around the graphic window. Therefore, every fan of cyber SB sports can write an AUTONOMOUS SB program, which will also "see" the ball on the field, using "vision" and will be able to control the right team of football players, moving the cursor on the screen. Thus, two "sighted" robots can compete with each other. (what do you think about our Small Basic now? ) The Ethics of AI in Competitive Sports**. - ThorstenFuh - 09-15-2024 Is it ethical for AI programs to compete against human athletes in sports? As AI continues to advance, should we reconsider the definition of competition, or does this undermine the spirit of sportsmanship? What implications does this have for the future of both AI development and athletic integrity?", "refusal |