Yay! My first Cascade Module!

So there were a few modules missing from Cascade between UE3 > UE4, so I’ve decided to make them myself :smiley: Size By Velocity and Size Scale By Time are my first targets. (Yes we do have SizeBySpeed, but that’s limited to GPU particles only). The possibilities are endless! Please share my enthusiasm as I have virtually zero C++ or programming background of any kind…

I honestly expected a massive crash with this one, but it currently appears to work just fine… It needs some more functionality to match it’s UE3 counterpart but hopefully I can manage that too. Could anybody quickly tell me how to return the vector length of the particles velocity? currently this is my implementation:

ParticleModules_Size.cpp



void UParticleModuleSizeByVelocity::Update(FParticleEmitterInstance* Owner, int32 Offset, float DeltaTime)
{
	BEGIN_UPDATE_LOOP;
	FVector VelocityScaleFactor = SizeByVelocity.GetValue(Particle.RelativeTime, Owner->Component) * (Particle.Velocity);
	Particle.Size = Particle.BaseSize * VelocityScaleFactor;
	END_UPDATE_LOOP;
}


What I need to do is get the length of (Particle.Velocity), as the implementation is designed to be similar to Size By Speed. I guess though, I could create a radio box like ‘bUseVelocityVectorValues’, to scale the particle according to it’s direction perhaps?

Now if I could just figure out how on earth to use GitHub properly I can submit a Pull Request for it once it’s finished… I’m assuming that this sort of thing is suitable for a future engine update?

Wow this is awesome TheJamish!

Great stuff!

I can’t wait to see what other cascade modules you come up with!

~~

Regarding git hub

you can create a fork and clone with these steps

then you should create a branch using the same link


Branches

- you should have a branch for each major cascade module / update

so that you can then backtrack back to the start point after that fork is accepted / modified.

This enables your repository to not be only an amalgamation of every possible feature you've ever offered to Epicv.


Git Hub “Save You Lots of Time” Tips

  • have branches of your own repository for each major individual unit / pull request that you want to offer :slight_smile:

  • Always check what branch you are on before submitting another commit

  • Try to do all the editing locally rather than after you submit the pull request.

  • Always create local backups of your repository directory!

  • In the course of learning git hub you are likely to delete your local copy multiple times :slight_smile:

so have a backup that is not within your repo directory

Enjoy!

Thanks :slight_smile:

I fixed my implementation to use the vector length, so it works ‘properly’ now. Although using the individual vector components gave some pretty entertaining results… maybe I’ll leave a radio button in to let people keep that functionality :wink: Just need a Cap Min and Max size now to finish it up.

Video of it in action so far:

, as the only person whose made a plug-in for the engine so far that I’m aware of, how easy (or possible) would it be to make something like this as a plug-in rather than a change to the engine? I might venture into making some kind of advanced module pack for Cascade that adds some cool functionality to it.

You need a way to tell the end user’s UE4 engine to use an alternate set of code, stored in an alternate class.

For my purposes, I was able to extend the UnrealEdEngine, a new class, and use a config file to tell UE4 to use my EdEngine class instead of the main class.

Then I told my extend UnrealEdEngine class to use my new EdMode which contained all the vertex snap code :slight_smile:

So you will need to look and see, or ask Epic Devs, whether there is an easy way to add in new modules as additional classes, via config file or UnrealEdEngine.

This is really a question for them to answer, and if the functionality is not there

**[FONT=Comic Sans MS]enabling users to easily add plugin cascade components sounds awesome (should be an answerhub request probably)
**

This looks awesome :smiley: well done Jamsh Cant wait to see what else you can do.

Very cool and congratulations!! This is the first example of an extensible Cascade change that I’ve seen since our launch in March. Given even we haven’t attempted Cascade extensions in a plugin module yet, I’d love to hear about what obstacles in the engine that prevent you from doing this as a plugin. Basically, what you are looking for is being able to compartmentalize your changes in a standalone module, whether it is a plugin or not. Either way, very cool!!!

Thanks !

Currently I had to make a couple of changes to what look like some very core files, ‘Paticle_Helpers.h’ and ‘ParticleModules_Size.cpp’, what I could probably do is compile a new Engine.dll with my additional code in it, and tell the engine to use that in a config file the same way did it, but I’m not entirely sure that would work. ( do you have your plugin source available anywhere to look at?)

Of course the problem with doing that is if anybody else made a Cascade module, or a change to another part of the editor they could only use one at once, and not use multiple plugins with each other. My aim would be to make it a completely modular piece, but it might be that I need to first make Cascade scan some external files if the plug-in is turned on and that would mean changes to the core code… somehow. Once again I’m a C++ newbie so this is all a bit new to me :smiley:

As a particle anthousiast I already love this like my future firstborn :slight_smile:

Why don’t you try to submit this directly to UE github? it’s not a big change. Also isn’t in Unreal style those modulas should use “Over” insted of “By” like “Size Over Velocity”?

Because:
A) I can’t even update my fork to 4.1 let alone submit something on the complete mess that is GitHub, and
B) I just named it after what it was called in previous versions of the engine. I dunno, size over velocity sounds odd, and its a multiplier, so ‘by’ velocity seems to fit better

Delete the fork and fork again? :stuck_out_tongue:

I’ll more than likely try to attempt submitting it as a plugin later :slight_smile: I want to experiment with some other not-yet-seen-before modules too, working on some cool stuff atm like alternative ways of camera-facing sprites etc. Just landed myself an industry job so times getting thin :stuck_out_tongue:

Congrats on the job :slight_smile:

If you ever do want to play around with it again, a rotation on direction would be cool.
(so the particle rotates towards the angle it moves.)

Unless im totally derp and didnt notice one.