Sunday 24 February 2013

Making a Pipboy-3000

I went to San Diego Comic-Con 2011 dressed as a vault-dweller, and I wore a custom  Pipboy 3000 prop that I made myself. It was a poorly made mess of wires and barely worked, but I posted a video that made it look pretty nifty :



I received quite a few requests to share the Android app or make a tutorial, but I haven't done so for a couple of reasons; the code was hacked together very quickly over a few weekends and it would embarrass me to release it, and the app relies on a bunch of assets from Fallout that I don't have permission to distribute.

Recently I wrote a script to pull out all the necessary assets out of a game install, which left only my desire not to be judged on the terrible code, which I think I can swallow provided the following disclaimer is attached:
  • Don't judge me on the pipboy code! It was hacked together over a few weekends as an experiment at the same time I was frantically working on the rest of the costume. There are (many) memory leaks, buffer overflows and generally unsafe coding, and a gross misunderstanding of how to use OpenGL properly (it was my first experiment with OpenGL too).
  • The Java side is almost a complete mystery to me. I don't know Java at all, and it's massive hodgepodge of official samples and code I've found online cobbled together. Expect crashes and force-closes all over the place. I'm sure it will kill your battery too.
  • I'm working on my costume for the next SDCC right now,  and I'm finished with this project. Everything is provided as is and I don't have any time to support any of it, sorry.
With that out of the way, on to the fun stuff.

Install the apk

You can find the source code for everything on my GitHub but the easiest way to get started is to download and install the apk, which you can download here. I don't want to go into how to install apks here since it's pretty easy to Google. Once you've installed it if you try to run it straight away, you'll find that it just gives an immediate error, since it can't find the configuration files.


Creating the configuration files


You'll need a working install of either Fallout 3 or Fallout New Vegas at this point. If you don't have them, then go to Steam or another online merchant and get them right now! After they're installed, you'll want to grab my data collection script from here, and then extract it somewhere.


Open up a command terminal and navigate to the directory you extracted the script to. Type pipboy_create_data.exe [output_directory] [path to your fallout game]. You can also put the paths to both games if you want the music from both. After a while it will finish, and you should be able to look into the output directory and find a bunch of files like this:


Note that the data.zip is enormous. It contains all the music from both games in an uncompressed format (I was in too much of a rush to handle compressed formats, sorry!). You will almost certainly want to go into the zip file and remove those music files that you don't want, and update the music.txt file accordingly. You can also give the tracks full names, since by default they will just be named the same as the file. It should look something like this afterwards:


You can also customize everything else at this point. Have a look at the files and see what you can change. Be careful with the formatting though, remember that the code is held together with string.

When you're happy with it, copy it to the root of your sdcard in a directory called pipboy and then when you load the pipboy app, you should be greeted with a lovely Pipboy screen (after a lengthy loading process):


There is a rudimentary touchscreen interface where you can swipe between views, move up/down/left/right by touching in that general part of the screen, and long press to select. Pipboys don't have touchscreens though, so next you'll want...

Physical Buttons

For my video, I used an Arduino with a USB Host shield running Microbridge to act as an ADB debugger for the phone, which would then set up a tcp tunnel and send control packets to the phone when buttons were pressed. It worked, but it was way too complicated, and quite flakey since the phone wants to charge from the arduino which is running from a battery.

If you want physical buttons, (and why wouldn't you?) I would encourage you to try another approach, probably involving using the phone as the USB Host (I was running gingerbread at the time which I don't think can do that). If you want to reproduce what I did though, the sketchbook is on the GitHub, and the following pictures might help you to wire it up:


100 comments:

  1. what is the directory of the sd card? once it is on the sd card i still get the error, and i mad a folder called pipboy and that is where everything is located.

    ReplyDelete
    Replies
    1. Did you do the command prompt thing? You'll need to do that

      Delete
  2. Hey! Good job on this! :) I have followed your instructions but still have a problem. When I'm trying to load the app on my smartphone, I receive an error telling that app couldn't load a file called "monofonto_verylarge02_dialogs2". Any ideas what should I do? :)

    ReplyDelete
    Replies
    1. I have the same problem... anyone can help us?

      Delete
  3. appel or Google must make one of these and than a keybaort atached to the screen i would buy on that would be like a computer you carry arrount your arm and its bigger than a pone so hardware could be all arount your arm and there could be even better hardware in it then the best phones also a really cool look to it

    ReplyDelete
  4. also if google made this their could be a extra battery bacause its so big and then you can attach google glass to it and the battery life would be awsome

    ReplyDelete
  5. I must have done something wrong somewhere, this is all I got cmd to do:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    D:\Users\Desktop>D:\Users\Desktop\pipboy_create_data\pipboy_create_data.exe "D:\
    Users\Desktop\pipboy_create_data" "D:\Fallout 3\Data"
    Traceback (most recent call last):
    File "", line 376, in
    IOError: [Errno 2] No such file or directory: 'perks.txt'

    D:\Users\Desktop>

    ReplyDelete
  6. Gabriel, you need to change directory first before running the command, so something like:

    "cd pipboy_create_data"

    first. Poor coding on my part, apologies.

    ReplyDelete
    Replies
    1. Thanks a lot, I'll see if this works.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. "monofonto_verylarge02_dialogs2.fnt" How i fix this?

      Delete
  7. I have gotten everything ready, but now there is a problem with my phone not installing. I'll have to try this again when I get a better phone.

    ReplyDelete
  8. I got an an error in the cmd also
    it said "IndexError: index list out of range"

    ReplyDelete
  9. Yep, It works. But I had to put it on my tablet, so I have the world's biggest pip-boy now.

    ReplyDelete
  10. Wow, this is amazing. Thank you very much.

    ReplyDelete
  11. It says that 'Pipboy_create_data.exe' is not recognized as a internal or external command

    I followed your instructions to the every last detail, hence there must be something i'm missing?

    ReplyDelete
  12. I commented on your youtube video about these: (https://www.sparkfun.com/products/10441). They seem like a passable solution to get working lit buttons. Kinda wish someone would do this without the android phone. Even if I had the parts, I don't have an android device. Really, with decent graphics lcd, an arduino /arduini clone can probably handle this alone, or at least with some "minimal" supplementary circuitry (like a second microprocessor to just handle the screen).

    ReplyDelete
  13. I got an error:"Error Loading font from file monofonto_verylarge02_dialogs2.int"

    ReplyDelete
  14. It works amazingly, but how can I turn the music on? ^^ also, any chance to have it green/black?

    any directions will be fully appreciated by this traveller

    ReplyDelete
  15. How dumb I was, I solved the music problem later without further complication, my bad. It works like a charm.

    Anyway, may I ask what should I tweak to have a green display instead or yellow, please? :D I am very interested in having a green display

    ReplyDelete
    Replies
    1. Hey Dani, I was wondering if you still have your .apk available for me to download and edit my own stats. I can't seem to figure this out no matter how hard I try.

      Delete
  16. Dani, to change the colour you just need to edit the file config.txt on your sdcard with the RGB values that you want, you can change a bunch of other options in there too.

    You may need to reboot for it to take effect though, I'm not sure why but it seems to cache it sometimes

    ReplyDelete
    Replies
    1. Thank you, I did so. Also started tweaking more stuff like adding own items and such. Thanks for sharing this stuff, it made me happy! next step will be crafting the housing from scratch (the official clock one is starting to go way too expensive).

      Delete
    2. How did you add your own items.

      Delete
  17. thank you Tom!!!!!!! I'm gonna try that in a while

    ReplyDelete
  18. Please help. I am not that good with programming and I am stuck on the first part of the setting up the configuration part. So I ask that may you please make a video, not only for me but for the other people that are having trouble. thank you

    ReplyDelete
    Replies
    1. Im having the same problem as you did you ever get it

      Delete
  19. add an internal wire harness (pretty much just the outside except without the screen and where the screen goes put the natural curl) and also you could wire the buttons up so that the wires connect like the buttons on a mouse (except for the fact that there are three) and then have the buttons be bendy plastic (like the stuff they use for floppy disks except kinda see through and a little more floppy you should know what I'm talking about I hope) so It is the full Pipboy 3000 that goes on your arm now these are just suggestions.

    ReplyDelete
  20. What is the max wire travel distance for most of that wiring? If you could run a few cat6 cables (probably 4 total? 2 for each direction?) from the unit, down your arm, to a project box somewhere on your person and back again, it might be wearable...

    ReplyDelete
  21. One question. The display is upside-down. The status bar is on the bottom of the screen and no matter what way I rotate the screen, It just stays the same. With the status bar where it should be and the app upside-down I mean. Do you have a quick-fix? Or just a fix?

    ReplyDelete
  22. This cant load more than 85% in the loading process in the Android.
    I have an Xperia GO. Can anyone help me? D:

    ReplyDelete
  23. It took a bit of time for it to finish.
    Is that normal?
    Also if my game was modded would that effect the process?

    ReplyDelete
  24. I'm getting this error
    http://i.imgur.com/xkiz5Eo.png
    after following the tutorial perfectly. My file's directory is/storage/extSdCard/pipboy. Is there I way I can make this work?

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. Ok I've hit a snag
    Here is whats happening...

    C:\Users\TXGorilla>cd/pipboy

    C:\pipboy>pipboy_create_data.exe C:\PipData D:\Program Files\Steam\steamapps\com
    mon\fallout 3
    Failed to find font, is your fallout installation complete?

    C:\pipboy>pipboy_create_data.exe C:\PipData D:\Program Files\Steam\steamapps\com
    mon\fallout new vegas
    Failed to find font, is your fallout installation complete?

    ReplyDelete
    Replies
    1. change it to the data folder inside

      Delete
    2. Ok Well Ive got a step forward at least...
      I copied the Misc Sound Textures and Voices *.bsa files into a lower directory... D:pip\ is what I used... now I have it running clearly... with the exception of the screen is upside down... and cant get the music to play

      Delete
    3. You have to press the screen without moving for a couple of seconds.

      Delete
  27. Replies
    1. Did you ever fix it? I'm getting that error too.

      Delete
    2. You have to put the whole directory location in quotes.

      Delete
  28. im having trouble using the command prompt Create the configuration files

    ReplyDelete
  29. hey guys, i managed to get past the failed to find font issue! At first i tried with fallout 3, then with fallout new Vegas separately but when tried them together, making sure that the " " was around each one It worked for me!
    my setup is on windows 7 64bit, with fallout 3 goty and fallout new vegas from steam.
    so my working code was this, making sure that i was cd'd into the correct folder with another one inside it labled out.
    cd c:your file location.
    pipboy_create_data.exe out "C:\Program Files (x86)\Steam\SteamApps\common\Fallout 3 goty\Data" "C:\Program Files (x86)\Steam\SteamApps\common\Fallout New Vegas\Data"

    i did need to enter this a few times, as it kept getting permission errors for a temp location it was using, but it worked in the end :)

    ReplyDelete
  30. oh and changing to other screens does not work for me thus far, as its configured for the hardware buttons tom added to his device. but i shall try to get at it with a usb otg cable and see how we get on :)

    ReplyDelete
  31. This comment has been removed by the author.

    ReplyDelete
  32. This comment has been removed by the author.

    ReplyDelete
  33. Suggestion: Maybe you should make a video and put it on your youtube channel for this.

    ReplyDelete
  34. This comment has been removed by the author.

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. Thank you for this tutorial. I have 2 statements. 1. Can i possibly make a video and post it to my youtube channel, thetankfrog568, where you can add it here and i will give you full credit. 2. It would be cool if you can select the items, but I found out a way to make a scertain item be selected

    ReplyDelete
    Replies
    1. Of course you can make a video. I've long since moved on to other projects, so I haven't been able to offer any help to people struggling to make this work, so by all means.

      Delete
  37. I know this is fairly late, but whenever I go through the process i fail to receive a music.text file when creating the config files. Any clue what I may be doing wrong?

    ReplyDelete
  38. Люди ПОМОГИТЕ ПОЖАЛУЙСТА!!! Как я не пытался сделать файлы конфигурации,у меня ничего не получалось!!(( 7 месяцев я ничего не мог сделать((( Пожалуйста у кого всё получилось,скиньте мне файлы конфигурации которые у вас получились мне по скайпу,если что мой скайп miha007xxx,я ВК id179379286.Помогите пожалуйста!Заранее спасибо!

    ReplyDelete
  39. There's a rather identical (designwise) pipboy that I've seen that fits around the arm. No sound however. Is there a connection there?

    ReplyDelete
  40. app closes at about 76%, although its possible it could be my phone...

    ReplyDelete
    Replies
    1. Probably you have too much music in music.txt (see my post down below)

      Delete
    2. Where did you put the files in your phone can't seem to get passed the screen with the fatal error since it isn't really specific.

      Delete
  41. Guys, here is some info for you:
    1. Do NOT extract .zip file to SD Card, instead copy there .zip
    2. There will be probably too much sound files in music.txt, which makes the app crash during loading
    3. If app loads, but screen will be black, try lock your screen on smartphone or tablet, and unlock it (it works like this on my mobile)
    4. If you get error during loading screen about bad image file, you have to change that name in .txt file (for example, in perks.txt perk "Amazing beard" has picture "perk_life_giver.png", BUT in .zip file is "perk_life giver.png" (without second _ ))

    Also, on my mobile button for "menu" work as "confirm" (as if you hold your thumb on screen).
    And don't forget to swipe to right/left, if you want to see your items or listen to music files ;-)

    ReplyDelete
    Replies
    1. Jakub, what does he mean by copy it to the root of the SD Card. Please tell me. I have a galaxy s4. Reply back at epicdavid_04@yahoo.com

      Delete
  42. If you ever come back to this project - It might be worth looking at using a Teensy for physical controls and LED.

    It's an absolutely tiny chip and acts as a native HID controller (which means later version android will pick it up as a keyboard automatically.) Connects via usb, so could use an OTG cable to connect it directly to android device.

    Just a thought.

    Also, "#define DATA_DIR "/storage/sdcard0/pipboy/""is the devil.
    Galaxy S4 uses extSdCard for the external sd, sdcard0 is internal, and your code doesn't play nice with recompiling in eclipse, which seriously cuts down the amount of data I can have :(


    ReplyDelete
  43. Hah, you're right about hardcoding that path being evil! In my defence, I knocked this up in a few weeks for a cosplay a few years ago and I intended to be the only user!

    ReplyDelete
  44. Has worked surprisingly well, once you take that into consideration.
    I've got it running flawlessly on my Galaxy S4 (with 300mb of data.zip clogging up my 8gb internal memory, noooooo)

    It's stable, and it works (although it letterboxes to maintain aspect ratio).

    I'm 3 pieces of http://www.thingiverse.com/thing:109716 away from finishing the physical build - Hopefully it'll do your earlier one proud!

    ReplyDelete
    Replies
    1. Kiah, how did you put it in the internal memory? Isn't it suppose to be in a SD Card? If you can explain how you got access to it please tell me.

      Delete
  45. could you post a .zip on the data files so we dont have to buy the fallout game? i dont mind what the data is i just want the app to run

    ReplyDelete
  46. Hi :)
    I just found this and got it running on a tablet.
    only problems i got is the screens upside down, and not sure how yo get to the other screens via the touchscreen. also wheres the github? would like to try making physical buttons but no idea where to get the arduino code.

    any help will be great :)

    ReplyDelete
    Replies
    1. actually i worked out the screen controls, its just the arduino code im after now X3

      Delete
    2. https://github.com/tompudding/pipboy

      Delete
    3. thanks dude :) been wanting a pipboy for my androids for ages ;)

      phone wont find the /mnt/sdcard tho since nowadays they tend to put them elsewhere like /storage/sdcard or ext-sdcard or watever. any way round this? some kind of path redirect in the system perhaps?

      Delete
  47. why doesn't it work if i have mods installed

    ReplyDelete
  48. After much effort i run it. But i have not readable text and pip boy is not in full screen.

    ReplyDelete
  49. Oh great and powerful Tom, creator of the code. I ask you, please help me. You see I have same problem as "Bongmaster" my phone can't find the /mnt/sdcard as the sdcard is in /storage/sdcard . If you could tell how I redirect the path the code takes or even what file that part of the code is in and where it's at I would be so thankful.

    ReplyDelete
    Replies
    1. You can use my Pip-boy 3000 app
      https://www.youtube.com/watch?v=CJawcUnB3ss

      Delete
  50. I have a HTC one mini, which doesn't have an sd card, what can I do?

    ReplyDelete
  51. Check my pip boy3000 app for android https://www.youtube.com/watch?v=5tCEXEuICWs !

    ReplyDelete
  52. This comment has been removed by the author.

    ReplyDelete
  53. I dont understand where i have to save the file on my android device to get the app to work?
    Help?

    ReplyDelete
  54. This comment has been removed by the author.

    ReplyDelete
  55. Alright so I managed to fix the Index Error Somehow but now I'm getting a error saying "Failed to Find Font File, is your fallout installation complete?"

    ReplyDelete
    Replies
    1. Dang now I'm back to the "Index Error" this is how I'm doing it. C:\Users\Andrea18\desktop\pipboy_create_data "C:\Users\Andrea18\Desktop\pipboy_create_data" "C:\Program Files (x86)\R.G. Mechanics\Fallout New Vegas - Ultimate Edition\Data" But it loads some .mp3 files but after 2 seconds it gives me that error.

      Delete
    2. Ok, so I managed to get through the index error again and the Font File. But when it gets all music files. It doesn't get the configs, items, perks, skills, and specials. Just the music. In the pictures in this tutorial he has stuff.

      Delete
    3. Ok, so now i have everything ready. But where do I put the files? Do I go to the actual /mnt/sdcard? or like you said the "root" of the sdcard. Please be more specific with your projects.

      Delete
  56. Hi man. Great work! I followed the tutorial but im stuck on the prompt. Look what i write first:
    cd pipboy_create_data.exe C:\Users\Utente\Desktop\pipboy_create_data out "C:\Users\Utente\Desktop\pipboy_create_data>pipboy_create_data.exe" out "C:\Program Files (x86)\Steam\steamapps\common\Fallout 3 goty\Data"

    I know i write it wrong, but can someone tell me how to write it?

    ReplyDelete
  57. mmh it work on the pc but the app dont regocnize the the data at /mnt/sdcard/pipboy.
    i have a Nexus 5 and it has no external sdcard only the memory inside.
    is there a way to change the file path? the nexus has root for changes

    ReplyDelete
  58. I have the Galaxy S6 which doesn't have the SD card, where do i put it so i don't get the error?

    ReplyDelete
  59. Hello, i would ask if someone got a fix for "monofonto_verylarge02_dialogs2.fnt"??
    or
    Can anyone who working for him upload his "monofonto_verylarge02_dialogs2.fnt" from his data.zip folder?

    ReplyDelete
  60. i do everything here, but when i start the app, appear the same fatal error menssage, what can i do to fix it? i'm downloading all stuff from "out" in a paste named pipboy

    ReplyDelete
  61. Nice Job! like your pipe Boy ^^

    ReplyDelete
  62. If you need a help with Java may I can Help You, I work on Java SDK development.

    ReplyDelete
  63. Hey I just watched your vid this year and I was wondering if you can give me a download link to the pip boy app

    ReplyDelete
  64. No existe un directorio con el nombre de mnt, ¿alguna forma de cambiar esto?

    ReplyDelete
  65. Hi guys, I wanted to download app, but I was told by dropbox that it does not exists there. Is here someone who could share the app with me, please? Thank you for any reply

    ReplyDelete
    Replies
    1. This was already fixed by author. Thank you

      Delete
  66. I know someone already requested this but the dropbox link is down again for the script thing, would you be able to fix it?

    ReplyDelete
  67. Schick quattro Titanium Art, Art & Crafts - Titanium
    Schick quattro Titanium Art, Art winnerwell titanium stove & titanium men\'s wedding band Crafts · Product · Special Projects · apple watch aluminum vs titanium Creative iron titanium Director · View topic. · Related Pages · columbia titanium More Details.

    ReplyDelete