Skip to content

More User Friendly, easier track creation, Tensorflow 2.X - #11

Open
LjAquinox wants to merge 9 commits into
Code-Bullet:masterfrom
LjAquinox:master
Open

LjAquinox wants to merge 9 commits into
Code-Bullet:masterfrom
LjAquinox:master

Conversation

@LjAquinox

Copy link
Copy Markdown

What the title say

@LjAquinox

Copy link
Copy Markdown
Author

Sorry I'm new to posting things on github if there is anything I've done wrong tell me I'll update things.

If you want to see the repo : https://github.com/LjAquinox/Car-QLearning

@AlexandreCGMeier

Copy link
Copy Markdown

@Code-Bullet please accept the pull request. This works. Thanks, @LjAquinox!

@JamesLear92

Copy link
Copy Markdown

This is beyond broken. Even if you fix all of the incorrect import names (Globals rather than Global, Game rather than Games) etc, the game state is butchered. Before it had forward and reverse momentum game state, now it only has one, so the AI cannot ever go backward, key for learning tracks.

I have fixed all of this and will upload a correct version that works soon.

@LjAquinox

Copy link
Copy Markdown
Author

This is beyond broken. Even if you fix all of the incorrect import names (Globals rather than Global, Game rather than Games) etc, the game state is butchered. Before it had forward and reverse momentum game state, now it only has one, so the AI cannot ever go backward, key for learning tracks.

I have fixed all of this and will upload a correct version that works soon.

I agree with the naming issues. 100%, tbh this was done without any consideration for anything. I believe I removed the backward state to speed up the learning process (it's been years; I don't remember but that's what I expect)

Have fun fixing the other issues. There are a ton. Good luck.

@AlexandreCGMeier

Copy link
Copy Markdown

Hello everyone! In case anyone is still interested/active/sees this in the future. I had 100 USD to blow through with Fable 5.1 and it blew it out of the park completely with GUI, tournaments, track builder, plotting of performance. The only limitation as I see it now is that it is geared towards Apple Silicon, but this should be solvable if someone with a 20USD subscription gives this to Opus/ChatGPT and asks to adapt where necessary for Windows. I've had tons of fun. The readme is the starting point, just remember to adjust the static path names that refer to venv etc. Feel free to ask if you have any questions and please leave a star if you can. Cheers!

@JamesLear92

Copy link
Copy Markdown

Hello everyone! In case anyone is still interested/active/sees this in the future. I had 100 USD to blow through with Fable 5.1 and it blew it out of the park completely with GUI, tournaments, track builder, plotting of performance. The only limitation as I see it now is that it is geared towards Apple Silicon, but this should be solvable if someone with a 20USD subscription gives this to Opus/ChatGPT and asks to adapt where necessary for Windows. I've had tons of fun. The readme is the starting point, just remember to adjust the static path names that refer to venv etc. Feel free to ask if you have any questions and please leave a star if you can. Cheers!

So I did have this fully working on windows, but what LjAquinox says is true. If you reintroduce the the ability to go backward or "brake" by enabling backwards direction, it will not learn, which honestly was quite sad to find.

I might still have the working code laying around.

@LjAquinox

Copy link
Copy Markdown
Author

Hello everyone! In case anyone is still interested/active/sees this in the future. I had 100 USD to blow through with Fable 5.1 and it blew it out of the park completely with GUI, tournaments, track builder, plotting of performance. The only limitation as I see it now is that it is geared towards Apple Silicon, but this should be solvable if someone with a 20USD subscription gives this to Opus/ChatGPT and asks to adapt where necessary for Windows. I've had tons of fun. The readme is the starting point, just remember to adjust the static path names that refer to venv etc. Feel free to ask if you have any questions and please leave a star if you can. Cheers!

It seems we think alike, I did something very similar to test current LLM level for this type of thing two months ago. It got a fully working better version in about 3 messages using GPT 5.6 I believe at the time.
I haven't pushed anything because I don't want to push full AI code I didn't write or read at all but it was trully impressive.
The one thing I would consider though is to not use a library like pygame to actually do this but rather to let the AI create it's own physic simulation logic for better integration with the training and headless mode. Because for some reason the training in headless with pygame was way too long and I couldn't fix the bottlenecks to improve performances using it.

When I go back home I'll probably take a look at your project but yeah LLMs really got better at this.

PS : @JamesLear92 I think the backward state collapse of the model can be fixed with better reward functions but these type of models are way to sensitive to everything and collapse all the time so removing the backward move is still the easiest fix for this.

@AlexandreCGMeier

Copy link
Copy Markdown

Hello everyone!

Isn't it crazy that we live in a time where you can discuss a toy project with complete strangers just for the sake of the thing itself. I love it!

@JamesLear92: The AI did point out the necessity to adjust the parameters (punishment for wall, reward for gate, etc) juust right to get it to work. I solved it manually ago by including a partial reward for movement towards gate, as opposed to only rewarding passing through gates itself. This worked!

@LjAquinox : Right on the kisser: In the readme.md, first points lines 163-165:

## What changed from the 2024 version

* TF1 graph code → PyTorch; pyglet 1.5 + pygame vectors → pyglet 2 + numpy; Python 3.9 → 3.11+.

If you still want to have a look, my old version 2024, managed to get a car running after 2h on my Dell i7 with TF2, pygame and all that. The specific TF version I used was geared towards running on Intel CPU.

Important note though: The AI replaced TF2, from my last human version, with PyTorch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants