Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Anything like TheComet's 3d Trails in AGK?

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 20th Sep 2018 18:43
https://forum.thegamecreators.com/thread/190374

Is there something similar in AppGameKit? I've been trying to make a sword slash trail, but can't get anything that looks nice.
puzzler2018
User Banned
Posted: 20th Sep 2018 20:19
Maybe

Have your sword object as full alpha

Have mutiple of swoard objects at the same position (say (20)) until you do the swipe

Then move the 20 objects with the main sword but say a few pixels apart on the top edge and keep the position the same at the hand end with them fading away with the furthest been the most faded one.

Im talking gibberish but i know what you mean. Ill try and do a quick example over the weekend
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 20th Sep 2018 20:27 Edited at: 20th Sep 2018 20:28
I see what you're saying, puzzler, and possibly a solution. I am still trying to mess with the 3d particles, but so far the best I can do is get a smoke effect or something really blocky. Plus the emitter doesn't seem to be able to keep up with the speed of the animation. So, depending on angle there is a gap.

I tried to create a 3d trail mesh like this: http://wiki.unity3d.com/index.php/OptimizedTrailRenderer, but my first efforts were a fail. I "think" this is what Comet does but I could be wrong. I don't know darkpro, and I only skimmed the code.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 20th Sep 2018 20:40 Edited at: 20th Sep 2018 21:16
Basically it is same as 2D and what puzzler described is almost exactly what I did for the trail on the player cube dash attack.



If you know the position of the weapon as it moves through the attack sequence then as he said you can have a trail of fading clones following it.

This kind of thing is often just built in to animations also at least for 2D. So you could just model this FX as part of the animation even if done as a separate model and animation of its own to be used with different weapons. Advantage there is you can independently control the color and transparency level of the FX. At the least you can overlay something like a tiny cube to trace the weapon arc / move so you have something to use as a reference for spawning your trail if you do not already have that point of reference throughout the animation.

But actually it does seem like if you could visualize it... like have your model in 3D space then you could use particle fx to do it. You'd need to make a simple tool for that. Something that lets you view your model and do the attack animations on key press AND configure the particle fx so can line it up and time it right visually. Perhaps running everything at 1/2 or 1/4 speed. Is there possibly a plug-in for your 3D modeler that would allow you to do this kind of thing generating the fx?
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 20th Sep 2018 21:14
OK. That is food for thought. Thank you both.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 21st Sep 2018 20:15 Edited at: 23rd Sep 2018 17:10
I spent some time reviewing why the trail renderer was not working. Needs a lot of work but here is what it currently looks like.



puzzler2018
User Banned
Posted: 21st Sep 2018 20:16 Edited at: 21st Sep 2018 20:17
Looking good! keep it up - well done
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 21st Sep 2018 21:16
I tried to have use the sword trick, but it only creating the sword a few times. I wonder if it was only creating the sword at the animation key frames.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 22nd Sep 2018 15:36 Edited at: 22nd Sep 2018 16:26
Updated the video to the current progress.

Only issue now is due to rotation.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 22nd Sep 2018 21:36
Updated again. I really like this one. I need to figure out the rotation. For instance, at 270 degrees the swoosh needs to be pushed in the z direction instead of x.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Sep 2018 22:35 Edited at: 22nd Sep 2018 22:45
I don't know how you are creating the fx but sounds like it is separate from your model so maybe just set an anchor for it. Create cube. Use FixObjectToObject to attach the cube to the model at the point where you want to spawn the fx. Of course turn cube object invisible once you have it sorted. I mean just a one time thing as far as positioning of cube goes and keep cube object around "forever" just invisible. The idea is no matter which angle your model is at this cube will always be at the correct position and angle you need to spawn the fx. So it becomes your spawn point. Get its position and its angle.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 22nd Sep 2018 23:04
Hey Gar,

I created it using memblocks based off the sword's position.

I tried to use fixobjecttoobject(even fixobjecttobone), but there must be some sort of crazy offset. Its like 6 units away from my sword now.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Sep 2018 23:20 Edited at: 22nd Sep 2018 23:29
Hmm.... that's strange. It should position it at the cube position so maybe the cube is not positioned right. Really not sure what is going on without seeing example project. This is just an easy way to do this kind of thing instead of trying to come up with an algorithm to mathematically handle it. Works for launching bullets, etc.

I am out at the moment but will be back home before too long and can take a look if you haven't got it sorted.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 22nd Sep 2018 23:33
Yeah, I am sure its because I have somehow mixed up the worldspace and model space.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 23rd Sep 2018 02:30 Edited at: 23rd Sep 2018 05:47
I haven't done a lot of animation work in 3D and what I did was quite a while ago now.

In general I have a lot of patience but when in game dev mode I like to get $4!7 done so I don't like tedious things and 3D animation rigging and such is one of the most tedious things I have ever experienced. I'd be more inclined to spend a year looking for a tool that made it more efficient
than I would to spend a year doing it. At least these days there are some solutions such as Mixamo.

Anyway hopefully you are close to sorting this out.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 23rd Sep 2018 17:10
Gar,

I ended up creating an "empty" parented that to the weapon and moved it up along the z-axis where it was almost to the tip. Then based the position off that, and just used smaller values. The one animation is a thrust so it really shouldn't have had that long slash look.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 23rd Sep 2018 17:18 Edited at: 23rd Sep 2018 17:19
Glad you got it working. Yeah this approach of using a second object is very handy for such things. It was actually working in Unity that got me to looking at things this way. I would be looking at it mathematically to figure out the angle and radius to the desired position of the secondary object / fx etc which is certainly doable but a complete beginner would just drop in an empty game object attached to the main object at the desired offset and that was all that is needed. lol I try to look at other game engines and how people are developing in them when I can because there are lots of little things like this people use to simplify game dev and save time.

Looking forward to seeing your video update when you get the slashes for the attacks all implemented!
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 23rd Sep 2018 17:25
Absolutely. Without the unity tutorials I'd still be stuck on "Hello World!".

Login to post a reply

Server time is: 2024-11-23 16:35:12
Your offset time is: 2024-11-23 16:35:12