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.

DLL Talk / The Matrix1Utils plugins collection

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 31st Dec 2008 10:55
What about the ability to call a function with a variable argument list You could do it in a similar way to the current arglist commands, or you could take a pointer to some memory containing the arguments and use a string similarly to how you did the set/get array format commands.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 31st Dec 2008 18:25
No, no, front buffer works great!!! I wanted to see some BlueGUI panels and their contents, something I could never do before. The ugly code I got to dump was my old solution -- writing text information all over the screen before I captured an image of it.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 1st Jan 2009 03:06 Edited at: 1st Jan 2009 03:09
Quote: "What about the ability to call a function with a variable argument list"


I am not sure what you mean by this, but I am pretty sure it can be done with the most recent dll. I use a string to pass variables via a script to call a new function. There is a format to follow, but it works; semi colons separate the parameters, a $ leading the parameter indicated it is a string, a # indicates that the data is a float, and a ! indicates that the data is an integer. The default data is a DWord.

This is slow, but it was easy to code. IanM suggested creating a Variant type using double integers. The first DWord stores the data (string pointer, float, integer, dword) and the second DWord stores the variant type.

The function calling allows for parameters to be missing, or to be over-included. In my code, I pass 8 parameters to any function being called whether the extra parameters are needed or not.

Here is a sample of my code in action. The function Move_Object() is being called using nothing but variables. Not too impressive, it does show that the concept works - you can call functions using variable parameters. This was written before Ian's latest update. I will likely be changing this code.



Open MMORPG: It's your game!
matty47
16
Years of Service
User Offline
Joined: 20th Nov 2007
Location:
Posted: 2nd Jan 2009 20:29
I seem to be getting an error where TRIM$ occurs in both StyxCore.dll and in Matrix1Util_16.dll. Have I installed incorrectly or is there a work around for this conflict? THanks for any pointers..
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Jan 2009 17:04
If you know what you are doing, you can use a resource editor to change the commands in my plug-in so that they don't clash.

The simpler alternative is to ditch one or the other. No other plug-in of mine relies on Matrix1Util_16, so it's safe to move to one side - you'll lose all of the other commands in that plug-in too though.

Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 6th Jan 2009 15:37 Edited at: 6th Jan 2009 15:44
While at work I got bored so I thought of a nice addition you could add to the object groups... A command that will exclude whole group from the rendering process as the exclude object on/off command does. This would be very handy for rendering bloom or other effects that require large amounts of objects to be hidden/shown. For example in one command you would be able to hide all level brushes or hide all entities or hide every group from the rendering pipeline. I known we could just use a loop through group objects list but then again I guess it would be a bit slower than coding it directly in C++. Besides as these type of shaders are real time we need to squeeze any juice possible from DBP.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB Ram, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DirectX10, DBPro 7.1
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jan 2009 18:05
Actually, DBPro already provides commands that gives you control over which objects are rendered on which cameras, but there's a few functions in my plug-ins that can be used help here too.

Check the SET OBJECT MASK command - it does exactly what you want.

If you also check out the BITSET functions in my plug-ins, you can use those to set, unset or toggle the bits within the camera mask for you object:


It does look like I need to provide a method of getting the current mask though...

Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 6th Jan 2009 20:20 Edited at: 6th Jan 2009 20:23
Nah, you misunderstood me. What I actually was talking about is BATCH version of EXCLUDE OBJECT ON. Something like EXCLUDE OBJECT GROUP ON group_num and EXCLUDE OBJECT GROUP OFF group_num as I said this would speed up and make excluding hundreds of objects from the scene in one command.

And, yes I know about set object mask but this is not the case. Explore Bloom code from DarkShader for example. You at first need to render scene without bloom, then EXCLUDE/HIDE ALL OBJECTS (in this case your new command would come very handy) and render only full screen shader quad with the new bloomed image.

These two commands would come in handy when you want to appply bloom for lights or other entities only not the whole level. So then you would need only place entities that you want to apply bloom on into other group than the rest of the objects and using your commands hide/show those when you need to render the sahder.

I only gave you example for shader rendering purposes but there any many other ways where these two commands would be extremely useful, besides they fit into your 19th plugin very nicely.

I hope I explained better this time...

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB Ram, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DirectX10, DBPro 7.1
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jan 2009 00:00
Ok, I get it this time
These commands (or something similar) will be in the next release.

Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 7th Jan 2009 09:41
Thanks Ian, you a star! ... here have one!

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB Ram, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DirectX10, DBPro 7.1
Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 8th Jan 2009 08:44
As for objects, how about some commands to retrieve an object's boundaries points? Useful if you want to make a custom selector thing when looking at objects. I can do it with some math, but placing the individual 8 objects* real-time having to figure out an object's angle, size and position every time you look at an object could be a bit troublesome for such an insignificant part of the code, but it's required for the effect. It would just make things a little easier. Or just some extra commands regarding the boundaries box in general. It's fun to toy with. I can't use the DBPro one as it's hideously ugly.

*see attachement

This message was brought to you by Grandma industries.

Making yesterdays games, today!

Attachments

Login to view attachments
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 8th Jan 2009 14:13
I have a request:

Make object plain object number, xsize, ysize, xChunks, yChunks, xRows per chunk, yrows per chunk

I dont know the right word so i used chunk, what i mean is, i need to make this plain object from several smaller limbs. And i would like to set the polygon amount of every small limb.

Or, just give me a command that can subdivide object vertex amounts.

is it possible?

There is always one more imbecile than you counted on.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jan 2009 14:30
Quote: "is it possible?"

In software, anything is possible - it's just down how long you want to wait for it

Basically, you want what the terrain plug-ins does (a multi-limb plane), without the heightmap stuff. Yes, it's doable and just needs the command to be thought out so that it doesn't clash with an existing one. I think the example you used is Ok, and I can probably add an extra parameter for the FVF too.

@Grandma,
the SHOW OBJECT BOUNDS command does something similar to what you've asked for (is that the 'hideously ugly' one?), but I guess you want to be able to query the coordinates too? I'll look into it - something like this should be relatively easy to add.

Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 8th Jan 2009 15:55 Edited at: 8th Jan 2009 16:04
Yup, you understood me correctly. Basically, I want a custom box so that I can change its colour and maybe other appearance based on item type (yellow for ammo, red for weapons, blue for buttons etc). I'm thinking that would be nice. Using 3d models that is.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 20th Jan 2009 18:58
@IanM:

For Years and Years, I've been writing DBPro programs which use a vriable called CR$ to add carriage returns to the end of lines of text before I save them to a file.

Now I've updated to DBPro 7.1 and the latest Matrix utiles, I have thousands of lines of code to change before my old projects (and my newer ones at that) work again because u've included it in your command set!!!

Lol, ah well; keep up the good work dude.

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 22nd Jan 2009 11:36 Edited at: 22nd Jan 2009 11:40
@ IanM,

First time i've looked at these plugins for a while and they're fantastic.

Any chance of a pick limb command? Perhaps with the other limb commands ie. give 2d x and y and it returns the nearest Limb in 3d.

the DKShop stuff no longer works with latest version of DBPro and the author has done a vanishing act...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Kernunos
15
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 22nd Jan 2009 12:26
How do I access the help file from within the DBP Pro Editor? There is no link available for the included documentation.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jan 2009 14:07 Edited at: 22nd Jan 2009 14:08
You do what I do - if you don't know the command you want help from, type in a command chosen by you from my plug-ins (I use MAKE BANK, FWIW) then hit F1. Then you can navigate around the help files from there.

If you do know the command, then just hit F1.

@Duffer,
That and other commands have been on my 'future' list for quite a while, which means that I have no firm plans on doing them - mostly that's because they are already out there somewhere, or they'll take a while to put together and I'll need to commit a largish amount of time specifically to them. These functions come under the heading of 'both', so I'm not saying no, but I'm not saying yes either.

Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 22nd Jan 2009 14:58
Quote: "the DKShop stuff no longer works with latest version of DBPro and the author has done a vanishing act..."

Indeed, I E-mailed him a while ago about this and no response.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 23rd Jan 2009 00:00
IanM, I have a zone command request. Could we get a third version of the 'Zone' command, one that only tests against a specific type of zone? I have zones that could potentially overlap, one zone type is doors and the other is buildings. So then I could use 'zone' like...

ZoneNumber = Zone(X,Y,ZoneType)

Thanks!


Come see the WIP!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Jan 2009 00:23
Sure.

I'll need to think about the functions a little though - your example matches the existing 3 parameter version for searching for a point in a 3d zone.

Until then, you could use the FIRST ZONE/NEXT ZONE functions to iterate through all zones, check the zone is of the correct type, and then use POINT IN ZONE to check the coordinate. Wrap it all up in a nice little function and you're done.

Would it be a problem for you if I changed the word 'TYPE' to 'GROUP' in the zone commands to bring them into line with the object groups? I'd like to make a few additions and provide a set of commands that mirror object groups in a standardised way.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 23rd Jan 2009 10:03
It doesn't make any difference to me if it's 'type' or 'group'. I didn't think about the extra parameter for the 3D version of the command.

I'm iterating through the zones, but I like it when your plugins are doing the work for DBP. I just know it's faster and won't break.

I appreciate it.


Come see the WIP!
Serge Adjo
17
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 25th Jan 2009 03:07
I think there are 2 broken links in your help page (http://www.matrix1.demon.co.uk/Matrix1Utils_Help/Matrix1_Index.html at the bottom) :

http://www.matrix1.demon.co.uk/Matrix1Utils_Help/Commands.htm

http://www.matrix1.demon.co.uk/Matrix1Utils_Help/main.htm

-me, always -

pascontent.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jan 2009 14:15
Yes, that's because those links are to the standard DBPro help files and I haven't uploaded those - they work just fine when you click them in the IDE

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 4th Feb 2009 15:15
Quote: "I have a request:

Make object plain object number, xsize, ysize, xChunks, yChunks, xRows per chunk, yrows per chunk

I dont know the right word so i used chunk, what i mean is, i need to make this plain object from several smaller limbs. And i would like to set the polygon amount of every small limb.

Or, just give me a command that can subdivide object vertex amounts.

is it possible?"


Do you have any progress on this one?

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 4th Feb 2009 16:05
Quote: "you could use the FIRST ZONE/NEXT ZONE functions to iterate through all zones"

What the... these plugins have ZONES? Why did I spend a few nights making my own DBPro based zone system then? I've only been using Matrix1 for the hitimer() and pulling words out of a formatted string. Arg!

I've got to download the latest version and see what's going on. Sometimes I end up just coding inside my little box here all alone and reinvent wheels (which are probably octagonal shaped and slower!).

I'm not a real programmer but I play one with DBPro!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Feb 2009 18:15
Quote: "I've only been using Matrix1 for the hitimer() and pulling words out of a formatted string"

Then you are using maybe 4 commands/functions out of the 800+

Quote: "reinvent wheels"

Not necessarily a bad thing, as long as you are doing it to see how it's done, but coding it yourself when it's already there...

Quote: "Do you have any progress on this one?"

Not so far - I've spent very little time on the plug-ins since the last release. I'll see what I can do for the February release.

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 4th Feb 2009 20:31
Ah I did already look into the zone stuff you offer a while ago. I steered into my own home-grown solution because a typical game level of mine will have well over a hundred (potentially overlapping) zones. I do zone checks 100 times a second (physics related).

I did not do timing tests to see how fast your zones are but I decided if I had to check every zone every time no matter where the player was, it might get to be too much. My solution was to chop up the level into x/z grid slivers and keep a list of all the zones that "touch" those coordinates. Then when it's time for a zone check I take the player's grid x/z on the level and go to that list of zones to see if the player is within any of them (they can overlap). So it only checks the zones that have a chance of happening. Of course this makes me use a X by Z by MAX_ZONES size int array.

As your zone code works now, it would just replace my x/y/z location checks for the zone. The equivalent of your POINT IN ZONE() function. Maybe that's all I can get out of this...

What I'd like is a list optimized for only zones the player has a chance of being in. Basically have the plugin do the FIRST ZONE/NEXT ZONE/POINT IN ZONE for me.

Or is my DBPro-based optimization good enough and I'm just a lazy Basic programmer?

I'm not a real programmer but I play one with DBPro!
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 9th Feb 2009 20:53 Edited at: 9th Feb 2009 20:53
(Nevermind)

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 21st Feb 2009 22:56
Quote: "Quote: "I have a request:

Make object plain object number, xsize, ysize, xChunks, yChunks, xRows per chunk, yrows per chunk

I dont know the right word so i used chunk, what i mean is, i need to make this plain object from several smaller limbs. And i would like to set the polygon amount of every small limb.

Or, just give me a command that can subdivide object vertex amounts.

is it possible?"

Do you have any progress on this one?"


Still nothing at all?

There is always one more imbecile than you counted on.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2009 00:22
Not so far. I'll see if I can come up with something this weekend - we're about due for another release

Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 28th Feb 2009 11:41
Oh boy oh boy!
Did you add anything relating to objects' bounding boxes?

This message was brought to you by Grandma industries.

Making yesterdays games, today!
GMS0012
17
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 1st Mar 2009 18:41
is this working with 7.2?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Mar 2009 00:24
@ IanM,

Been looking and think some of your string commands conflict with STYX string commands - for future ref.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Mar 2009 00:31
Actually, it's the styx commands that conflict with my plug-ins - the commands in question existed in mine before styx was even thought of.

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th Mar 2009 01:15
@ IanM,

Whoops - my mistake...

No worries Ian - will do a workaround myself.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 10th Mar 2009 20:57
Quote: "s this working with 7.2? "


I've been using some of the functions and have had no problems yet.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Mar 2009 22:08
I suppose I should have taken the time to respond to a few outstanding questions ...

Yes, 7.2 is a minor change to 7.1 and so the plug-ins should work just as well with either one (providing the release notice with 7.2 was complete) - I've not noticed any problems so far, and as you can probably understand, I use the plug-ins all of the time.

@Grandma & CuCuMBeR
No, I've many other things on the go right now, but I'm working on both of these as and when I get a spare few minutes.

@tiresius,
I don't have an optimised search of zones just yet, but when I do, I'll use something like an octree for detection.

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Mar 2009 15:10
Sorry to bring this up, it's my fault for not moving along with the updates properly.
Anyway, I recently updated from a rather old version (I can't tell which, unfortunately, but I believe I downloaded it around the summer of 2007), and am now naturally having some compilation problems due to changes over the last two years.
Most of them are fixable by reading through the documentation, but here is one thing that I cannot seem to make out of my own, even though I spent hours on it:
get ptr to function(functionNumber) gives off the following error message: "Runtime Error - Matrix1Util_20: Unable to locate DBPro code prolog at line xxxx". It does not seem to matter what function numbers I feed it; 0-based, 1-based, having the actual functions written before or after the call to get ptr to function, and so on. However, the error message seems to imply that the fault is not actually with the parameter, but rather some sort of info that is unreachable. Is there some initialization command that has to be executed prior to using that method, or am I missing something else.
I'm using DBP v1.07, by the way.

Grateful for any advice,
Rudolpho.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 13th Mar 2009 17:57
tiresius,

I have a zone solution that does just that.
It was built for speed and stability so it has a very long code...

Here it is:
http://forum.thegamecreators.com/?m=forum_view&t=138546&b=6

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Mar 2009 23:26
Oh, finally found the answer to my question on page 16 in this thread.
Well then, all good. Lost my commands index file to the pesky DBP update installer again though...

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Mar 2009 14:35
Can you add this function to Matrix1Utils 07?



Your current function doesnt work with floats.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Mar 2009 14:58
Yes it does:


This correctly displays 1, 0.5 and 2.5. Are you mixing the types somehow? Sometimes DBPro doesn't make the best choice of functions when you mix them.



Anyway, here's a long overdue release:
Matrix1Util_01 - 1.1.0.3
- Internal change, relocation of code to shared repository.

Matrix1Util_02 - 1.1.0.5
- Internal switch from MS hash_map to tr1 unordered_map.

Matrix1Util_03 - 1.1.0.3
- Internal switch from MS hash_map to tr1 unordered_map.
- Internal switch from boost shared_ptr to tr1 shared_ptr.

Matrix1Util_04 - 1.1.0.4
- Added memblock read/write for strings, double integers and double floats.
- Changed all size parameters to accept integer values instead of dwords to remove unnecessary type conversions in DBPro.

Matrix1Util_08 - 1.1.0.3
- Internal switch from MS hash_map to tr1 unordered_map.
- Internal switch from boost shared_ptr to tr1 shared_ptr.

Matrix1Util_10 - 1.1.0.2
- Internal switch from MS hash_map to tr1 unordered_map.

Matrix1Util_12 - 1.1.0.7
- Added new versions of the GET LIMB BY NAME with a starting limb number.

Matrix1Util_13 - 1.1.0.6
- Added GET DISPLAY DEPTH function.

Matrix1Util_15 - 1.1.0.2
- SET ENTRY BUFFER and ADD TO ENTRY BUFFER commands added.

Matrix1Util_18 - 1.1.0.6
- Addition of multi-limbed planes.
-- Current design is to allow 1 texture per limb - this may not be what's generally needed and may change later.
-- In addition, width and depth must be positive values.
- Internal reorganisation of code.

Matrix1Util_19 - 1.1.0.4
- Added commands to exclude (or not) by group, or all objects.
- Added commands to call function pointers by group or all objects.
- Renamed functions GROUP COUNT & GROUP OBJECT to OBJECT GROUP COUNT and OBJECT FROM GROUP
- Tightened up checking of function pointers.
- Internal switch from MS hash_map to tr1 unordered_map.

Matrix1Util_20 - 1.1.0.6
- Internal switch from MS hash_map to tr1 unordered_map.
- Added new function to get DBPro function names by index.
- Tightened up the checking of function index ranges in GET PTR TO FUNCTION.

Matrix1Util_21 - 1.1.0.4
- Added FIND FREE ZONE functions.
- Refactored code for easier expansion and lower memory usage.
- Added group functions that act in the same way as object groups.

Matrix1Util_22 - 1.1.0.8
- Internal switch from MS hash_map to tr1 unordered_map.
- Correction of boost library usage.

Matrix1Util_26 - 1.1.0.0
- Internal code cleanup.

Matrix1Util_28 - 1.1.0.0
- Internal switch from MS hash_map to tr1 unordered_map.

Matrix1Util_29 - 1.1.0.0
- Added new variation for GET ARRAYPTR COUNT.
- Corrected help for CLEAR ARRAY command regarding UDT strings/memory leaks.
- Allow index to be set to -1, or 1 past the end of the array.

Matrix1Util_31 - 1.1.0.0
- Correction of boost library usage.



Version change only
Matrix1Util_14 - 1.1.0.0
Matrix1Util_25 - 1.1.0.0
Matrix1Util_27 - 1.1.0.0
Matrix1Util_30 - 1.1.0.0
Matrix1Util_32 - 1.1.0.0

There's nothing earth-shattering in this release - mostly internal changes that should not affect functionality - but some of the functions in the object group plug-in have been renamed so that I could re-use that same idea in other plug-ins (just zones so far).

Attachments

Login to view attachments
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 1st Apr 2009 05:38
Thank you for the zone grouping functions. It must be more efficient than me storing a X*Z*MAX_ZONES array!

I don't see a helpfile for FIND FREE ZONE. According to keywords it takes no parameters, but I assume it returns a free ZoneID ?

Thanks again IanM - you're my new hero!

I'm not a real programmer but I play one with DBPro!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Apr 2009 15:06
Thanks for pointing out the missing help - I'll get it added for the next release.

There are two versions of FIND FREE ZONE - the first accepts no arguments, and the second accepts a start point (a minimum zone id) and a range size - this matches all the other FIND FREE functions.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 6th Apr 2009 18:05
Problem with the Open Console. If you manually close the console window by clicking the [X] button, both the console and the program that called the console close.



Quote: "There's nothing earth-shattering in this release"

You're kidding, right? I really like the new commands to call function pointers by group or all objects! Allow for objects to be placed in multiple groups, and this will be perfect (imho).


Open MMORPG: It's your game!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Apr 2009 16:02
Quote: "Problem with the Open Console"

I'll look into that - I think that DBPro takes any window close event as closing the application down.

TBH, I'm not sure whether this is a good thing or a bad thing right now, but it might be good to allow either behaviour and allow the programmer to choose.

Quote: "You're kidding, right?"

Depends on your point of view. Once I'd thought about it, it was relatively trivial to implement. Also, I'm not sure that many people actually use the function pointer stuff, even though I've made it really simple to use - perhaps a few examples may get more people using it.

Quote: "Allow for objects to be placed in multiple groups"

I'm currently thinking here that instead of changing the plug-in to do this, that this should be done in DBPro code. I'm happy to write it myself though - I'll also convert it to template form if you send me details on how you are planning for that to be done.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 8th Apr 2009 00:49 Edited at: 8th Apr 2009 00:51
These new functions are amazing, especially the callbacks, I have no idea how you did them!

With the commands to call a function for each object, it might be useful to be able to pass some additional parameters

This plugin should come as standard with DBPro. It's a shame so many people don't even know about it.

If you need any new ideas, some advanced data structures would be cool, like the tables found in LUA. Each table would be a map of strings against objects, where each object could be any standard data type, or another table.

So you could have commands like this:
int id = create table()
set table element to integer <int tableid>,<string key>,<int value>
set table element to table <int tableid>,<string key>,<int tableid>
remove table element <int tableid>,<string key>
int id = get table element table()

etc.
You could have commands to write a table to a file, and it would automatically serialize any attached tables. You could allow function pointers to be written to the table and called straight from it as well, although when you serialize it, it would save the name of the function.

Would be a much more advanced form of the current ini plugin, and would mean that we wouldn't have to invent a new file format every time we want to save some data.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 8th Apr 2009 18:34
I can do it easily enough in code. It's just that your fantastic DLL is soooo close.

Basics: Create an array that contains a Group UDT and Object UDT. Cycle through the array, pull the group to determine which function to call and pass the associated Object ID to the function (and, yep, additional parameters would be cool).

The problem with this in DBPro is the array management is either slow or complex. Using your previous advice on another subject, I've created a sorted array code exporter, which exports the necessary functions to create a sorted array so the look-up of unique identifiers is fast. In the case of something like this object-group assignment, the unique identifier would probably something like ID=Val(Str$(ObjectID)+Str$(GroupID)) - which now slows things down again. I know there are other ways to do this too. The point is that this gets complex and slower, something your DLL helps to avoid.

I've even coded a nifty little source that stores, to the object, pointers to the function call and parameters using DBPro's new Add Memblock To Object command. This does the job nicely, but not neatly. This basically makes the Objects nearly autonomous - they can store their own functions and variables.


Open MMORPG: It's your game!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Apr 2009 22:42
I'm sure I can come up with something a little faster than that - I've been thinking about the issue a little and I'm sure I can come up with something modelled on the object group commands. I haven't decided whether to base it on arrays, memory banks, or even strings (Don't laugh: Although string storage may make things a little difficult in places, I do have lightning fast string manipulation routines).

If it turns out to be too hard to make it fast enough, then I'll simply knock together a stand-alone plug-in that can be used for general-use grouping of anything.

@Diggsey,
Maybe you should take a look at the data plug-in on my site - it's very similar to what you propose.

The biggest issue I have with that kind of system is whether to allow automatic conversion (as per the data plug-in), whether to only allow one data type (as per the lookup plug-in, matrix1util_31), or whether to simply trigger an error when carrying out a lookup of the wrong type (not written one for that yet).

The data plug-in allows any of the integer, float and string types, but you can pay a hidden conversion cost when you carry out a lookup (didn't like that, but it makes the job easy for the DBPro programmer).

The lookup plug-in only allows strings, but you have to explicitly convert the type (and it's a pain that I'm regretting already).

The last method may be the best for an experienced coder, but not for a beginner - I may code that in the future, or even change the lookup plug-in to act in that way.

Quote: "You could allow function pointers to be written to the table and called straight from it as well, although when you serialize it, it would save the name of the function"

Difficult - I can't guarantee to have the name of the function, and even if I did, I can't guarantee to have the code that function represents in memory.

Remember that with my plug-in you can register your own functions (they could come from some other plug-in such as a LUA plug-in), and that you can get function pointers from DLLs (that may not be loaded and that may also have come from another plug-in). 'Work for some, but not for others' isn't something I would like to put in place.

Your suggestions are gratefully accepted though, and the future suggestions on how to get around this issue

Login to post a reply

Server time is: 2024-04-26 01:43:11
Your offset time is: 2024-04-26 01:43:11