And this headline just in...
Ok, tonight is turning out to be a live breaking news story or the like... all very exciting… well, kinda. I've started to move onto the next part of the problem of getting physical data into the game which is getting it out of the device (assuming it ever gets built)
Sooooo... the options are Python, Processing or C++... ok, I'll cut straight to the chase here- as loath as I am to choose it (seriously... I cannot emphasise my contempt for the dammed thing), Python will do for now as all I need is something quick & nasty to rip the data out and fire it into a binary file... seeing as I've pretty much gotten the hang of getting Python to communicate with stuff through serial connections from the last project I may as well stick with it for the time being.
I swear to god though- if I've spare time (even a day) I will be doing my best to figure out how to do the connecting & file creation in C++ and I'll be making a nice little self contained exe without bloody Python. I don’t think I'll go with Processing for this thing as it’s really not what it's designed for (it’s more of a graphics thing... not a file manager & serial communicator!)
Ahem, anyway- I ploughed ahead into Python with the binary stuff. I was a bit rusty at first but soon got the hang of file I/O and needless to say it became quickly apparent that I needed to download yet another blooming library (thankfully no dependent libraries though) to do the simple binary stuff I wanted to do.
The base version of Python can read bytes from binary files BUT it instantly converts them to strings which is a bit of a pisser. Anyway, one download of NumPY later and I got the hang of some of the module functions and now, long story short, I have Python merrily reading and writing binary files.
Here's where things get interesting though... when Python reads in the same binary file as the game was reading in, it also seems to be reading in the bytes in backwards order... what the hell is with computer people!!! Why can’t ye makes things bloody straight forward!!! You know!! Some of us are still human and not computers!!!...
Anyway- I suppose I should be happy as it means everything is consistent and that the machines are happy at any rate- who cares if humans can’t read the files, the computer is all that matters... grumble grumble
Moral of the story- humans shouldn’t edit binary files, we're backwards to computers apparently
Sooooo... the options are Python, Processing or C++... ok, I'll cut straight to the chase here- as loath as I am to choose it (seriously... I cannot emphasise my contempt for the dammed thing), Python will do for now as all I need is something quick & nasty to rip the data out and fire it into a binary file... seeing as I've pretty much gotten the hang of getting Python to communicate with stuff through serial connections from the last project I may as well stick with it for the time being.
I swear to god though- if I've spare time (even a day) I will be doing my best to figure out how to do the connecting & file creation in C++ and I'll be making a nice little self contained exe without bloody Python. I don’t think I'll go with Processing for this thing as it’s really not what it's designed for (it’s more of a graphics thing... not a file manager & serial communicator!)
Ahem, anyway- I ploughed ahead into Python with the binary stuff. I was a bit rusty at first but soon got the hang of file I/O and needless to say it became quickly apparent that I needed to download yet another blooming library (thankfully no dependent libraries though) to do the simple binary stuff I wanted to do.
The base version of Python can read bytes from binary files BUT it instantly converts them to strings which is a bit of a pisser. Anyway, one download of NumPY later and I got the hang of some of the module functions and now, long story short, I have Python merrily reading and writing binary files.
Here's where things get interesting though... when Python reads in the same binary file as the game was reading in, it also seems to be reading in the bytes in backwards order... what the hell is with computer people!!! Why can’t ye makes things bloody straight forward!!! You know!! Some of us are still human and not computers!!!...
Anyway- I suppose I should be happy as it means everything is consistent and that the machines are happy at any rate- who cares if humans can’t read the files, the computer is all that matters... grumble grumble
Moral of the story- humans shouldn’t edit binary files, we're backwards to computers apparently

0 Comments:
Post a Comment
<< Home