FreeOrion

Forums for the FreeOrion project
It is currently Sun May 19, 2013 8:35 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: CreateShip
PostPosted: Thu Oct 29, 2009 6:58 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1770
Location: Orion
Would it be possible to implement a CreateShip (or perhaps CreateFleet) effect? My idea is that the Ancient Ruins special, which currently (in my version) gives a free tech or building to the empire, could also perhaps give a free ship, or fleet of ships, with very special hulls and parts which can't be unlocked and built normally.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Thu Oct 29, 2009 7:47 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
It should be possible to add a CreateShip effect.

This would be more complicated than CreateBuilding due to issues of which empire to give ownership of the new ship to; with a building, the ownership can match the planet on which it's created. Ships wouldn't need to be created only at the location of a certain kind of object; they could be created anywhere there's a system, or perhaps even outside systems, and the ownership of the system wouldn't necessarily have to match the ownership of the new ship. Adding an owner id parameter to the effect definition could probably resolve this, with Source.Owner and Target.Owner being available to set the owner. This might not always work as desired though, as if there is more than one owner of a source or target object, .Owner would return -1, the same as if there are no owners, and no owner would be assigned.

What fleet to put the new ship in might also be a bit complicated... Presumably if the target object is a fleet or ship with the same single owner as the new ship is to have, then the new ship could be inserted into the existing fleet. Otherwise it'd be created in its own fleet.


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Thu Oct 29, 2009 8:10 pm 
Offline
Space Dragon
User avatar

Joined: Fri Mar 10, 2006 12:32 pm
Posts: 311
Location: Finland
Bigjoe5 wrote:
My idea is that the Ancient Ruins special, which currently (in my version) gives a free tech or building to the empire, could also perhaps give a free ship, or fleet of ships, with very special hulls and parts which can't be unlocked and built normally.


Has it been considered that instead of changing the one ancient ruins special that we already have, we could perhaps add more specials that deal with lost civilizations and stuff that they left behind?

Here are a couple of my very early ideas on this topic:

We could have for example ancient ruins of an advanced civilization special, which would give you a research bonus like the ancient ruins special currently does.

Then we could have an ancient ruins special of a civilization that never achieved an advanced (space travel) stage and so doesn`t offer very much in terms of technology. This special however might give you a bonus in trade, as it could attract tourists from around the galaxy to explore galactic history and to reflect their own values to the ruins. And even if your particular culture would see the ruins only as meaningless traces of the past, the ruins could still probably be turned to profit, by selling the found unique artefacts/buildings to those who consider them valuable. (I am currently not sure, if the ancient ruins special of an advanced civilization should also receive a trade bonus. It could probably however make sense either way, as one the one hand ruins that are capable of offering you a significant research bonus would probably be off-limits for most of your citizens to avoid revealing any usefull information to enemy spies, but on the other hand if visitors are allowed to see the advanced ruins, they could possibly gather more people than less advanced ruins.)

In addition to these, we might have the kinds of things that you suggested like hidden/crashed ships or fleets and technology that the ancient races left behind on various planets or solar systems, as independent specials. (Although perhaps in some cases also combined with the ancient ruins specials.)

If I can remember right, something a little like this was once already suggested by marhawkman, but in his suggestion there were also ruins that didn`t have much positive to offer, which is something that I myself oppose, as I would like to see each trace of a lost civilization to offer something usefull to the game.

_________________
What is your favourite alien species and WHY?
Preliminary thoughts about diplomacy
Some unfinished ideas for specials


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Thu Oct 29, 2009 9:17 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
Also worth considering is having things like abandoned ships or a variety of ancient ruins be represented in game as actual ships and buildings, rather than specials.

The buildings version of ancient ruins could be implemented a bit awkwardly now by having an ancient ruins special that creates an ancient ruins building and then removes itself. Longer term, there would probably be more options for directly creating stuff around the galaxy during universe creation.


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Fri Oct 30, 2009 7:44 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
Geoff the Medio wrote:
It should be possible to add a CreateShip effect.

It should (might) now be possible to use the CreateShip effect in the SVN version. It's completely untested beyond "does the game still run when not using CreateShip?", however.

Ships can currently only be created using designs with names in premade_ship_designs.txt and not with player-made designs, and the design can't be specified using references to the target or source object. The owner empire id also needs to be specified, but this can reference the target or source objects to get their owner's empire ID. The ship is created at the location of the target object, which should be or be in a system.

For example:
Code:
CreateShip designname = "SD_MARK1" empire = Source.Owner


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Sat Oct 31, 2009 2:36 am 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1770
Location: Orion
I tested it by modifying the homeworld special to create a scout. When activation = Source, the game gets stuck on universe generation. When I set activation to PrimaryFocus Farming, the game starts, but when I set Primary Focus to Farming so the scout can be created, it gets stuck, believe it or not, on "waiting for players to end turn..."

Image

I've actually never seen this screen before, for obvious reasons. I tried this with and without the optional "empire =" and "designname =" with the same results. Once, it got stuck on "Production and Growth..." but I wasn't able to reproduce this.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Sat Oct 31, 2009 3:54 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
Post logs of this occurance, and your exact special definition.


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Sat Oct 31, 2009 2:48 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1770
Location: Orion
Code:
Special
    name = "HOMEWORLD_SPECIAL"
    description = "HOMEWORLD_SPECIAL_DESCRIPTION"
    effectsgroups = [
        EffectsGroup
            scope =
                Source
            activation =
                Source
            effects = [
                SetMaxPopulation value = Source.MaxPopulation + 10
                SetMaxFarming value = Source.MaxFarming + 8
                SetMaxIndustry value = Source.MaxIndustry + 5
                SetMaxTrade value = Source.MaxTrade + 2
                SetMaxSupply value = Source.MaxSupply + 2
                SetMaxConstruction value = Source.MaxConstruction + 20
                SetMaxDetection value = Source.MaxDetection + 5
            ]

        EffectsGroup
            scope = Source
            activation = PrimaryFocus Farming
            effects = CreateShip "SD_SCOUT" Source.Owner
    ]
    graphic = "icons/specials_huge/homeworld.png"


This time it got stuck on "Fleet movement..."

Here are the freeorion, freeoriond and ogre logs:


Attachments:
log_files.zip [7.99 KiB]
Downloaded 7 times

_________________
Warning: Antarans in dimensional portal are closer than they appear.
Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Wed Nov 04, 2009 12:14 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
I guess I forgot to mention it, but I think I fixed CreateShip a few days ago. Give it another go...?


Top
 Profile  
 
 Post subject: Re: CreateShip
PostPosted: Wed Nov 04, 2009 3:24 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1770
Location: Orion
I forgot to mention it in my last tech tree update, but the latest one with the Economics tree also includes an updated Ancient Ruins special which now also has a chance of creating a rare powerful ship.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


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

All times are UTC


Who is online

Users browsing this forum: YandexBot and 0 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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group