Jump to content


Photo

Super Binary


  • Please log in to reply
41 replies to this topic

#1 ChIkEn AtE mY dOnUtS

ChIkEn AtE mY dOnUtS

    Pwner of barcodes

  • GMC Member
  • 2409 posts

Posted 18 February 2008 - 10:09 PM

<span style='font-size:14pt;line-height:100%'>Super Binary</span>
Multiple datatypes, more functions, and more!

Download
WillHostForFood.com

Information
This DLL is made to allow more than bytes to be written to a file, but while I was reading up on fstream there were lots of other functions that GM doesn't have, so I included them too..

Function List
file_binary_init
file_binary_open
file_binary_rewrite
file_binary_close
file_binary_seek
file_binary_position
file_binary_size
file_binary_isopen
file_binary_peek
file_binary_eof
file_binary_read_byte
file_binary_read_short
file_binary_read_int
file_binary_read_float
file_binary_read_double
file_binary_read_string
file_binary_write_byte
file_binary_write_short
file_binary_write_int
file_binary_write_float
file_binary_write_double
file_binary_write_string


As you can see, this is a pretty hefty DLL that took me a little bit (Although most of it was me pulling my hair out wondering why I couldn't get it to work on others PC's, ends up I renamed it before sending...) so I'd appreciate some credit.

This is my first 'big' DLL, so yeah, I've created a few small ones in the past (And a prank one :(), and if you have any DLL ideas feel free to PM me.


Edited by ChIkEn AtE mY dOnUtS, 28 March 2008 - 10:43 PM.

  • 0

#2 Postality

Postality

    GMC Member

  • New Member
  • 244 posts

Posted 19 February 2008 - 06:17 AM

Sweet DLL you've created.

I'm not sure I'd need anything like this in the near future, but it's definately a sweet DLL if I ever need something like it.

10/10
  • 0

#3 cpsgames

cpsgames

    GMC Member

  • GMC Member
  • 79 posts
  • Version:Unknown

Posted 20 February 2008 - 02:24 AM

Nice 9/10
  • 0

#4 Doogie_Forever

Doogie_Forever

    Dog Warrior

  • GMC Member
  • 811 posts
  • Version:GM:Studio

Posted 23 February 2008 - 05:02 AM

I'm pretty sure the 39dll can do the exact same thing. Either way, very nice must have taken a while.

Would be better if it was plain GML because so people hate the use of DLL's.

I'm just saying that it would be cool to demonstrate how to load two bytes or more (and make the value merged) with GML functions and it would be very useful to some.
  • 0

#5 theloon

theloon

    GMC Member

  • GMC Member
  • 70 posts

Posted 28 February 2008 - 09:03 PM

Binary rocks for level data files. Trust me when I say binary functions in interpreted languages such as Game Maker are really, really, really sluggish.

I would have enjoyed a .GMD example but I'll pick through the .GML file until then.
  • 0

#6 JeremyDF

JeremyDF

    GMC Member

  • New Member
  • 33 posts

Posted 04 March 2008 - 02:52 AM

I made a .gex for it.
Download: This Link Was Deleted
I put your name in it ChIkEn AtE mY dOnUtS so people know you made the dll.
Edit
I was clearing my files and I accidentally deleted it.

Edited by Galena, 14 March 2008 - 12:48 AM.

  • 0

#7 ChIkEn AtE mY dOnUtS

ChIkEn AtE mY dOnUtS

    Pwner of barcodes

  • GMC Member
  • 2409 posts

Posted 04 March 2008 - 04:16 PM

I made a .gex for it.
Download: GM Super Binary
I put your name in it ChIkEn AtE mY dOnUtS so people know you made the dll.

<{POST_SNAPBACK}>

Thank you very much. :lol:
  • 0

#8 halo shg

halo shg

    Programmer

  • GMC Member
  • 597 posts
  • Version:GM:Studio

Posted 28 March 2008 - 01:28 AM

I loved the quality and simplicity but hated the speed. On a test, it took almost 5 minutes (289640 milliseconds) to copy a 8.46kb file in bytes (using the file_binary_write_byte(file1,file_binary_read_byte
(file2)) method) even on highest priority.

This is VERY slow considering a GM file is over 1 mb.
  • 0

#9 ChIkEn AtE mY dOnUtS

ChIkEn AtE mY dOnUtS

    Pwner of barcodes

  • GMC Member
  • 2409 posts

Posted 28 March 2008 - 10:44 PM

I loved the quality and simplicity but hated the speed. On a test, it took almost 5 minutes (289640 milliseconds) to copy a 8.46kb file in bytes (using the file_binary_write_byte(file1,file_binary_read_byte
(file2)) method) even on highest priority.

This is VERY slow considering a GM file is over 1 mb.


Erm, priority doesn't change how fast GM runs.

Anyways, its unable to be faster than GM because there is the DLL overhead. Oh well.
  • 0

#10 remoladen

remoladen

    GMC Member

  • New Member
  • 147 posts

Posted 09 June 2008 - 02:16 AM

OMG U DON'T KNOW HOW MUCH I LOVE YOU!!!! I'VE BEEN TRYING TO DO THIS FOR EVER!!!!! <3<3<3... lol not that Im gay or anything haha.. :huh:
  • 0

#11 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 972 posts
  • Version:Unknown

Posted 22 June 2008 - 04:11 AM

If I am correct binary is machine code, which means that u can make an OS with game maker using this dll, u could make a operating system.
  • 0

#12 ChIkEn AtE mY dOnUtS

ChIkEn AtE mY dOnUtS

    Pwner of barcodes

  • GMC Member
  • 2409 posts

Posted 17 August 2008 - 01:45 AM

If I am correct binary is machine code, which means that u can make an OS with game maker using this dll, u could make a operating system.


You are freaking retarded.
  • 0

#13 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14384 posts
  • Version:GM:Studio

Posted 17 August 2008 - 04:13 AM

Ah cool, I have to remember this is here when I convert my maps save to binary format

Adds to favorites

BTW, your dll would be a great spot to put in encryption/decryption while saving/loading. I have some good code for that

Edited by icuurd12b42, 17 August 2008 - 04:17 AM.

  • 0

#14 jakman4242

jakman4242

    Vertical Shmup Junkie

  • New Member
  • 3222 posts

Posted 17 August 2008 - 04:25 AM

If I am correct binary is machine code, which means that u can make an OS with game maker using this dll, u could make a operating system.


You are freaking retarded.


I got a seriously good chuckle out of that.

I'm pretty sure binary isn't machine code, if it is then oh well. I'm wrong.
And, good luck making an OS with Game Maker. Or just an OS in general.

And this DLL looks quite interesting. Pretty advanced-looking from that hefty function list. I'll give it a try when I need something like this.
  • 0

#15 Shining_Saber

Shining_Saber

    Top Gundam

  • New Member
  • 610 posts

Posted 17 August 2008 - 04:27 AM

If I am correct binary is machine code, which means that u can make an OS with game maker using this dll, u could make a operating system.

Please.... never talk again.
You probably won't even be able to make an OS with C++. An OS is VERY complicated business, and only the 1337est of the 1337 programmers do it. Creating games and creating an operating system are very different things, with the later taking years of study.

Anyways, good job. Must've been really hard to code. :)

Edited by Shining_Saber, 17 August 2008 - 04:28 AM.

  • 0

#16 jakman4242

jakman4242

    Vertical Shmup Junkie

  • New Member
  • 3222 posts

Posted 17 August 2008 - 04:37 AM

with the later taking years of study.


Or the source code of Linux. Haha.

But, yeah. I have a question, probably an unimaginably stupid one. But, in what instances could this be truly useful?
  • 0

#17 johnie102

johnie102

    GMC Member

  • New Member
  • 1608 posts

Posted 17 August 2008 - 03:23 PM

with the later taking years of study.


Or the source code of Linux. Haha.

But, yeah. I have a question, probably an unimaginably stupid one. But, in what instances could this be truly useful?


If you want to write a value larger then 255 to a binary file and don't want the conversion math yourself you can use this DLL.

Oh and
binary!=machine code
binary is a data type
machine code is code that can be directly used by computers (eg: C++ can't be read by a computer, it first needs to be converted to assembly and then to machine code).

I'm probaly not perfectly right on this.
See Yourself's sig or ask him for the details.

EDIT: How does your DLL determine the length of a written string?

Edited by johnie102, 17 August 2008 - 03:32 PM.

  • 0

#18 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14384 posts
  • Version:GM:Studio

Posted 17 August 2008 - 07:04 PM

EDIT: How does your DLL determine the length of a written string?


Usualy, one writes the length to the file followed by the string. Pretty standard, so when you read a string, its read the length then the string.

5Hello

Edited by icuurd12b42, 17 August 2008 - 07:04 PM.

  • 0

#19 molloyboy08

molloyboy08

    pyr0t3chnic

  • New Member
  • 473 posts

Posted 17 August 2008 - 07:20 PM

Cool dll, I'm downloading now to check out the speed as I have an interesting comparision I want to make....

Anyway machine code is a set of 0's and 1's that correspond to commands as understood by the computer's processor. Machine code is in binary but binary is not machine code (does that make sense its a small distinction...) binary is all about how its being treated. The binary pattern 01000001 can be represented in some ways such as a decimal number 65, by the character A or possibly as a for example an add command. So, in theory you could make an OS or even an exe using these commands but 1) you'll be there forever trying to figure out the structure to use and what the instruction set it 2) it will have to be understood as the OS otherwise it wont do a thing...

Using these you could even make a bmp file if you so wanted to (not sure why you would but its an example) as long as the file extension was .bmp and you have the format correct. I hope this clears some things up. Johnie was pretty good explaining.

Edit: to expand on icuurd's post it could be like this (the byte setup)
5 H E L L O <- length stored before edit2: I counted wrong... going to go hang myself now
or
H E L L O 0 <- null terminated string (goes till the 0 )

Edited by molloyboy08, 17 August 2008 - 07:31 PM.

  • 0

#20 Yourself

Yourself

    The Ultimate Pronoun

  • Retired Staff
  • 7341 posts
  • Version:Unknown

Posted 17 August 2008 - 08:25 PM

binary is a data type


No it isn't.

See Yourself's sig


You definitely should.

Binary is one method of representing data. A data type is a specific interpretation of that binary string into something more abstract; e.g. the real number 2.25, the character 'ยต', the color crimson, the instruction to add two numbers, etc. These are all abstract concepts which can be represented (somewhat arbitrarily) as a binary string. A binary string by itself admits nothing about the type of data it holds. By that I mean that given a binary string you have no actual way of knowing what data it represents.

It's been possible to create "anything" using GM ever since the binary file functions were added way back in 5.x (whatever version they were added; I can't remember). They provided the ability to create and read any file possible. Everything from sound files to machine code can be written using the built-in binary file functions in GM. That doesn't mean it's a good idea to actually do this, however.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users