Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
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 744 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Member




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

Ubuntu
Offline Herkules

Senior Member




Friendly fire isn't friendly!


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

Depends.....

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 Member




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.

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (9 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (46 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!