3D Shooter in AGS through Raycasting [includes YOUTUBE video-preview]

Started by DoorKnobHandle, Sat 03/01/2009 01:18:12

Previous topic - Next topic

DoorKnobHandle

For a few days now I have been working on a plugin for AGS that allows the rendering of 3d worlds and sprites through a technique called raycasting. It works very similar to how the first ego-shooters such as Wolfenstein 3D and Doom 1 worked.

Here is a link to a youtube video for a preview:


Click the image to view the video...

The engine features the following at the moment:
- walls can be rendered at any angle, round parts are possible
- as many textures as you like
- sprites for objects and enemies*
- waypoints for enemies*
- comes with an editor for levels
- is designed in a flexible manner: the actual game controls the crosshair or the weapon or the movement etc. (so more than straightforward shooters are possible)
- runs stable at 40fps, even for more complex scenes (in-depth stress testing will still follow)

*these features are implemented but not shown in the video, sorry, my hard-drive is too full for longer footage.

Any feedback, you think you could use this in a game?

Oh, and before I forget - the next you are going to see about this is most likely going to be a short deathmatch game using this plugin.



Ryan Timothy B


bicilotti

I really look forward to this! Handshake dkh!

Ghost

I... sensed a great disturbance of the force, as if a million onion rings of reason cried out... and were suddenly silenced...

Man. That's some great stuff!

Program-wise, I'm interested in how pathfinding and enemy AI will work...  And what are the system requirements?

And... when will you update?

Creator


R4L

This is extremely impressive! How long have you been working on this?

ThreeOhFour

Yeah, yeah, really great.

Small questions ;D (Lots of them, but they're not overly complicated to answer, I hope)

-Will this be able to support a mouselook system?
-Will you be able to have platforms/rooms of varying height? (ie, Doom levels as opposed to Wolfenstein 3d levels)
-Is there a limit on the weapon used? Ie, will it be easy to add multiple weapons to the game, with different damage/rate of fire characteristics?
-How does the level editor work exactly? Do we need to create an image, a 3d file, a text document? A series of regions/hotspots/walkable areas?
-Will there be in game functions for things such as collision detection/item interaction (shooting dudes/getting shot and opening doors), ammo count and player health, to make it easy for non advanced scripters (me) to build their own fps?

Even if the answer to all of these questions is "no", I am still really pumped about this! All these would just be a bonus :P

This is incredibly exciting man! The ability to build an FPS in AGS is something that would absolutely make my year!

It is hard to know whether to be more excited about this or Troopers, you insanely talented freak! ;D

Rocco

great work, this is really brilliant, it will come a lot in handy with minigames and so on....  :D


DoorKnobHandle

Thanks everyone!

QuoteProgram-wise, I'm interested in how pathfinding and enemy AI will work...  And what are the system requirements?
At the moment, every enemy has a list of waypoints which are placed in the editor beforehand. Enemies will loop through this list until they see (or hear) the player. What happens in combat, I'm not yet sure about. First I'm thinking of them stopping and just aiming and shooting the player.
System requirements: the plugin just uses allegro's 2d drawing functions so I suppose they aren't exactly high. As I said, on my 7yr old machine with old gfx card it still runs at max frames. It does NOT require the modern d3d driver or anything.

QuoteWill this be able to support a mouselook system?
Already does. :) The controls in the video you can see work exactly like in all modern-day fps on the pc. WASD for moving/strafing, mouse to aim (horizontally and vertically), etc.

Quote
-Will you be able to have platforms/rooms of varying height? (ie, Doom levels as opposed to Wolfenstein 3d levels)
I'm not yet sure about it. Will do some tests to find out exactly how hard this is. Drawing walls with different height is somewhat trivial (already had that in an earlier iteration of the plugin), but walking up steps etc. isn't quite as easy. AND the editor would be much more complicated, too. I'll think about it!

Quote-Is there a limit on the weapon used? Ie, will it be easy to add multiple weapons to the game, with different damage/rate of fire characteristics?
This is a good time to explain the flexibility-feature I put into that feature-list in the first post: the plugin is really just for the rendering of the 3d-stuff, all weapon code for example is in the game itself. Take the way the pistol bounces up and down when running in the video - that's not fixed by the plugin, that is all in the game. And the game is what the user is going to write him- or herself! This means that, while the user has to do more than call one or two simple commands but in return he gets a way more powerful plugin.
So, to summarize, any game any user creates with the plugin can have any number of weapons which can all work completely different - it does not depend on the plugin.

Quote-How does the level editor work exactly? Do we need to create an image, a 3d file, a text document? A series of regions/hotspots/walkable areas?
The editor is just another AGS game and basically works like MS paint. You get a blank canvas and you can draw walls onto it just like drawing lines with the line-tool in paint. Additionally, it features an optional grid at various sizes to which the lines can snap if you want to. Then you can also place sprites for objects, enemies, enemy waypoints and the player start. When saving, you enter a filename and the editor writes the file. That you take and copy into the game folder and load it using the plugin-command LoadMap (or similar). :)

Quote-Will there be in game functions for things such as collision detection/item interaction (shooting dudes/getting shot and opening doors), ammo count and player health, to make it easy for non advanced scripters (me) to build their own fps?
Collision detection between the walls and objects and enemies will be done in the plugin but you will be able to deactivate it for flying/noclip simulation. Player health, ammo count etc. are all done in the game, so no limitations there! I'm not yet 100% sure about the AI, I'd like to let the user write his own but I also want offer a default behaviour maybe, because writing the AI is not exactly easy.

Hope this answers some questions and I'm glad this is of interest to people!

Lt. Smash

this is really great! So many things can be done with this. (hmm... if this could be combined with the Inet plugin=))

just another question: will it be possible to make doors or move objects (like in Wolfenstein)?

DoorKnobHandle

Quote from: Lt. Smash on Sat 03/01/2009 13:37:04
just another question: will it be possible to make doors or move objects (like in Wolfenstein)?

Walls are not fixed, so they can be moved/rotated etc. dynamically. Now, I don't know quite how much wall animation I will implement (again, it does make stuff difficult, especially for the editor and the map file format) but doors that move up or slide open are definitely going to be in there!

Anyways, here is a quick shot of the editor to give you guys more of an impression as to how levels work:


Red lines are walls (duh), gray is the grid (remember, it can be turned off for completely free drawing of walls or entities, and it can also have different sizes), the dots are the player starting location and several objects (tables in this case, I believe). Textures are not yet selectable from the editor, working on that. For the video, I just opened the map file and added the texture flag (what texture to use for this wall) myself (that's why the map in the video isn't textured very well)...

Dualnames

Downloading wise..is there a link for that plugin?
Seriously I wasn't expect less from the man that brought the AGS Pong. Well, we're gonna see a thread like : Yes, you can make FPS with AGS fools-See inside for more info.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ponch

Quote from: dkh on Sat 03/01/2009 01:18:12
Any feedback, you think you could use this in a game?

Sweet zombie Reagan, dkh! Are you joking? I would create a game just to use this plugin. This makes my "Duck Hunt" shooter code look soul crushingly pathetic. I can't even face myself in the mirror now, knowing that this exists for AGS.

How the hell did you get from AGS Pong to this? Simply amazing.

- Ponch

Domino

Looks Great, reminds me of Doom Builder, which is a program I have used many times.

Ghost

Quotethe plugin is really just for the rendering of the 3d-stuff, all weapon code for example is in the game itself

It's like... the Doomguy and Duke Nukem had a tea party, drinking out of blue mugs.

Sounds all uber-great. Ribcages of luck, sire!

ThreeOhFour

QuoteAlready does.  The controls in the video you can see work exactly like in all modern-day fps on the pc. WASD for moving/strafing, mouse to aim (horizontally and vertically), etc.

Hell yeah! I thought I saw some slight vertical movement in the video, but it was so slight that I was unsure whether it was mouselooking or not. This is great!

QuoteSo, to summarize, any game any user creates with the plugin can have any number of weapons which can all work completely different - it does not depend on the plugin.

This is a very good thing ;D

QuoteCollision detection between the walls and objects and enemies will be done in the plugin but you will be able to deactivate it for flying/noclip simulation.

Does this include collision of bullets with enemies? Or is this just done with a function similar to an interact mouse mode whilst the crosshair is over the character?

QuoteI'm not yet 100% sure about the AI, I'd like to let the user write his own but I also want offer a default behaviour maybe, because writing the AI is not exactly easy.

I'm guessing I'd probably have a pretty hard time writing AI, so if you could include default behaviour, that'd be quite excellent!

The map editor looks nice and simple to use - great work!

m0ds

Awesome stuff Jan! Wasn't expecting that but the video looks great! Santa Claus Down 2 will be awesome thanks to you!!! :P It could be very interesting to see what people do with it, especially as it will effectively be the first time people can make 3D adventures for free, without ****ing watermarks... so HOORAY FOR YOU!!!!

subspark

Brilliant work DKH. When did the idea of making an FPS system out of AGS spawn in your head? I find my brilliant moments come in the early hours of the morning.
This is cool. Major cool, man.

Cheers,
Sparx.

Khris

This is great work, I'm definitely going to have a look into plugin coding myself now.

One question though: am I correct that the raycasting works on a 2D basis, like in Doom? I.e. you can't really look up and down, just raise or lower the "camera"?

DoorKnobHandle

Thanks everyone! ;D

QuoteDownloading wise..is there a link for that plugin?

It's not done yet. I will release it bundled with a game (and release its source as well).

QuoteDoes this include collision of bullets with enemies?

Ah, this is not in the current version of the plugin (had it in an earlier version though) - but I see two ways right now: leaving it to the user to write in the game or allowing the user to select pre-written ways such as a simple hit-scan, support for projectiles and splash damage.

QuoteOne question though: am I correct that the raycasting works on a 2D basis, like in Doom? I.e. you can't really look up and down, just raise or lower the "camera"?

Yep, but looking up and down is possible by moving the horizon up and down. This is not a correct way, it distorts the more you do it but it's barely noticeable. This is called y-shearing, I believe. In addition, moving the camera up and down is perfectly possible to simulate jumping/crouching as you said.

SMF spam blocked by CleanTalk