I’ve been messing with this game “Teardown” that uses little 3D cubes called “voxels” to build objects and terrain.
When I started, there were only two editors that would build things for it, and I wanted to understand it better – so I dove into some tools to see what makes the .vox file format tick.
I finally found some code that I could adapt – in python – so I’ve been working on making that work. If I had the ability to create .vox files programmatically, then I could do nearly anything and automate it – instead of doing things by hand. (Although I still do from time to time.)
I’m at the point where I can create my own .vox models and import them into the game, purely with code. This is awesome. But so what? you may ask.
I’ve been wanting to recreate a small part of the open-outcry trading floor environment that I used to work in long ago. I started with the idea of having the quoteboards first.
That’s nice, but they were circa 2008, so they didn’t use LEDs. They were flipdots. These are small discs that are switched or ‘flipped’ on a side with an electromagnet.
So they have particular characteristics and I’ve been working on making that happen. I made a model in a 3D editing program that I can drive with code to flip the correct dots for a given number or letter.
The only other problem is that the game doesn’t allow you to read local files or write them. This is mostly a security thing, because they allow mods to be made for their game and if they allowed a mod to have file access — some bad actors could do nasty things like wipe your drive or overwrite something important.
This means that the data needed to drive my quoteboards – which would be contract, price, etc couldn’t just be read in using a text file.
So the next step is to make a web-scraper in python, (I’ve done it before, so it isn’t too hard.), then have my voxel writer encode the numeric/character data into color values.
In the ASCII table – there’s a decimal number for each character and number. This works for me, because colors can range from 0 – 255 and the table itself only goes from 0 – 127.
That’s including a bunch of special characters I may not need, but why not.
So, if I were to encode something like a contract symbol ‘SPH2’ – S&P500 Futures March 2022 futures contract — It would look like this in ASCII — 83, 80, 72, 50
In a color it would be Vec(83, 80, 72) one color and then Vec(50, 0, 0) for the next
Obviously I’d pack these together with delimiters so I could strip out the data again, so ideally it would be like — :SPH2: — using colons to separate things.
Point being, I’ll be able to scrape a website/datafeed, get the quotes, and encode it into R,G,B colors and write a voxel model that I can import into the game and ‘read’ the data from it.
More to come, just getting started…