Super Hexagon Bot
crackedopenmind.com
Super Hexagon Bot
1–10 of 31 posts
Re: Super Hexagon Bot
#2Re: Super Hexagon Bot
#3Re: Super Hexagon Bot
#4Once you remove all the human-confusing effects, the levels are actually very simple, being just 4-6 columns. Since the minimum thickness of obstacles is quite high and they are aligned with each other, you could even represent the level as a graph, and run your pathfinding without having to manage the geometry explicitly.
But then again, I'm the guy who thought about implementing a bot when the game came out, instead of actually doing it.
Re: Super Hexagon Bot
#5Hmm, I'm a bit surprised that some sort of ad-hoc AI is used, instead of extracting the topology of the level and running a pathfinding algorithm on it. Once you remove all the human-confusing effects, the levels are actually very simple, being just 4-6 columns. Since the minimum thickness of obstacles is quite high and they are aligned with each other, you could even represent the level as a graph, and run your path…
Re: Super Hexagon Bot
#6Watching my son play is quite the experience. It seems my reflexes are not what they once were. It's an amazing game.
I want to think that writing my own bot would count as beating the game, but I doubt my son would say it counts. So, here's to the next few thousand attempts at level 6. "Again!"
Re: Super Hexagon Bot
#7Re: Super Hexagon Bot
#8From the article:
> Of course, because we replaced the function with our own, we have to actually swap the buffers by explicitly calling the original glutSwapBuffer() function. I did this by undoing the hook, calling the original function and hooking it again.
Background qualification: I do this sort of debug launcher + DLL injection thing a lot. For one example with source, see my tool header magic ( http://www.romhacking.net/utilities/796/ )
As someone with experience, please take it from me: this is a really bad idea. If you rewrite functions to call the originals, it becomes possible for another thread to call that function in the middle of your rewrite, and end up executing illegal instructions. Not only is this theoretically possible, it routinely happens all the time. Even when you think for sure that your program is not multi-threaded. Even something like hooking a Windows file size function, you'll learn that the open file dialog on Windows Vista+ is threaded, and will bomb out on you with alarming frequency.
The proper way to do this is to create "trampolines" instead. The idea is that you copy the first few instructions from the original routine, and put them somewhere else. And at the end, you jump back into the original function after your patched jump. The address of where you put the original instructions is your pointer to the "original function" that you can use if you want.
So basically, something like this:
originalFunction:
opcode1
opcode2
opcode3
Becomes: originalFunction:
jmp detourFunction
nop
resumeAddress:
opcode3
trampolineFunction:
opcode1
opcode2
jmp resumeAddress
detourFunction:
call trampolineFunction
Now, I know this sounds horrifyingly complicated: you probably think you'll need a full-on x86/amd64 disassembler+assembler. And it's theoretically possible to make a near-impossible function to trampoline. But keep in mind that 99% of APIs are built in higher level languages, and as such, have very consistent function prologues (usually saving the stack frame.) So in practice, you can write trampoline installers using one or two "signatures" and hook nearly every function you'd ever want to.But if that seems too challenging, there is also a library called Detours ( http://research.microsoft.com/en-us/projects/detours/ ) that you could try instead. I didn't find it necessary for my own purposes.
Re: Super Hexagon Bot
#9Ever since my 8-year old son beat the game multiple times on level 6, I have been working on getting there as well. The best I have made has been 19 seconds on level 6 - though I have beat the first five levels, level 6 is truly insane. Watching my son play is quite the experience. It seems my reflexes are not what they once were. It's an amazing game. I want to think that writing my own bot would count as beating th…
Re: Super Hexagon Bot
#10Ever since my 8-year old son beat the game multiple times on level 6, I have been working on getting there as well. The best I have made has been 19 seconds on level 6 - though I have beat the first five levels, level 6 is truly insane. Watching my son play is quite the experience. It seems my reflexes are not what they once were. It's an amazing game. I want to think that writing my own bot would count as beating th…
I think my level 1 record is somewhere near 10 minutes now.