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 / 3d Particles limitations?

Author
Message
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Oct 2017 14:46
Hello World!

I am playing around with particles in my current 3d project, and had a few questions for those of you who have ventured into this realm before...

Right now I have only made 3 effects for this game, and I have them all in place in game, and everything is fine so far.

I have not gotten any frame rate drops so far (see image), but my processor fan keeps going into overdrive like my processor is melting or something.

How many 3d particle effects have you guys had on the screen at one time without having any performance issues???

Another thing I ran into with my water cannon is changing the direction of the effect.

The manual information for Get3DParticlesDirectionX() mentions Set3DParticlesAngle, but I see no such command in the command list.

I am guessing that is a command that was removed at some point, so I am working on a work around for changing the direction, but...

How are you guys working around that to change the angle or a 3d particle effect with manual controls via user input?

I already have a method I am working on, but it is a bit complex, so I was trying to figure out an easier way.

Thanks in advance for any suggestion/comments.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 10th Oct 2017 01:20 Edited at: 10th Oct 2017 01:45
BUMP

I guess there are not a lot of people playing with the 3d particles? (or they don't want to disclose what the have learned so far? lol)

Anyway, I got my controls for the water cannon working well, so the angle thingy is worked out.

Thank FRAPS for the frame rate drop and apparent lag in the video, but in game I am getting a solid 59+ frames per second.

Here is a peek at the ship in all it's 3d particle glory... (low resolution though to reduce file size, but you get the idea)



P.S.
My first idea was too complex and didn't work and I got more confused the more I tried to make it work.
Then, I sat back with some scratch paper and started over and found a much simpler way to make that thing spin around in a circle.
The Set3DParticlesDirection() seemed to have its limitations for getting all angles at first, but it was all I needed after doing the math on paper instead of in my head.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Oct 2017 23:16
Although the built in stuff suits many purposes, I've always made my own particle system. Much more flexible and well... do anything basically.

It's quite easy when you have a good implementation for it.

If you want to have a go with your own, then I'll share some code for it.


nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Oct 2017 23:40
One of the biggest problems I had was that the built in particles are an emitter based system.
If you wanted to bulk affect the particles (or even individually) after they were emitted then you are out of luck. (by affect, I mean move them around like world co-ords)

My approach is to have a particle engine which you do like this:

A loop that processes a the particle queue, updated in your main loop
A CreateParticle() function, which is flexible enough to take different particle types and textures etc.

The process function applies the set behaviors such as velocities, lifespans, gravity and stuff.

In my implementation, I have falling leaves, sparks, sparkles, smoke you name it. All working from the same queue.
I can also interact particular particles with e.g. the floor or background or other objects.

You can easily simulate the default emitter behaviour with this system.




Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Oct 2017 13:04 Edited at: 18th Oct 2017 01:03
Thanks for the offer to share your code and feel free to post it here if you want.

I am sure we can learn from it, and that many people could use it.

Quote: "One of the biggest problems I had was that the built in particles are an emitter based system.
If you wanted to bulk affect the particles (or even individually) after they were emitted then you are out of luck. (by affect, I mean move them around like world co-ords)
"


Moving the built in particles around in world coordinates is not a problem. (using a work around)

As you can see from my video, they move along with the ship, and even stay in the right place when the ship is rotating.

You can move the ship forwards and backwards and rotate it left or right to change course, and the camera can be tilted slightly and panned 360 degrees so you can scan the horizon without having to turn the ship.

Maybe you cannot tell it, but the ship is moving in the world co-ordinates, just the camera is following the ship for the third person perspective which makes it hard to tell.

If you look closely, you can tell by the water when the ship is moving, and by the direction of the smoke from the smoke stack because it does not change direction (straight up) but flows because the ship and particle base is moving. (the lag caused by FRAPS makes it difficult to see, as well as the low resolution, but they are moving)

The ship is slower than normal to take off because of the frame rate drop, but it is moving and that is why I run into the other ship. (you can see it bump and the smoke gets bumped too because it stays at the smoke stack)

There are no long list of commands for moving the particles like the objects have, but you can set the position to the world coordinates of an object.

In my case I am using hidden boxes like the ones that I use for the ships ray casting for collision.



That way they are being positioned with global and local commands relative to the ship for the proper offsets to stay right when rotating.

The hidden boxes are following the ship, so I just set the position of the particles to their world coordinates.



This way, I can use all of those fancy commands for moving objects to move my particles.

I first did that when playing around modifying the 3d particles example included with AppGameKit, the hard part was getting the angles worked out when trying to spin them around.

EDIT
I have been making a lot of 3d particles without any frame rate losses, which is excellent. (the particles really make things come alive)

I made sure to use reasonable frequencies, and so far they take less hits than adding lots of objects.

I added 300 icebergs to my ocean and that dropped the frame rates from 59 to 42+ depending on which way I rotate the camera and how many are on screen.

The 3d particles I have added have not affected the frame rates at all, so I am very pleased and finding the limitations are easily worked around. (angles only so far)

The frame rates have been capped at 30 to save energy for mobile batteries, so the icebergs are not a problem either. (solved fan problem - it was uncapped before)

If i get to a point where the frame rates drop below 30 (29.xx) then I will simply add a LOD system for the icebergs and ships.

It is amazing what AppGameKit can do with the limited resources on these mobile devices.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Attachments

Login to view attachments
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th Oct 2017 01:12
Quote: "Moving the built in particles around in world coordinates is not a problem. (using a work around)
"

I mean moving the particles in the world once they've been emitted. This was a problem for me in the past.

Of course, for an emitter system like a smoke stack, when would you ever want to move them all somewhere? I had problems when I used a view-port style position mapping system, where I had to position everything based on my own virtual positioning system, so AppGameKit particles couldn't be used.

Without checking the help, it seems like it would be useful to parent the emitter to an object which could be rotated locally?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Oct 2017 02:01
Quote: "I mean moving the particles in the world once they've been emitted"

Is the OffsetParticles command (or Offset3DParticles for 3D) suitable for this?
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th Oct 2017 10:45
Maybe? Is that a relatively new command?

I recall there being an issue and also of course when there was no 3D particles.

Once I'd made my own system, I have gotten used to it.

I think if I was going to make a smoke trail or a water cannon etc, I would probably try the inbuilt particles again but I always seem to need to do things like leaves falling off trees or some other distributed particle requirement.

Login to post a reply

Server time is: 2024-04-26 16:19:41
Your offset time is: 2024-04-26 16:19:41