C++ Engine
Home › Forums › TimelineFX Module › C++ Engine
- This topic has 42 replies, 11 voices, and was last updated 7 years, 10 months ago by piecuchp.
-
AuthorPosts
-
May 16, 2014 at 2:17 pm #5204
damuczParticipantHi there.
I implemented my own C++ library. It’s based mainly over the BlitzMax source, however I inspired in Peter’s sources here and there.
However – the result is standalone library usable in ANY engine or system. There are few virtual classes supposed to be implemented. As an example I did PugiXML loader (can be replaced by any loader you want) and Marmalade renderer (can be replaced as well).
There are still some little issues, but nothing is perfect in the beginning. π The particles are particling and it’s the most important. π
You can check my work at github. There you can find additional information.
Thank you for great piece of software and enjoy the particles.
May 17, 2014 at 12:12 pm #5205
peterigzKeymasterMany thanks for your contribution Damucz, that sounds great! π
With regards to unzipping the eff files for use, this sounds similar to the monkey implementation. You can export the effects files as .zip files in TimelineFX to make things easier. I guess if the image files are in the same folder as the xml you only need to extract the file name from the path without any need to edit the xml manually, that’s what the monkey version does anyway.
I wish I had time to learn c++, I could remake the vaders example, but sadly I’m knee deep in PHP for my day job… Oh well, one day π
May 18, 2014 at 6:01 pm #5206
damuczParticipantTo be honest, I didn’t buy the editor so far, so I’ve got disabled Save and Export. π I’m going to buy it soon, however I’m little short of money right now. π But thanks for advice. I updated the description. I hope there will be more sales for you by the C++ and Marmalade users. π
I was doing PHP 6 years profesionally. One beautifull day I decided to quit and join a gaming company in town. I don’t work for them anymore, but still stuck with C++. I like the language.
Allow me one question – there is “Sub effects/Space Creature” in the samples. In my code and even in editor, the purple glow is keeping the circle path, but the “trailing” particles are following bigger and bigger elliptic way and finally get out of screen. Just watch the particles for the few minutes. Is it correct? Looks like some rounding error or maybe float presision.
May 19, 2014 at 2:12 pm #5207
peterigzKeymasterWell done for getting out of the day job π
You’re right about the space creature, I remember looking into that and thought I’d fixed it. Was quite a while ago now, maybe it’s crept back in somehow. It could well be a rounding issue. If I remember correctly that effect has single emitters that never die, they just have sub effects that spawn the tail of the worm. So it’s something in way that they rotate I think, thinking back it maybe have been something that happens when the angle passes from 360 back to 0, something jolts so they slowly spiral outwards. I can’t remember for sure I’ll have to take a look again π
May 20, 2014 at 9:45 am #5208
TonCParticipantHi Damucz… π
This library is great, thanks! It’s given us a big “legup”. π
I’m seeing some differences with emitters that use a “stretch” effect though. The effect in-game doesn’t look the same as the effect in the editor.
I think I’ve maybe found the source of the issue:
I notice that in “UpdateSpawns” in TLFXEmitter.cpp (line 1271 approx) the scale is set to something like:
e->SetScaleY((GetEmitterScaleX(0) * e->GetGSizeX() * (e->GetWidth() + (fabsf(e->GetSpeed()) * GetEmitterStretch(0) * _parentEffect->GetCurrentStretch()))) / _image->GetWidth());
where the GetEmitterStretch(0) is multiplied by the e->GetSpeed() term…
and in “ControlParticle” in TLFXEmitter.cpp (line 1704 approx) the scale is then set to:
e->_scaleY = (GetEmitterScaleX(e->_age, (float)e->_lifeTime) * e->_gSizeX * ( e->_width + (Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) * GetEmitterStretch(e->_age, (float)e->_lifeTime) * _parentEffect->GetCurrentStretch()))) / _image->GetWidth();
where the GetEmitterStretch(0) is multiplied by the Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) term.
If I change the Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) calls to e->GetSpeed() the effect looks the same as in the editor.
What do you think?
Thanks again for the lib. π
TonC.
May 20, 2014 at 9:50 am #5209
TonCParticipantApologies.. the above should be
fabsf(e->GetSpeed()) not just the e->GetSpeed()
Cheers,
TonC
May 20, 2014 at 6:11 pm #5210
damuczParticipantWow, thanks TonC!!!
I spent about two hours with this issues yesterday. Without any success and without a single clue. π
You are really right.The github is updated.
Thank you again.
May 21, 2014 at 7:32 am #5211
TonCParticipantNo worries! π
I’ve been chasing a couple of other strange bugs, although they might be down to my image “anchor” / “handle” rendering code (or lack of it). The issue I’m chasing is that some sub effects (dependent on the “General Settings” “Auto center” and handle settings in the editor) appear to be offset from their parent effect. I’m pretty sure it’s to do with the “handle” settings for the image or the effect / emitter.
BTW, in “LoadEmitter” in PugiXMLLoader.cpp, line 284. The ANGLE_OFFSET is being loaded / cast as a “bool”.
I think it should probably be an “int”?i.e.
e->SetAngleOffset (node.attribute(“ANGLE_OFFSET”).as_bool());
should be,
e->SetAngleOffset (node.attribute(“ANGLE_OFFSET”).as_int());
Cheers!
I’ll keep you updated with any other stuff I find. π
May 21, 2014 at 10:05 am #5212
TonCParticipantEDIT:
EDIT: Found it! My bad. Ignore the rest of this msg.
EDIT:Hello again.. π
Just out of matter of interest, does the Environment/Bubbles/BubbleStream look correct for you in your renderer? In my system the bubbles rise and rotate (around the sprite center point) but dont rotate around their handle.
I was just wondering if it’s something I’m missing with my renderer.
Cheers.
π
- This reply was modified 10 years, 7 months ago by TonC.
May 21, 2014 at 11:43 am #5214
damuczParticipantThank you for the other fix. π
If you are investigating the Handle, maybe you could focus on _handleCenter in Emitter and _centerHandle in Entity. Didn’t have time to investigate if it is the same or not. It could be mismatched somehow. It’s from original BlitzMax code.
Most of the bugs I faced when converting the code, were typos (x/y) and IDE autocorrections I didn’t notice in time. There could be some I missed. Another problem was with timing and precomputed arrays. To sync them properly, or evaluate index correctly.
Just out of curiosity – are you working in Marmalade, TonC? Or another engine?
@peterigz
I just discovere the “bug” in Space Creature effect. There are some strange values in weights. If you remove all weight and weight over time from all effects/emitters/subeffects, the Space Creature stays with glow.May 21, 2014 at 7:07 pm #5215
peterigzKeymasterAhh, that’s interesting, well spotted π I shall look into that.
May 23, 2014 at 4:13 pm #5216
damuczParticipant@TonC , could you share the steps to reproduce the issue you are facing? I could have some spare time this weekend to dig into with you.
December 27, 2014 at 3:53 pm #5314
sesillaParticipantHi,
i’m using Peter Ward’s C++ code for TimelineFX but i have some problems about implement it.
Have you a simple sample?
Regards
SesillaFebruary 23, 2015 at 1:25 pm #5365
duncanperhamParticipantI am very keen on getting this into code. I use C, (some c++), I also use the allegro library which is so simple and quick to use. more time coding less time reading manuals. I am going to download this lib and see if I can use it as is, or if it needs tweaking for allegro. But before I go to all that effort, has anyone else did a port for allegro yet?
February 23, 2015 at 2:16 pm #5366
duncanperhamParticipantI had a good look over the file from git hub, but its far to complex for me, too many things to install and do (of which they all have there own learning curve), to little documentation.
-
AuthorPosts
You must be logged in to reply to this topic.