MODULE & PLUGIN: Ags 3d v1.20

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

Previous topic - Next topic

Kweepa

This is a module to create and manage three dimensional rooms.
A picture is worth a thousand words:





The module includes a player movement controller (keyboard and mouse, collisions).
Full interaction with objects and characters is possible.
The zip file includes the module, plugin, and documentation.
Rooms can consist of sprites, cuboids, cylinders, spheres, pyramids and tetrahedra.

Download v1.20 (Requires AGS v2.71 or higher.)
(Now also uses a plugin for speedup!)
Mirror v1.20 (Thanks Neole & Rui)

Thanks to Jan Simon for the basis version, "AGS3D".
Still waiting for Purity of the Surf II

HeirOfNorton

Useful tidbit I noticed while playing around with this. If two primitives are directly next to each other (ie, they have two faces on the same plane) it can cause some sorting errors, however, if even the tiniest space is left between them (0.001 units, say, too small for the gap to be seen) then they will be sorted properly.

HoN

Kweepa

Can you provide an example of the sorting errors?
I don't have problems like that, and I'd like to fix it - it shouldn't be that fiddly.
Still waiting for Purity of the Surf II

HeirOfNorton

I'll include the one I've had (commented out) in my Ags3d modification I'm posting later this evening. In brief, though, I have an indoor sceen with several hallways, and a single cuboid as the ceiling. Sometimes the ceiling is drawn in front of the walls, and putting the miniscule gap there fixed it. (I would imagine that CalcSplitPLanes works better with a gap than with primitives that are touching, but that's just a guess.)

One other thing, though. The engine cannot handle flipped sprites (in character views) properly. Not sure if it's possible to fix, as I have been unable to find any way to find out in the script if a particular frame is flipped. (Hey, CJ, how about another GetGameParameter?)

HoN

Kweepa

Quote from: HeirOfNorton on Fri 16/09/2005 01:14:58
In brief, though, I have an indoor sceen with several hallways, and a single cuboid as the ceiling. Sometimes the ceiling is drawn in front of the walls, and putting the miniscule gap there fixed it.
If it's a ceiling in an indoor scene, why not just make it one of the unsorted prims? It should work anyway, but the unsorted prims are essential for speed.

Quote
(I would imagine that CalcSplitPlanes works better with a gap than with primitives that are touching, but that's just a guess.)
Not really. It handles slightly overlapping prims pretty well (usually!). I'll be interested to see your example.

Quote
One other thing, though. The engine cannot handle flipped sprites (in character views) properly. Not sure if it's possible to fix, as I have been unable to find any way to find out in the script if a particular frame is flipped. (Hey, CJ, how about another GetGameParameter?)
I hadn't noticed that. There's an obvious workaround, though. :)
Still waiting for Purity of the Surf II

HeirOfNorton

Quote from: SteveMcCrea on Fri 16/09/2005 01:25:24
If it's a ceiling in an indoor scene, why not just make it one of the unsorted prims? It should work anyway, but the unsorted prims are essential for speed.

There are other parts of the scene that are higher than this ceiling, so they would sometimes appear THROUGH the ceiling.

Quote
Not really. It handles slightly overlapping prims pretty well (usually!). I'll be interested to see your example.

Hmm, now that sorting error's back again. Maybe I imagined the change helping (arrghh).

Quote
Quote
The engine cannot handle flipped sprites (in character views) properly.
There's an obvious workaround, though. :)

Heh, yeah, but you might want to mention this in the docs, so that people know it's a limitation in AGS itself, and not a mess-up on their part or a bug in the module (like I thought at first)  :)

Anyway, new version's up in the other thread. Check it out.

HoN

Kweepa

#6
Thanks strazer :)

I worked on the plugin (not the module) some more...



http://www.steporg.com/step/ags/games/IVSpy.zip

[EDIT] Fixed url. Damn server requires capitalization.
[EDIT] Added alleg42.dll.
[EDIT] This version is using a plugin and a module combined... for extra ease of use.
Still waiting for Purity of the Surf II

GarageGothic

Wow, so you've actually managed to do all the texture perspective deformation that can't be done in-engine?

Kweepa

Sort of. I let Allegro do it :)
It was painful to get right though. Texture maps have to have power of two widths and heights, so I had to create a texture cache. And, AGS's Allegro version is old, so the BITMAPs aren't interchangeable.
Still waiting for Purity of the Surf II

GarageGothic

Oh ok, so this isn't a technique I should look into for my dynamic shadow script then (based on dynamic sprites, so no caching)? Nevertheless, I'm looking forward to try this out, if the internet works when I get back to the hotel.

Kweepa

#10
I could add a function to invalidate the cache for a sprite.
I could also add transparency if you need it.
Still waiting for Purity of the Surf II

GarageGothic

#11
Wow. This is quite impressive indeed. I can't believe how far you've come just in the last two months. Didn't the old plugin support 640x480 res though? When I try it here I only get a 320x200 window in the upper left corner with corrupted graphics.

Edit: Ah, I see. I could have sworn that the previous version of the plugin (not module) supported it though - I've been running all the AGS3D tests in hi-res to see what kind of frame rates I got. Still, this is beginning to look like an actual game. I especially loved the ringing phone - I see great potential in the plugin/module.

Kweepa

#12
I forgot about 640x480.
With the module, it was all handled automatically by AGS.
I need to write specific support for it in the plugin.

[EDIT] The previous plugin called AGS functions to draw the triangles, so yes, you're right, it did support 640x480.
Still waiting for Purity of the Surf II

Gregjazz

#13
Wowies! :o

So would I be correct in assuming that a completely texture-mapped world using this new AGS3D would be possible?

Rui 'Trovatore' Pires

Extraordinarily impressive, and it reminded me of something I wanted to ask for. I know that we can make the camera move as we will, and thus create effects like the "swinging out of bed" one, but that'd involve rather a bit of "Set Camera Position to XYZ, Wait, Set Camera Position to XYZ, Wait, Set Camera Position to XYZ..." and so on, no?* What would be the chances of functions that did it for us?


*If not, I'd be interested in knowing how you did those effects - i.e., if there's a more user-friendly way
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kweepa

A fully texture mapped world would need just a little more work...
Presently you can only assign a texture to one face of a cube, or to a sprite (which is essentially one face of a cube). I'm not sure what the best interface would be to extend that. A fully textured cube? Texturing all primitives (but how to assign UVs?)? I want this to still be scriptable...

For the swinging out of bed, I played the game, writing out the camera positions as script commands, then cut and pasted those into script. Spline support would be a nice addition, but it's difficult to set up a spline without visualizing it. I guess I could add splines to the editor.
Still waiting for Purity of the Surf II

Gregjazz

For the short term, a one-texture-per-face wouldn't be all that bad. After all, that's what DOOM had, right?

IceMan

Now this really is something - well done!
The idea of recording your own camera movements, then plugging them back in, is a brilliantly simple one.Ã,  Right now I'm wondering how this can be used to create 3d effects in 2d games.Ã,  That is, if the detail of 3d rooms reaches a certain point, you can "fool" the player into thinking they are looking at a 2d background in a cutscene, and then WHAM!Ã,  The camera actually SPUN ABOUT THE PLAYER!!!!!

Aw, yes!Ã,  ;D

Rui 'Trovatore' Pires

#18
Heh, interesting. I say, that recording, was it done manually or did you add something to the plugin that helped you along? If the latter, will you keep it for general release?

EDIT - You know, the things you've been achieving with the plugin and the sheer speed stability (stability non-existant with the module) make me wish you wouldn't scrap the plugin. I mean, you could release both. People who'd care about cross-platforming could use the module, other people could use the plugin.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kweepa

#19
Don't worry, I've decided to release the plugin/module combo too. Worst case, I get 40FPS with 25% CPU usage. So I can add a lot more detail to the RON town square, for example. The plugin might be faster with a z-buffer - if so much more complex models exported from 3d packages are possible. And animated models...

It's going to be a pain to keep both versions "in sync" with bug fixes and common features but such is life.

I added something to the module to start and stop camera movement recording, so I could trigger it from scripting. In my case, during PlayerEntersRoom. For the release, I'll call it Ags3d.StartCameraRecording(String filename);

IceMan, I had a similar idea for IVSpy - the intro dream sequence will be 2d, then bam, 3d gameplay.
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk