Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Combat rounds

Combat rounds

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Zuccuss   (8 posts)  Bio
Date Fri 16 Jan 2004 06:13 PM (UTC)
Message
Does anyone know where I would change the length of combat rounds and how complicated this would be? Thanks!
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Fri 16 Jan 2004 08:31 PM (UTC)
Message
I think you want to look at PULSE_VIOLENCE or something like that, which should be in mud.h.

However, changing this might have consequences you don't expect. I think that combat rounds are used for many things other than combat; for one, spell effect durations are in combat rounds. I think that some mob behavior as well is dependent on combat rounds, but I'm not sure about that.

The function that processes combat rounds is violence_update in fight.c, if I'm not mistaken.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #2 on Fri 16 Jan 2004 10:27 PM (UTC)
Message
Spell durations and most of the other things Ksilyan mentioned are actually measured in ticks, not combat rounds. There are some other issues to address when you tinker with combat rounds though, spell recasting delay, skill reuse timers and most of the other delay timers are handled on the violence_update function that works based on combat rounds. I would *strongly* advise against tinkering with combat round durations until you have looked at everything else that might be affected by that change. There may be things affected by this that you'd never even imagine would be connected to it.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Sat 17 Jan 2004 12:32 AM (UTC)
Message
If by tick you mean the area reset, I would be astounded if spell durations are counted in those.

Unless it's changed since SMAUG 1.0, effect durations are measured in violence_update...


/*
		 * We need spells that have shorter durations than an hour.
		 * So a melee round sounds good to me... -Thoric
		 */
		for ( paf = ch->first_affect; paf; paf = paf_next )
		{
			paf_next	= paf->next;
			
			if ( paf->duration > 0 )
			{
				paf->duration--;
			} 
			else if ( paf->duration < 0 )
			{
			}
			else
			{
				if ( !paf_next
					||	  paf_next->type != paf->type
					||	  paf_next->duration > 0 )
				{
					skill = get_skilltype(paf->type);
					if ( paf->type > 0 && skill && skill->msg_off )
					{
						set_char_color( AT_WEAROFF, ch );
						send_to_char( skill->msg_off, ch );
						send_to_char( "\n\r", ch );
					}
				}
				if (paf->type == gsn_possess)
				{
					ch->GetConnection()->CurrentCharId = ch->GetConnection()->OriginalCharId;
					ch->GetConnection()->OriginalCharId = 0;
					ch->GetConnection()->GetCharacter()->SwitchedCharId = 0;
					ch->GetConnection()->GetCharacter()->SetConnection( ch->GetConnection() );
					ch->SetConnection( NULL );
				}
				
				
				affect_remove( ch, paf );
			}
		}


Maybe Thoric took it out in later versions, but I know that it was not added to our custom codebase by the coders before me.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zuccuss   (8 posts)  Bio
Date Reply #4 on Sat 17 Jan 2004 08:46 PM (UTC)
Message
What I'm trying to do here is make combat rounds take a random amount of time between like 1-3 ticks. However, I still want spells and abilities to take a set amount of time.

This is from mud.h:

#define SECONDS_PER_TICK 70

#define PULSE_PER_SECOND 4
#define PULSE_VIOLENCE (3 * PULSE_PER_SECOND)
#define PULSE_MOBILE (4 * PULSE_PER_SECOND)
#define PULSE_TICK (SECONDS_PER_TICK * PULSE_PER_SECOND)
#define PULSE_AREA (60 * PULSE_PER_SECOND)
#define PULSE_AUCTION (9 * PULSE_PER_SECOND)

Could i make a #define PULSE_SKILLS (some set time), then change PULSE_VIOLENCE to random time?
The problems I see with this are that I'd have to revamp fight.c so skill use and spell casting isn't in violence_update (which would be ran with random times), but in something else which would be ran off of PULSE_SKILLS. Any ideas?

p.s. I've tried to add a WAIT_STATE at the beginning of the violence_update function but instead of adding time to each round it adds time after combat has been completed for some reason.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,706 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.