Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 25th Aug 2003 00:10
I see memeblocks used within programs.
Could someone describe the reasoning behind there use and point to a description / tutorial on the benifits derived from them?

Thanks in advance

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Aug 2003 00:21
memblocks are nothing more than data stored in machine format.

Rather than having an integer, float or string such as

a=0
a#=0.0
a$="zero"

You have a byte, word, long word (dword?).

A byte is 8 bits of information, and a bit is either a 1 or a 0.

Words are two bytes, and a long word or double word is 4 bytes.

Because this is data in it's rawest format it can be used to hold and manipulate data very efficiently, such as an object mesh, or a texture file - you can access the individual bytes and play around with them.

Even text can be held in a memblock, you may be aware but there is an ASCII code for every character, much like the scancode but the table is different (http://www.asciitable.com). Now if memory serves correct (and i'm too lazy to look) then the letter A has a value of 32.

We could put the value of 32 into a byte of a memblock.

Now lets say we write a program the 'scramble' our text. To scramble it we could add a value of 100 to that ASCII value, so we take the 32, and make it 132.

Of course we can do that with other commands too, but memblocks allow us to do this with image data, objects, limbs, sound - anything you want.

They're also quite handy for constructing and decoding multiplayer game packets.

Pneumatic Dryll
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Aug 2003 00:22
Note that my memory did indeed not serve me well, /shrug. 32 is space.

Pneumatic Dryll
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Aug 2003 00:24 Edited at: 25th Aug 2003 00:26
you can load something like a bitmap into them and perform operations at speed over large amounts of data (like you could invert the colours in said bitmap), they also allow you to play directly with data and get your hands dirty, you could make a memblock and fill it with the correct values for an wav file then stuff it full of random numbers and get white noise (or modify an existing sound, make the pitch higher or merge two soundtracks for example) when you convert it back to audio, or modify the information that makes up a model directly, mostly for advanced users, but even I have been known to use em, cheers.

Mentor.
MicroMan
22
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 25th Aug 2003 08:57
Memblocks is a very useful piece of DB. Right now, for instance, I'm learning how to bypass several of the known "issues" with DBP, such as friction free motion.

If you move an object with move object then you'll always move in the current heading. But if you ignore that command and do a bit of coding, you could twist and spin your object and keep it moving it in the same direction as before -- regardless of its orientation.

There's probably a simpler way to do that, but it'll teach me about memblocks. The good thing with DBP is that you can take something like memblocks, and use them in ways the language makers didn't consider when they wrote in the limitations to the language

I'll also use the memblocks as chained objects, much like an array but a lot faster, for my game entities.

Login to post a reply

Server time is: 2026-07-23 00:17:37
Your offset time is: 2026-07-23 00:17:37