The MASM Forum

Toddler's Corner => Romper Room => Topic started by: daydreamer on May 18, 2020, 07:57:19 PM

Title: so how many k is bloat for you?
Post by: daydreamer on May 18, 2020, 07:57:19 PM
so how many k is bloat for you?and what limit should be used???one byte too many over x number of kbs? :bgrin:
Title: Re: so how many k is bloat for you?
Post by: hutch-- on May 18, 2020, 09:21:35 PM
 :biggrin:

1   :tongue:
Title: Re: so how many k is bloat for you?
Post by: Vortex on May 18, 2020, 09:41:18 PM
Hi daydreamer,

It depends on what you are trying to achieve.
Title: Re: so how many k is bloat for you?
Post by: mineiro on May 18, 2020, 10:41:08 PM
kkk is bloat.
In Brazil an expression of laughter or smile is transcribed as kkk.
A user read a news about kkk and commented:
"These people smile about serious things. Journalists are hypocrites."

To uncle Bill more than 64k is bloat.
Title: Re: so how many k is bloat for you?
Post by: HSE on May 18, 2020, 11:37:27 PM
1   :tongue:
:thumbsup:

Title: Re: so how many k is bloat for you?
Post by: caballero on May 19, 2020, 12:07:25 AM
And due to this, graphic demos competitions with executables less than 64kb were institutionalized, as well as others. The challenge is not only to make the graphic effect more surprising, but also in the smallest possible size.

https://www.youtube.com/watch?v=05XmI6zr_Ek
Title: Re: so how many k is bloat for you?
Post by: jj2007 on May 19, 2020, 12:11:34 AM
Whatever takes more than a second to open.
Title: Re: so how many k is bloat for you?
Post by: daydreamer on May 19, 2020, 02:09:25 AM
Hi daydreamer,

It depends on what you are trying to achieve.
Assembly game would be nice to achieve, but graphics and sound data could make it big
First get it working right and debugged might be bigger,before you start to reduce size,load highly compressed jpgs /mp3s instead of bmp and wav files and find nice compressor to use
Almost 28k 32bit exe so far
Title: Re: so how many k is bloat for you?
Post by: caballero on May 19, 2020, 03:17:34 AM
> sound data could made it big

https://www.auralfractals.net/music.php
Title: Re: so how many k is bloat for you?
Post by: Vortex on May 19, 2020, 06:40:57 PM
Hi daydreamer,

You don't need to move all the multimedia data to resource files. They can remain in their original files.
Title: Re: so how many k is bloat for you?
Post by: daydreamer on May 19, 2020, 08:27:40 PM
You don't need to move all the multimedia data to resource files. They can remain in their original files.
I have thought of that earlier and want some of them encrypted,even text files so the game isnt easily spoiled by open riddletext files and area maps
 
Title: Re: so how many k is bloat for you?
Post by: daydreamer on May 20, 2020, 03:41:17 AM
Well you could make an x86/x64 XBOX game now fully equipped with blueray ROM if you want to
Now try using tv as secondary monitor, it wouldn't be hard to port a PC game to XBOX version

Title: Re: so how many k is bloat for you?
Post by: caballero on May 20, 2020, 04:47:50 AM
Hi daydreamer,

You don't need to move all the multimedia data to resource files. They can remain in their original files.
Sure, but all of them have to sum their size  :thumbsup:
Title: Re: so how many k is bloat for you?
Post by: mineiro on May 20, 2020, 04:48:53 AM
Interesting.
You can hide a signature/watermark in the least significant bit of each color. Our eyes cannot discern the difference. Regrouping the least significant bits of each color you can form a keyword for each map. An attempt that the map will not be changed.

Usually random numbers echoed crudely on the sound card generate grunts or noises; maybe some distortion in time can form some audible music. One idea is to play the map or the program code on the sound card as a try to see if it can be reused as music. The audacity program opens raw files (just rename any file to .raw).
Programs/sounds can be opened by image editors as raw too, maybe the opcode generated can be a map phase, we are assembly programmers  :eusa_dance: , for this it is necessary to factor the file size to find X and Y (usually square or rectangle). If file size cant be factor then add some bytes to file size to perform the action.

The thing with XOR cipher is that need 2 same size files.

----edit----
Well, when we turn on "tell a vision" we find "programs". After we realize that we are being programmed. Conspiracy theory.
Nowadays we use a lot of sight and hearing, then touch, after smell and taste. I don't know if we are regressing or evolving.
Title: Re: so how many k is bloat for you?
Post by: Siekmanski on May 20, 2020, 08:34:43 AM
Often I try to find ways to make executables as small as possible, just for the kick.
But most important is finding a balance between quality, speed and size.
Just for fun, I try to find repeating patterns in data to compress it to smaller sizes if possible.
Last month I was successful in writing an algorithm that compressed an old Amiga Protracker Music-note table.
16 * 3 octaves and finetune stages.
The original was 1152 bytes long, my algorithm routine to pre-calculate the table and inserting the errors back, is 127 bytes.
It wasn't easy because there were a lot of rounding errors in the original from the year 1987.
The result was 11% of the original size, this is what coding makes fun.  :eusa_dance:
Title: Re: so how many k is bloat for you?
Post by: mineiro on May 20, 2020, 08:49:19 AM
Nice.
The most easy way to speed up a program execution is by creating tables, precalculating things before so we can just move results. The problem is that tables give an increase in size of procedure.
When I as an eletronic addict I think that we can optimize by Karnaugh map, just transposing to assembly language.
Title: Re: so how many k is bloat for you?
Post by: jj2007 on May 20, 2020, 09:12:10 AM
Interesting.
You can hide a signature/watermark in the least significant bit of each color.

How would you do that, for example with \Masm32\examples\exampl04\car\car.jpg ?
Title: Re: so how many k is bloat for you?
Post by: mineiro on May 20, 2020, 09:20:12 AM
jpeg is lossy, we loose bits with that. But, after dumping to raw file that can be done if we save that as bmp, gif, png, ... (lossless).
In gif files we also have map color table, and most programs that read a gif file ignore what comes after ";", the last byte.
Jpeg2000 is a lossless solution, but I never played with that.

---edit---
I build an example to you son; please open image using hexadecimal editor.
Title: Re: so how many k is bloat for you?
Post by: jj2007 on May 20, 2020, 10:40:58 AM
jpeg is lossy, we loose bits with that

Yessss! And guess what happens if you send emails with photos in png, bmp or gif format instead of jpg? Our secret friends get very curious :bgrin:

I am working on a simple image and video viewer, see attachment - just drag any file over it. Without a commandline it will throw an error.

Compared to the standard M$ viewer in Win7, it's a lot faster, and the zoom function yields a better image quality. Feedback welcome, it's work in progress but already pretty stable. It works with animated GIF and TIFF images, too. I am particularly curious how it works with non-Ansi filenames, e.g. on Russian or Chinese systems.

- mousewheel zooms
- arrow up/down views other image files in the same folder and its subfolders, sorted by date
- arrow left/right and Shift up/down moves the zoomed image

P.S.: Thanks for the secret message, mineiro :thup:
Title: Re: so how many k is bloat for you?
Post by: Siekmanski on May 20, 2020, 06:01:04 PM
mineiro, it's not a secret anymore.  :biggrin:

Jochen, I got this message,
Fatal error:
Line ???: Array erased or undefined
Title: Re: so how many k is bloat for you?
Post by: jj2007 on May 20, 2020, 07:21:59 PM
Jochen, I got this message,
Fatal error:
Line ???: Array erased or undefined

Without a commandline it will throw an error.
Title: Re: so how many k is bloat for you?
Post by: Siekmanski on May 20, 2020, 07:48:49 PM
OK.  :thup:
Title: Re: so how many k is bloat for you?
Post by: daydreamer on May 21, 2020, 08:08:06 PM
Often I try to find ways to make executables as small as possible, just for the kick.
But most important is finding a balance between quality, speed and size.
Just for fun, I try to find repeating patterns in data to compress it to smaller sizes if possible.
Last month I was successful in writing an algorithm that compressed an old Amiga Protracker Music-note table.
16 * 3 octaves and finetune stages.
The original was 1152 bytes long, my algorithm routine to pre-calculate the table and inserting the errors back, is 127 bytes.
It wasn't easy because there were a lot of rounding errors in the original from the year 1987.
The result was 11% of the original size, this is what coding makes fun.  :eusa_dance:
great reduction :thumbsup:

Title: Re: so how many k is bloat for you?
Post by: daydreamer on May 22, 2020, 06:26:33 PM
isnt this the best solution on modern cpu to not have unneccerary bitfiddling when you want it to run fast?also you dont want overhead of uncompress right before a invoke that needs it to be dword size
first you develop with data sizes that works good on modern cpus,bytes and dwords and qwords and octowords
when you get it working right and debugged it,start to reduce size and init proc that expands bits into bytes,dwords...,screencoordinates bytes/words->dwords
???

something that only need true/false can be placed as bits,instead of bytes,words and dwords,qwords


Title: Re: so how many k is bloat for you?
Post by: Siekmanski on May 22, 2020, 08:46:35 PM
Thanks Magnus,

Sometimes you can get reasonable size reduction with creating pre-calculate lookup tables with indexed values such as used in 256 indexed colored pictures to represent larger bit values 32-64-128 and replace them with a byte/word stored as index number to reduce the size.
But sometimes the fastest and smallest way is to calculate it on the fly in code without lookup tables.
It all depends on the algorithm you create and the type of data you need to work with.
Write smart equations, simplify them to the max, removing all variables you can do without.
Try finding repeatable patterns and index them.
It's always fun to find a smart way to reduce data that doesn't fit so well in standard packing algorithms.

A great candidate for massive size reduction is 3D object vector data.
Symmetric objects you can store halve and mirror the other halve when depacking.
Some objects have many repeating 3D vector data, 8 tentacles can be saved as 1 and the other 7 can be translated in position when depacking etc.
Never store normals, calculate them when depacking.
Many object parts can be 100% calculated using trigonometric formulas and bend in shape with curve routines ( exp, sin cos combinations etc.)
Another cool technique is sub-division to remove vertices for storage and rebuild them when depacking.

Reducing bit depth without losing resolution:
For example, 8 bits is enough to represent a highly detailed vector object with a screen resolution of 10 bits.
If you create a 3 dimensional space divided in 3 by 3 by 3 cubes, you can reduce and store a 32 bit float as 8 bit ( subtracting the cube offset ) in each space cube,
when depacking add the xyz offset of each cube to the coordinates per cube to restore the original values and store them as floats in memory.
You don't need index numbers to identify the 27 cubes, only the coordinate count per cube to reconstruct the data.
If you divide the 3D space of the object in even more 3D cubes you can reduce the 3D object size even more.

Math rules!  :cool:
Title: Re: so how many k is bloat for you?
Post by: daydreamer on July 19, 2020, 03:17:54 AM
@Siekmanski
about 3d cubes,I have seen an example from fluxus only using 3d simplest deformed cubes to be long and thin be used in a reciprocal loop that goes up and down resizing and rotating and ability to pushstate and popstate on all geometry used in loop to finally a simple 3d tree has been generated,so I have many years ago based some SSE code macros on that,creating a fake stack,because you can fit 8 3d coordinates into xmm0-xmm7 enough for a cube
maybe worth revisit one day

Title: Re: so how many k is bloat for you?
Post by: daydreamer on July 19, 2020, 03:24:30 AM
today its extreme thing with MASM you can produce a small few k game that produces textures and meshes and almost everything with code
and latest games you need Terabyte drives to be able to handle all data :greenclp:
Title: Re: so how many k is bloat for you?
Post by: TouEnMasm on July 19, 2020, 05:46:52 PM

Ko are not a real problem actually.
I remenber the time where the computer answer you:
         "I am not enough memory to do that"
          "I am not enough place on the disk to do that"
I can also rementer what happend when those machine was making an update.
          WAIT  ,it wasn't possible to use them.

Those times are finished,stay just a question,can it work on other computer ?
Title: Re: so how many k is bloat for you?
Post by: daydreamer on July 19, 2020, 08:10:27 PM

Ko are not a real problem actually.
I remenber the time where the computer answer you:
         "I am not enough memory to do that"
          "I am not enough place on the disk to do that"
I can also rementer what happend when those machine was making an update.
          WAIT  ,it wasn't possible to use them.

Those times are finished,stay just a question,can it work on other computer ?
can it adapt to the widescreen standard monitors instead of annoying look of 800x600 in the middle of a screen made for 1360x768,with annoying black on sides
can it work well on other computers than it was designed for?,not just for slowest 386 without any timing/delay (some old DOSgames),or singlethread app made for run at fastest PIV 3ghz+ only?
I remember when dualcores was new,so people had dualcores with lower ghz than the games needed,so some games updated with patches to use several cores to be able to run those games on their new computers
that is modern thing,to write app that uses several cores,instead of a singlethread that lags or sometimes freezes UI when doing other things isnt motivated to have on modern multicore computer