• Welcome to PiBoSo Official Forum. Please login or sign up.
 

AI, ROBOT, Ability to play against the Computer.

Started by asic_designer, March 24, 2016, 05:36:20 PM

Previous topic - Next topic

HornetMaX

Quote from: PiBoSo on March 24, 2016, 09:36:57 PM
The main reason for not integrating AI is that it would be a colossal amount of work, to have something that would probably end up not very good anyway.
I agree.

Quote from: asic_designer on March 25, 2016, 01:03:47 AM
I agree with the "trainer" request.  This would be sufficient for everyone's needs.  A complete AI may perhaps be too complex, however just a simple robot/trainer which can navigate a track fast efficiently would be great.  This would suit our needs definitely, just so long as we can tap into and pull data from the trainer, and have it run independently, itself on the track.
The trainer (as it is already in MXb and KRP) is just a saved "replay" that is shown on track while you ride.
It would not fill your need asic-designer: you will have to be riding to see it (and the data will be from the bike you're riding).

asic_designer

Quote from: HornetMaX on March 25, 2016, 08:08:13 AM

Quote from: asic_designer on March 25, 2016, 01:03:47 AM
I agree with the "trainer" request.  This would be sufficient for everyone's needs.  A complete AI may perhaps be too complex, however just a simple robot/trainer which can navigate a track fast efficiently would be great.  This would suit our needs definitely, just so long as we can tap into and pull data from the trainer, and have it run independently, itself on the track.
The trainer (as it is already in MXb and KRP) is just a saved "replay" that is shown on track while you ride.
It would not fill your need asic-designer: you will have to be riding to see it (and the data will be from the bike you're riding).

  Ahhh yes I see, thanks Max.
Encephalon Nand Logic Smart Helmet
http://www.nandlogic.com/promo-smarthelmet.php

Urban Chaos 2.0

April 16, 2016, 04:33:17 PM #17 Last Edit: April 16, 2016, 04:35:04 PM by Urban Chaos 2.0
AI can actually work really well with GP Bikes, and easily so. It need not be a f*** up. You can build really effective AI by training it. It's something I came up with after only a few seconds of consideration so there might be issues, but I don't think so. My proposal? Lap a certain track many, many times, and have the AI record your exact movements. The set of inputs which cause crashes can then be completely ignored. Keeping those inputs which result in complete laps will allow for AI which can lap in several configurations of racing lines. The changing variables (like tyre wear) of course will also be recorded from the player and so can allow for AI to adapt to conditions. sets of inputs which result in crashes or going off track can be kept and designated for utilization by the AI to simulate the fallible human element. This would be allot of work, given that there are quite a few bikes available in GP Bikes (mods and whatnot), and many tracks (mods and whatnot), so rather than doing all the work Piboso, simply create a set of tools for the users to then use in building the AI around a base artificial intelligence model you create.

HornetMaX

I'd say you needs a few additional seconds of consideration.

Urban Chaos 2.0


HornetMaX

"Learnig" a trajectory is a fairly simple task. Definitely you don't need to do what you described (the "training" stuff).
In principle it's essentially a dynamic inversion problem, but tackling it this way is hard and inflexible.
However, one could set up a relatively simple tracking controller with a predefined trajectory, that's not too hard.
The current GPB virtual rider does essentially that with a few exceptions:

  • The trajectory is not given by X,Y points but by lean angle points (plus throttle and brake)
  • There's no predefined target trajectory: you give the trajectory in real time with your joypad input
  • Due to the absence of pre-defined trajectory, the tracking controller can't have any form of look-ahead (which is usually a big plus in terms of accuracy of the tracking)
That said, the problem is that while you're on track with 20 other bikes, you don't stick to the one single trajectory you can do. You have to watch where other bikes are, brake to avoid collisions, get out of the perfect line to avoid obstacles, overtake or avoid being overtaken. It's far from trivial. If in just a few seconds you can devise a brillant solution for that, then you can ring the MIT or Google: they will fly you first class to the US and offer a tremendous scholarship or job. :)


matty0l215

Quote from: Urban Chaos 2.0 on April 16, 2016, 06:46:40 PM
Quote from: HornetMaX on April 16, 2016, 06:04:59 PM
I'd say you needs a few additional seconds of consideration.

Elaborate

This would require a lot of coding (intelligent AI, i mean) it isn't just a case of it taking the best parts from a lap and stringing them together otherwise all games would have used this system long ago.

The closes thing we have to AI at the moment is in MX Bikes in the form of the Trainer ghost. (you record a fast lap, the game can save that lap and then you try and beat it then you can use that lap to then try to beat) You are racing yourself but i believe it would help the slower riders if people shared their laps for people to try to beat.
For faster responses, please visit the discord server- HERE

Urban Chaos 2.0

April 16, 2016, 07:16:23 PM #22 Last Edit: April 16, 2016, 07:19:08 PM by Urban Chaos 2.0
It is a general solution, so there is nothing specific to Piboso's code base in the suggestion. If left alone, the AI could perform repeated laps with variable lacing lines. The inclusion of one additional rider (the player) will only be a matter of prediction. Given the typical racing lines, the AI can continue it's path, or slow down depending on the position of the player. Given the commonsensical nature of that, I didn't bother to mention it. AI must be slowly rolled out and improved, as the GPB beta is. It can't be expected to be in "full working order" in its first stages (which should be single-player only for the first few releases). Teaching the AI through repeated laps is the best method, I feel. Given that the responsibility will shift from Piboso, to third party developers who can create their own brands of AI for each track as they see fit.

RiccoChicco

Currently finishing my studies in...AI. Si I know "a bit" about that stuff  ;D

Following a trajectory is pretty simple, but you'll need to code something to get the correct trajectory. The "cheated" version would make the track builder register a "prefect lap" as the reference for any AI on track. But if you start to do that, the AI would be already not a real AI. Once you've done that, the harddest part comes : multiple bikes sharing the same tracks. You'll need to predict any collisions (as a human) and take in consideration your options. The decision part is the biggest (and harddest) part of a good AI. You can avoid a collision, but by doing that you'll maybe create another with someone else. That's just a simple example. There a few other domains to consider to create a full AI, but it's not a simple task. Implementaing an AI is not easy, especially in racing games when a wrong decision would lead to a tootal disaster on track.




doubledragoncc

How about having Multiple Trainers from different real riders!!! Beats any AI and I know it would have several problems but if the Trainers passed through each other it would not be a problem but it would be good for learning to overtake multiple riders.

DD
GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls; i7 12700K 5.1GHz Z690 ASUS Strix Z690-A Mobo 32GB 3600MHz DDR4 RAM ASUS Strix RTX3080 OC 10GB DDR6X ASUS Ryujin 360 AOI Cooler ROG Thor 1200w PSU in ROG Helios Tower Case.

HornetMaX

Quote from: Urban Chaos 2.0 on April 16, 2016, 07:16:23 PM
Teaching the AI through repeated laps is the best method, I feel.
You may feel that, but you've already two of us (with some fair knowledge in the area) telling you it's not.

Quote from: Urban Chaos 2.0 on April 16, 2016, 07:16:23 PM
Given that the responsibility will shift from Piboso, to third party developers who can create their own brands of AI for each track as they see fit.
That is something that is already doable today: I could code an input plugin that can actually ride the bike for me (i.e. autonomously provide the inputs to GPB).
GPB would see the "robot" rider just as an input device (a joypad). The hard part, of course, is ... the AI (i.e. how to compute the inputs).

matty0l215

Getting an AI to ride a lap is one thing, getting an AI to react to other players is a whole another ball game. That's when AI becomes intelligent rather than a trainer...
For faster responses, please visit the discord server- HERE

Urban Chaos 2.0

April 16, 2016, 08:30:53 PM #27 Last Edit: April 16, 2016, 08:39:50 PM by Urban Chaos 2.0
Quote from: HornetMaX on April 16, 2016, 07:59:20 PM
Quote from: Urban Chaos 2.0 on April 16, 2016, 07:16:23 PM
Teaching the AI through repeated laps is the best method, I feel.
You may feel that, but you've already two of us (with some fair knowledge in the area) telling you it's not.

Quote from: Urban Chaos 2.0 on April 16, 2016, 07:16:23 PM
Given that the responsibility will shift from Piboso, to third party developers who can create their own brands of AI for each track as they see fit.
That is something that is already doable today: I could code an input plugin that can actually ride the bike for me (i.e. autonomously provide the inputs to GPB).
GPB would see the "robot" rider just as an input device (a joypad). The hard part, of course, is ... the AI (i.e. how to compute the inputs).

You don't get me. Let me explain:

I'm lazy to type, so I'll be as brief as possible. There are several phases of development of the AI. The first and most basic of which is as follows:

A circuit is navigated along paths with restrictions, the inside of which constitute a probability of racing lines. When 'x' number of such lines are realised by the continued inputs of a user, the data sets (inputs, track position, etc.) can then be sent to an AI program. This program can then replicate directly, or improvise (based on a statistical availability of possible trajectories) the lines. When one additional rider (the player) joins the AI, the paths along the circuit are predictable by the AI via the stored statistical information of the rider's lines (which limits the AI's behaviour to a a specific bike the user rides). Given the position of the player, it can be very easily calculated, how far the player will travel along the most likely trajectory. When amalgamated with the AI's track position, the rate at which it continues to lap the circuit in the provided trajectories can then be varied to allow for some awareness of the player's position.

Should the player make a mistake, or operate outside the ascertained parameters, there will be no problem unless he hits the AI rider. In which case, they both are disturbed (as in real life). Should the player make an attempt to overtake, the onus is on him to do so properly, and if he does so, it's a simple matter on the AI's part, of maintaining velocity, or it's rate of change inside the circuit so as not to make contact. Something achieved via the processes outlined above. Overtaking on the part of the A.I. is a matter of a set of defined "behaviours" (in accordance with the lines and location information described above) which one could classify as "risks".

More riders simply means several more instances of the AI's awareness system and a reduction of possible position outcomes on the part of the AI (where the AI can place itself). Then there's the optimization stuff, etc. Things which can only come through time and development. Initially, the AI should be for offline use only and for a single rider.

There should be no coding involved on the part of the third party. The basic systems would have to have been in place by piboso, to allow for users to mark certain parts of the track for certain functions, and to supply the AI with pre-set data from which to begin calibration. The development tool would be entirely up to piboso of course, and the extent to which is offers UI-based programming of the AI would as well be up to him. It's only a suggestion, and as I've said: I don't know Piboso's code base, so how he would interpret the suggestion is something he will know. Perhaps it would not work with his current layout, and might not be feasible. I wouldn't know.

HornetMaX

You're suggesting something for as problem that's not there.

Again: computing a nice trajectory is not that hard. The rest is hard.

Urban Chaos 2.0

Haha, you still didn't get me. But never mind it's all good. In any case, the rest is not hard. Not to me.