Curiosity stikes me

Started by Guyserman82, Wed 02/12/2009 00:54:23

Previous topic - Next topic

Guyserman82

I am curious. I know that AGS can be manipulated to do first person mazes, and point and click shooters, but do any of you think it would be possible to make a first person shooter in AGS?
If so, how do you think you would do it?
Please note: I do not know enough about AGS to try this yet, but I am curious.


Khris

Any programming language that supports math and drawing can be used to create a first person shooter.
The question is, is it feasible? ;) (also, speed is an issue)

Phemar

#3
You could use ray-casting to accomplish it. Technically it's not really 3d, but it creates the illusion pretty well.

Edit: Just noticed that that's exactly what that plugin GarageGothic posted uses :)

zabnat

Yes, it's possible but I would advice not to do it if you just want to create a fps game. There are other game making tools that are far superior for that purpose. But if you just want some programming practice and want to see how far can AGS go, then go ahead. :)

m0ds

It'd be nice to get the 3D plugin rolled out at some point. It's proven its possible to do first person but it's still only been accomplished by a one man-Jan! As stated though, it does use one of the earliest forms of creating first person style, so I'd imagine you could never really have a rich environment that's big and has lots of objects. I can't see AGS coping too well with that.

For tinkering with FPS or 3D game creation, you might want to try Unity...its free, it's good fun, even for beginners...but hell knows how to actually put in any real gameplay or characters and stuff. With Unity, you definitely need to be capable of making your own 3D objects in Blender or Max.

Guyserman82

Quote from: GarageGothic on Wed 02/12/2009 01:06:35
Yes, it's perfectly possible.
WHOA! That is exactly what I was thinking of doing! Now, how much experience in AGS should I get under my belt before I try this?

Phemar

Quote from: Guyserman82 on Wed 02/12/2009 18:10:12
WHOA! That is exactly what I was thinking of doing! Now, how much experience in AGS should I get under my belt before I try this?

A lot. To put it bluntly.

Calin Leafshade

not specifically in AGS but in programming in general.

to be honest an experienced coded can pick up AGS and be pretty much fluent almost immediately. Its very intuitive.

Khris

Guyserman82:
After I saw the other thread back then, I tried my hand at this myself, just to see how far I'd get. Here's a snippet of the raycasting part, copied unaltered from the really messy but working code:

Code: ags
bool Intersect(int cw) {
  // intersect v[CAST] with w[cw]
  // intersection    ->  save data in w[cw], return true
  // no intersection -> clear data in w[cw], return false
  V c; c.Set(cam.x, 0.0, cam.z);         // virtual camera position
  cam.ign_distance = ((cam.factor-1.0)*0.160);
  V t; t.SetMul(VIEW, -cam.ign_distance); // move way backward
  c.x = c.x + t.x; c.z = c.z + t.z;
  V u; u.Set(v[CAST].x, 0.0, v[CAST].z); // view
  V o; o.Set(w[cw].ox, 0.0, w[cw].oz);   // origin of wall
  V d; d.Set(w[cw].dx, 0.0, w[cw].dz);   // direction + length of wall
  float wl = d.l(); // wall length
  // Display("%.4f, %.4f", w[cw].dx, w[cw].dz);
  // Display("cw: %d, length: %.4f", cw, wl);
  d.Norm();
  float D = d.z*u.x - d.x * u.z;
  if (D == 0.0) return false; // view and wall parallel
  float l = c.z*u.x - c.x*u.z + o.x*u.z - o.z*u.x;
  l = l / D;
  if (l<0.0 || l> wl) return false; // ray misses wall
  float sw = IntToFloat(Game.SpriteWidth[w[cw].slot]);
  if (w[cw].slot>1000) w[cw].l = (sw*l)/wl;
  V is; is.Set(o.x + d.x*l, 0.0, o.z + d.z*l);
  float dist; // not just >0, if dist is <0, wall is behind cam
  if (u.x != 0.0) dist = (is.x - c.x)/u.x;
  else dist = (is.z - c.z)/u.z;
  if (dist <= cam.ign_distance) return false;
  
  w[cw].dist = dist-cast_len;
  return true;
}


(This part checks whether the view vector intersects with a wall.)

Code like this is the main ingredient of every 3D-type game coded from scratch. It's all about vectors, matrices, equations, all the fun stuff, basically ;)

Scarab

Quote from: Khris on Thu 03/12/2009 10:11:16
Code like this is the main ingredient of every 3D-type game coded from scratch. It's all about vectors, matrices, equations, all the fun stuff, basically ;)

Aww Khris, you got me drooling... I think its about time someone revived the Homework Thread...

Scavenger

If raycasting is definitely possible in AGS, how feasable would creating a game like Normality or Realms of the Haunting, which use low-poly models to supplement the raycasted scenes?

I mean, if you implemented the character/object interactions while rendering like that, you could have any number of awesome things going on and the world would seem a lot more real than most FPSes (where your only interaction is usually shooting something.)

(I think it would be absolutely breathtaking to see something like BUILD with the features of the Norm/ROTH True3D engine, personally. 2.5D rocks, as does Room above Room, but actual 3D modelling is way hard and this looks stylish :D)

SMF spam blocked by CleanTalk