MODULE & PLUGIN: Ags 3d v1.20

Started by Kweepa, Sun 11/09/2005 23:45:01

Previous topic - Next topic

Kweepa

Ok, sorry for the delay.
I finally got around to investigating these problems.

32 bit - I'm not sure this has ever worked, now that I look at the plugin code. I'll see what I can do about it for the next version, but for now, you'll just have to use 16 bit, which works fine.

Sky - I seem to have commented out the code that draws the sky, so it's always a default blue sky. Sorry about that. I'll put it back for the next version.

Resolution higher than 320x240 - You need to use the Ags3d.SetWindow function to position and size the 3d window. I didn't want to make the plugin automatically resize the window depending on the room size because you might have called the SetWindow function. I suppose I could check for that, but it's not really all that necessary because it's much easier not to and not obvious what's happening behind the scenes.

Not sure when I'll have time to release another version, but it probably won't contain much more than these fixes.
Still waiting for Purity of the Surf II

Sunwalker

Thank you Steve, that works perfectly! In any case I await the new version impatiently. There are some functionalities which I would like much to see in one of your future versions:
- The use of the characters in 3D with plug-in character3D.
- Possibility of having a character in front of the camera for a play in third person view.
Of course, that is only suggestions and you does of them what you want. Continue your super job!

Kweepa

Ok, I updated to v1.19.
http://www.steporg.com/step/ags/tech/Ags3d119.zip
Now, 32 bit works fine, as does the sky (which must be the same colour depth as the game).
I also replaced the "editor cursor sprite" with a crosshair because I was having trouble rendering the sprite in 32 bit.
Still waiting for Purity of the Surf II

Sunwalker

Good, I tested the new version of Ags3d, Steve. Thanks to the SetWindow command, I could put the game in 640x480 without problem. On the other hand impossible to go beyond without bugs. Just to know, it is normal that we cannot ? Did you voluntarily limit the resolution ?

With regard to the pallet in 32 bits, the bug disappeared, replaced by another! Indeed, as soon as I launch my game with this mode of color, it plants and is closed immediately. It is not really a big problem because 16 bits is already sufficient.

Besides, they is always cool. I tested the loading of models OBJ and it goes perfectly. On the other hand, it is necessary really to optimize the number of polygons to the maximum if we doesn't want it lags. A question about models OBJ: How do you make to import some with textures in your game ? I use 3dsMax and at the time of export, I do not see exactly what it should be done so that texture appears on the model concerned. A tutorial could be useful in this case. A small problem with certain models: I pass through the walls by places and at others I block straightforwardly whereas one must be able to reach it. I do not know from which the problem comes (Perhaps an adjustment of the box of collision of the hero ?)

Another question: I do not understand well the operation of the SetFirstPersonStepDown command. I put various values, but I do not see any change. With what that is used and how to make use of it? Is it what makes it possible to define the value from which, the hero will be able to go up on objects? (like the steps of a staircase)

Here, I will stop there for the moment with my questions. I hope not to annoy you with all that but I like much work that you made with it plug-in and I try to understand the least details of them before using it to do something of concrete.

Ubel

In the new version the shadows aren't similiar to those in the screenshots anymore, which bugs me a lot. For example, if I make a box, two of the sides that should be shaded with a darker color are now plain black. I might be just missing something, but if I'm not, could you please fix this? :)

Kweepa

Quote from: Pablo on Sat 07/10/2006 15:22:45
In the new version the shadows aren't similiar to those in the screenshots anymore, which bugs me a lot. For example, if I make a box, two of the sides that should be shaded with a darker color are now plain black. I might be just missing something, but if I'm not, could you please fix this? :)
Oh, yeowch. I'll take a quick look and get a fix out.
Still waiting for Purity of the Surf II

IceMan

Apologies if this has already been covered, but does this support sprites that only face on direction (i.e. don't always face the camera)?

Thanks

Sunwalker

You have the function Ags3d.SetObjectSpriteUseHeading (oObject, bool). You put the name of your object at the place of oObject and you replace bool by true if you want that your sprite stay fixed and false if you want that it always faces the camera (what it does by default). Of course, it is necessary that your sprite is an object which you created in AGS and not simple a sprite. I did not find a command doing that directly on a sprite. Finally the difference between a sprite and an object is small.

IceMan

Great stuff!  Thanks sunwalker.

Sunwalker

Steve, could you make available variable X, Y, Z of Ray Hits please? It would be very useful to develop a FPS.

Kweepa

I've added a bunch of new accessor functions and updated to version 1.20.
See the first post or get it here: http://www.steporg.com/step/ags/tech/Ags3d120.zip

Pablo, I don't see the problem. The lights were updated several versions ago - perhaps you need to add an ambient light?
Still waiting for Purity of the Surf II

Sunwalker

Steve, I tested some of the functions (GetRayHits and GetPrimPosition) but they always return me a float equal to 0.00. I think there is a problem somewhere, no ?

DoorKnobHandle

Quote from: Sunwalker on Mon 23/10/2006 10:35:28
Steve, I tested some of the functions (GetRayHits and GetPrimPosition) but they always return me a float equal to 0.00. I think there is a problem somewhere, no ?

In this context I'd like to re-mention the problem with the functions that should return the camera position values and returned 0.0f always as well. I think those problems still exist, if I didn't miss anything.

Great work with version 1.2 though, it's getting better and better with each and every update! :)

Kweepa

#133
Ok, I fixed the float return values, and reuploaded v1.20.
I should have done a forum search to find this answer (rather than poring over calling conventions and the AGS source code): :)

Quote from: Pumaman on Mon 10/10/2005 18:47:05Floats are a bit special in the AGS scripting system. This is because most compilers such as GCC and MSVC always convert floats to doubles (64-bit) when passing to and from functions, whereas the AGS script actually uses them as 32-bit floats.

This is an extract from the AGS Source Code on how the engine deals with this problem. It's not pretty.

#define SCRIPT_FLOAT(x) long __script_float##x
#define INIT_SCRIPT_FLOAT(x) float x = *((float*)&__script_float##x)
#define FLOAT_RETURN_TYPE long
#define RETURN_FLOAT(x) return *((long*)&x)

int FloatToInt(SCRIPT_FLOAT(value), int roundDirection) {
  INIT_SCRIPT_FLOAT(value);

  int intval = (int)value;

  return intval;
}

FLOAT_RETURN_TYPE IntToFloat(int value) {
  float fval = value;

  RETURN_FLOAT(fval);
}


Above are some examples of a (stripped-down) version of FloatToInt and IntToFloat to demonstrate how the macros are used.
Still waiting for Purity of the Surf II

Sunwalker

Thank you Steve. It seems to work. Excellent job. ;D

abibliophobe

Okay, so this is probably something stupid, but when I try and rotate an object by putting in Ags3d.SetPrimRotation(i, 20, 0 ,0) [where i is the int value thingy for a cube as in the default code in the manual/readme/thing] it comes up with a scripting error - "Type mismatch: cannot convert 'int' to 'float' ".

Normally I would assume it was something wrong with my coding but if I change "Rotation" to "Colour" or "Scale" or any of the other parameters it works fine...

DoorKnobHandle

Quote from: Zirconius on Wed 15/11/2006 11:49:12
Okay, so this is probably something stupid, but when I try and rotate an object by putting in Ags3d.SetPrimRotation(i, 20, 0 ,0) [where i is the int value thingy for a cube as in the default code in the manual/readme/thing] it comes up with a scripting error - "Type mismatch: cannot convert 'int' to 'float' ".

Normally I would assume it was something wrong with my coding but if I change "Rotation" to "Colour" or "Scale" or any of the other parameters it works fine...

Untested, but you should try it with:

Code: ags

Ags3d.SetPrimRotation ( i, 20.0, 0.0 ,0.0 );


The ".0" means you're passing floats instead of ints, and this function seems to expect floats!

abibliophobe

Thanks dkh, that seems to work ;D

Gareth r 07

hi.
    (before you say anything, i know this probably doesnt belong in this forum, but i dont know where else to post it!)

ok, i have tried all different versions of ags3d with all different versions of ags, but keep being bombarded with errors. i can fix some, but then i get struck with another. the one i am stuck with at the moment says;

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x01E13BB5 ; program pointer is +31, ACI version 2.71.894, gtags (2039,18)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------



i am totally stumped because the demo works fine. can somebody please help me... i cant even start making a new game.   :(

Kweepa

Did you use the tutorial? At what point did it stop working for you?
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk