RClick Colonize Planet
Moderator: Committer
RClick Colonize Planet
Here is a patch to right-click on a planet and order a colony ship to move to colonize it. This is merely a FleetMoveOrder(), it does not automatically colonize the planet once the colony ship arrives. Additionally, the selection of the colony fleet is very basic; it just selects the first valid colony fleet with no regard to species or suitability.
Ready to submit unless there is code review feedback.
Ready to submit unless there is code review feedback.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.
Re: RClick Colonize Planet
Basic but improvable? Regardless, I like, especially if it can over time be improved on.yandonman wrote:does not automatically colonize the planet once the colony ship arrives. Additionally, the selection of the colony fleet is very basic;
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: RClick Colonize Planet
It's intended to be improvable, yes. Some of the potential improvements are controversial, hence starting basic.MatGB wrote:Basic but improvable?
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.
Re: RClick Colonize Planet
Vincele recently posted a question regarding implementation of the same kind of combo-travel-colonize order feature, so you might want to double check with him about the status of that before putting time into implementing the combo order aspect.
As far as what you've got here, the primary code review comment that comes to mind is that I'm pretty sure you'll need to filter out known destroyed objects, or get the object map and then use ExistingFleetsBegin() and ExistingFleetsEnd(). Also, in addition to checking suitability as you mention, you'd also want to check availability (that it's not already in the midst of a colonize or similar combo order).
As far as what you've got here, the primary code review comment that comes to mind is that I'm pretty sure you'll need to filter out known destroyed objects, or get the object map and then use ExistingFleetsBegin() and ExistingFleetsEnd(). Also, in addition to checking suitability as you mention, you'd also want to check availability (that it's not already in the midst of a colonize or similar combo order).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: RClick Colonize Planet
!fleet->Empty() apparently works just as well, as I ran into this defect while testing an earlier version.Dilvish wrote:filter out known destroyed objects,
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: RClick Colonize Planet
To pick a ship, you can check if there is any suitable ship in system and then pick which to use by using the same code as the existing colonize button that appears of the planet panel.
The menu text should probably specify that it is ordering a fleet to move to the planet, not just colonizing immediately... But I'm generally quite hesitant about something like this because it's very unclear what the command will do. It will find a colony ship somewhere, somehow, and then somehow get it to move to the planet... but which should it pick, given not only the issues that go into picking one from those in system, but also additional issues regarding which is safe / best to move to the system, and how to handle ships that are already in a fleet with other ship (split fleets automatically? should solo ship fleets be preferred over multi-ship or mixed-ship-type fleets?). Should it automatically enqueue a colony ship somewhere if it can't fine one, or even default to enqueuing rather than doing remote fleet manipulations? I don't think there are good answers to these questions...
The menu text should probably specify that it is ordering a fleet to move to the planet, not just colonizing immediately... But I'm generally quite hesitant about something like this because it's very unclear what the command will do. It will find a colony ship somewhere, somehow, and then somehow get it to move to the planet... but which should it pick, given not only the issues that go into picking one from those in system, but also additional issues regarding which is safe / best to move to the system, and how to handle ships that are already in a fleet with other ship (split fleets automatically? should solo ship fleets be preferred over multi-ship or mixed-ship-type fleets?). Should it automatically enqueue a colony ship somewhere if it can't fine one, or even default to enqueuing rather than doing remote fleet manipulations? I don't think there are good answers to these questions...
Re: RClick Colonize Planet
It could display a list of available colony ships with suitability and jump distance (or projected travel time) to select a ship from.
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
Re: RClick Colonize Planet
The "best" one, meaning the one that (in order) has the highest max population, has the highest starting population, and has the shortest route.but which should it pick, given not only the issues that go into picking one from those in system,
But this is not needed for this patch. It is arguable whether or not the first (most suitable / will give highest max population) is needed for this patch.
The move system already maps out routes and highlights danger areas. So, with this patch, the player indicates they want a planet colonized, the route system indicates there is danger and now the player can make adjustments to the route easily.but also additional issues regarding which is safe / best to move to the system,
Leave it in the fleet. AKA don't override the players fleet building decisions.and how to handle ships that are already in a fleet with other ship (split fleets automatically?
Edge case, not relevant.should solo ship fleets be preferred over multi-ship or mixed-ship-type fleets?).
This is not needed for this patch.
No (at least not right now). Building a colony ship is a PP spend, and that is a separate significant player decision. Perhaps if there are no colony ships, a popup could ask the player if they want to en-queue one.Should it automatically enqueue a colony ship somewhere if it can't fine one,
But this is not needed for this patch.
No. See above.or even default to enqueuing rather than doing remote fleet manipulations?
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.
Re: RClick Colonize Planet
Hello, I'll answer in your thread, and not mine
Yes, I have a patch that I'm using, which does exactly that.
Yes, I have a patch that I'm using, which does exactly that.
My patch does this, and add :yandonman wrote:The "best" one, meaning the one that (in order) has the highest max population, has the highest starting population, and has the shortest route.
Code: Select all
0 - from the best (wrt suitability) race having an unassigned colony ship in your empire.
My patch properly split the chosen ship from its actual fleet.Leave it in the fleet. AKA don't override the players fleet building decisions.and how to handle ships that are already in a fleet with other ship (split fleets automatically)?
I'd say no, we only want a fairly basic "choose a ship and send it there", I don't think anything more than that will be really useful.Should it automatically enqueue a colony ship somewhere if it can't fine one
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: RClick Colonize Planet
Given the fact that the colonization mechanics might undergo some serious revision (see here), do you really want to spend the effort patching the current system? Revising the mechanics seem to be the better approach to me than implementing some automations to fix what looks like a design flaw.
Re: RClick Colonize Planet
@Vezzra - actually, we should since discussions could literally take years. vincele's patch (have you posted it somewhere?) sounds like it solves one of the immediate problems. Additionally, I don't see colony ships going away, just having an additional (better) mechanism, so vincele's patch would still have value.
Also, "perfection is the enemy of done"
Also, "perfection is the enemy of done"
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.
Re: RClick Colonize Planet
I just posted the patch (quickly rediffed against trunk), if you want to try it... This is only the menuitems, not the objwnd enhancements to display suitability, which nicely complements it. But which isn't currently acceptable as suitability is too expensive to compute.yandonman wrote:@Vezzra - actually, we should since discussions could literally take years. vincele's patch (have you posted it somewhere?) sounds like it solves one of the immediate problems. Additionally, I don't see colony ships going away, just having an additional (better) mechanism, so vincele's patch would still have value.
Also, "perfection is the enemy of done"
The French saying is more like "The best is the ennemy of the good" (approximative translation of : Le mieux est l'ennemi du bien)
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: RClick Colonize Planet
Yeah, I know, we have a tendency for that. However, currently I'm determined to get this streamlining colonization thing done for 0.4.5. And Geoff seems determined not to have an entire year between releases again, more in the 4-5 months range. So we're hopefully talking about months, not years this timeyandonman wrote:@Vezzra - actually, we should since discussions could literally take years.
I still wouldn't count on it, as I'm still trying to make my case why colony ships should be thrown out...Additionally, I don't see colony ships going away, just having an additional (better) mechanism, so vincele's patch would still have value.