-
Posts
3,788 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by Nuke
-
so a few days ago i was playing around with one of those esp8266 internet of things modules. its a nifty little gadget that lets you connect anything with uart to wifi. it got me thinking, what can i do with this fun little gadget. i played with moving strings between computers and my arduino. rummaging through my dev boards i found several camera and lcd modules i can play with and so decided to see what kind of images, possibly even video i can send over wifi. it has all kinds of applications, remote rendering to portable devices, wireless cameras for drones and robots. there is one small catch, the maximum data rate is supposed to be around 2 megabit so i need compression. i cant just use something off the shelf or out of a library found on github. i need something that can compress fast and decode even faster. i will probibly be running it on an arm arduino. so im going to need to cook up some algorithms. time for some science! in fact i had spent the last 3 days working on the required tools to do some reserch, and around 1:30 am i smashed the last bug and was ready to start writing some algorithms to test. i drew a lot of inspiration from the way block compression algorithms for game textures work. you turn an image into a bunch of small cells, and use indexed color to reduce the bits per pixel. dxt1 uses 2-bit color indices, so each cell has only 4 colors. however it only needs to store 2 colors with the cell, the brightest and darkest presumably, and interpolates 2 more intermediate colors. its color data is 16 bit, and so 32 bits go to pixel indices, and the other 32 go to colors, so it only takes 4 bits per pixel. my first attempt was on a grayscale image. i know i can get better than 4bpp with gray. im using a 5x5 block, the reason is i needed an extra 6 bits. unlike dxt1 which uses floating point interpolation, my format only stores a single grayscale value. i also store a 6 bit delta value, so i can use simple addition, multiplication and bit shifts to do the arithmatic. this is a data map one of the blocks: --in binary the image would be in the format: (1 char = 1 bit) -- PpPpPpPp PpPpPpPp - pixels 0-7 -- PpPpPpPp PpPpPpPp - pixels 8-15 -- PpPpPpPp PpPpPpPp - pixels 16-23 -- PpDddddd Oooooooo - pixel 24, delta, offset -- total size: 64 bits, bits per pixel: 2.56 --compression algorithm - 1 determine the extents of the pixel values in the block, these are valueMax and valueMin - 2 valueRange will be calculated as valueMax-valueMin - 3 the delta will be calculated as follows: valueRange/4 (the division can be performed with a right shift by 2 for speed if neccisary, otherwise a fixed point divide will be used for better rounding) - 4 the offset will be valueMin, it may be adjusted to compensate for any overshoot or undershoot of offset+delta*3 in relation to offset+valueRange - 5 the color table will be build such that color indices 0-3 will equal offset+index*delta - 6 the uncompressed pixels will be given the index of the color value in the color table that it is closest too - 7 the data is packed into a 64-bit block as shown above - 8 to decompress, the color table will be generated as in step 5, then each pixel will be assigned the value that corasponds with its index. decompress should be very fast. if you have a pocket calculator, you can divide the number of bits by the number of pixels to get the bpp: 2.56 bpp! a frame @ 640x480 will only be 96k. 10 fps should come in at under a megabyte. though there is a tiny problem in that an arduino only has 96k of ram total, and that would take 8 megabit to move over the esp8266. so i will probibly have to decrease the resolution to make it usable. at 320*240 is more usable at 24k a frame. so what are we looking at in image quality: its not quite optimal, there is a lot of underuse of the color table, only about 1/10 blocks has more than one color used. so it needs some work. but in my eyes its a succes, im on the right track. now i require sleep. tomorrow i will attempt a color format.
-
Interplanetary Governence - how do we manage off-world colonies?
Nuke replied to RainDreamer's topic in Science & Spaceflight
a lot of scifi universes like to use feudal systems or a confederacy for multi-planetary governments that span many star systems, since you really cant have any kind of centralized government. for example your vote for a presidential candidate might not arrive until that presidents term is up. this would make operating a centralized democracy impossible. any planet/solar system can have whatever kind of government(s) they want but then have alliances and treaties with other nearby planets/solar systems. for a colonized solar system i have a feeling governments wouldn't be to different from the multinationalism we have today. distances of communication/travel are long but managabe. either way i can only imagine running a government would get much more complicated than it is now. -
currently working on algorithms to see if i can send compressed grayscale video through an esp8266 wifi-uart bridge, totally relevant to indoor droning. i have an idea for an algorithm that can get lower than 3 bits per pixel data rate without too much quality loss, looking at about 5 fps if my arduino can compress the data fast enough. i mostly coded test apps in lua today to read image files and functions to manipulate the data so i can get before and after images of the compression "quality".
-
learn 2 grill. i hate it when people overcook their meat.
-
i want a ribeye steak, bout an inch thick, and i want it rare.
-
it says im snarky enough to have a few dots yet not quite good enough to have a full bar.
-
i was just playing around with one of those esp8266 boards. its pretty nifty. i was able to get it on my network in a single evening and got it talking to a lua script on another rig. it also only takes 5 connections to my arduino due (if you run a 3.3v board, 5v needs level conversion). it also has a very simple at command set over serial, so you dont need any libraries to use it. supposedly you can run the thing stand alone though the mcu on the module doesnt have a whole lot of i/o. anyone using these things yet? did we ever get an over ip version of this interface?
-
most expensive pizza delivery ever. i hope the iss crew likes anchovies.
-
you can race, but most people dont. i mean if you kill all the other cars then there is nothing to race against and you kind of win be default.
-
interstate '76 <3 carmageddon as well. sometimes i wish they would breed and have an abominable mutant offspring. it would mix the car dogfighting with the pedestrian splatter demolition derby of carmageddon. i didnt really like games like twisted metal, it felt too arcadey. carmageddon had a somewhat interesting physics model with deformable geometry on the cars. it wasnt just the carnage in that game that made it awesome. interstate '76 ran on the mechwarrior 2 engine which likely explains why i enjoyed the game so much. dogfighting in cars is kind of tricky, the guns were fixed and so if you needed to shoot down a helicopter, you had to find a hill. you could get turreted weapons and missiles but that wasnt as fun. you also had a pistol for shooting out through the side windows. i always wished i could do that in carmageddon, because sheep.
-
while i do prefer coke over pepsi, what i actually drink is the generic knockoff of both.
-
i saw a ufo when i was 5 and living in the california desert. it looked a lot like an f117 (which were still classified at the time).
-
humans are already one of the most deadly species on the planet (right behind mosquitoes) and you want to make it deadlier.
-
honestly i only read this thread in case eagleworks or whoever posts news and the thread explodes.
-
i just junked a rig like that, stripped it of useful parts, chucked the mobo in the scrap pcb box and the case in the dumpster. useful drives got put in another machine. theres also an old cd rom i figure i can salvage the stepper motor for some project. the psu will make a good bench supply. id use it as a linux box. find a lightweight distro to play around with. windows can make old hardware seem slow.
-
people had peen pressuring me to make fried chicken for awhile. i always put it off, and the rising cost of chicken didnt help much. one day they bring me a whole frier chicken and everything else i needed was already in the pantry. nailed it on the first try. i guess the trick is to not be afraid of so much oil, if you dont put enough down the food wont float and it will stick to the bottom. same rules apply to chicken fried steak, but because they are usually thin you dont need as much oil. i also reuse my fry oil 3 or 4 times before throwing it out. i can also do a lot of things with a deep frier. onion rings, corn fritters, apple fritters, donuts, beer battered halibut, shrimp tempura, and so on.
-
neither, jailbreak it and instal linux proper.
-
idk whats my name here...ah yes. when i was very little i saw a documentry on nuclear weapons. i always found them quite awesome, mankind greatest accomplishment (i even thought that before i knew you could use them as rocket fuel). so i named my self after them.
-
i once made what i called "admiral lucifer's chicken". my own version of general to's chicken. needless to say it was way too spicy, and totally awesome. i didnt have any of those little red chinese peppers, so i substituted them with habaneros.
-
many things. i could probibly figure out anything with an unlimited grocery budget. unfortunately limited budget doesn't allow for what i like to call "science experiments", so i stick to things i know how to make without messing up.
-
im not really a big fan of rum. im more a tequila kind of guy.
-
in the 90s it was mostly just spamming the registry. some games you could copy from your old system and they would work without running the installer (anything idtech). but others would look for certain registry keys and wouldn't run without them, sometimes it would tell you to reinstall. some games in the 90s were really picky about things like video drivers, which you pretty much needed to upgrade with each new game you bought (they were big on pushing the limits of technology back then). on modern systems most of that is taken care of by auto updates done by the os. i really miss the dos days when all you had to do was type 'copy *.*'.
-
its more than just copying files. also setting up stuff with the os. on windows this means writing stuff to the registry, setting up directories for code and user data in the appropriate folder, installing services for drm, anticheat and whatnot. i actually kinda like that ksp keeps it to copying only. i dont like some of the things these game installers put on my computer. i assume linux does things more or less the same way, with some kind of install script. i dont really know what happens when i 'sudo apt-get install whatever', but i assume it does a lot of the same things that windows installers do.