FreeOrion

Forums for the FreeOrion project
It is currently Thu Dec 14, 2017 8:42 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Ship weapons
PostPosted: Wed Sep 07, 2016 7:13 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Edit: this is resolved i was using a older version.

Hello i was reading this tutorial here which appears outdated

http://www.freeorion.org/index.php/Effe ... al#Example

this line here shows that there was previously a number of shots type that could be set.
Quote:
A new weapon
default/scripting/ship_parts/TUT_WEAPON.focs.txt

Part
name = "TUT_WEAPON"
description = "TUT_WEAPON_DESC"
class = ShortRange
damage = 4
shots = 1
mountableSlotTypes = External
buildcost = 25 * [[FLEET_UPKEEP_MULTIPLICATOR]]
buildtime = 2
location = OwnedBy empire = Source.Owner
icon = ""

#include "../common/shared.macros"

class defines what kind of part this is: a short range weapon, a fighter weapon, a piece of armor, etc.
For direct fire weapons (ShortRange), there is a primary stat of damage and a secondary stat of shots.
damage refers to the amount of damage for each shot.
shots is how many times this part shoots during each combat round, this may be omitted and defaults to 1.
The FighterHangar class has a primary stat capacity and a secondary damage.


Is this no longer valid i.e. can it no longer be done or is it just a new syntax that must be used.

I wanted this to script it for simulating weapons for, fighter, flack, or low penetrating high rof weapons on low armored or in this case low shielded targets. Ive been altering the balance for weaponry which is very bland by simple consideration of what is available currently. Such that the implementation i wish to put in place is as follows, under the following doctine.

The idea... Smaller weapons can do more damage against weakly or non shielded targets. While single shot weapons only firing have as often doing double damage have less damage deflected by shielding. So that shields in this game serve as true damage deflection armor. Armor could then serve as choice to bolstering hp against high penetration weapons when lower damage multi firing weapons are in play.

For this i need multiple shots then by that alone i can create sub classed ships. High dpm multishot ships example.

Fighter x3 damage 10 = 30 max dpr
(30 total damage vs un-shielded), (12 total damage vs a shield rating of 6).

Capital ship 1x damage 25 = 25 max dpr
(25 total damage vs un-shielded), (19 total damage vs a shield rating of 65).

So i could effectively have 4 subclasses

small high dpm.
small high penetrating
large standard high penetration cap ships.
large higher anti small ships high dpm weapons less armor, but more vulnerable to other cap ships.


Last edited by xlightwavex on Sun Sep 18, 2016 4:12 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 7:25 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
What version are you playing?


Works fine in current master. For example, take a look at the flak cannon ("WEAPON_0_1").

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 7:59 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Morlic wrote:
What version are you playing?


Works fine in current master. For example, take a look at the flak cannon ("WEAPON_0_1").


The dev build from a couple days ago.

When i add this line...

shots = 2.

I get script errors. The ai in game window hello message instead outputs some errors.
As well the weapon wont show up in the create ship screen after being researched.

Totally removing that line fixes the problem adding it adds the errors back in.


Last edited by xlightwavex on Wed Sep 07, 2016 8:06 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:06 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12041
Location: Munich
Post your modified script file?


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:12 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Geoff the Medio wrote:
Post your modified script file?


In ship_parts.txt

Just add the line to the first weapon part to test it.


Part
name = "SR_WEAPON_1_1"
description = "SR_WEAPON_1_1_DESC"
class = ShortRange
damage = 10
shot = 2
mountableSlotTypes = External
buildcost = 16 * [[FLEET_UPKEEP_MULTIPLICATOR]]
buildtime = 3
location = OwnedBy empire = Source.Owner
icon = "icons/ship_parts/mass-driver-1.png"



the hello window msg reads...

"handleDiplomaticMessage": "'NoneType' object has no attribute 'handle_diplomatic_message'"

</rgba></rgba>
<rgba 255 255 0 255>AI_6: <rgba 255 0 0 255>AI_Error: AI script error in "handleDiplomaticStatusUpdate": "'NoneType' object has no attribute 'handle_diplomatic_status_update'"</rgba></rgba>
<rgba 255 255 0 255>AI_6: <rgba 255 0 0 255>AI_Error: AI script error in "handleDiplomaticStatusUpdate": "'NoneType' object has no attribute 'handle_diplomatic_status_update'"</rgba></rgba>


ect...

removing the line returns things to normal.

Creating AI Clients
Generating Universe
Begin Turn 1
<rgba 0 255 255 255>AI_4: Control Empire (typical):
"Ave, Human, morituri te salutant!"</rgba>
<rgba 0 255 0 255>AI_2: Seigniory Empire (typical):
"Ave, Human, morituri te salutant!"</rgba>
<rgba 255 255 0 255>AI_1: Panarchy Empire (typical):
"Ave, Human, morituri te salutant!"</rgba>
<rgba 114 0 179 255>AI_7: Order Empire (typical):
"Ave, Human, morituri te salutant!"</rgba>

other then that it starts up in latin with the hello or something lol


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:23 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12041
Location: Munich
xlightwavex wrote:
In ship_parts.txt
There is no ship_parts.txt in the latest master build.

What is the version string of the "dev build from a couple days ago" you're using?


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:27 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
maybe i somehow downloaded a old version the version date makes no sense.

this is link from the main page to the latest releases.

https://sourceforge.net/projects/freeor ... n%200.4.5/


Last edited by xlightwavex on Wed Sep 07, 2016 8:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:31 pm 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
xlightwavex wrote:
Geoff the Medio wrote:
Post your modified script file?


In ship_parts.txt

Just add the line to the first weapon part to test it.


Part
name = "SR_WEAPON_1_1"
description = "SR_WEAPON_1_1_DESC"
class = ShortRange
damage = 10
shot = 2


Also note it is shots, not shot.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:36 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3291
xlightwavex wrote:
maybe i somehow downloaded a old version the version date makes no sense.

this is link from the main page to the latest releases.

https://sourceforge.net/projects/freeor ... n%200.4.5/

That's the year old Release version, so the code simply CANNOT work as the rate of fire mechanic didn't exist. You wan the Test releases:
FreeOrion - Browse /FreeOrion/Test at SourceForge.net

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:37 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Morlic wrote:
xlightwavex wrote:
Geoff the Medio wrote:
Post your modified script file?


In ship_parts.txt

Just add the line to the first weapon part to test it.


Part
name = "SR_WEAPON_1_1"
description = "SR_WEAPON_1_1_DESC"
class = ShortRange
damage = 10
shots = 2


Also note it is shots, not shot.


Edit:

ok sorry you posted after i clicked to reply/.

ya this main page link

http://www.freeorion.org/index.php/Main_Page

has two different places to click and both take you to different spots.

https://sourceforge.net/projects/freeor ... FreeOrion/

https://sourceforge.net/projects/freeor ... n%200.4.4/


Last edited by xlightwavex on Wed Sep 07, 2016 8:42 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:39 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3291
That's weird, those errors are diplomatic related.

Regardless, the rate of fire stuff is intended to go alongside the Fighters stuff which we deliberately stopped work on so we could catch up with other things and get the current Release done. There is a Fighters branch on Github in which the AI has received updates to take into account the code changes and similar, hopefully after the current Release is in the bag we can get on with integrating Fighters into the Test releases relatively early, but it depends on the scripting/balance team and the AI team working together in a way we've not done before as it's hard to balance things until the AI is using them but the AI can't use them unless it knows what they're doing.

And yes, having a tech that gives the Mass Driver an improved Rate Of Fire is something I really want to implement in the later game.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 8:48 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Ya i had the old one in, no wonder.

I know, i dunno what one had to do with the other, diplo message error output ? Maybe just the error log wasn't to hot and it was a way for someone to hack around a problem to see the error.

grabing the newer version now.


Top
 Profile  
 
 Post subject: Re: Ship weapons
PostPosted: Wed Sep 07, 2016 9:56 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Ok got it to work. Its looking good.

Little fyi for future reference.

The old version the left files remained they didnt fully uninstall. With those stuck in program files x86, the new version after install, crashed, and with the processes still in memory after closing the crashed program by windows. (chrome boost specifically the old CA file). I had to manually stop the processes afterwards (via task manager) to delete the files and folders that remained. Then reinstall again.

Point is that will affect people when you release the new version. The fast fix is to uninstall, reboot then delete that freeorion folder in x86 with admin privilages if it not prompted to by default. Then to reinstall the new version you should probably make a note of that.


Anyways to get back on topic.

When i posted this earlier mind you im not really much for the idea of fighters more so frigit sized vessels replacing them. While the shots work it really means each gun should have Two versions a capital ship version that fires once with high damage and multiple shot small versions that fire more less damaging shots this overall makes it harder to balance and is sort of reverse of the actual concept. In reality a capital ship has a armored gun with lots of ammo space. A bomber has no armor no space and just one shot. This works when in either case when a single penetrating hit to either ship is severely damaging or devastating. In reality a machine gun wont take out a tank not even on its side or ass but a missile launch might or it might disable it. Fighter/ bombers essentially are the same as just a gun and dodging to get one good shot in when you only have one shot.

In game this translates to the following. A single capital ship hit on a small fighter would destroy it.
On a frigit/destroyer would cripple or take a large chunk of hp, We simulate larger guns or one single good shot. In game from many gun slotted ships (at least that's the idea i have here) or a single shot, that is more damaging then any 'one shot of a smaller set of volleys', but not as damaging as the sum of the volleys.
Were shields simulate deflection potential of large well armored targets that are also costly and time consuming to produce yet effective when used properly. In a space game, really all ships should be big and frigit sized ships would be the fighter/bombers, but they really shouldn't be able to outgun a BB or Crusier, specifically equipped to deal with them. This is of course why they make bigger ships in the first place, i.e. they are cost effective when they bounce bullets at a steady rate. The keyword is 'when' and "steady rate'. The idea of types is to gain a advantage via logistical cost effectiveness when you cant simply outproduce your opponent.

In space missiles smart ones, would replace small fighters altogether.

So this is a stop gap solution below.

Quote:
For this i need multiple shots then by that alone i can create sub classed ships. High dpm multishot ships example.

Fighter x3 damage 10 = 30 max dpr
(30 total damage vs un-shielded),
(12 total damage vs a shield rating of 6).

Capital ship 1x damage 25 = 25 max dpr
(25 total damage vs un-shielded),
(19 total damage vs a shield rating of 6).

So i could effectively have 4 subclasses

small high dpm.
small high penetrating
large standard high penetration cap ships.
large higher anti small ships high dpm weapons less armor, but more vulnerable to other cap ships.


I should of added i need two types of gun for each gun type, the multi shot type, and the single shot type. To say large cannons and a small faster firing cannon, akin to a 120mm vs a 30mm.

More favorably a frigit sized vessal would fire once every other round a spinal mounted gun at larger targets (with a chance to miss ect). Capital ships would have these as turrets and have smaller guns in the anti missile role anyone who specializes at one thing then leaves themselves vulnerable to another.
Too many small guns on a cap ship your weaker vs other cap ships. No shields and lots of guns hp as a cheap alternative you might die to a group of smaller vessels ect you could put the single shot version on smaller ships but then if the shields are expensive other smaller ships might be able to take you out with your low hp pool.

For this to all work properly guns have to be more cost effective then armor at least a little bit more.

The age old variability is then in place to say knowing yourself and your enemy is to win. In modern terms, then you can cost effectively plan for who you see as a threat before any shots are even fired. It introduces a element of tactical strategy.

Anyways ima try the new version and test the scripting a bit.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group