UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[SVN514][Copern] Missing Necromancy Potions

Status
Not open for further replies.
Re: [CODER NEEDED] Missing Necromancy Potions

psz;680666 said:
Why not use the spawner's Homerange?

It's a circle, it's settable in script or [props...

really nice idea, although, checking scripts, the only part I have found related to a Point3D and HomeRange is: (spawner.cs)
Code:
        public Point3D GetSpawnPosition()
        {
            Map map = Map;

            if ( map == null )
                return Location;

            // Try 10 times to find a Spawnable location.
            for ( int i = 0; i < 10; i++ )
            {
                int x = Location.X + (Utility.Random( (m_HomeRange * 2) + 1 ) - m_HomeRange);
                int y = Location.Y + (Utility.Random( (m_HomeRange * 2) + 1 ) - m_HomeRange);
                int z = Map.GetAverageZ( x, y );

                if ( Map.CanSpawnMobile( new Point2D( x, y ), this.Z ) )
                    return new Point3D( x, y, this.Z );
                else if ( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
                    return new Point3D( x, y, z );
            }

            return this.Location;
        }
and to me looks like much a square than a circle...
 

psz

Administrator
Re: [CODER NEEDED] Missing Necromancy Potions

You are correct, it is a square (I'm so used to mobs moving about quickly that it appears as a circle within a second ;->)


Might be an idea, though. Check MSDN for some other Point3D/Vector3D/etc options.
 
Re: [CODER NEEDED] Missing Necromancy Potions

I'm really near to it, and I'm going to release a patch (even partial) soon.
Just to ask you to set it in development. Thank you :)
 

psz

Administrator
Re: [IN DEVELOPMENT] Missing Necromancy Potions

I think you're there, and just need to get creative with the code you've got ;->
 
Re: [IN DEVELOPMENT] Missing Necromancy Potions

silvertiger;681366 said:
Go Daedalus! So you do have the actual non-visual effect working?:D

The issue is only the visual effect. All of the rest was working since SVN 343 :p (unless psz hasn't something to add...)
Now I have only to study a bit how to implement delays (Xavier is teaching me some ways to do them) and maybe add some "thickness", then it should finally be done.
 
Re: [IN DEVELOPMENT] Missing Necromancy Potions

This is still a work in progress, and especially a case-study.

Xavier's lesson about timer classes was interesting, but Nikki's one about delegates had a better effect on me :p

Now, there is an issue that was happening also before the delay implementation:

part of the halfcircles, especially the second one, is not immediately "rendered", like the "for" loop at a certain point... locks up, then it returns working after 0.5 seconds.
This is most evidentiable with Greater confusion blast potions, where the circle is licterally splitted in 3 parts now: the first halfcircle, a piece of the second halfcircle, and the rest of this one.

I'm posting this either for a milestone, and to let partecipate everyone in this case study (aka: I don't want to bother Xavier or Nikki in IRC too much :p).
Why a case study? Because I really don't know which approach to use to "fix" this glitch.

I'm posting 2 patch: the "dbg" one contains some lines of code more for debugging purposes, infact when you throw a confusion blast you will be spammed by messages telling you coordinates of each tile where the effect will be shown.

How do you want to tag this, [consulence needed] ? :-P
 

Attachments

  • necropots-SVN485.patch
    26.3 KB · Views: 2
  • necropots-SVN485-dbg.patch
    26.6 KB · Views: 2

Copern

Sorceror
Re: [IN DEVELOPMENT] Missing Necromancy Potions

Back when you posted the formula I was farting around with it. I wanted to do something where we could set the angles (start and end of the circle) and it would translate that into something usable in that formula. Similar to what you were trying to do initially with that for loop from 0 - 360, but wouldn't work with the trigonometry formula. It would use a slightly modified EffectLine from the original patch to fill in gaps. Particularly in the "middle" of the circle (or just before the ends of the half circle) where the formula leaves a gap due to the rounding. I came fairly close to a usable function but still needed some work. Reason for this would be a) we could reuse it and b) from that AVI posted earlier, they aren't perfect half circles but rather the first half circle seems to cover more with the second half circle covering less.
 
Re: [IN DEVELOPMENT] Missing Necromancy Potions

Copern;682089 said:
Back when you posted the formula I was farting around with it. I wanted to do something where we could set the angles (start and end of the circle) and it would translate that into something usable in that formula. Similar to what you were trying to do initially with that for loop from 0 - 360, but wouldn't work with the trigonometry formula. It would use a slightly modified EffectLine from the original patch to fill in gaps. Particularly in the "middle" of the circle (or just before the ends of the half circle) where the formula leaves a gap due to the rounding. I came fairly close to a usable function but still needed some work. Reason for this would be a) we could reuse it and b) from that AVI posted earlier, they aren't perfect half circles but rather the first half circle seems to cover more with the second half circle covering less.

It's true OSI effect is not really 2 half circle (imho the whole thing is a bug, usually a blast spreads in circle!)
anyway I decided to use another way to draw halfcircles because the original code wasn't working correctly, and this way I limited number of reiterations from 360 to not more than 40.

Of course, if you have another solution that works, feel free to use it :)
 

Copern

Sorceror
Re: [IN DEVELOPMENT] Missing Necromancy Potions

Alright, I'm going to continue working on what I had before. The drawing of the circle is fairly close to what you have now actually, except meant to create a full circle. Around 30 iterations for a 7 radius full circle. To fill the gaps left by the formula, use a modified EffectLine found in the first patch. We could set what parts of the circle to draw by passing an angle start and angle end that would translate into something usable by the circle loop. So to do a half circle we do 0 to 180 (15ish actual iterations). It won't be perfect of course due to the tile based nature of UO but it should work well enough I think.

Another idea that came up was we could pass the circle/line method a delegate that we use to actually create the effect. Then we could have something really re-usuable where we could do anything like creating a circle of effects (confusion blast potion) or creating a circle of mobiles, circle of items, circle of particles, or whatever crap we might happen to need. Some of the OSI monster specials require circle effects too don't they?

Those are the ideas anyway, from what I've gathered it's doable. I'll let you know how it goes.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] Missing Necromancy Potions

This was... time consuming. But I believe I have what I set out to do after a lot of testing. Added a new static class called Geometry. Rewrote EffectLine to use the Bresenham's Line Algorithm and changed the name to Line2D. Rewrote EffectCircle (now Circle2D) to use a version of the Midpoint circle algorithm. The mid-point circle algorithm only does a full circle but it's quite fast. For an idea of how the mid-point circle algorithm creates the points have a look here around the middle of the page. So what was time-consuming was coming up with a way to exclude points the way I wanted it to. But now I think I've got it.

So you can draw a full circle if you want... Or you can draw a circle from a certain angle to an end angle. So you can draw all kinds of partial circles. 0 starts in the east of the center point, 90 degrees is north of the center, 180 degrees is west of the center, etc. Setting a start angle greater than the end angle will basically draw the opposite. For example, using a start angle of 130 and an end angle of 240 will result in a smaller half circle while using a start angle of 240 and an end angle of 130 will result in a larger half circle.

Another thing is the effect isn't tied to the circle function so you can do anything you can think of for the circle points.

So what the heck does this have to do with the necro pots? Welp, now we have an effect for confusion blast that looks very similar to the video that was posted earlier in the thread. That and a reusable circle and line function. I may do some tweaks to the circle function at a later time.
 

Attachments

  • necropots-SVN491.patch
    32.5 KB · Views: 5

psz

Administrator
Re: [TESTING] [Copern] Missing Necromancy Potions

Because UO is an isometric, non-proptionally scaled 2.5 dimensional engine.


In other words, it's a totally skewed perspective that doesn't actually line up properlly. (The old 3D client made this even more obvious)
 

Xavier

Account Terminated
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

uome found this whilst the forums were down, and I wanted to check a few things out on TC before it got posted anyway, so Im posting it now.

Conflag pots: Dont damage mobiles looping through an IPooledEnumerable, it locks the shard up when the mobile dies. Per Mark: it causes null netstates. I wont laugh too much, as Ive made this same mistake myself, except mine made it to SVN =P

I did this at the end of baseconflag.cs on the TC to keep it on there for now:

Code:
List<Mobile> mobiles = new List<Mobile>();

foreach( Mobile mobile in m_Item.GetMobilesInRange( 0 ))        
{
mobiles.Add( mobile );
}

for( int i=0; i<mobiles.Count; i++ )
{
Mobile m = mobiles[i];          
if ( (m.Z + 16) > m_Item.Z && (m_Item.Z + 12) [truncated, thx pico]
{
if ( from != null )
from.DoHarmful( m );
AOS.Damage( m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0 );
m.PlaySound( 0x208 );
}              
}


Note: I also noticed a bit of a server freeze for a second 2 out of 3 times the confusion pots go off. I dont know if it was just a fluke with my connect, the server, or actually something in the code, but Im noting it here for you.
 

Copern

Sorceror
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

The only thing I did was add the geometry stuff and effects. I didn't look at anything else since I was under the assumption everything else worked, so please don't laugh at me. :D Though I guess I should have. Not sure what's causing the pauses. I don't remember any slow downs but then again I don't have millions of items/mobiles and other players on my private testing grounds.
 

Copern

Sorceror
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

I could have another look at the circle effects sometime, see what I can do to improve it further. Not sure when I can get around to that.
 

EvilChild

Knight
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

Razor also needs an update so that it doesnt unequip any hands to toss the pots.
 
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

yeah, it's my fault or of a previous' one (MalGanis or either Arthanys). Strange I have never noticed a crash due to this...

anyway yes, it should be fixed.

EvilChild;690306 said:
Razor also needs an update so that it doesnt unequip any hands to toss the pots.

IIRC I remember some threads in RunUO forums where Razor recognizes conflag potions as "black potions", randomly picking them and nightsight ones.
 

uome

Bug Hunter
Re: [TESTING-TC] [Copern] Missing Necromancy Potions

osd_daedalus;690529 said:
IIRC I remember some threads in RunUO forums where Razor recognizes conflag potions as "black potions", randomly picking them and nightsight ones.
That reminds me, i noticed that the conflag and confusion pots have the wrong coloured bottle in the crafting gump, they are black like night sight. No idea how osi is.
 
Status
Not open for further replies.
Top