DLL Talk / The Matrix1Utils plugins collection |
| Author | Message | ||
| IanM |
Newest release 27/05/2012
We're now up to 33 plug-ins in this pack - latest release info can be found HERE (Release 20120527). Download links can be found at the bottom of this post. In addition, I've uploaded the help files to my website, so you can browse through all of the commands, so you can see what you'll be getting without having to install the whole thing first. Just click here to see them. 01 - Memory Banks - memblocks, with a few new options added 02 - Basic Timing - Metronome type ticking, and hiresolution timing. 03 - Mutexes - system level synchronisation between processes (primarily for use with shared-memory banks) 04 - Raw Memory & String Allocation - low level stuff only of use to masochists 05 - Find Free ... - locate free images, objects ... everything really 06 - Error message control - Take a little control over DBPro error messages, or even trigger your own (with a line number!) 07 - General functions - min/max, plus a few numeric functions that are missing from DBPro 08 - Random numbers - Many different random number generators. 09 - Functions and commands that should have been in DBPro from the start. 10 - Logging - Output logging info from your app, in nicely formatted html or rtf if you want to. 11 - Console window, with colours 12 - Limb information and updates 13 - Desktop & window info + manipulation 14 - Adhoc 'doesn't fit anywhere else' commands 15 - Extra WAIT commands - including system-friendly versions that use no system time 16 - Strings - A comprehensive set of string functions. 17 - 64 bit bitset manipulation - DBPro binary functions don't work with double integers, these functions do 18 - Create custom objects from nothing and get information about the state of objects. 19 - List and group objects 20 - Function pointers 21 - Zone commands, transferred & updated from the original utility plug-in. 22 - File I/O 23 - Colour conversion 24 - System Folders 25 - Windows shortcut files 26 - Syncs and callbacks 27 - Hashing (and encryption in the future) 28 - Networking for IP and UDP (tutorial zip file) 29 - Arrays - Information from arrays, plus sorting, clearing etc. 30 - Basic 2D Commands 31 - String lookup tables (with load/save of ini files). 32 - Vector & Matrix maths - Some commands and functions to make using the 3d maths commands a little easier. 33 - Redirect drawing operations to images The release is a zip file for easy installation - just let winzip extract it to your DBPro installation folder and it'll all go into the right place. DBPro 7.1 download and later : http://forumfiles.thegamecreators.com/download/2355306 DBPro 7.0 download and prior : http://forumfiles.thegamecreators.com/download/1599357 (No longer updated) If the DLLs fail to load, then you may need the files in the following download: VC++ redistributables : http://forumfiles.thegamecreators.com/?i=959271 - For 32 bit systems, place the contents in c:\Windows\System32 - For 64 bit systems, place the contents in c:\Windows\SysWOW64 - Alternatively, if you are uncomfortable placing these files in those folders, or if you don't have the correct permissions to do so, place the files in the same directory as your executable. If you have any of the original Matrix1Utility, Matrix1Array or Matrix1Extend1 plug-ins, then you'll need to delete the DLL's and the INI files for them before starting up DBPro. Please also note: I have not ported any of this code to GDK, and these plug-ins will not work with GDK whatsoever Warranty: None, for any purpose whatsoever. Conditions of use: None. Royalties required: None. |
||
| Back to top |
|||
| IanM |
Memory banks - expanded memblocks. For any kind of manipulation of data, you'll soon start to wonder how you did without them. In addition to the standard ability to write different basic data types to the banks, you can also: - write double integers, double floats and strings too - copy blocks of data between banks or even memblocks - share memory between different programs - map a file into memory (effectively load a file into a bank, but any changes you make are reflected in the file). A long while ago, I wrote a function that would allow you to write a DBPro bitmap to a bmp file using standard file functions. I've written a small program that uses that function, but also does the same thing using a mapped file - run it yourself to see the speed increase: + Code Snippet For free Plug-ins and source code http://www.matrix1.demon.co.uk |
||
| Back to top |
|||
| IanM |
Timing - simple tickers There's not much in this plugin really. There's the standard hi-resolution timer that was a part of the original utility plugin, and that works in the same way, and now there is also a regular ticking timer that ticks as often as you tell it. Here's a simple example with two tickers - one is used to drive the flashing cursor, and the other is driving the tenth-of-a-second timer + Code Snippet For free Plug-ins and source code http://www.matrix1.demon.co.uk |
||
| Back to top |
|||
| IanM |
Error messages There's not much to say here really (despite this being a real ... hard nut to crack) - error messages, with line numbers. You can trigger your own messages, change the title on DBPro error messages, even trigger messages under certain conditions. Here are a few examples. As basic as it gets: + Code Snippet How about this: + Code Snippet Error 502 is 'image does not exist' - the numbers can be found in C:\Program Files\Dark Basic Software\Dark Basic Professional\Compiler\lang\english\Errors.txt in the RUNTIME section Setting a 'reasonable' title for a DBPro error: + Code Snippet Ok, so we may differ in our opinion of 'reasonable' Finally, error under certain circumstances - in the C world this is called an assertion, in which the error does not occur if the condition is true. + Code Snippet I'll post a few more things tomorrow For free Plug-ins and source code http://www.matrix1.demon.co.uk |
||
| Back to top |
|||
| IanM |
Here's a full program that I wrote to automatically generate the help and keyword files for all of these plugins, and to demonstrate their use. It mostly uses the banks and string plugins and features: - Correctly splitting up the command line arguments when dropping files onto the exe - Reading/writing whole files in a single set of operations - Reading resource strings from a DLL (used to get all of the commands for the keyword files) - Complex and fast string manipulation There are also some little 'bonus' routines in there for dealing with filenames and directories. |
||
| Back to top |
|||
| IanM |
Here's another one for banks ... they really are my favourite! In last months newsletter, Rich included a section on the Winch's site that includes details of the makeup of a DBPro executable or .PCK file. I decided that would be a good test of banks, so I wrote the following program that will decipher the exe/pck, list all of the files included within it, and will then explode it out into the separate files. There's no reverse process ATM, but that may come in the future. |
||
| Back to top |
|||
| IanM |
The logging plugin might look a little inpenetrable at first sight, so here's a small example program that writes out a html format log file. You can also see the parameter substitution it provides when it's writing log file types 3 and 4. + Code Snippet |
||
| Back to top |
|||
|
Bmad6
User Joined: Thu Aug 25th 2005 Location: Virginia, United States |
Only one suggestion - in part 13, the get display width() command (and others, I assume) interfere with the same command from the DBPro Enhancements Pack. Maybe add a prefix or something? Other than that, though, this looks awesome! Programming is the art that fights back. |
||
| Back to top |
|||
| IanM |
Thanks for pointing that out - I'll change the command and repost it later today |
||
| Back to top |
|||
| BatVink |
|
||
| Back to top |
|||
|
spooky
User Joined: Fri Aug 30th 2002 Location: United Kingdom |
Am I right in saying your new ABS command completely takes precedence over existing ABS command. Surprised not to see some sort of duplicate command error that I've seen in the past. Anyway your ABS command is SO much faster than built in ABS command which is renowned for being so slow so I'm happy. Too busy to try rest of commands, must get back to work. Boo! |
||
| Back to top |
|||
|
Lost in Thought
User Joined: Wed Feb 4th 2004 Location: U.S.A. : Douglas, Georgia |
|
||
| Back to top |
|||
| IanM |
@Spooky, Lee provided a ABS command for floating point values - that's why it's slow with integers as it has to convert integer to float, then float back to integer for the result. I've just provided an integer-specific version. It's OK to provide overloaded versions of existing commands and functions in plugins as long as their signatures are different. @Bmad6 & Batvink, I'll probably just drop the 'GET' at the start of the name to remove the clash. |
||
| Back to top |
|||
|
sneaky smith12
User Joined: Sun Apr 30th 2006 Location: Like id tell you, oh wait i just did |
hmmm... when i run the program i always get a + Code Snippet Then it lists several locations one including autodesk which doesnt make sense, because I don't have any autodesk products. If at first you dont succeed, LOWER YOUR STANDARDS. |
||
| Back to top |
|||
| IanM |
Ah, the old 'runtime library' problem huh? Here they are for use with the plugins - Just drop them into \Windows\System32 - If you already have these files installed in your machine, do not allow them to overwrite existing ones. @Everyone else, I've replaced the zip in the first post with the modified '13' DLL - I've simply removed 'GET' from the start of all of the functions. Just follow the install instructions again and allow the new files to overwrite existing files. |
||
| Back to top |
|||
|
John Y
Synergy Editor Developer Joined: Wed Sep 4th 2002 Location: West Midlands, UK |
This is a really cool collection of commands. Thanks! |
||
| Back to top |
|||
| IanM |
Thank you. Here's a simple example of using the bitset commands. The code that a lot of people use to detect a mouseclick is usually a little ... clunky (using bit manipulation) ... or even plain wrong (using straight comparison). Instead, you can just treat the value of MOUSECLICK as a bitset, and interrogate the values by key number: + Code Snippet There are other uses too. For instance, in a piece of code that I'm performance testing right now, I can enable and disable various bits of code depending on which bits are set, and I can do it even when the code is running. Here's a little taster of how that works: + Code Snippet Yes, it could also be done using indivually named global variables, or using an appropriately sized array too. This way uses less storage which can be useful when writing to a file, or storing in a memblock or memory bank. A single bitset is also easier to pass around your program, seeing as it is basically just a standard variable. |
||
| Back to top |
|||
|
Bmad6
User Joined: Thu Aug 25th 2005 Location: Virginia, United States |
|
||
| Back to top |
|||
| IanM |
I know - I posted that code only a week or so ago, and a lot of the less learned coders on the forums wouldn't even know why it works. Besides, it's quicker this way + Code Snippet [edit]Quick update to the plugin 17 - It wasn't handling the full 64 bit range correctly - now it is. |
||
| Back to top |
|||
|
Grismald
User Joined: Tue Mar 4th 2003 Location: France |
Just wanted to say thanks for these great dlls. I am making a snippet to write text files using memory banks mainly to see if i can get some speed improvements over using standard file functions; it's not fully working yet, but here's a link anyway: http://forum.thegamecreators.com/?m=forum_view&t=86495&b=6 (see 2nd post) |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
| IanM |
Thanks. I've made a post in your thread that may help you get the speed increase you are after. |
||
| Back to top |
|||
| IanM |
Here is a new update, including one semi-experimental new plugin that allows DBO objects to be loaded from a memory bank. Matrix1Util_01 1.0.0.2 Added 3 SEARCH BANK functions to allow string searches within banks. Added 2 ZERO BANK commands to clear banks or areas of banks. Matrix1Util_07 1.0.0.2 Added GCD functions (greatest common denominator) Added integer and double version of the clamp and wrap functions Matrix1Util_12 1.0.0.1 Initial public release (GET LIMB BY NAME, GET LIMB COUNT, GET LIMB FVF) Added SET LIMB NAME command Added GET LIMB PARENT/CHILD/SIBLING functions Matrix1Util_13 1.0.0.2 Added HAS FOCUS function and GRAB FOCUS command. Matrix1Util_16 1.0.0.2 Faster string-length function for a general speedup throughout. Fix bug for positional checking in the GET SPLIT WORD function. Matrix1Util_17 1.0.0.2 Faster bit count routine. Matrix1Util_18 1.0.0.1 New plugin that allows objects to be created from memory banks. They need to be .dbo format. |
||
| Back to top |
|||
| Olby |
Ian you rock this place mate! "Error at line 0 - Your game sucks. Try again loser..." (Cash Curtis II) AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2 |
||
| Back to top |
|||
| IanM |
Thanks. Have a 'fix' release. Matrix1Util_13 1.0.0.2 Corrected help files - added 'GET' to all infomation functions Matrix1Util_18 1.0.0.2 Corrected 'offset' version of the MAKE OBJECT FROM BANK command Removed need for the fourth argument too as DBO knows how far it can go Plugin 18 is no longer experimental - it works just fine every time. |
||
| Back to top |
|||
| IanM |
Here's an example of multiple DBO objects being loaded from a bank. It uses the new bank functions to search for DBO objects and loads them. It's a little involved, but bear with it. + Code Snippet |
||
| Back to top |
|||
|
cjb2006
User Joined: Sat May 20th 2006 Location: Cyberspace |
IanM, I am in awe. Great work. In my current project I'm working with x-files. I understand they are slower but it's easier for this human to parse a .x text file. Is it possible for you to add a "make object from bank" command for a text .x file to the collection? A kind of "Load mesh"=>"Make object" command from a virtual file (bank). I know I sure could use it but if I'm the only one, then it's no biggy. Thanks for all you've done already. |
||
| Back to top |
|||
| IanM |
I've been looking into it since you posted, and there doesn't seem to be an easy way ATM. I won't give up on it though - I'm sure that it can be done. In the meantime, you can use DBPro to load your x models and save them back out as a dbo file if you want to take advantage of the new command. When I do figure out the loading of x files from a bank, the same code will be able to load the data without you needing to give it any clues beyond the start position. |
||
| Back to top |
|||
|
cjb2006
User Joined: Sat May 20th 2006 Location: Cyberspace |
Hey, thanks for looking into it. I'm basically working on a custom model editor - adding / deleting verts, flipping edges etc. on the fly. I can keep track of that stuff fairly easily in a .x text file. I can use a bank to write the file but it would be nice to not have to re-read it for each model update (since it's already in a bank). Keep up the good work, and thanks again. |
||
| Back to top |
|||
|
ThomasFN
User Joined: Thu Aug 26th 2004 Location: Cyberspace |
any advanced matrix functions about? (ie colour individual verticies on a mtx, apply a texture to the whole matrix rather than just a tile, detail texture blending, tile border blending) |
||
| Back to top |
|||
| Olby |
@IanM - I have probably found an error (what else I can do?), when I call find free memblock() some times I get the memblock id is out of range. So I guess your limits are incorrect. It only happens occasionally because I use random free memblock finding. I tried to lower the value to find free memblock(1,100) then everything worked fine. I dont know but maybe the maximum memblock count is 128? [Edit] Did I already told you that these are very good and fast plugins! And Im currently building my FPS engine around these. AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2 http://www.myspace.com/producerolby |
||
| Back to top |
|||
| IanM |
@ThomasFN, I don't think that kind of functionality is available for matrix's - you might need to use standard objects & limbs for all of that. You can search in the Code Snippets forum, or in the code base for example code. I may add something like this in the future. @Olby, I can't find any error with the FIND FREE MEMBLOCK code. Are you remembering to check for a returned value of 0? If you do get 0, then you've already used up all of your memblocks. If you have any example code that exhibits this problem, then just post it here or email it, and I'll take a look. |
||
| Back to top |
|||
|
ThomasFN
User Joined: Thu Aug 26th 2004 Location: Cyberspace |
Thanks for your help, IanM. I may use an advanced terrain and used vertex data and limb stuff to do what i want. |
||
| Back to top |
|||
| Diggsey |
Cool, I needed that parent limb function ![]() |
||
| Back to top |
|||
|
Scraggle
User Joined: Thu Jul 10th 2003 Location: Leeds UK |
Some very handy commands here Ian I have been trying a few but have come across one that doesn't work 'as advertised'. + Code Snippet That code brings up this error: Cannot perform 'integer' cast on type 'TEMP2' at line 10. Is there any chance you could have a look at this? It would be very handy. Thanks [edit] Same problem with REMOVE ALL$ |
||
| Back to top |
|||
|
Bmad6
User Joined: Thu Aug 25th 2005 Location: Virginia, United States |
Scraggle, I'm surprised you didn't catch this error! That error message means that it's trying to store String data in an Integer variable. either replace tS w/ t$ or put tS as integer above this code. (I assume you meant to do the former from the start.) Corrected code: + Code Snippet And I ran it, to check. Windows XP Home Edition SP2, Intel Celeron 1.4 GHz Processor, 768 MB of RAM, 1024x768 Srceen Resolution, NVidia 256MB FX5200 GPU |
||
| Back to top |
|||
|
Scraggle
User Joined: Thu Jul 10th 2003 Location: Leeds UK |
Now I feel stupid! Sorry Ian for assuming it was a problem with your plugin-in and thanks to Bmad for pointing out my stupidity ... and yes, I did mean to do the former from the start. |
||
| Back to top |
|||
| IanM |
No problem - I generally spend quite a bit of time on testing these before I release to avoid being embarrassed later, so I was surprised to see your post. So far, only 2 bugs found in these plug-ins, and one of those I found myself Thanks to Bmad6 for finding the problem. |
||
| Back to top |
|||
| Olby |
I found another bug with split string$. Check this... + Code Snippet It splits string not using all delimeter string " -" but uses just first which is just a space. Even if this is not a bug adding this functionality for more than one char in delimeter string would be awesome. AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2 http://www.myspace.com/producerolby |
||
| Back to top |
|||
| IanM |
Sorry, but that's not a bug - the second string is used as a list of single character delimiters. If you want to search for string delimiters, then a simple way to do that would be to REPLACE ALL of your delimiters with a single character, then SPLIT STRING using that character. Also, if you check out the HelpGen code in one of my earlier posts, you'll find that it contains a source file 'CommandLine.dba' which takes the command line and splits it correctly. |
||
| Back to top |
|||
|
FERSIS
User Joined: Wed May 17th 2006 Location: Cyberspace |
just wanna say that im using your plugin for the timer functions |
||
| Back to top |
|||
This is a multi-page thread older than 30 days.
Go to the last page to check if you can reply to it.
Go to the last page to check if you can reply to it.
Forum Search
Enter a word or phrase to search our Forum for:
|
|









