AGS 3D

Started by DoorKnobHandle, Sun 15/05/2005 15:21:53

Previous topic - Next topic

Kweepa

#120
You can easily add a mouse cursor by adding an object to the center of each room and updating its image depending on the cursor mode, but I agree that some special case code would be nice for that. Or you could use a persistent gui - for all HUD style stuff. That's what I'll be using for the inventory.

Giving Scids a window is of course a possibility, but then I need to make the inside visible from the outside and vice versa. I was considering it, but it would double the art production time and slow down the game.

Primitives with hotspots is as easy as placing a game object with a blank sprite at the location of the primitive. Moving them can be done too - just look at the disco ball code in Room 1, and replace Rotation with Position.

Characters moving is a little trickier. I plan to take advantage of AGS's moving and animation code. So character coordinates in AGS will be XZ coordinates in the world. To get the rotation right, I'll just:
check if character is walking
  get walk loop to determine walk direction
  rotate walk direction by the camera matrix
  determine new walk loop
  draw walk frame from new walk loop

Having them change room means a slight redesign, but it will happen.
Still waiting for Purity of the Surf II

mätzyboy

This look really awesome, guys! Nice efforts, keep it going!

But, 2D characters on 3D makes me think... How about 3D characters on 2D? I started looking into free engines that were capable of rendering characters and animating them from for example md2 or x files. I found Irrlicht and ogre to be the two most interesting ones. I could animate sprites on screen, at least with Irrlicht. Thing is I kind'a got stuck. I was planning to render to an image in memory, which could be used as whatever sprite but I guess I just wasn't skilled enough for it. Anyway, thought I'd plant a seed of thoughts if anybody else gets motivated to try out more 3D stuff...

GarageGothic

Quote from: mätzyboy on Fri 19/08/2005 21:07:27How about 3D characters on 2D?

But everybody does that these days, and without textures or antialiasing, it would probably look like crap. However, what about 2D vector characters, like in Cruise for a Corpse? Now that could be interesting. It wouldn't require as much processing as 3D, and the vector character could even use a hidden sprite-based character at it's feet to work out all the walkable-area/region stuff and get all the benefits of bitmap characters.

Gregjazz

#123
Voxel characters on 2D background anybody?

mätzyboy

Quote from: GarageGothic on Fri 19/08/2005 21:28:40

But everybody does that these days, and without textures or antialiasing, it would probably look like crap.

Wintermute does it, right? Just thought of the possibilities with 3D characters, and the use friendliness of AGS. Plus, the md2 format supports skeleton animation and textures. Antialiasing... Don't know...

GarageGothic

That's really a totally different discussion. The md2 format might support animation and textures, but getting them into AGS is an entirely different issue. I see no way that this could be done using the 3D script. It would most likely require a total rewrite of AGS, and we've been through that issue many times before.

Kweepa

You could probably do it without textures - just map the textures to colours.
Loading the animations wouldn't be too difficult, I'd guess (with a text format, say).
As long as all the polygons were relatively small (so a simple sort worked), and there weren't too many polys in the model (maybe 400 max), I think it could be done in scripting.
You're right though, that is a different discussion.
Still waiting for Purity of the Surf II

Gilbert

Quote from: SteveMcCrea on Fri 19/08/2005 13:48:18
Giving Scids a window is of course a possibility, but then I need to make the inside visible from the outside and vice versa. I was considering it, but it would double the art production time and slow down the game.

Hehe I wasn't talking about such complicated stuff, I just meant a window inside the bar to see that gradient sky outside and I don't care what you'll see from outside.

Kweepa

New version with player collisions HERE.

If you find any bugs in the player collision please let me know!

Notes:
- no character collisions yet.
- only works with objects that have been rotated around the up/down axis (using A and S). Will be inaccurate for other rotations.
- toggle collisions with F6.
Still waiting for Purity of the Surf II

DoorKnobHandle

Awesome, Steve. Once again... ;)

I did not encounter any bugs yet, the collision detection gives the whole scene a lot more "feeling".

What else are you planning to implement before releasing it as Script Module? I can only think of Texture Mapping, but since that is almost impossible with the current version of AGS and since I think you can create good looking worlds with the flat-shaded colors, I think this point should not have the highest priority. I also thought of some kind of model format importer. I recently wrote an MS3D and MDL file importer using C++ and OpenGL, but that is still going to be a hard task. But it just might pay off big time... ;D Anyways, I'll see what I can do.

GarageGothic

Amazing. This is starting to feel like a real game now. Is the collision detection done at the base of the object, or would it be possible to walk up a sloped surface?

Also, I was thinking about the sprite deformation and texturing that we'd discussed: An addition of perspective deformation of dynamic sprites would also allow for "flat", non-facing sprites, which were used heavily in the Tex Murphy games.

Kweepa

[ ... ], this is the current todo list:
- walking on objects (eg steps, slopes)
- better sorting, if possible. I gave it a stab yesterday but it's difficult...
- inventory system
- right click looks
- moving characters
- deleting objects and characters from, or adding to, a room
- some user-defined primitives
   - in the room script, it would go like this:

Code: ags

ClearUser1Prim();
AddUser1Vertex(x, y, z);
AddUser1Vertex(x, y, z);
AddUser1Vertex(x, y, z);
AddUser1Triangle(0, 1, 2);
AddUser1Prim(x, y, z);


GG,
The collision detection is at the height of the camera. Walking up steps and slopes isn't yet possible, but it should be quite easy. I just need to look under the camera for the closest object, and change the camera height appropriately. I still have to write the ray-triangle intersection routine though. Should be generally useful.
Still waiting for Purity of the Surf II

Darth Mandarb

I haven't yet replied to this thread (though I've been reading it daily) but I just had to chime in ...

You guys have got my vote for next years "best plugin" award :)  This is simply fantastic!

In JP & Cosmo II I was planning on having a 'space battle' sequence where JP mans the gun turret on the back of Cosmo's ship and blasts some bad-guy ships into space rubble ...

I was planning on doing this pretty basically using sprites that just scale as they get "closer" to the ship.  However, after seeing the direction this is headed, I'm now thinking it could be used quite nicely for what I have in mind.

So I have some questions (forgive if they've been asked already ... this is a huge thread now!)

> Would it be possible to have objects follow paths (the bad-guy space ships)

> would it be possible to put an 'over-lay' graphic that wouldn't move with the 3D stuff (the window panes of the gun turrets and the guns themselves)

> would it be possible to have actual 3D 'weapons' (lasers, missles) that would, when colliding with other objects cause them to go boom?

> lastly, would it be possible to use a background (starfield) that would loop/scroll (AGS can already do this) so that as Cosmo navigates around the scene the stars would be moving in the background?

I know that's a LOT to ask ... I'm just curious more than requesting :)

I have a few other ideas where this application could be used quite nicely in the game.

EXCELLENT JOB GUYS!!

DoorKnobHandle

#133
Since Steve is offline at the moment, I'll just reply to the best of my knowledge. If something is wrong, then feel free to correct me.

Quote
> Would it be possible to have objects follow paths (the bad-guy space ships)

As far as I know Steve is currently working on allowing MoveCharacter commands for 2d sprites or characters in the game world. By using those commands it should be pretty much possible to script flying enemy ships etc. just like you'd script them in standard 2d.

Quote
> would it be possible to put an 'over-lay' graphic that wouldn't move with the 3D stuff (the window panes of the gun turrets and the guns themselves)

The only problem you can encounter is that room objects are drawn beyond RawDraw stuff - thus your enemy ships would be in front of your gun. Either use GUIs or maybe even draw the edges of the own ship and the gun in 3d as well. Building those using simple cubes and maybe even a cylinder for the gun will add feeling and won't be too slow as long as you don't use too many spheres...

Quote
> would it be possible to have actual 3D 'weapons' (lasers, missles) that would, when colliding with other objects cause them to go boom?

Sure, with a little bit of self-scripting. ;) Again, with the right functions to draw those missiles or lasers from the Script Module it will be pretty much the same than doing it all in standard 2d. Maybe I'll even go ahead and release some small tutorials with the Script Module ( if I can find the time that is ).

Quote
> lastly, would it be possible to use a background (starfield) that would loop/scroll (AGS can already do this) so that as Cosmo navigates around the scene the stars would be moving in the background?

This will depend on how exactly the 3d functions will work in the "final" release. But I am sure there will be SOME way to create the effect. Once again you could always go ahead and create your own addition. I am thinking of something like this: Right before you call your 3d drawing functions to draw enemy ships and your ship/gun, you simply RawDraw some stars to the screen, that will (pretty much like in a particle system) all have their own z-coordinate. Then when moving the camera every star will move "against" the camera direction depending on how large his z-coordinate is. With a little tweaking that could already create a rather realistic looking, smooth starfield.

Kweepa

Quote from: [ ... ] on Sat 20/08/2005 21:54:50
Quote
> Would it be possible to have objects follow paths (the bad-guy space ships)

As far as I know Steve is currently working on allowing MoveCharacter commands for 2d sprites or characters in the game world. By using those commands it should be pretty much possible to script flying enemy ships etc. just like you'd script them in standard 2d.

That's right, you could do it that way. Or you could just move and rotate the ships around in 3d every frame.

Quote
> would it be possible to put an 'over-lay' graphic that wouldn't move with the 3D stuff (the window panes of the gun turrets and the guns themselves)

Any object in the room, and any GUI, is drawn on top of the 3d. So that should work fine. Your weapon can be drawn Wolf/Doom style.
Still waiting for Purity of the Surf II

DoorKnobHandle

Quote
Any object in the room, and any GUI, is drawn on top of the 3d. So that should work fine. Your weapon can be drawn Wolf/Doom style.

That's wierd, I could've sworn (sp?) that objects are drawn behind. Anyways, it's better this way... I'll recheck what I did to draw my object behind the RawDraw lines/triangles.

Kweepa

#136
Walking on objects is done.
I might add jumping to the todo list - it's pretty easy since falling is already implemented.

[EDIT] Jumping is done. Press the RMB to jump.
Still waiting for Purity of the Surf II

deltamatrix

Whoa!

Super cool dudes!

I hope I start another AGS soon so I can use this module. COOL!
BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

GarageGothic

Quote from: [ ... ] on Sat 20/08/2005 22:39:42That's wierd, I could've sworn (sp?) that objects are drawn behind. Anyways, it's better this way... I'll recheck what I did to draw my object behind the RawDraw lines/triangles.

I think that the only way this would be possible, would be to have a pre-existing walkbehind for that part of the screen.

Ozzie

The collision detection works nice and, as far I can tell, flawless.
Only it's still that sometimes objects are drawn in front when they should be behind.
Robot Porno,   Uh   Uh!

SMF spam blocked by CleanTalk