GithubHelp home page GithubHelp logo

ninjabrain-bot's Introduction

Ninjabrain Bot

An accurate stronghold calculator for Minecraft speedrunning. Achieves better results than regular calculators by accounting for user error and stronghold generation mechanics. See triangulation.pdf for an explanation of the underlying mathematics.

NinjabrainBot

Getting started

Download the latest release and run the jar. To use the calculator, throw an ender eye, look at it, and press F3+C, and repeat for as many eyes as you like. The calculator will give you a certainty percentage of how confident it is that the predicted location is correct. If you want the certainty improved you should also change the standard deviation in the settings (see the FAQ down below for how to do this).

If you are used to perfect travel and want the same accuracy you need to set hotkeys for "+0.01/-0.01 to last angle" in the advanced options, and calibrate your standard deviation (can also be done in the advanced options).

Video guide

Full tutorial by Four

Features

  • Most accurate known triangulation algorithm
    • Accounts for user error and all known stronghold generation mechanics
    • The certainty value describes how much the prediction should be trusted
  • Subpixel adjustment
  • Evaluation of blind coords (press F3+C in the nether)
  • Fossil divine
    • Look at the fossil start and press F3+I to get the divine coords
    • Works with blind coord evaluation
    • Ender eye throws can be combined with divine for increased precision
  • OBS overlay (auto hides in OBS when it's not showing anything)
  • Lots of quality of life features

History

Ninjabrain bot was first created in November 2020, in the era of Throwpro. The bot was created because the calculators at the time were too inaccurate, especially for calculated travel which was just beeing pioneered at the time. The two most common alternatives, Throwpro and FastStronghold, used models that were too simple and were not accurate at long distances. However, back then Ninjabrain bot only existed in a more primitive form, as a twitch chat bot. The first example of it being used in a real run can be seen here.

FAQ

Is this legal to use in speedruns?

Yes, as of the calculator unban 2021-12-09 it is legal for runs submitted on speedrun.com.

The calculator said it was 100% certain but still missed the stronghold, what went wrong?

You most likely moved when you were throwing one of the eyes. It takes way longer than most people think for the player to fully come to a stop, even when your coordinates in F3 are completely stationary you still have to wait a while before throwing the eye (because of weird client-server desync). If you want to come to a stop quickly I recommend pushing yourself into a corner between two blocks, this also seems to prevent the aforementioned client-server desync.

Can I do subpixel adjustment, like in perfect travel, with the bot?

Yes. Under advanced options in the settings you can set hotkeys for "+0.01 to last angle" and "-0.01 to last angle". Pressing those hotkeys will manually change the angle of the last F3+C you did. So for example, if your resolution is 1920x1027 and your eye has a wide middle eye-slit, you would press the "+0.01 to last angle"-hotkey to adjust the angle. See the perfect travel document for more details.

What does the "Display stronghold location" setting mean?

It is just a setting that says how the stronghold location should be presented, it does not impact the accuracy of the calculator in any way.

  • (4, 4) will show you the coordinates of the starter staircase
  • (8, 8) will show you the coordinates of (8, 8) in the stronghold chunk (the center of the chunk)
  • Chunk will show you the chunk coordinates of the stronghold

What is "Standard deviation" in the settings?

Simply put, the standard deviation describes how accuretely you measure ender eye angles. The better you are at measuring ender eyes the lower the standard deviation should be. Setting the standard deviation to a small value means that the bot will trust your readings more, but setting the standard deviation too low means that the bot will be overconfident in its results. To find out your optimal standard deviation you can use the "Calibrate standard deviation" funciton available in the settings. Each players own standard deviation depends on a lot of factors such as FOV, resolution, mouse sensitivity, and experience measuring ender eyes, but the value should typically be in the range

  • 0.050 - 0.200, if you're measuring eyes in quake pro
  • 0.020 - 0.040, if you're measuring eyes in 30 FOV
  • 0.005 - 0.010, if you're measuring eyes in 30 FOV and use subpixel adjustment

What is "Crosshair correction" in the settings?

Crosshair correction is used to correct crosshair misalignment. Usually the crosshair is aligned correctly but on certain resolutions combined with certain in-game settings it is misaligned. Below is a list of known settings that cause crosshair misalignment, and what you should set the crosshair correction to. If your resolution and GUI scale are not listed, your crosshair correction should be 0.

  • 1440p Fullscreen GUI scale 3, you should set crosshair correction to 0.026.
  • 1440p Fullscreen GUI scale 6/Auto, you should set crosshair correction to 0.104.

What is "Show angle errors" in the settings?

Angle errors tell you how wrongly you measured each ender eye (assuming that the predicted stronghold location is correct). This can be used to practice your ender eye measuring accuracy by trying to get as low errors as possible. It can also be used as a sanity check in runs, if the angle errors are abnormally large you may have measured something wrong, or moved while you were throwing one of the eyes.

What is "Use advanced stronghold statistics" in the settings?

"Advanced stronghold statistics" will use the existence of other strongholds and the fact that the eye points towards the closest one to make a better prediction. This improves the accuracy and it should be turned on for 99.9% of users.

What is "Show direction to stronghold" in the settings?

With this setting enabled the bot will tell you the direction you need to go to get to the stronghold. If you press F3+C while looking down the bot will tell you what direction the stronghold is from your current position, which is useful if you have gone off angle while traveling. This will also update the distance to the stronghold, and can be done in both the overworld and the nether (in the nether you don't have to look down, however). The stronghold direction is presented as both a raw angle, as well as a relative angle (meaning how much leftward or rightward you have to turn to be on the right angle).

What is the "Lock calculator" hotkey in the settings?

Pressing this hotkey will toggle "Locked mode", with this mode enabled:

  • Hotkeys for Reset, Undo, and subpixel adjustment will be disabled, so that you do not change the result by accident.
  • If "Auto reset when idle for 15 minutes" is enabled, the calculator will not auto reset.
  • Pressing F3+C will not count as another eye throw, but will rather update the distance and direction to the stronghold from your current location (keep in mind that in order to see the direction to the stronghold you have to enable "Show direction to stronghold" in the settings).

ninjabrain-bot's People

Contributors

blu3smoke avatar char3210 avatar crsuh2er0 avatar dar9586 avatar erxson avatar exersolver avatar fabo0814 avatar gizlposu avatar groobledierne avatar jatie1 avatar javatrix avatar kuragehimekurara1 avatar lingmuqingyu avatar ninjabrain1 avatar pedrotelesh avatar rediban avatar redlime avatar vdpineapple avatar yorunoken avatar zhz0704 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ninjabrain-bot's Issues

Disable Automatic Update Detection

It would be nice to be able to disable automatic update checks/update warnings. I don't want the flashing warning light at all times, and I don't want it making outbound calls with zero way to disable it. I want to be able to check for updates on my own terms and I especially don't want to have to update every time to disable it because then it breaks my batch file.

the order in which you throw eyes might matter?

these weren't real measurements, but still i'd imagine the result should be the same
image

i also tested it with real measurements and the results were the exact same:
image

i don't really understand how it works, but i'd imagine the first situation can maybe occur in a run and it seems like unintentional behavior to me? idk if it really matters

0.0046 standard deviation btw

Settings not visible

I open the .jar file and the main window opens up fine, I hit the gear icon and nothing pops up, yet on the taskbar it shows the settings window, but if I try to click on it nothing happens.

Are divine coords for 0divine correct

I'm pretty sure I didn't mess up the F3+c part and it sent me to coords for divine 3 and not 0. If you don't have seed with divine 0 to check here is a seed: 2108312397911699510.
Screenshot (253)

Window never opens

When running the JAR file, nothing happens; no window appears anywhere.
Version 1.4.1

All advancements mode automatic detection does not work properly when worlds are pre-generated

When playing MCSR Ranked with the pre-generate all worlds option enabled, the calculator detects that the end spawn region has been created and the all advancements panel is opened before the player has entered the end.
One option is to instead detect existence of more than 4 files in the folder, which will happen once the player enters the outer end, entering a different region from the 4 at spawn

Reset issuse

When i update(click on ninjabrain bot) the bot delete result(i turn auto reset off and dont use reset hotkey)

Suggestion: being able to f3+c no matter what if crosshair is in the right pos

So for example when you try to boat eye, and you do that incorrectly, it will show the red boat and you wont be able to f3+c untill you turn off boat eye and move around/move crosshair(which will make measurement incorrect). So my suggestion is to be able to f3+c even if boat eye is red and add like a text "you tried to boat eye but it was incorrect" or something like that.
I get it that not seeing red boat is my problem but sometimes you try to do that fast and dont look if your boat is red or not, you just throw eye and only after that you realise it
Also probably thats doesnt make sense since in 99% of the times you will need to throw second eye anyways if this will be implemented but whatever, my goal is to suggest.

Issue with calibration for macOS

I am not sure how it works, but while calibrating the copy-paste doesn't seem to work for macOS, it seems to copy the commands, but it doesn't paste the commands to the Minecraft window. Is there a way to solve this?

cant calibrate on 1.19.3

i am playing on 1.19.3 my open command is on K and none other keybinds are conflicting it, when i try to calibrate and press F3+C nothing happens it just says Debug: Copied location to clipboard.
pls help

edit: now i understand that it is not about calibrating the program just does not dedect me pressing F3+C

Question about the paper - what is 'snapping'?

Hi, thanks for bringing the incredible tool to the MCSR community.

I read your paper but could not understand what 'snapping' refers to. Also, it was said that and biome snapping favors offsets towards the edges but I could not find what 'biome snapping' means. Could you give me some pointers to any resources to learn about them?

Suggestion: Add an option to auto hide after eye spy

Advancement would be detected the same way AA tracker does. It would require a pause to autosave but that shouldn't be an issue since most people pause after entering stronghold to change fov for preemptive anyway.

Not too important or necessary for most people but it is nice for say, streamers who want to have the bot gone from their stream screen as soon as its not necessary anymore. Would be a good alternative to auto hiding after a set time.

Problem of minecraft on the system linux

I tried to use this plugin with minecraft on the system linux.
I found that when I press "k", the command line will show "/" or "/k" (this may be the problem of minecraft)
Secondly, jnativehook has many wrong keycode and rawcode for linux, so the F3 + C can't be truely detected

Tool fails to work properly when the coordinates are large

I am not a native English speaker and I used Bing to translate this issue. Please forgive me if there are any mistakes or misunderstandings.

  • The tool version I used: Ninjabrain-Bot-1.4.1.jar

  • The operating system I used: Windows 11 22H2

  • The game version:1.20.1

  • The problem I encountered: When I enter large coordinates (for example: 200000,~,10000), the tool fails to work properly after throwing only one eye, and displays :

Could not determine the stronghold chunk. You probably misread one of the eyes.

This is unlikely to happen when playing single-player, but it sometimes happen when playing on a server and using random teleportation.

  • The expected result: The tool can handle any valid coordinates correctly and give a brief hint about the stronghold generation range when the coordinates are too large, because I learned from the Minecraft Wiki after several failed attempts that strongholds only generate within a certain distance.

  • The steps to reproduce the problem:

  1. Create a new save
  2. Teleport to (200000,~,10000) or even farther
  3. Throw an eye and look at it, press F3+C

1.4+ Doesn't work on linux

Hi o/
It appears that since 1.4.0 and and onward, the mod crashes after the loading screen when ran on linux (Pop!_OS 22.04, kernel 6.2.6). The 1.3.2 version works well however.

java -jar Ninjabrain-Bot-1.4.1.jar 
[main] Language: Français
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f1a2a297f74, pid=39940, tid=39942
#
# JRE version: OpenJDK Runtime Environment (17.0.7+7) (build 17.0.7+7-Ubuntu-0ubuntu122.04.2)
# Java VM: OpenJDK 64-Bit Server VM (17.0.7+7-Ubuntu-0ubuntu122.04.2, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x97f74]  pthread_mutex_lock+0x4
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/grooble/Téléchargements/core.39940)
#
# An error report file with more information is saved as:
# /home/grooble/Téléchargements/hs_err_pid39940.log
#
# If you would like to submit a bug report, please visit:
#   Unknown
# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#
Abandon (core dumped)

And here is the log file mentioned in the error

hs_err_pid37821.log

Don't hesitate to ask me if you need more details.

SUGGESTION

Maybe make it so hotkeys only work when tabbed into minecraft, in that case you don't accidentaly reset your eye throws when typing something

Window glitching out while dragging it around

Running any version of the bot, window completely freaks out while being dragged, jumping all across the screen. When stopped dragging, window appears in the correct position.

System: Ubuntu 22.04.3 LTS 64bit

Ninbot 1.4.2 numpad hotkey issues.

Updated to 1.4.2, read that some hotkeys can get messed up, so I went to re-set them. Realised that you (at least for me) can't set numpad specific number keys as hotkeys.

In 1.4.1 and earlier, I can have a hotkey set to "NumPad-6" or "NumPad-3" etc. I try to set this back up in 1.4.2, pressing numpad 3 when binding a key, and the only thing that appears in the hotkey window is "3", and my "normal" 3 key (the one over W/E) now ALSO triggers that function. (which is an issue because hotbar / piechart)

I assume this isn't intended?

"Non-numpad-number" keys work fine from what I can tell. This includes some keys like numpad+ and numpad-, although they're called "0xe4e" and "0xe4a" respectively in ninbot hotkey menu, which I assume is like the ahk "code" for the keys?

Suggestion: Exported telemetry

Hey! Just thought it would be cool if the bot had a feature where, along with the OBS image it dumps, it could output a basic .txt file with the data it displays on screen. This could be as simple as just displaying the percentage and the distance, though I'm sure if you wanted you could put all of the data. This would let people customize/drive displays other than the OBS display. Thanks!

Ninjabrain open but not there

Whenever I open ninjabrain bot, it opens a window but it is like blank and I can't use it, like it shows up in taskbar and task manager but there is no application, I didn't change anything or update anything, I closed reopened it earlier today and when I reopened it wouldnt show up, when I try to maximize it a white/black box appears
Screenshot 2024-01-24 012936

Settings not visible v1.4.3

Detecting F3+C input and the Undo and Reset buttons work normally.
Just opening the options window doesn't work. You can click the Options button, but nothing really happens.

my system:
windows 11
AMD Ryzen 5 5600x
NVIDIA Geforce RTX 3090
language: korean

Ninjabrain Bot v1.4.3

graalvm-jdk-17.0.11+7.1

Suggestion: divine travel by a button

So there is rn 2 possible divine travels, one if there are mobs in your 0 0 owerworld chunk, if yes you go to certain coordinates to nether
and by block of generation fossil on 0 0 nether chunk, so i thought
What about if would show you like one line of text where it says go to X X coordinates in nether if u had animals in your 0 0 overworld chunk
and if you f3+c in nether it would show you that divine table in text

this has a lot of possible implementions thats what my best one is

Suggestion: Add an option so that in detailed view, only overworld coords or nether coords are shown

I don't think there's any point to having both displayed at once, and it just takes up more space.

It would be sufficient for most players to only show nether coords or overworld coords based on whether the last f3+c was in nether or overworld.

The only time you really want both displayed at once is right after initial measurement, for judging whether to travel through overworld or double travel through nether, but a blind close enough to warrant overworld travel is rare unless you are blinding without enough obsidian for second portal, in which case it really wouldn't be a time loss to f3+c while running/pearling towards the coords in overworld to show overworld coords, so it would be viable to default to nether coords (even though initial measurement is done in overworld). Alternatively, have an option to show both until, the first non-measurement f3+c.

Also, a keybind to toggle between showing (4,4) and chunk coords would be cool.

calibration no longer works in 1.19.3+

In 22w42a, the placement code for the stronghold was changed to be more efficient, causing stronghold positions to shift.

Because of this, whenever I try to calibrate in 1.19.4 it gives me a way too high number for standard deviation (around 4). I have tried with "use advanced stronghold statistics" on and off, and when I calibrate in 1.16.1 it works perfectly fine.

(edit: nevermind I didn't see the 1.19+ button my mistake)

Wrong version warning inconsiderate of Nvidia drivers + Sodium

In 1.19+ with sodium & NVIDIA drivers, the title will say Minecraft* (version hidden from driver) instead of stating the actual version.
This means that the warning label for using the wrong Minecraft version will pop up regardless of if it is 1.9-1.18 or 1.19+.

Unable to use "Create new theme"

Not really sure why, I'm not able to use this feature.
I can select others prefabricated themes, but nothing happens when I click the "Create new theme" button.

Immediate crash on launch

1.4.0 immediately crashes on launch (shows loading screen for ~0.5s)

> java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

Took a look through the code for log/saved preferences locations but didn't dig too deep. Can provide logs if there's a way to do so. Guessing that it's a preferences conversion error but hard to say.

Minor formatting problem

When at coords (-xxxx, -xxx) that are okay for highroll, the "okay for highroll" doesn't show up because there is not enough space. It appears on large scale setting but most people use the small scale.
ninbot

A Java Exception has occurred

I have a Java Exception has occurred on ninjabrain bot 1.4.0 with the latest version of Java. But the 1.3.2 work.

Inaccurate Trangulation

Ive been trying this for about an hour or three and about 2/5 times I throw an eye The stronghold triangulation is inaccurate. Even though I wasnt moving and sometimes It would be inaccurate for about 2000 blocks

Cannot change language

bot automatically downloaded in Russian, when I selected English in the settings and relaunched app, only the names of languages and settings titles sizes have changed, but the bot itself remained in Russian.
https://youtu.be/DH8gdjcZ9kU video for showcasing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.