Product Chat / Bullet holes in a concrete wall

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 08:11
I started a thread in the forum scripts but I still have not got an answer, however I have continued to investigate, trial and error, and this is what I have so far:

bullet holes test1



Now I'm going to try with metal + wood

It would be nice if we could clone an entity via script.

I'm not sure if I chose the tag correctly, if not, please excuse me.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Feb 2019 09:48
I did something similar (GraPhiX provided the images):





Unfortunately the engine needs some more tweaks to make this work properly, for example if you shoot at an animated entity like a door the bullet holes (or blood splatters or whatever) will not follow the animation when the door opens!

Similarly if you put bullet holes on a physics entity the engine needs an addition to move them to track with the entity. I could add this bit but without the animated entity issue being fixed I couldn't see the point.

Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 12:16
Yes, You are right, I'm just developing the idea while engine provide more tweaks to continue with.
Now I'm I'm designing decals for wood and metal.
Nice vid.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Feb 2019 13:18
My video was done using particles btw, GraPhiX made glass, metal, wood and stone ones.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 1st Feb 2019 14:41 Edited at: 1st Feb 2019 14:42
Most of the early PlayStation games didnt require cloning for this. But they would limit something like 10 or less bullet holes, that would move to the newest shot location. I am unsure how FPSC did this though, so we had bulletholes in that engine, however not GG for some reason after all these years.

5 years previous:
https://forum.game-guru.com/thread/210164
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 14:48
Quote: "My video was done using particles btw"

I was placing decals where the bullet impact has place.
OH! mate I wasn't aware how particle system has evolved, I was taking a look in global file due to your post, love all these commands !!!
long time away, not internet where I was, working with version 1.141.
I'm not still familiar with it, but I've seen a few commands that can help.
Dude, you have pointed me the way and I am going to cross it.
I also have to keep breaking walls and bottles and boxes and glasses, and buildings, etc ... many things to do.
On the other hand I am also burning buildings with debris and so on, even a forest, until now I used decals for fire, but I think the particles can do the job better.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 14:52
Quote: "however not GG for some reason after all these years"

But we has nice commands for workaround as AM has shown in their videos.
Any thing I love of GG is that i gives the chance for think out the box.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Feb 2019 15:13
Be aware that I added some extra functionality to the engine for the bullet holes but I haven't pushed those changes to GitHub for the reasons I gave above about animated and physical objects.

Basically the changes were to allow single particles to be placed at a specific location and angle, by default the engine rotates them to the camera but you don't really want that to happen in this case.

@Teabone, my 'bullet holes' gradually fade away over time so they don't pop out of existance, well not unless you use them all up of course!


Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 16:02
Quote: "Basically the changes were to allow single particles to be placed at a specific location and angle, by default the engine rotates them to the camera but you don't really want that to happen in this case."

Yes I has seen rotateSpeedMinZ, rotateSpeedMaxZ, and that worried me.

Does the images has to sit in effectbank\\particles folder as mandatory?


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 1st Feb 2019 16:07 Edited at: 1st Feb 2019 16:08
Quote: "@Teabone, my 'bullet holes' gradually fade away over time so they don't pop out of existance, well not unless you use them all up of course! "


Amazing! That's even better than some slightly older AAA games.

I wish we could have fading for entities :/ I'm not very good at shader scripting. Also if you make some mistakes you can freeze your computer.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Feb 2019 16:23
The image files could go anywhere, the sprite sheets have to be square, i.e. 2x2, 3x3 etc and the max is 8x8 (i.e. 64 images on the sheet).

The bullet hole sprite sheets that GraPhiX made for that demo were 8x8 so there were 64 different types of 'hole' for each type of material.

The particle generator just picks one at random from the 64 available for the material.

The script I created for this does the heavy lifting of working out the position and angle that the particle needs to be at and passes that to the engine so that the next particle created is put there.

I wanted to extend this and allow an entity id, offset position and relative angle (quaternion) to be passed in and have the engine calculate where to position the particles relative to the specified entity. That way physics objects could have bullet holes, for example if you shot at a turning wheel the bullet hole would track with the wheel turning.

There are several things in the engine that need to be fixed first though, for example if you put a bullet hole in a transparent entity you want to be able to see it from the other side, currently you won't be able to. Particle occlusion (and decals presumably) appears to be hard wired in the engine so very strange effects occur when they are used.

And of course animated entities can't have bullet holes, making that work is way beyond my knowledge of the engine!

Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 17:14
Quoted!
Can get the concept of particleid param, Global say: particleid = ParticlesGetFreeEmitter(), but I can see in a script setting "e" as particleid , does this make sense?
I'm using ParticlesAddEmitterEx: because I want to use entityID param too. Then the imageframe param is for that 8x8 images?
Does de 0 do something here, ie: if I don't want to scaleStartMin/scaleStartMax if I set 0 as param, avoid the particle (hole) being scale?
What should trigger the script? Should I attached script to the wall in my case?
Ty for feedbacks mate.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Feb 2019 17:22
Quote: "The bullet hole sprite sheets that GraPhiX made for that demo were 8x8 so there were 64 different types of 'hole' for each type of material."

64 images per material WOW ! An incredibly heavy job, unless you have a hole generator at home.
Then it would be better that I go to prepare a pot of coffee, because a very long night awaits me
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 1st Feb 2019 19:28 Edited at: 1st Feb 2019 19:33
Hi 3com here are some to get you started

these were the test holes I sent to AmenMoses metal x 64 wood x 64 glass x16 stone 2 x 16
Welcome to the real world!
Main PC - Windows 10 Pro x64 - Core i7-7700K @4.2GHz - 32GB DDR4 RAM - GeForce GTX 1060-6G 6GB - 1TB NVe SSD
Test PC - Windows 10 Pro x64 - G4400 @3.3GHz - 16GB DDR3 RAM - GeForce GTX 950 2GB - 500GB SSD
Laptop - Helios 300 Predator - i7 7700HQ - 32GB - Nvidia GTX1060 6GB - 525GB M2 - 500 SSD - 17.3" IPS LED Panel - Windows 10 Pro x64
Various Tutorials by me

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Feb 2019 20:11
I'll try to get the engine changes into GitHub tomorrow, then at least they are available, whether Lee want's to include them in the master or not is another matter entirely.

Just to be clear, the engine changes I've done so far simply allow individual 'particles' to be placed statically at a specific position and orientation. The hard work of working out what that position and orientation is still has to be done by scripting. (although I have written the script obviously as you can see from the video )


Been there, done that, got all the T-Shirts!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Feb 2019 01:31
Cool stuff ;p
My only concern personally about adding this sort of detail into a game is the performance cost. I'm sure there's ways to make this sort of feature run with no performance hit, given enough memory and some way of updating the objects texture ( and/or geometry). Having loads of planes dotted all over would for sure end up with issues at some point. I'm not keen on slowly vanishing bullet holes in games myself.

This would be great if bullet holes could be updated on the actual textures of the objects in game. Updating the textures would only cause a minimal performance cost when they have to be updated compared to the exponential cost of adding geometry. Also, it should be practically free memory wise as it is simply changing the current textures and not significantly altering the memory footprint.

Would be a great feature As a dabbler in programming I can say that would also be impressive indeed. The maths behind it scares me with just the thought, lol.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 2nd Feb 2019 05:30
That would be great. Can I find some instructions on using the particles?

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Feb 2019 06:13 Edited at: 2nd Feb 2019 06:14
Quote: "Hi 3com here are some to get you started"

Cool! nice saver time stuff. Ty GraPhiX

Quote: "I'll try to get the engine changes into GitHub tomorrow, then at least they are available, whether Lee want's to include them in the master or not is another matter entirely"

Would be great if he does.
Quote: "The hard work of working out what that position and orientation is still has to be done by scripting"

I know, I'm struggling with it. Still I've doubts about, ie: about particleid as I stated in my previews post.

Quote: "My only concern personally about adding this sort of detail into a game is the performance cost."

I though about, for that reson decals was my firts though, given them a brief life and destroy them after a short period of time, or when the player is out of the scene.

Quote: "That would be great. Can I find some instructions on using the particles?"

Not well documented yet, the only related info is in global file, as far as I know.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 2nd Feb 2019 08:40 Edited at: 2nd Feb 2019 09:42
You can find details on the particle system here https://forum.game-guru.com/thread/220140

and here https://forum.game-guru.com/thread/220163


also here https://forum.game-guru.com/thread/220232
Welcome to the real world!
Main PC - Windows 10 Pro x64 - Core i7-7700K @4.2GHz - 32GB DDR4 RAM - GeForce GTX 1060-6G 6GB - 1TB NVe SSD
Test PC - Windows 10 Pro x64 - G4400 @3.3GHz - 16GB DDR3 RAM - GeForce GTX 950 2GB - 500GB SSD
Laptop - Helios 300 Predator - i7 7700HQ - 32GB - Nvidia GTX1060 6GB - 525GB M2 - 500 SSD - 17.3" IPS LED Panel - Windows 10 Pro x64
Various Tutorials by me
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Feb 2019 11:25 Edited at: 2nd Feb 2019 11:26
@ GraPhiX
Ty mate for the links. I had seem you are taking good profit with particle system.

@ A.M.
Quote: "Not well documented yet"

My fault, I had missed your thread Now I saw I was doing many silly questions about, great job you has made with particle system.
Long time away from here, and not many time left to take all the changes.
As aside note, does you miss to talk about the alpha in your thread?

Quote: "alpha : How see-through the particle is (this is actually very important as we'll see later)."


I thought Lee has most focused particle system toward wheather , wind, snow, rain etc, is great to have to, but is there another kind of static particles that don't need to be animate/scale/move etc, like bullet holes. Most likely attached to a entity and move with the entity; as you said before (car wheel).
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2019 14:45
Yes I was going to continue with the tutorial series when my next batch of changes were ready but I sort of stalled when I realised I couldn't fix the animated entity issue without Lee's help.

GraPhiX probably knows more about the Alpha side of things, pretty much just makes things see through as far as I am concerned. So 100 = fully solid, 0 invisible values in between being most useful, at least I think that's how it works. (GraPhiX was using 0-255 in one of his scripts but I'm not sure which is correct)

Make sure when using min/max values that you specify them in the right order, for example if you want to have a value between -1 and -5 make sure to specify min=-5 max=-1! (as -1 is > -5)
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Feb 2019 15:02
0-255 makes the most sense because that's how paint apps will scale it (i.e. textures will have values from 0-255) so it will translate more easily and it's how most other engines will handle it - though 0-100 is still easy enough to convert by multiplying the value by 2.55 in the shader, it just wouldn't be quite as precise.

and yes GG would really benefit from a parenting system, it was great to use that in that other main stream engine i used for a while - want a different gun? simply remove the existing one from the hierarchy and parent the new gun, want a hat? simply parent it to the head... the engine does all the rest for you - it opens up so many more possibilities when you're not confined to very specific models
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 2nd Feb 2019 15:47 Edited at: 2nd Feb 2019 15:48
If this system ever gets implemented into GG proper, it would be cool to also play material-specific sounds with your material-specific bullet holes. So a bullet impact on metal could be played when it's metal, wood when wood, flesh when flesh etc.

AE
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2019 20:56 Edited at: 2nd Feb 2019 20:59
Ok so I made a fresh clone of the current repository and copied over the changes for just the bullet hole stuff from my myriad of working folders and it appears to work:



The video shows how the bullet holes align to the object edges they hit and how they change depending on the material. For fun I used a pain splat one for 'stone' material, which the house reports as.

I need to update global.lua to include the new commands before I push it to Lee, I haven't figured out his new 'Alphasite' branch yet so will push to the master but I don't really consider this a 'new' feature, more a tweak to an existing feature.

I've attached the script (yes this is a single script doing this!) so you can see how this is all achieved but obviously it won't work with the current GG build as you wont have the new particle commands.


(btw, the Alpha is 0 to 100 but it's floating point not an integer value!)

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Feb 2019 21:23
Quote: "0-255 makes the most sense because that's how paint apps will scale it"


Quote: "(btw, the Alpha is 0 to 100 but it's floating point not an integer value!)"


GG uses several weird ranges at times. Want to set your surface levels up in a script? Forget copying your slider settings as they do not have the same values Always thought that was a bit of a crazy system. I mean any other language I've used uses RGB values for these sort of things, so you can simply get the rgb values of the colour you want to use and feed em in. GG it seems, has to be awkward.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2019 21:41
It depends on what it is, 0-255 for RGB values makes sense because that's what most people think of but under the covers when calling the DX routines a lot of things have to be converted to 0 .. 1 values where 0 represents the minimum value and 1 represents the maximum value, the Bullet engine is the same in this respect.

To me 0 - 100 makes sense as 0 is fully invisible and 100 is fully opaque.

Been there, done that, got all the T-Shirts!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Feb 2019 22:16
Yeah horses for courses. It just makes things more difficult for the average user who wants to simply get the slider bars values to put into a script, as they do not match. Especially if they do not know what the generic slider values convert to.

As long as the documentation notes the value ranges (to remind us users who will automatically use 255) the particle system transparency sounds fine to me.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Feb 2019 23:05 Edited at: 2nd Feb 2019 23:08
Quote: "pretty much just makes things see through as far as I am concerned. So 100 = fully solid, 0 invisible values in between being most useful, at least I think that's how it works. (GraPhiX was using 0-255 in one of his scripts but I'm not sure which is correct)"

usually graphic software uses the 0-255 system, however 0-100 would also be fine. though, just as range for alpha channel.

Quote: "Make sure when using min/max values that you specify them in the right order, for example if you want to have a value between -1 and -5 make sure to specify min=-5 max=-1! (as -1 is > -5)"

Good point.

Quote: "I've attached the script (yes this is a single script doing this!) so you can see how this is all achieved but obviously it won't work with the current GG build as you wont have the new particle commands."


Ty for the script mate
Let's hope the master Lee add these commands in next build.

Quote: "(btw, the Alpha is 0 to 100 but it's floating point not an integer value!)"

We can convert it as needed, thought.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2019 23:15
Documentation?
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Feb 2019 23:22 Edited at: 2nd Feb 2019 23:22
Do you ask to me?
If so, does the math.floor do so?
Or maybe this piece of code does?



Or I'm missunderstanding the statement maybe?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Feb 2019 23:51
Sorry I was responding to DVader, I'm currently updating the particles part of the global.lua script which is probably the only 'documentation' we have for this stuff.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 3rd Feb 2019 00:09
Quote: "I'm currently updating the particles part of the global.lua script which is probably the only 'documentation' we have for this stuff."

Yes, thanks to your tutorials we have some idea about how the particle system works.
Global file is a bit sparse in descriptions; although I understand that Master Lee has to multiply and it is not easy to do it.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Feb 2019 00:47
Well to be fair in order to know how to use any specific particles system it helps to know what they are and how they work, for that you should use google. The same applies to my other tutorials, quaternions are very useful but you need to understand why you need them first, physics is a vast subject and you need to understand how the Bullet engine works first before really being able to apply its features in GG.

My tutorials are intended to be for beginners but beginners who understand why they need those tutorials in the first place.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 3rd Feb 2019 06:51
@ A.M
I know, I start reading about particle system because 3ds max, although I did not delve into it because GG did not use the particle system yet.
Anyway I hope that the average user does not need a master's degree in physics, mathematics, trigonometry, geometry, etc. to be able to use the particle system in GG.
Anyway your tuto is useful to understand the new LUA command to deal with.

@ everybody interested about who like deal with, searching for info, or simply curiosity.

Summarizing the concept a lot, a particle is an object, and a particle system is a collection of those objects, often represented by a simple shape or dot. GG use a sprite sheet.

This piece of code is not mine, but I think it recreates quite well the way to create a particle. It has location, velocity, and acceleration, a constructor to initialize those variables, and functions to display() itself, and update() its location.



Here the author is using an ellipse, drawning it directly on the screen via code, instead of using a shape, referencing a "PImage" to draw the particle.
Usually particle systems involve something called an "emitter", the emitter is the source of the particles and controls the initial settings for the particles, location, velocity, etc. and for perfomance sake, as new particles are born, we need old particles to die; otherwise our system would go crazy, and we run on the risck to thrown it thru the windows, LOL.

Here comes into the scenary "lifespan" to help with. Usually going from 255 thru 0 (and the timer will start at 255 and count down to 0); it does thus because to act as the alpha transparency as well. When the particle is "dead" it will also have faded away onscreen.

On code "boolean isDead()" check out and see if the value of "lifespan" is less than 0. If it is return true, otherwise return false.

"run()" function calls both "update()" and "display()" . In addition, it give the particle a random initial velocity as well as a downward acceleration (to simulate gravity).
Of course there are another parameters involved, such as force, repellers, gravity etc implied in the behavior of the particles.

Hope this help to clarify something, many of the function used as already declare in another class of course, but not necessary to explain this concept.


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 3rd Feb 2019 16:13
Quote: "Forget copying your slider settings as they do not have the same values Always thought that was a bit of a crazy system. I mean any other language I've used uses RGB values for these sort of things, so you can simply get the rgb values of the colour you want to use and feed em in. GG it seems, has to be awkward."


I've noticed this too.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-11-24 03:02:17
Your offset time is: 2024-11-24 03:02:17