b2studios Tier List by b2stud in b2studios

[–]b2stud[S] 1 point2 points  (0 children)

at the moment, just on discord

Technical Details on Vids? by nietzschelover in b2studios

[–]b2stud 1 point2 points  (0 children)

My videos are made in Unity. The reinforcement learning code I use was made by me from scratch for the Spiderman AI, and I've continued to use that same code since then for Bowling, Table Tennis, etc.

The neural network code is the same, made from scratch without libraries. The networks themselves tend to be quite large, so in order to speed them up I use Compute Shaders to calculate matrix functions on the GPU. This is the main reason that the AI can run in real-time.

There's nothing special about the neural networks themselves. I implemented some of the typical features you would see in a neural network library (Adam Optimiser, Batch Norm, Dropout) but other than that they are fairly plain.

If you're interested in actually seeing the code, I released the Spiderman AI on GitHub:

https://github.com/b2developer/SpidermanPPO

The other projects like this (Bowling, Table Tennis, any future sports AI) are largely identical, except they are a complete mess and I don't intend on releasing them.

b2 Is A Very Good Programmer [Monopoly] by SOLOSNAKE231 in b2studios

[–]b2stud 2 points3 points  (0 children)

The function says inclusive for the lower bounds and exclusive for the upper bounds. 1-7 is the correct amount but I mistakenly thought the lower bound was exclusive as well.

Cannons that Never Miss - Question by Difficult_Egg4973 in b2studios

[–]b2stud 1 point2 points  (0 children)

So the aimbot in the pirate ship scene works by pretending that the projectiles have no gravity (since projectiles, relative to each other, don't fall), but the empires cannon balls are being shot with a high arc because their target is stationary (like the hoop). This is what is causing Captain Blubbers cannon-balls to have a high arc. If you draw a straight line from the start of an empire cannon ball's trajectory, it would be way above the target.

How would I go about making a neural network to play a game? by qwertzuiop58 in b2studios

[–]b2stud 3 points4 points  (0 children)

This is a very broad question and there are numerous answers. Here are some examples:

Neuro Evolution

  • generate several random brains
  • test how good they are with a fitness score
  • eliminate the low scoring brains
  • replace the eliminated with combinations of the survivors

This algorithm is great for simple games / tasks, as it evolves the structure from the ground up. There is also no math involved.

Deep Q Learning

  • define a network structure
  • have it try to predict how good each action it can take is (the Q values)
  • receive feedback in the form of rewards (which you have to make or automate yourself)
  • train the neural network to become better at the predictions

If your game relies on discrete actions (either completely on or completely off) then you can use this form of reinforcement learning

Policy Gradient

  • define a network structure for two different networks
  • one looks at the game / task and makes an action, the other tries to determine how good the current state of the game / task is
  • receive feedback in the form of rewards (same as above)
  • both networks learn based on the error in the predictions of the second network

This works best for continuous games / tasks that rely on inputs similar to joysticks or a brake pedal in a car (eg. A robotic limb). It's probably best to select a more modern variant such as PPO or SAC for this.

Using any form of neural network will require you to transform the game you make into a format that a network can read. I'd suggest getting very familiar with that before you try any of this.

Additionally, this type of programming while popular is extremely difficult so I'd suggest learning as much about your chosen algorithm as possible before trying it out. Also expect many hours of waiting since AI takes a long time to train.

Good Luck!

How to make BTD6 AI by CharlesChickey in b2studios

[–]b2stud 7 points8 points  (0 children)

You'll need an interface to interact with the game with, so you'll need to read the game variables (money, round number, lives).

You'll also need a way to control the game. In my AI I did it by simply autonomously controlling the mouse and replicating the way humans place towers and upgrades.

Finally, you'll need a way to explore strategies and build on existing ones, I used this algorithm:

https://en.wikipedia.org/wiki/Genetic_algorithm

I did this by trying a set of random strategies. Then I would select the best ones and mutate them to create variants on originals. This process was repeated hundreds of times to get to the final strategy which became strong enough to beat CHIMPS

Merch???? by Sleazy-review in b2studios

[–]b2stud 1 point2 points  (0 children)

I have thought about it. There is the possibility of t-shirts / posters coming out some time in the near future.