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
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 29th Jul 2009 13:40
I've found another bug related to the Make Object Plain/plane command: the height is always overwritten with the width, and thus, only squares can be created.
Phjon
18
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 31st Jul 2009 14:01
IanM,

Would it be possible to add some commands that allow the manipulation of arrays using their names (in variables) - something that can do the following:



I know that you can call functions using their name in a variable ( eg. the command "Call Function Name" ), so I thought it might be useful if one could do something similar with arrays...as in handle them by their name in a variable.

I suspect that the above is possible, as you've mentioned that, along with the array storage, the array's name is stored in memory (I'm guessing it's accessable through a pointer somewhere).
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Jul 2009 16:05
By 'name', I didn't mean 'stored as a string', but as a location in memory that you refer to by name in your code.

The only runtime names in string form that are available are function names (hence the recent addition of getting/calling functions by name), and that was an accidental side-effect of Lee including UDT format strings for use at runtime which I took full advantage of.

Phjon
18
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 8th Aug 2009 01:07
IanM,

Would it be possible to add a command which prevents a lookup table from automatically sorting its contents into alphabetical order?

Could I also ask how you're getting on with the creation of examples to be placed into helpfiles for the DBPro help system?
CresCo
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 14th Aug 2009 17:56
Hey IanM,

Is there a way to prompt a player for input, show the input on the screen as it is being typed as with the standard 'input' command, but keep this input process from pausing the program execution? I need to create a scenario in which a player tries to copy a word displayed on the screen but only has a few seconds to do so before the the program interrupts his/her input and continues on to the next step of its execution. Here is what I have so far:


obviously the stupid <= 0 at the end is only necessary because at the moment the time simply counts down forever while it waits for the user to hit 'enter' after typing their response, often turning up negative numbers by the end.

The next part of the program needs to compare the two strings and determine the player's accuracy. Here is what I have for that:


As is probably clear to you (but is as such a mystery to me) this simple function does not work; neither enemydamage nor playerdamage is increased in any circumstance.

Finally, is there a better way I can achieve the stopwatch functionality from my first code snippet- perhaps one of your dll plugins?
Thanks!

CresCo Games: makers of fine software since 2004
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Aug 2009 21:01
Quote: "Is there a way to prompt a player for input, show the input on the screen as it is being typed as with the standard 'input' command, but keep this input process from pausing the program execution?"


You already have the tools to do this, and fairly simply too:


Quote: "neither enemydamage nor playerdamage is increased in any circumstance."

Have you declared these variables as globals? If not, then they will be local to the function and will reset to zero every time you enter the function.

byo
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 20th Aug 2009 02:12
Thanks a lot. I just found out about this extension. This really improves the command set a lot.
tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Sep 2009 06:55
I'm starting to look through the ZONE stuff you offer, since I was going to overhaul my large array of 60x60x200 integers (which is 60x60 groups of possibly 200 zones max), and just use 3600 zone groups. But I found something curious and I just want to know if it is intentional or not.

Is a zone only allowed to belong to one group? Or should a zone belong to multiple groups? With the following code it seems to overwrite which group the zone is in, so it is in the last one set.



...causes the following output:


I was hoping zone 2 could be in group 10 and group 5. Is the above intentional? Thanks for any info.

I'm not a real programmer but I play one with DBPro!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Sep 2009 15:38
It's intentional right now - a zone must be in a group (it's placed in the default zone group when it gets created).

At some point I'll work on allowing you to specify whether a zone can be placed in one group only or in multiple groups, and whether it's possible to have a zone in no group at all. Once I've worked it out, I'll do the same for object groups at the same time.

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Sep 2009 22:31
Ok in the meantime I'll try to streamline my system as best I can, and whenever you're done with the new grouping implementation I'll check the efficiency of both and decide on one. Thanks!

I'm not a real programmer but I play one with DBPro!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 20th Sep 2009 23:42
I've been fighting with the Make Object Plain command for a while, I seem to be having the same problem as Math89 - the height is overwritten by the width causing only squares to be created.


Come see the WIP!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Sep 2009 16:41
@Cash & Math89,
I've spotted and fixed that bug - it'll be in the next release.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Sep 2009 20:19
Quote: "that bug - it'll be in the next release."


I hope not...

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th Sep 2009 00:02 Edited at: 28th Sep 2009 00:33
Apparently Matrix is not compatible with the DBP FPSC source code. The compile error is in regard to a variable that is extensively used by Lee: pi

It is also apparent that there are math commands and/or functions in this plugin which more than likely contains the mathematical pi expression.

Now, the question. Is it possible to somehow get rid of the individual expression or the whole math part of the plugin? I doubt that I will use it.

EDIT:

Never mind, I figured it out

-----------------------------------------------
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2009 15:14
Three obvious fixes:
1. Rename the variable 'pi' in the code to something else,
2. Change all occurrences of 'pi' in to code to 'pi()',
3. Move matrix1util_07 to one side while compiling the code, losing the min/max functions, and the integer version of ABS, along with a few other minor things.

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th Sep 2009 17:54
Thanks IanM

This is a great collection of plug-ins BTW.

-----------------------------------------------
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 1st Oct 2009 05:21
OK, I tried "split" and "nest" for search. Nothing came up, so here is the question:

Can you have nested "split strings"?

-----------------------------------------------
OliveTreeGames
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2009 15:15
I'm not sure exactly what you are asking. Can you give me an example?

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 1st Oct 2009 21:15 Edited at: 1st Oct 2009 21:16
Thanks for responding. It was probably a dumb question because, even though I haven't test it (too lazy), I don't see how it could be

What I meant was can you nest them just like nested if statements. However, each "split string" would need its own array of "words" and I don't see that that is possible. In creating a "compiler" such as FPSC, you need the ability to have developer input and then parse that out. In doing so, you have strings within strings that need to be parsed. First/next token$ seems to get confused when you try to parse strings within strings. I thought maybe that was possible since the "Next Token$" requires at least the delimiter. However, that doesn't work. I thought perhaps I would send the next string to get parsed to a function. That didn't work because it still needs to retain the information regarding the old string.

Just for the fun of it I'm going to try writing a function that will do what I would like to see as far as a string parser. Since arrays are global automatically anyway then this might work. We'll see.

-----------------------------------------------
OliveTreeGames
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Oct 2009 00:11 Edited at: 2nd Oct 2009 00:12
TBH, unless the language that you are parsing is quite simple, I wouldn't use the string functions. I'd probably load the file into a memory bank, peek bytes from it to build each token, then pop them onto a stack. Then I'd parse that.

However, if SPLIT STRING is your thing and you want a stack of the split results, then you can either simply re-split the string when you need to, or save the results each time in an array that's local to your function - you might even find that it's faster to re-split the string than save the results each time, and it'll probably be easier too.

Phjon
18
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 4th Oct 2009 15:23
IanM,

I seem to be having some trouble trying to use your Hitimer() command with numbers in scientific notation. I have some example code which demonstrates the problem:



The variable "Time" seems to be OK, as the "Hitimer()" commands which provide it with its value use numbers in non-scientific format. A number in scientific format by itself seem OK as well, as shown in the third line of text that is displayed by the program.

However, the "TimeB" variable, whose value is supplied by "Hitimer()" commands which use scientific notation for the frequency, seems to degenerate after a short while, oscillating between 0 and a number.

There must be something wrong here, as a line of code cannot take 0 seconds to execute. However, I'm not sure if it is just a problem with the "Hitimer()" command, or whether the use of numbers in scientific notation affects other commands as well.
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 10th Oct 2009 03:28
Hi IanM, I was wondering if it would be possible for you to add a command/set of commands that work similar to the Set Particle Z Sorting command found in the cloth and particles pack. I am currently working on a particle system, but I am working within the confines of evolved's deferred shading. This causes a few problems since I want to apply a shader to the particle objects to do various things (such as allow the objects to be obstructed by the scenery, even though the final render is done with screen quads). I converted Math89's soft particle shader to do just this (I posted a demo in the "Learning to write shaders" thread), but I am running into problems with Zsorting. I havn't found any pleasing ways to get the objects to render in the proper order while the shader is applied, and I am out of ideas on the subject.
Do you think this is even possible though a plugin, and if so would you consider adding the functionality to your already great set of plugins?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Oct 2009 21:40
If you have transparency enabled in your shader but have not used the SET OBJECT TRANSPARENCY command on your particle object, then try that. That will place the object into a different rendering phase that automatically sorts it's objects by distance from camera.

Quote: "Do you think this is even possible though a plugin"

TBH I have no idea. I'm willing to take a look at it, but try out my suggestion first. If it doesn't work, then I'll need example code/media to use to play around with - you can email that directly if you wish.

@Phjon,
Think about what you are trying to do here - you are running a processor that at the most is clocking at 3400000000 ticks per second and you are asking it provide measurements at around a third of that clock rate.

In addition, with numbers that large, and using the floating point version of hitimer (that's happening when you specify a float number, and scientific notation is floating point) you are also introducing further discrepancies as the numbers get further apart - it's a standard floating point issue. It could be fixed for frequencies that high, but only at the expense of lower frequencies and I don't plan on doing that.

My recommendation is to use 1000000 as the maximum useful frequency value for performance timing purposes, and something very much lower, such as 60, 100, or at a stretch 1000, for game use.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Oct 2009 21:43
Here's a small maintenance release.

Matrix1Util_02 - 1.1.0.7
- Added new SET TICKER RATE command.
- Cleanup of hitimer functions to give slightly better/more accurate results at higher frequencies.

Matrix1Util_07 - 1.1.0.4
- Stop crash on INTVAL/MIN/MAX functions when a null string is passed.
- Fix crash on matching min/max values for the WRAP functions.
- Fix crash on the GCD functions when the initial divisor is zero.

Matrix1Util_16 - 1.1.0.5
- Fix UNQUOTE$ function - terminator char was off by 1 and could include another char in error.

Matrix1Util_18 - 1.1.0.7
- Corrected minor error in internal mesh initialisation code.
- Fixed bug in plane creation that caused the width to be used instead of the depth.

Matrix1Util_20 - 1.1.0.8
- Fixed lookup in CALL FUNCTION NAME function.

Matrix1Util_22 - 1.1.0.10
- Force a flush when changing the file size.

Attachments

Login to view attachments
freight hopper
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Just beyond the Dunsmuir yard limits
Posted: 24th Oct 2009 20:43 Edited at: 24th Oct 2009 21:17
display depth() works but doesn't auto-highlight in blue like the other display commands.

--hmmmm. Now it is coloured.

Maybe it's CodeSurge.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 1st Nov 2009 13:44 Edited at: 1st Nov 2009 13:46
Your plains worked great in my game MetalMorphosis. I was able to make destructible walls because of them. Thanks again for a wonderful set of plugins! Thanks for fixing the plain bug, but I think I'm glad the bug was there in the first place, it kept my wall plains smaller.

While I'm posting, I have a thought / suggestion. With the command CALL FUNCTION PTR, do you think it would be useful to be able to call it as 'CALL FUNCTION PTR ptr,arglist$', where arglist$ is a comma delimited string containing all of the function's arguments, rather than 'CALL FUNCTION PTR ptr, arg1, arg2, ...' and your plugin parses it appropriately?

It would greatly simplify using this command in a scripting engine. As it is now it is cumbersome to call functions with mixed data types in this manner.


Download the game!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Nov 2009 18:30
I've believe that I've had that discussion before in this thread, and I decided I wouldn't do that.

The problem is here:
Quote: "and your plugin parses it appropriately?"


Basically, should the string "5" be parsed as a string, an integer, a float, or even one of the other types? Because there's no way for the plug-in to know the target types (those are 'lost' during compilation), it can't do the parsing/conversion automatically.

My suggestion for you is to pass the string into your function and then use the SPLIT CSV STRING command to split it and convert the fields as needed.

Alternatively, you can take a look at OPEN ARGLIST and associated functions in the function pointer plug-in and see if they can be of any use. For an example, take a look at a simple 'printf' function that Diggsey put together using arglists : http://forum.thegamecreators.com/?m=forum_view&t=153516&b=6

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Nov 2009 20:36
Yay, someone finally noticed it

Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 6th Nov 2009 12:02
Hi IanM. You have created a great plugin collection but unfortunately due to my programming limitations, I have only been able to use a few of your "commands". Would you be able to find time to include a small example of each of their uses below your descriptions in a similar way that the DBPro help works. Thanks.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Nov 2009 14:17
That has been asked for before and it's something I'm (occasionally) working on.

In the meantime, look for examples I've posted here and there throughout this thread. If you have any specific requests, just ask.

Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 9th Nov 2009 04:44
I think I may have found a bug

It seems that the command "call function for object group" is broken for groups containing more than one object. Here's an example:



If you change i = 1 to 25 into i = 1 to 1 then it works fine.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Nov 2009 21:26
Darn it

Thanks for the report - I'll take a look into it.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 14th Nov 2009 21:16 Edited at: 14th Nov 2009 21:51
Hi Ian, here is what I've got with Make Object From Pointer. The string table is apparently wrong since I can only find MakeObjectFromAddress() function.



[Edit]

Even after fixing wrong string table I couldn't make this command do anything. It simply locked up DBPro. Could you please be so kind and give me a quick example on how to correctly use this command in DB? Thanks.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DBPro 7.4 + PureGDK

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Nov 2009 01:05
Yes, the resource string was wrong and I've corrected it ready for the next release.

As for using the command correctly, you need to make sure that you have a DBO format file loaded into memory in some way, and use that address.

Here's a very simple example:


The command may not seem that useful, but the idea is that you can store multiple DBO objects in a single file and load each of them in turn.

I would actually advise using MAP FILE TO BANK and MAKE OBJECT FROM BANK instead - they are easier & safer in use than raw memory, and will work as long as the whole file can be mapped into memory.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 15th Nov 2009 01:42
Yes, thank you this is now perfectly clear. I want to get this working together with PureGDK.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DBPro 7.4 + PureGDK
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 16th Nov 2009 06:18
Ian, would it be possible to have something similar to Make Object From Pointer but with images? Make Image From Pointer ID, MemoryAddress, Mode, Reduce. Mode and Reduce are quite important, at least for me since if there wouldn't be such parameters we could not load cube maps or specify texture quality when loading. Thank you.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DBPro 7.4 + PureGDK
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 19th Nov 2009 06:11
Ian:

I have another request for you if you think it is feasible. What I am looking for is a way to confine 2d commands, including paste image and Cloggy's D3D_Func commands, to a set of coordinates. I believe there would be three commands, one to only allow changes between x1,y1,x2,y2, one to only allow changes outside of x1,y1,x2,y2, and a third to reset to default.

Is something like this possible? Right now I have functions set up to do this. The first takes the current bitmap and copies it to a free bitmap. Then I do all my drawing commands. After that I call another function which copies the allowed area from the temporary bitmap onto the actual bitmap and frees the temporary bitmap. However, bitmap commands are somewhat slow.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Nov 2009 14:17
Quote: "Is something like this possible?"

It's fairly easy to do the 'in an area' for the accelerated stuff (PASTE IMAGE, PASTE SPRITE, BOX, LINE, TEXT, PRINT etc) as I've already done that for sprites (see SET SPRITE VIEW).

Circle, ellipse and dot are harder so I wouldn't necessarily bother with those, although they are doable.

'Outside an area' is a little more difficult, but again doable to the same levels.

@Olby,
I'll take a look, but I'm not promising anything - I have no experience with cube maps in particular, so can you provide a working example that uses LOAD IMAGE? Just zip it and email it to me direct.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 19th Nov 2009 20:53
Ian, I sent the example you wanted.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DBPro 7.4 + PureGDK
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Nov 2009 22:47
Great, I have received it. I'll try and get to this soon (after the next release I'm afraid).

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 21st Nov 2009 02:36
Quote: "Great, I have received it. I'll try and get to this soon (after the next release I'm afraid)."


Great, thanks.

ACER Aspire 5920G: Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP1, DBPro 7.4 + PureGDK
Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Australia except on Tuesdays
Posted: 21st Nov 2009 10:30 Edited at: 21st Nov 2009 12:32
Hi IanM

I'm not sure if this is a bug or not but here goes

the Standard LEFT$ treats negative values in the size parameter as zero and produces an empty string.

your FAST LEFT$ gives a Runtime Error 112 - Illegal size error

Personally I think getting the error is better and encourages good coding standards.

I only menton it as the latest FPSC source exploits the fact that negative sizes produce empty strings and a direct replacement of the standard string functions with your far faster ones will not work.

I know because I tried it. Hence this discovery.

RaTall

ps quick hint for those modding FPSC for removeedgespaces think TRIM$ but remember tabs etc
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Nov 2009 13:52
Quote: "I'm not sure if this is a bug or not but here goes"

No, it's not a bug - it's something I deliberately coded in because I believe the same as you.

However, as people need to do what you tried to do, here's a simple fix to the problem:


That is directly equivalent to the built-in LEFT$ command.

Quote: "think TRIM$ but remember tabs"



Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 22nd Nov 2009 20:17
Do you think it would be possible to make a command that would generate mipmaps on an image? I'm creating an image from a memblock, then applying it to an object - however no matter what I do, I can't get mipmaps to work

I've tried making a bitmap out of the memblock and then using get image and I've tried using set object texture, so far no luck. The only workaround that seems to work is saving it to a file and then loading it, which isn't a very nice workaround

Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Australia except on Tuesdays
Posted: 23rd Nov 2009 07:19
FOR INFO

on WINDOWS 7 64 bit

WINDOWS VERSION() returns 6010

WINDOWS PLATFORM() returns 2

or at least it does on my system.

Would anyone know if it returns different on the 32 bit version.

RaTall
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Nov 2009 19:05 Edited at: 24th Nov 2009 19:37
That's what I'd expect to see from 32 bit or 64 bit versions of windows - 32 bit or 64 bit does not change the windows version, and really, as DBPro is 32 bit and so are it's plug-ins, you are running in 32 bit mode anyway.

@Airslide,
Right now I don't believe that there is a way to create a mipmapped texture in DBPro other than via loading from file, and I see nothing that I can hook into to force it. I'll keep it on my outstanding list for future work.

Ernst Rolf
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location: Sweden
Posted: 29th Nov 2009 11:20
Admittedly I haven't looked through the entire thread, but a googling yielded no useful results anyway.

I have a problem with the is memory writeable / readable functions from this pack. It appears they basically always return false. Maybe I'm using them wrong, but it looks straight-forward enough.

This small snippet will simply print
Quote: "0
0
-----
0
0"
when I run it:



O ja
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Dec 2009 21:16 Edited at: 3rd Dec 2009 22:05
Quote: "Maybe I'm using them wrong"

Or maybe you are using windows Vista or 7? Microsoft has disabled those calls for these OS's because it can cause problems when growing the program stack.

I didn't know they'd disabled those calls until now, so I hadn't looked for a replacement - I'll do that now though.

[EDIT]BTW, just because the memory is flagged as readable or writeable, it doesn't necessarily mean that you should do either - the memory may not belong to you directly (it may belong to a DLL, and not one that's necessarily connected with your game, or it may be memory that you are going to allocate in the future). Use these functions with care.

Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 6th Dec 2009 13:55 Edited at: 6th Dec 2009 13:58
Are there limits to either the vertices or indices arguments in the MAKE OBJECT NEW command? I'm trying to optimize a geodesic sphere, trimming it to unique vertices only. I get an "unknown exception" error when I crank up the size. I can't reach what would be called the Level 6 quaternary triangle matrix in your older geosphere code. I'm using code older than that which depends on "frequency", or the number of divisions of each side, and which is not limited to powers of 2. I get the error with a frequency greater than 52 as shown:
Level, Freq, Polys, Verts , Indices
5, 32, 8192, 4098, 24576
n/a, 52, 21632, 10818, 64896
6, 64, 32768, 16386, 98304

Here is code to illustrate.


Any way around it?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Dec 2009 14:54 Edited at: 6th Dec 2009 15:13
DBPro has a built-in limit of 65536 vertices, which means 65536 polys with an index, or 21845 without. Also, sometimes the video drivers can cause problems with high-poly meshes too, by converting an indexed mesh internally to a non-indexed mesh.

The way around it is to use multiple meshes/limbs in an object - you can make a multi-limbed object by using my BEGIN NEW OBJECT/ADD NEW LIMB/FINISH NEW OBJECT commands.

For 2 meshes you can divide the vertices into 2 sets, left (x <= 0) and right (x >= 0). For 4 meshes, divide further into another 2 sets (y <= 0 and y >= 0). For 8 meshes, divide each set further (z <= 0 and z >= 0). 8 times the current limit should be more than enough for almost any purpose.

[EDIT] I'll add a few more checks to the command to make sure a real error message is displayed

[EDIT 2] Thinking about it again, I'm not so sure of the limits for a index-based mesh. The number of vertices is right (it's always 65536), but it may be that the index size is effectively unlimited.

Login to post a reply

Server time is: 2024-11-22 04:50:51
Your offset time is: 2024-11-22 04:50:51