Jump to content
Eternal Lands Official Forums
Entropy

Special effects

Recommended Posts

Just an update: Summons are done. Still left on my TODO list: A smoke effect (for chimneys -- I thought of that while my partner was playing the other day), and spells. Then incorporating this into the game. :P

Share this post


Link to post
Share on other sites

KarenRei, right now we create the particles ourselves in the particle editor that is located in the map editor. Then the map makers place the particle objects..

Is there anyway for you to redo that particle editor? Or will a programmer such as yourself have to make us the particles from now on? I assume that both types of particles will be compatible with the game of course, but right now the particle editor is VERY unintuitive, so it'd be awesome if someone could fix that up.

 

I'm just unsure on how you plan to incorporate the static particle effects for us to use/place, and I'm letting you know how they're currently done.

Share this post


Link to post
Share on other sites

To be honest, I haven't looked at how they're currently done -- all I know is that, using point sprites, I can make much prettier particle effects, so that's what I've been working on.

 

I assume that you don't place individual particles -- rather, you place particle effects. Right? Here's an example of creating a particle effect in my system:

 

eye_candy.push_back_effect(new ec::SwordEffect(&eye_candy, &sword1_start, &sword1_end, ec::SwordEffect::SERPENT, 10));

 

eye_candy is the main particle effect control object. A SwordEffect is a type of effect for having particles trail behind fancy swords when they're swung. In addition to the eye_candy object, it gets passed pointers to the start and end of the sword, the type of sword, and the level of detail (1 to 10). The reason that it's pointers to the coordinates of the start and end of the sword instead of the actual coordinates is so that, as you move the object, you don't have to update the effect to tell it where the sword is now -- just the coordinates.

 

In the game, assumedly, when you enter a new area, the client knows (by the map) what is in the area, and thus where to place a given type of effect. I'll just have it call my code instead of the extant code. Assuming this is the case, there wouldn't need to be any changes in the map editor.

 

Here's another example of how an effect is created in software:

 

eye_candy.push_back_effect(new ec::TeleporterEffect(&eye_candy, &teleporter_pos, 10));

 

Pretty straightforward. Here's another:

 

eye_candy.push_back_effect(new ec::FireflyEffect(&eye_candy, firefly_center_pos, firefly_obstructions, 1.0, firefly_bounds));

 

The "tricksy" elements of this one are firefly_bounds (a vector of PolarCoordElement objects) and firefly_obstructions (a vector of pointers to Obstruction objects). The region that the fireflies are allowed to fly in (and be created in) is defined by the sum of sinusoidal functions in polar coordinates (read: wavy circles. :D ).

 

To add something like fireflies to the map would, thus, require changes to the editor.

 

I should take some new screenshots. My favorite thing about the summons is not how they themselves look, but how they light up the area around them. The tougher the critter you're summoning, the further the summon circle's color shift's along the rainbow -- low level summons start out purple, and run through blue, green, yellow, orange, red, bright red. The bigger the summon, the brighter the colored light from them.

Edited by KarenRei

Share this post


Link to post
Share on other sites

Ok, uh, you gotta realize that the mapmakers and people like me are not programmers :)

 

Just so you can see how we do it, open the map editor, press ctrl+p (that brings up the particle editor. Then we save the particle and can place it anywhere on the map as an object. Click the particle mode(icon with the boxes) then open(arrow icon with the star behind), and choose a particle. The black box is the "object", and if you see another box it's a light-we have some particles with lights attached.

We don't/can't place the particles in the code..they are placed specifically. They need to be placed within the map editor.

If we had to rely on a programmer to place them, well...there'd be no particles in the game :D

 

So yes, the map editor would of course have to be updated.

Share this post


Link to post
Share on other sites
Then we save the particle and can place it anywhere on the map as an object.

 

That's exactly what you'd be doing still. Except for things with bounding ranges (like the firefly effect), there would be no need to change the map editor to incorporate this. This code would affect only how the maps are interpreted, not how they're created.

 

KarenRei, are you using C++ for that? I see a couple '::' in there. You know that EL is all in C right?

 

Ack. :P Darn, well I guess I'll be converting it. :P

 

C++ is so much cleaner. Oh well. I'll just have to dirty up the code. Classes and inheritance can be mimicked with function pointers.

Share this post


Link to post
Share on other sites

You could do a C++ module, so long as it defined a C interface that could be called from the rest of the client; as done in 'cal3d_wrapper.cpp'.

 

Just write defensively and with a slightly paranoid attitude; the code will be touched by other developers, and a little knowledge of C++ is a dangerous thing...

Share this post


Link to post
Share on other sites

For some reason I have not been getting e-mail notifications...not that it mattered much since I was running a work calculation for the last 9 days on my computer hence preventing me from coding. Anyhow, it looks like a recent change in CVS somewhere has killed my display of special effects. Need to analyse the code now, then I will commit some changes of my own.

[edit] nevermind. pebcak.

Edited by 0ctane

Share this post


Link to post
Share on other sites

Please make sure the that effects not running in console mode & crash on map change bugs (probably related) are fixed quickly. The crash bug is evident if you use #beam me or die while in console.

Share this post


Link to post
Share on other sites

Well, something is going on strange with my CVS client. Can someone more knowledgeable regarding CVS please remove the sticky tag on special_effects.c. I am probably the culprit, but I cannot make any changes to cvs because of it.

cvs server: sticky tag `1.62' for file `special_effects.c' is not a branch
cvs [server aborted]: correct above errors first!

 

[edit] The crash on map change might be a pointer issue. It should be pretty easy to fix.

 

[edit2] figured out the sticky problem ;)

Edited by 0ctane

Share this post


Link to post
Share on other sites
Please make sure the that effects not running in console mode & crash on map change bugs (probably related) are fixed quickly. The crash bug is evident if you use #beam me or die while in console.

Can you be more specific on how the map change crash occurs? I have tried casting and changing maps, and I do not get a crash. Also, other people casting and changing maps did not crash. Does it only occur when in console? I have not tried killing myself yet....

 

[edit] BTW, latest commit to CVS includes a Advanced Video tab option for turning on and off the effects, with a hook into poorman. Thanks to Awn/Drakos7 for this.

Edited by 0ctane

Share this post


Link to post
Share on other sites
Please make sure the that effects not running in console mode & crash on map change bugs (probably related) are fixed quickly. The crash bug is evident if you use #beam me or die while in console.

Can you be more specific on how the map change crash occurs? I have tried casting and changing maps, and I do not get a crash. Also, other people casting and changing maps did not crash. Does it only occur when in console? I have not tried killing myself yet....

 

[edit] BTW, latest commit to CVS includes a Advanced Video tab option for turning on and off the effects, with a hook into poorman. Thanks to Awm/Drakos7 for this.

From what I've seen, it seems to be only from when in console. I think that the visualy effects waiting to be siplayed is the problem, maybe because the actor doesn't existing anymore on the new map or memory changing during map change. So, I think that the crash might vanish one the delay in effects caused by console mode is fixed.

Share this post


Link to post
Share on other sites
From what I've seen, it seems to be only from when in console. I think that the visualy effects waiting to be siplayed is the problem, maybe because the actor doesn't existing anymore on the new map or memory changing during map change. So, I think that the crash might vanish one the delay in effects caused by console mode is fixed.

Okay. It is kind of like how if you mapwalk while in console, then exit console, your viewpoint has to travel the distance rather than just appearing where you are currently. I am pretty sure this has something to do with cur_time and last_time which we grab from main.c. Clearly the timers are not being updated while in console. I will put in some pointer checking code first, but then I need to look at clearing effects that are generated (or fixing the timers) while in console. Is there a flag that lets us know when console is activated? I thought it was console_root_win, but that seems not to be correct (stays at 1 after the first time you ever use the console AFAI-can tell).

Share this post


Link to post
Share on other sites

One note:

if (!marker->owner) return; Means that stationary effects have to log an actor, and it also does not guarantee to check if the actor isn't there; A better solution is to check if any effects need to be removed whenever an actor is destroyed. Also, it contradicts the note that it will be NULL for stationary effects.

Share this post


Link to post
Share on other sites
One note:

if (!marker->owner) return; Means that stationary effects have to log an actor, and it also does not guarantee to check if the actor isn't there; A better solution is to check if any effects need to be removed whenever an actor is destroyed. Also, it contradicts the note that it will be NULL for stationary effects.

Oops. :P Stupid mistake on my part. Thanks for catching this. I will have to think of a different way of determining if the actor has left. Your suggestion (checking when an actor is destroyed) will not work within the current framework AFAI-can-tell. In my mind, this would require adding a special_effect field/struct to each actor. At one point, I was thinking was thinking about doing this...

 

Instead, we could have caster = -2 for static effects, since no actor will have a negative id. Then if (caster != -2) if (!marker->owner) return;. Of course, we would #define STATIC_SFX -2 rather than actually look for the variable -2. Does this sound reasonable?

 

[edit]Well, that does not seem to work. I have someone else cast a spell and beam or exit while I am in console, then I quickly switch to normal view. No crashes. Of course, the marker->owner still exists at that point (I checked), so at least on my system I do not have a problem. Learner, please try to reproduce the error.

Edited by 0ctane

Share this post


Link to post
Share on other sites

[edit]Well, that does not seem to work. I have someone else cast a spell and beam or exit while I am in console, then I quickly switch to normal view. No crashes. Of course, the marker->owner still exists at that point (I checked), so at least on my system I do not have a problem. Learner, please try to reproduce the error.

The pointer marker->owner won't change. :P You have to either iterate for where marker->owner == &actor, or add a callback pointer to the actor structure, otherwise there is the possibility you could have undefined effects.

Share this post


Link to post
Share on other sites

Sorry for the delay on updates -- I got distracted by, of all things, the game :) I must break the habit of, when my partner gets tired, taking over for her because our parrot and dealing with dinner/dishes distracts me earlier in the evening, leaving precious little time for programming. Thankfully, here comes a four-day weekend. :evilgrin:

 

Magic effects cast on one's self are now done. I've started on magic effects on a target.

 

Remaining: Finish magic effects on targets; magic effect ambiance (for example, the occasional sparkle of a shield) and instantaneous magic effects (for example, striking a shield should have a flare of light at the point of impact); smoke for chimneys (easy); integration (not as quick, now that I know the game is C, not C++)

Share this post


Link to post
Share on other sites

Just so you know, we're going to have an update around the middle of december, so hopefully you guys will have a good amount of effects done by then :)

 

@ KarenRaei, you have a parrot? What kind, I love parrots :confused: Any pics?

Share this post


Link to post
Share on other sites

He's a DYH amazon named "Mal" after the main character in Firefly. You can see a few older pictures at:

 

http://www.daughtersoftiresias.org/Mal/09-10-06/

 

These are my favorites:

http://www.daughtersoftiresias.org/Mal/09-...he%20pepper.jpg

http://www.daughtersoftiresias.org/Mal/09-...%20sleeping.jpg

 

He's such a sweetie -- of course, he's only 5 months old now ;) Doesn't talk yet, but he's really smart. He figured out the clasp on one of my vests and now can solve it in seconds. He also figured out how to get at treats that we put at the end of a rope by climbing up to what the rope was hanging from, grabbing the rope, and then walking with it to slide it over to where he can get at it, then looping it around there so it will stay.

Share this post


Link to post
Share on other sites

from this thread: http://www.eternal-lands.com/forum/index.php?showtopic=30458

 

I want to make the server send some extra information when a magic spell is cast, or in some other circumstances.

//special effects
...
//when a player casts heal summoned. Player
#define SPECIAL_EFFECT_HEAL_SUMMONED 9

I'd like more local events and visual effects, like

// radon pouch hit, orange gas cloud maybe
#define SPECIAL_EFFECT_RADON_POUCH <byte>
// cavern wall collapses, greyish cloud of dust maybe
#define SPECIAL_EFFECT_CAVERN_WALL <byte>
// mother nature gets pissed, maybe lightning strikes
#define ...
// blessing by queen of nature, green glow perhaps
#define ...
// stung by a bee, swam of bees flying around player
#define ...
// teleport nexus, same effect as for t2r spell, different color(s)
#define ...

 

Now go ahead and pick my ideas to pieces ...

 

Flo

 

 

Sounds like a cool idea, maybe bring it up in the special effects thread in the programming section, see what the devs and karenrei has to say

 

 

would be awesome if a programmer would do it :icon13:

Share this post


Link to post
Share on other sites

Not sure if it would work for those events, as they are mostly bullshit (they are there to take your health, but have to say something, not like oops, some of your health dissapeared so you can't macro easely).

Share this post


Link to post
Share on other sites

sure, but as long as those events are there, why not make it so they're a bit more interesting?

as long as it's not too annoying/distracting (since in a crowded mine you could get a lot of them), I think it might make players dislike the anti-macro events a bit less

Share this post


Link to post
Share on other sites

I am (as I type) coding the logic for it, any takers on the SFX side? Currently I am just reusing the existing spell effects.

 

Why when you want events (good or bad) to happen:

1) The mine is empty

2) No events actually occur :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×