Welcome Anonymous!
We host quality Star Wars sites - inquire at The Star Wars Rebellion Network  
SW:Rebellion Network
imminent-bean
 



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: laser headache
PostPosted: Sat Dec 16, 2006 9:34 pm 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
--note--
the following little bit is about my not for profit star wars fan game "In Defence of the Empire". although its not really meant as rebellion2, i think it might still kinda fit in this forum
--/note--

consider this.. (in my game)

a star destroyer has 60 turbolasers
a mon cal MC80 has 48 turbolasers
a nebulon b cruiser has 12 turbolasers

now lets say (in my simplified version of the sw universe)
that each ship fires one laser "shot" for each gun, and fires each shot one at a time. After it fires a number of shots equal to the number of turbolasers it has, it waits four seconds (to simulate the recharging of its guns) and then starts the process over again. lets also assume that the power of a turbolaser shot from a star destroyer is the same as the power of a shot coming from any other ship.

sound's fine right? thats what I thought when i wrote the firing code in my game engine. it does a nice job of keeping the screen from getting congested with hundreds of laser bolts, while doing a solid job of depicting ship to ship combat.

I found out that I had a problem when i threw in a little bit of code to actually count how many total shots each ship was taking. the results were as follows:

in one minute:
nebulon b: 120 shots
MC80: 180 shots
Star Destroyer: 183 shots

in 3 minutes:
nebulon b: 292 shots
MC80: 438 shots
Star Destroyer: 450 shots

for a ship with only 12 turbolasers, the nebulon b is doing really well (no wonder they were so popular in rebellion!)

the problem is that 12 shots takes significantly less time to fire then 60 shots. this is only slightly offset by the fact that ships that have less shots to fire spend more time recharging.

There are a couple things that ive been considering to deal with this problem
1. have more than one shot fired at once. the problem with this is that my game is for the most part a tactical fleet simulator, and the screen would get filled up with shots really quick. Not to mention firing 60 shots at once looks unbelievably ridiculous (imagine a green halo of shots launching from your sd)

2. have shots from different ships be different strengths. this is already actually coded, i just have to come up with values to assign, but its pretty hard to figure out how strong each individual shot should be

3. ask the swrebellion community for opinions--which is where you come in!

as always feel free to check out my website for some pictures and boring explanations
http://nordwindranger.com/mimages.aspx

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 10:58 pm 
Offline
<!-- Major //-->
User avatar

Joined: Fri Sep 02, 2005 12:00 am
Posts: 256
4. Calculate how long it takes to fire a single volley of the ISD, + 4 seconds.

Calculate how long it takes the Nebulon to fire a full volley, +4 seconds. At to the Neb's 4 seconds until time=same.

(Just a random thought...)

_________________
Sovereign ProtAKtor of the BEAK Imperium.

1 Corinthians 16:14 " Your every act should be done with love."


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 3:40 pm 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
sorry it took so long for me to reply, i was ambushed by final exams.

Thats an interesting idea, I'll have to give it a try.

The other thing I've been toying around with is increasing laser speeds. Currently my lasers are between Rebellion's super slow speed, and the super fast lasers in EvilleJedi's excellent Warlords mod.

I'm giving some serious thought to coding in the ability for a ship to target more than one enemy at a time, but I guess I'm not convinced that there would be any benifits.

Lets take the classic "Thrawn" scenario. An isd is attacked by 3 assault frigates (we'll make them Nebulon b frigates).
currently as the game is coded, the isd will detect all three targets, select the first one and attack it until it's disabled. It will then attack the next one and so on.

If the isd split its shots between two targets would that be seen as stupid or smart? It would certainly look cooler, but wheres the limit? if I allow ships to target multiple enemies, the ships firepower might become so diluted that it is practically ineffective.

it suddenly occurs to me that i need to have some sort of point based ranking system for ships so that the ai can decide when to concentrate its firepower.

perhaps this gives a little peak into the difficulties of even rudimentary ai programming :lol:

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 4:22 pm 
Offline
<!-- Major //-->
User avatar

Joined: Fri Sep 02, 2005 12:00 am
Posts: 256
Well, in <i>real</i> Star Wars, fire splitting makes sense... because it is not really splitting. Guns cannot point everywhere, after all...

(Yes, lots more coding for this one...)

_________________
Sovereign ProtAKtor of the BEAK Imperium.

1 Corinthians 16:14 " Your every act should be done with love."


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 9:24 am 
Offline
<!-- Warlord -->
User avatar

Joined: Wed Jun 15, 2005 12:00 am
Posts: 1944
Location: Death Stars are out at night, big and bright, deep in the heart of Texas.
In Rebellion the AI attacks the "most powerful" ship in your fleet. If you let this (your) ship "sit", the enemy ships have to run the gauntlet of your other ships to get to it. But at least the AI fires on these ships until it gets into weapons range. I don't necessary like this; I mean why force your way into the middle of an enemy fleet and be attacked on all sides? Theoretically, if I don't need full power to aft shields because I'm attacking the "leading edge" of the enemy fleet (they're all in front of me), that would mean extra power available to weapons! Plus the enemy wouldn't want his (relatively) weaker ships being attacked against a more powerful enemy ship and would be forced to bring up his more powerful ships to slug it out, or retreat. Definitely better ship combat tactics are needed, and somehow this would all have to tie into an Admiral's stats (assuming one is in command).

I like the idea of splitting ship fire over multiple targets, but only if it makes sense. If all systems on an enemy ship are down or just crucial ones, why keep firing until it's a hulk? This would be the time to start firing on another target while trying to disable the remaining active ship systems of the initial target.

PsychoInfiltrator wrote:
... Guns cannot point everywhere, after all...

There are weapons on the forward/aft/starboard/port sides of ships, why not be able to attack a target in (let's say) two of the four directions (remember the weapons recharge rate is fixed, so it will take longer to "reload" between shots when there are more targets)? This could be optional at the discretion of the player/AI.


PS Yeehaw, I just made Admiral (again) :D

_________________
Finally, after years of hard work I am the Supreme Sith Warlord! Muwhahahaha!! What?? What do you mean "there's only two of us"?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 9:48 am 
Offline
<!-- General -->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 838
Location: The Android's Dungeon in a galaxy far far away.
DarthTex wrote:
PS Yeehaw, I just made Admiral (again) :D


Congrats Tex! :D ... again.. :lol:

_________________
"Duct tape is like the force. It has a light side, a dark side, and it holds the universe together."
Image


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 11:25 am 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
DarthTex wrote:
Definitely better ship combat tactics are needed, and somehow this would all have to tie into an Admiral's stats (assuming one is in command).
There are weapons on the forward/aft/starboard/port sides of ships, why not be able to attack a target in (let's say) two of the four directions (remember the weapons recharge rate is fixed, so it will take longer to "reload" between shots when there are more targets)? This could be optional at the discretion of the player/AI.


Currently ships are organized into fleets. Each fleet has a designated leader that the rest of the ships will (theoretically) position themselves around. Although ships do tend to move towards ships they are attacking, when they are done attacking a target, they are supposed to move back into position with their fleet.

I've decided to change weapon reload times so that each laser has an individual reload time. I have the feeling that this will vastly change around the whole problem, if not completely eliminate it all together. this will mean that each laser will start recharging after it fires, not after every laser fires. In other words, a ship like the executor would have a virtually undistrupted stream of fire, because it has so many lasers that there will always be some recharged ones to fire.

I'll have to work on this over break, and then maybe get a video up. that would be pretty cool.

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
 Post subject: Video!!!!!!!!!!
PostPosted: Thu Dec 21, 2006 2:00 pm 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
alright I just threw together a little video of what firing looks like at the moment.

unfortunately its rather low resolution..
for a clearer picture i reccomend watching it at the origional size

http://video.google.com/videoplay?docid=7516872604068091966

oh yeah, hit testing was turned off for the video (in case you were wondering why the shots pass right through ships)

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 2:32 pm 
Offline
<!-- Commander //-->

Joined: Mon Sep 18, 2006 12:00 am
Posts: 360
Location: Somewhere between 100° N and 80° N
Great Video! 8O

_________________
"The Chimaera is at your command, Admiral."
—Captain Gilad Pellaeon


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 3:21 pm 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
thanks taco, glad you liked it!

I'm gonna make a longer one, and give it its own post so that it makes the forum summary on the front page of the website (apparently only new topics get on there?)

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 1:17 pm 
Offline
<!-- Warlord -->
User avatar

Joined: Fri Jul 22, 2005 12:00 am
Posts: 1796
Location: Brockville, ON
Nifty. This has potential. :twisted:

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 6:41 am 
Offline
<!-- Major //-->
User avatar

Joined: Thu Jan 04, 2007 12:00 am
Posts: 191
Location: Dark side of the Yavin moon.
Hi, just few another random thoughts about your laser headache.

Consider different model. We place turbolasers on "mount points" on the hull of the ship. Each MP has it's arc and power. Arc is determined by MP's placement, power by the total number of turbolasers this MP is representing. Mount point fires on an enemy ship when it's in range and in arc, probably fires at one ship until it's down (makes no sense for a turret to spin left-right until the gunner gets all dizzy :D).

Now, a small example... Lets take an ISD Vivisectionist and place five MPs on it. Fore, fore-port, aft-port, fore-starboard, aft-starboard (or maybe even top/bottom, but it still can reduce the "halo" effect of lasers to reasonable levels) with appropriate arcs and powers 20/10/10/10/10. If this ISD meets an enemy corvette and approaches it from front, it can attack with all three fore MP's, with a total power of 40. If that corvette would attack our ISD from side, only that side's MP's could respond and the power devoted to the destruction of this little corvette would be only 20 (30 with fore). However if the ISD would be attacked by two corvettes from both sides, it wouldn't notice the difference, since both sides would be evenly tearing the corvettes to pieces.

Next, laser recharge rate (keeping separate recharge counters for each MP sounds like a good idea) would not depend on the number of turbolasers the ship has, but instead on it's reactor type (or class) and it's status (damaged, overheating, etc.)

This also brings new possibilities for a ships's commander. First, ships position would be important because of firing arcs, and second, commander would be able to issue orders to take power from aft turbolasers and use it to boost reactor, thus allowing fore lasers to fire for a longer time without recharging. And so on...

Well, just some ideas :)
I don't know how far are you with coding, but the video looks very promising. Keep it up and happy coding.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 9:39 pm 
Offline
<!-- Lieutenant //-->
User avatar

Joined: Tue Sep 19, 2006 12:00 am
Posts: 127
Location: green bay wisconsin usa
thats a pretty good way of going about it, but its quite a bit more complicated than Im ready to try right now.

as far as progress goes....
I completely rewrote the entire engine over winter break, and in doing so I incorporated an updated firing mechanism. Both ion cannons and turbolasers are now implemented. ioncannons do more damage to shields and turbolasers do more damage to the hull. shields recharge slowly, but recharge is stopped once the hull is brought down to 20% of its original hit points. The hull can only be damaged when the shield is at 0.

in a test that I just ran:
an ISD mark I took aproximately 2 minutes to destroy a MC80
In the process of which, the ISD fired 342 turbolaser shots and 342 ion cannon shots. the MC80 fired 282 turbolaser shots, and 120 ion cannon shots before being completely disabled.

Ships are capable of targeting multiple targets (although this will obviously dilute the amount of fire that they are able to pour on each)

_________________
<a href="http://nordwindranger.com">http://nordwindranger.com</a>
I should really make a flashy banner


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 
 
 
^Top 
Home Your Account Forums Downloads F.A.Q. Submit News Hosting Contact Us

© 1999-2008 by SWRebellion.com. All Rights Reserved.
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters.
You can syndicate our news using the file backend.php

    Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group