Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (784)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Guns, Lasers, and Persistance  (Read 1148 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Devvie

There is nothing common about common sense

« Posted 2003-12-04 22:53:11 »

I would like to know if you guys know how bullets, lasers, and other projectiles aer handled in a 3D scene.  

Lets examine a laser beam.  The laser beam is constructed from a cylindar (I know you can take a plane and map a texture to it and animate the texture but its about the same thing).  So do game engines continue to make new laser "objects" every time a player shoots (from a gun)?  Or would an engine create say 100 laser objects and just use a circular que to pick which laser to use (hidding the lasers that aren't used)?  

So I have thought of 2 viabel methods kinda described above
1. Just create a new Laser object (and behavior controlling the thing) every time a shot is fired.

2. Create X lasers and just round robin them when needed (however, u are limited the number of lasers allowed on the screen at 1 time).

Are there better methods out there then the two above?  Which method do you guys suggest?

Thanks for your input

Offline Herkules

Senior Devvie

Friendly fire isn't friendly!

« Reply #1 - Posted 2003-12-05 04:02:01 »


In case of a laserbeam (single object, created/released rarely), taking a new object each time pulling the trigger is feasable.

On the other end of a spectrum - when firing with a particle system that consists of hundreds of particles .... better pool them together bc. creation might get expensive and the memory footprint is SO big, that you cannot assign one to all of your weapons.

Somewhere in between are the FlyingGuns cannonshots (12 cylinders) e.g.. They are created in a lazy manner an then are assigned to the weapon and kept there. When firing, they are just attached to the scenegraph.

So look for a tradeoff!

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Conzar

Junior Devvie

There is nothing common about common sense

« Reply #2 - Posted 2003-12-05 17:14:06 »

Ok, so I decieded to do a Laser Manager that creates all lasers at the start.  This should work fine b/c the number of lasers shot at one time is very small  
(for my lightsaber game).

I'll post back and let u guys know how things are working out.

Oh yea, like u said with the hybrid Idea.  You could create x number of lasers.  If you find out that more is needed, then u could create the extra lasers on the fly and then rotate them into the circular que.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

theagentd (76 views)
2017-02-18 13:42:33

theagentd (81 views)
2017-02-18 13:35:16

h.pernpeintner (1247 views)
2017-01-24 22:39:11

h.pernpeintner (1235 views)
2017-01-24 22:38:32

Galdo (1786 views)
2017-01-12 13:44:09

Archive (1901 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2437 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2287 views)
2016-12-15 21:50:57

Lunch (2366 views)
2016-12-06 16:01:40

ral0r2 (2154 views)
2016-11-23 16:08:26
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!