Alice Community

Alice Community (
-   How do I...? (
-   -   (FPS game) Mobs and hit detection problems (

TheTerran 11-29-2012 09:06 PM

(FPS game) Mobs and hit detection problems
1 Attachment(s)
Hello everyone, I need help for my FPS project.
My questions are as follows:

[B]1.[/B] How do you create many duplicates of mobs and have one set of code govern them all? I do not wish to have to individually program every single mob in the game, so this is important...

[B]2. [/B]This game uses the A key to shoot, and I have attempted to use a box that quickly moves forward and back quickly as the function which carries out damage to anything that is comes in contact with, but it seems that the proximity If/then statement couldn't detect that damage value fast enough. Is there a solution for this?

[B]3.[/B] Is it possible to put all the mobs in a list and have them all respond to a damage value individually as you shoot at them? Alice doesnt seem to have that function...

[B]4.[/B] is it possible to create a simple AI to govern all the mobs to avoid collision with buildings?[/FONT]

[I]Thank you for reading all this, I appreciate it!:)[/I]

x2495iiii 11-29-2012 09:47 PM

All those problems can be fixed, but it's somewhat complicated.

1. AI for mobs can be done with well-coded methods and the use of parameters, though you'll still need an event for every enemy you add (to support simultaneous execution). This can be simplified by attaching the event to the object itself, then when the event is complete, duplicating the object, which will duplicate the event as well.

2. Either the collision checker isn't run enough times, or the threshhold is too small. First, make sure the collision method is run constantly, as long as the bullet is in play, then try making the number larger. be careful, as larger numbers mean a greater chance for a hit registered for near misses.

3. My old [URL=""]RP4 prototype[/URL] had an example of individual damage values for similar enemies. Subparts included, even.

4. Same as the first: parameters for identical objects. As long as each enemy is a duplicate of the same object (e.g. a horde of zombies that are all duplicates of the zombie object), they can all be passed in as object parameters to a method that deals with them all individually, but can deal with them all simultaneously and uniformly as needed. In fact, if the actions are simple enough (e.g. disappear, move forward, spin around), the objects don't even have to be duplicates.

Clear as mud, right?

All times are GMT -5. The time now is 07:32 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.