Skip to content

Particle effects Version 1 & 2 - #3520

Open
LizardKing777 wants to merge 8 commits into
EasyRPG:masterfrom
LizardKing777:DynRPG-Particle-Effects-V1-&-2
Open

LizardKing777 wants to merge 8 commits into
EasyRPG:masterfrom
LizardKing777:DynRPG-Particle-Effects-V1-&-2

Conversation

@LizardKing777

Copy link
Copy Markdown

Both function independently of one another, so if a game was released using either version it should work flawlessly.

Both function independently of one another, so if a game was released using either version it should work flawlessly.

Got it figured out - V2 particle animations now move at whatever speed the game is moving at, without overloading the vector.
@jetrotal

Copy link
Copy Markdown
Contributor

some stuff to consider

/*
 * This file is part of EasyRPG Player.
 * ... (license header) ...
 * Based on DynRPG Particle Effects V1 by Kazesui. (MIT license)
 */

the generated code ignores the license code (my llm rigging of it had it removed to be economical, but it should be manually pasted)


Other thing thing, does the v1 and v2 share or repeat code?
Maybe having a dynrpg_particle_shared set of files, to group the repeated code could be thing.

@Ghabry

Ghabry commented Feb 23, 2026

Copy link
Copy Markdown
Member

Does this code address the non-working fast forward support?

When pressing "F" to speedup the Player the particles (e.g. in Deep8) kept the same speed (or even worse: On 120 Hz displays the particles were twice as fast than the rest of the game).

This was this "nobody understands the code Kazesui wrote" issue where I couldn't figure out how to split the Update and Draw logic.

@LizardKing777

Copy link
Copy Markdown
Author

As far as I know, the two versions are basically independent of one another, so probably keeping the code separate for now is probably the pragmatic way to go. I added the license info back and got V1 to sync with the acceleration (they were keeping the same speed and calling at the accelerated rate, which was creating a neat but undesirable effect. Basically moving the particles from "Draw" to "Update" - but it's causing a "Vector Substack Out of Range" overload on the V2 particle effects, so I'm going to have to play around with that one a bit more.

@Ghabry

Ghabry commented Apr 21, 2026

Copy link
Copy Markdown
Member

Is the particles V2 based on my deep8 code from here? https://github.com/DeepIA8/easyrpg-player-deep8/blob/latest2/src/dynrpg_particle.cpp

(Just asking as the simplest way to review it would me doing a diff so I know what I wrote myself)

@LizardKing777

Copy link
Copy Markdown
Author

Originally it was but it's pretty much been completely re-written. Using a compare tool it appears 328 lines were taken out and 258 were added. So I would treat it as its own code.

@Ghabry

Ghabry commented Apr 24, 2026 •

Copy link
Copy Markdown
Member

Could you link the kazesui dynrpg particle v1 source code? It looks like you "ported" it based on the dynrpg plugin but no idea where v1 can be found (I only have the V2 code)

@LizardKing777

Copy link
Copy Markdown
Author

ParticleEffectsPlugin1.zip

No idea how long this has been sitting in my RPG Maker folder, but here it is!

@Ghabry

Ghabry commented May 2, 2026

Copy link
Copy Markdown
Member

I cannot see the plugins source code in this folder. That's a game with a DLL

@LizardKing777

Copy link
Copy Markdown
Author

Source.zip

Sorry, wrong zip. Try this one.

@LizardKing777

Copy link
Copy Markdown
Author

Ugh, I forgot to update the CMakeLists.txt file to include the new .cpp and header files. Hopefully this compiles now.

(Obviously AI assisted)

Rename Particle to ParticleV2
…n helper function to match DynRPG loadFromFile better
…lse cases instead of lookup-table + some lambdas and static functions

DynRpg: Add another ParseArgs function that accepts an index

Now the warnings give the index proper.

Fix ODR violation with particle plugin
@Ghabry

Ghabry commented Nov 3, 2026

Copy link
Copy Markdown
Member

Thanks for your submission.

According to my tests this is all working in general. Even the fast forward, yeah.

Now the problematic part which is why I'm currently trying to fix but git is complaining:

Something is completely messed up here. Besides the whitespacing (which you fixed) somehow also the line ending is incorrect (CRLF instead of LF). No idea how this can even happen considering we have an editorconfig.

Afterwards I'll add multiple cleanup-commits to fix inconsistencies, e.g. V2 has a wild mix of static functions, lambdas and if-conditions for the function names. I will unify this and also fix the naming. So mostly refactoring and further checking here.

Also the naming conventions are way off but this is to be expected as its directly ported over from the original code.

So weird issues + lots of cosmetics. Commits coming soon (tm)

@Ghabry
Ghabry force-pushed the DynRPG-Particle-Effects-V1-&-2 branch from 287d43b to 722cf6a Compare November 3, 2026 20:52
…top of everything

Not entirely correct as it should be able to render over transitions but this just feels wrong

Fix plugin load order
@Ghabry
Ghabry force-pushed the DynRPG-Particle-Effects-V1-&-2 branch from 722cf6a to 482a999 Compare November 3, 2026 20:55
@Ghabry

Ghabry commented Nov 3, 2026

Copy link
Copy Markdown
Member

Jenkins: Test this please

What a mess (and the plugin is pretty complex maybe you should have started with a simpler one first xD).

Still no idea how the code of Kazesui actually works and I don't really want to understand it but all my refactoring didn't seem to have broken your code.

So I guess this is okay now? Just needs more testing... I only tested with provided sample games which appear to work.

Their arent really alot of games using this. Unfortunate considering how cool this plugin is 🤷 . I only see Zelda ToP DX in my list.

Well and Deep8 but this uses custom stuff so cant be used for testing.

@LizardKing777

LizardKing777 commented Nov 8, 2026 •

Copy link
Copy Markdown
Author

Testing results - using the demoProject to start with Version 1:

Waterfall Test - RPG Maker 2003 v 1.08 with DynRPG:

2QhMtiMcR4

EasyRPG (and Speed up test):

VU2CY20xMp

Afterburner Test - RPG Maker 2003 v 1.08 with DynRPG:

DtsZiF3fJq

EasyRPG:

0XhNXZGmk4

Volcano-Chimney-Explosion-Hearts - RPG Maker 2003 v 1.08 with DynRPG:

9EPx1EJyaV

EasyRPG:

arvfAeDqoR

Dynamic Darkness (Torches and fire burst) - RPG Maker 2003 v 1.08 with DynRPG:

iLEx7X0ZWI

EasyRPG (Dynamic Darkness not implemented yet):

EC2LijbH4g

Version 2 tests to come next.

@LizardKing777

Copy link
Copy Markdown
Author

Testing results - Version 2:

Pentagram, Torches - RPG Maker 2003 v 1.08 with DynRPG:

snsh8WWjx2

EasyRPG:

LvFy9V4pZF

Magic Effects - RPG Maker 2003 v 1.08 with DynRPG:

FAjPnMbdjx.mp4

EasyRPG:

GFLqAdo89p

Fire vent test - no texture - RPG Maker 2003 v 1.08 with DynRPG:

iabNuw31ia

EasyRPG:

NFJ8UY47RN

Fire vent with "pfx_set_texture" - this one mystifies me. The demo doesn't come with a particle.png in the Picture directory, but the Comment commands call for it - and then when you provide a file it looks like the feature was not fully implemented. EasyRPG on the other hand executes it perfectly.

Using a basic monocolour 2x2 "particle.png"

RPG Maker 2003 v 1.08 with DynRPG:

wbvJItbbZe

EasyRPG:

GWhuRYQeUF

But the difference really stands out when you use a larger image for a "pfx_set_texture" file like this one:

particle

RPG Maker 2003 v 1.08 with DynRPG:

RvvTu2DHCa

EasyRPG:

oZspEsbM26

@Ghabry

Ghabry commented Nov 8, 2026

Copy link
Copy Markdown
Member

Thanks for the testing but I'm not sure what you were doing with these commits.

I had renamed the files to _v1 and _v2. Your commits readded old versions of V1 and V2

@LizardKing777

Copy link
Copy Markdown
Author

Sorry - did not realize you had renamed the files. I'll update them with the fixes I found while I was testing.

@jetrotal

jetrotal commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

I suspect your changes undid more of the changes ghabry applied to your code. please review the changes from those buttons above:
image

@LizardKing777

Copy link
Copy Markdown
Author

It would appear so - my apologies for not seeing that. I'll review what Ghabry fixed in my code and re-test (preliminary testing suggests the Hearts effect in V1 needs another argument but everything else appears to work fine.)

@LizardKing777

Copy link
Copy Markdown
Author

So yeah, after repeating all my tests everything works in Ghabry's updated code except the Hearts in Version 1 - the refactoring appears to have created an issue where the code is not seeing the second argument (but it's seeing it in the other animations...)

TFw9AE9OHL

The code for the Parsing comment appears to have been largely rewritten and a number of the arguments aren't declared anymore. This is the new code:

	if (func == "effect_speed") {
		auto [speed, rand_speed] = DynRpg::ParseArgs<float, float>(func, args, 1, &okay);
		if (!okay) {
			return true;
		}
		effect->spd = speed;
		effect->rand_spd = rand_speed;
		return true;
	}

When I change the number of args in that from "1" to "2", it cranks up the speed of all the other animations and makes them not look right.

This is the old code:


		if (func == "effect_speed") {
			v1_effects[index]->spd = get_double(1, 2.0);
			v1_effects[index]->rndSpd = get_double(2, 2.0);
			return true;
		}

v1_effects and get_double aren't used anymore, so I'm going to have to do some thinking how to get it to work with the updated code.

@Ghabry

Ghabry commented Nov 8, 2026

Copy link
Copy Markdown
Member

The heart map misses an argument for the rndSpeed. Looking at the original source code there is no range checking at all (only if the effect exists):

        int index = parsedData->parameters[0].number;
        if(index >= 0 && index < effects.size())
        {
           effects[index]->spd = parsedData->parameters[1].number;
           effects[index]->rndSpd = parsedData->parameters[2].number;
        }

When you don't provide enough parameters it will just read out of range and read garbage data. Though unlikely to crash as the read is not that much out of bounds.

To be more precise what happens (asked AI to read the assembler code from DynRPG): When arguments are missing the data is stale. So if there was any command before which filled parameter[2] it will read this stale data here.

The real question is: Should this yield a sane default value or emit a warning?

@LizardKing777

Copy link
Copy Markdown
Author

I like the warning - it helps track down issues.

I added a second check for effect_speed and that appears to have resolved the problem without breaking anything else. Will begin testing with Zelda: The Trident of Power DX next.

@Ghabry

Ghabry commented Nov 8, 2026

Copy link
Copy Markdown
Member

btw you are creating lots of merge commits (Merge branch 'EasyRPG:master' into DynRPG-Particle-Effects-V1-&-2). These are unnecessary. Try to figure out in your tools what creates them.

(though don't worry about the messy commit history - this can be fixed before the merge with a rebase)

@jetrotal

jetrotal commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

I recomend Lizard to learn how to use Rebase instead of Merge whenever he needs to download recent updates into his code.

@Ghabry Ghabry added this to the 0.8.2 milestone Nov 9, 2026
Fixes the Heart Animation by adding a check for a second argument to the effect_speed code.
@Ghabry
Ghabry force-pushed the DynRPG-Particle-Effects-V1-&-2 branch from 9a82ddd to 8b83379 Compare November 22, 2026 22:58
@Ghabry

Ghabry commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Jenkins: test this please


I sent you an invite for the Player team. When you accept all your PR updates will automatically trigger our CI system (= you can see if it compiles and it generates binaries etc)


I fixed your mess a final time. Pleeeeease DO NOT try to do any commits here anymore. I wasted again 30 minutes to unbreak the branch. ONLY test, no commits! The code is ready imo.

Everytime you add a commit here it somehow breaks my git and I cannot rebase. I had some untracked files right after the checkout. I don't even know how this can happen. I have never seen such an error before in the last 10 years. (I already had the same problem 2 weeks ago with that branch)

Especially stop commiting files with Windows line endings (CR LF). Use a text editor that doesn't suck and respects our editorconfig.

(Sorry for the rant this shall not demotivate you to contribute. But pls learn how to use Git. At least your other PRs look clean.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants