Author Topic: Mage Duel system  (Read 938 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Mage Duel system
« on: August 06, 2012, 09:34:39 am »


               I've started working on an idea - inspired by Harry Potter and by a Mage Duel system from Skyrim.





Basically - the way I planned on implimenting this was

Spellhook - on hostile spell cast - mark the caster as both casting a spell, and casting the spell on the target.
Remove this variable/flag after 4 seconds.

When the target, targets his own hostile spell on the first player, the system detects from the flag/markers that the first player was casting a hostile spell at the current player.

This initiates the duel.


The way I tried to do this, was to spawn numerous invisible objects in a straight line from caster1 to caster2.
Then, we get the middle one.

Both players are told via script to apply a visual effect / beam to that same node.

The winner of the duel depends on who has the higher spellcraft.
I was trying to impliment a pseudo heartbeat, that would fire the same update function each time.
This function would increment the number (if the caster is a winner) - until the number = the max amount of nodes. 
If the caster is the loser - then the number decreases until it gets to 0.

0 =  The beams converge close to the caster (who initiated the duel)  (Caster Loses)
NodeCount = The beams converge close to the opponent.    (Caster Wins)


I am having some success with this, but I am finding that when I fire my function to test it all out.
My pseudoloops fire, and calculate my winners etc,
But the visual representations seem to be delayed by several minutes.

Eg - Fire function
Debug Messages fire
but then it is like 4 minutes before the visual effects fire, and even then, sometimes the beams tend to stick/stay on - despite only being given a duration of 0.35 seconds.

Anyone know a better way of doing this?

The only thing that I can think of that might be causing it, is that the nodes tend to number 300 in maximum count.
Meaning it is trying to go from 150 all the way to 0, or 150 all the way to 300 etc
(This gives a smooth change in Convergence point.)



Anyway - when the duel is over, the loser is typically blasted with damage.

Any ideas?
               
               

               
            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
Mage Duel system
« Reply #1 on: August 06, 2012, 09:57:37 am »


               You are talking basically about a "Wizard-Beam-Battle?"

'Posted

A beam moving back and forth sounds awesome, or an easier alternative might be to use multiple beams, the first person to get 3 beams wins.  (1 = dim, 2 = med, 3 = bright).

Depending on the setting, "freezing" the combats and using simulated combat (ie arcanespace/d20/no-dance of death mods) might make life easier as well...

If it helps, check out Prismatic Ray/Shield (and other goodies) in Custom Magic Items (Variable Based)

'Posted
               
               

               


                     Modifié par Carcerian, 06 août 2012 - 09:11 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Mage Duel system
« Reply #2 on: August 06, 2012, 01:55:18 pm »


               

Baaleos wrote...

 Any ideas?



Have you tried just a single invisible creature, that moves back and forth between the casters.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Mage Duel system
« Reply #3 on: August 06, 2012, 05:26:32 pm »


               I like this idea. OTR needs to speak up here about nodes and beams. '<img'>
               
               

               
            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
Mage Duel system
« Reply #4 on: August 06, 2012, 10:58:32 pm »


               Using a creature is a great idea, with the CEP using other tail/wing effects added to the invis creature, you can also get some extra special effects at the beam intersection.
'Posted.
               
               

               
            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
Mage Duel system
« Reply #5 on: August 07, 2012, 12:10:07 am »


               ':devil:' And when it gets too close to a caster it explodes?

'Posted

(perhaps by a small "self-destruct" aoe effecting only one of the two casters)
               
               

               


                     Modifié par Carcerian, 06 août 2012 - 11:25 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Mage Duel system
« Reply #6 on: August 07, 2012, 12:16:37 am »


               I like the idea except... if the winner is one with higher spellcraft, where is the player skill? That would be totally boring this way.
               
               

               
            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
Mage Duel system
« Reply #7 on: August 07, 2012, 12:24:54 am »


               There could be shields, and possibly a rock paper scissors kind of everything can be foiled by something else idea? (fire has bonus vs cold, cold vs acid, etc)
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Mage Duel system
« Reply #8 on: August 07, 2012, 04:34:59 am »


               How about a conversation system that allows the player to select between any element (ie damage type) they have a prepared spell in, changing their beam's type at any time during the duel, coupled with a fast iterating pseudo heartbeat that determines which player's beam will prevail in that scenario, with the rock paper scissors style logic. The collision moves closer to the player with the weaker beam type every second or so, and explodes when it reaches one end. If a losing player changes their beam type during the duel to a more suitable one via the conversation, the beam will head in the opposite direction.

Rinse & repeat beam re-selection until one player doesn't have an available counter and is forced to concede.


Incidentally regarding the beam target objects, you should only ever need one at a time. If you're getting slight delays by deleting that and spawning the new one each time, perhaps spawn in 3 (the currently affected one, and one on either side).
               
               

               


                     Modifié par _six, 07 août 2012 - 03:38 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Mage Duel system
« Reply #9 on: August 07, 2012, 05:02:13 am »


               A Quick test using a Will-O'-Wisp for the creature



Yes I know my tracking was off a bit.
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Mage Duel system
« Reply #10 on: August 07, 2012, 06:55:00 am »


               Nice idea!  And the test video looks like it works well with a "target" creature in the middle.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Mage Duel system
« Reply #11 on: August 07, 2012, 10:03:15 pm »


               One of the original ideas I had, was that there could perhaps be a fastest finger first sort of contest.

or Reaction based test.
eg- The invisible creature could say something, and both casters have to repeat it.
The caster who says it first, wins a point.
First to reach perhaps 10 points, wins?


Im gonna try the invisible creature approach - does anyone have any code snippets that can return a location exactly equedistant from two casters - eg - in the middle?
After that  - I think ForceFollow can be used to get the creature to move x towards the desired target.
               
               

               


                     Modifié par Baaleos, 07 août 2012 - 09:07 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Mage Duel system
« Reply #12 on: August 07, 2012, 11:29:41 pm »


               

Baaleos wrote...


Im gonna try the invisible creature approach - does anyone have any code snippets that can return a location exactly equedistant from two casters - eg - in the middle?



location GetGeometricMean( object oObject1, object oObject2)
{
  object oArea = GetArea(oObject1);

  vector vMean = (GetPosition(oObject1) + GetPosition (oObject2))/2.0;

  return Location( oArea,vMean,GetFacing(oObject1));
}
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Mage Duel system
« Reply #13 on: August 07, 2012, 11:38:23 pm »


               I managed to use

#include "x0_i0_position"
float fDist = GetDistanceBetween(oCaster,oTarget);
location l = GenerateNewLocation(oCaster, fDist/2, GetFacing(oCaster), GetFacing(oCaster));


Here is the effect I managed to get.
Note - I wish the purple star vfx from CEP was a few inches higher - so it would go perfectly in the center of the beams interlocking.




If anyone is wondering about the music - I added magical harps to player homes in my server - allowing the players to change their own area music.
This particular track is from the credit roll of Lands of Lore 3 - A great, if not buggy, game series.
               
               

               


                     Modifié par Baaleos, 07 août 2012 - 10:38 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Mage Duel system
« Reply #14 on: August 07, 2012, 11:49:08 pm »


               Video is still processing. So while I wait. I am not 100% on your function, The reason is that it requires the PC to be facing the correct angle to begin with. If he is turned just a little to the side, Over a good distance, your position may be well off.
               
               

               


                     Modifié par Lightfoot8, 07 août 2012 - 10:50 .