Giving more than one order possible ?

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Giving more than one order possible ?

#16 Post by Geoff the Medio »

MatGB wrote:...it does seem to have a bunch of defunct/dead fleets in memory as it's taking me to places that haven't had fleets for ages.
Another case of it looping through all latest known fleets, even if those aren't visible on the current turn, or have been destroyed.

yandonman
Creative Contributor
Posts: 699
Joined: Thu Aug 30, 2012 12:32 am

Re: Giving more than one order possible ?

#17 Post by yandonman »

@vincele - since it appears we are both trying to tackle the usability/micromanagement issues in colonization, did you get any further with any of this?

I'm investigating the feasibility of going down this path: "colony base (built on empty, supply connected world with no enemy forces present in system)...makes a colony on that world"


Executing this code via a rclick "Colonize Planet" button (a la here)

Code: Select all

HumanClientApp::GetApp()->Orders().IssueOrder(OrderPtr(new ProductionQueueOrder(client_empire_id, BT_BUILDING, "BLD_COLONY_BASE_V2", 1, m_planet_id)));
... will result in a colony base building to be added to the Production Queue on an unowned planet. (there is a problem with getting it to consume PP as the location is not part of the Empire::AvailablePP() locations... but that's a different problem).

Having that building do a

Code: Select all

effects = CreateShip "SD_COLONY_BASE" Source.Owner "SP_EXOBOT"
... will create the colony base ship, but then runs into the chaining orders problem you mention. And it also loses the planet target to colonize. (yes, I've hardcoded Exobots for the moment. There's a "which species to colonize" selection problem to solve here as well)

Musing on this even futher, I'm inclined to change the Order::ColonizeOrder accept a building as a valid thing to colonize off of. (it currently only takes a ship)

Also, it would be nice if content could access the Orders in from the EffectsGroup clause...

Thoughts?
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#18 Post by vincele »

yandonman wrote:@vincele - since it appears we are both trying to tackle the usability/micromanagement issues in colonization, did you get any further with any of this?
I answered in your thread, yes I'm using a patch that adds contextual menus to "choose best available colony ship and send it there". It works and help keep micromanagement low later in the game.
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!

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Giving more than one order possible ?

#19 Post by Vezzra »

yandonman wrote:Thoughts?
I wonder if we are making things way too complicated. The goal is to reduce the colonizing micromanagement mess we have currently, right? So, if I understand correctly, the main complaint (which is also mine) is that once you have explored more than just a few systems and the list of potential colonizing targets grows beyond a certain size, it gets exceedingly tedious to keep track of all the colony ships, species, enqueuing locations with the right species and, after a colony ship has been produced after a couple of turns, where it has been intended to go etc.

I've simpler suggestion just posted here (as that's the thread where it belongs, would be too off-topic here). I'd like to hear your comments there :)

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#20 Post by vincele »

Vezzra wrote:I wonder if we are making things way too complicated.
I don't find that too complicated: a context-menu item that does "Send the best unused colony ship here" (STBUCSH). An encyclopedia article explaining the way it works can be added for clarity, but it sounds very self-explanatory to me. Yes, I've given up on the multiple chained orders, because that's not really adding much.

My current status on the subject (i.e. DONE):
* new context menu STBUCSH added to sidepanel's rendered planet
* new context menu STBUCSH added to objectswnd planet rows
* new column in objectswnd showing (sortable) the planet suitability (very slow, but I don't care)

And that's all, it suits my way of playing, and does 90% of the annoying-micromanagy-colonization jobs
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!

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Giving more than one order possible ?

#21 Post by Vezzra »

vincele wrote:I don't find that too complicated: a context-menu item that does "Send the best unused colony ship here" (STBUCSH).
Not complicated for the player, but "complicated" wrt to implementation. We have a game mechanic that in its current form seems flawed (because it causes a lot of micromanagement mid to late game, that means it doesn't scale well), and try to fix that by implementing something that automates the whole process.

That's basically against our design philosophy. If a game mechanic requires to automate several steps/decisions for the player in order to avoid micromanagement, the mechanic is flawed and needs to be revised.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Giving more than one order possible ?

#22 Post by Dilvish »

Vezzra wrote:[If X]... the mechanic is flawed and needs to be revised.
Perhaps, but yandonman has a valid point about not letting the perfect being the enemy of the good/improvement/done. It sounds like vincele's changes would be considered an improvement by many people and shouldn't be a problem for others. Also it seems like it is Geoff's preference to leave colony ships in the game, even if as an alternative, so there is likely continuing value to this feature. Plus, if it's already done or mostly done, there is little cost to adding it and it could be taken out later. I can understand a little concern that ameliorating the headache of a broken thing without fixing it reduces the incentive to actually fix, but it seems in the other thread we are on a reasonable path towards fix and that this wouldn't stop the work on a more true fix.

Vincele, I'll second the request that you post your patch so it could start getting a little testing, even if you don't have it yet cleaned up all the way for final submission.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#23 Post by vincele »

Here is the patch adding the context menu entries to SidePanel and ObjectsWnd.

[The extension diff has been deactivated and can no longer be displayed.]

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!

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Giving more than one order possible ?

#24 Post by Vezzra »

Don't get me wrong, it's not that I won't like the improvements this patch is going to introduce to the current situation. My main concern was, as I intend to get a revision of the colonization mechanics done for 0.4.5, that people would pour effort into something that might be at least partially obsolete within the next months. So I just wanted to give a fair warning. If you still want to do that and get this patch in, by all means, be my guest and go ahead.

I'm certainly not going to complain about having some of the current colonization micromanagement alleviated :D

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Giving more than one order possible ?

#25 Post by Dilvish »

vincele wrote:Here is the patch adding the context menu entries to SidePanel and ObjectsWnd.
It looks to me that when stripping out the extra ObjectsWnd column value code, you also stripped out a GetSuitabilitiesForSpecies function that is needed by this patch. For the current purposes it might be just fine to leave in all the code for the extra column -- it would only chew up cycles if someone actually designates that a column be set to that calculation, right?

I also see various places where you check to ensure the planet is unowned, at some point you'll probably want to also allow it if the planet is owned by player and has zero pop (is an outpost).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#26 Post by vincele »

Dilvish wrote:It looks to me that when stripping out the extra ObjectsWnd column value code, you also stripped out a GetSuitabilitiesForSpecies function that is needed by this patch. For the current purposes it might be just fine to leave in all the code for the extra column -- it would only chew up cycles if someone actually designates that a column be set to that calculation, right?
D'oh, I create all my patches within a quilt stack and despite me checking for dependencies before posting this one, I missed that fact (And yes, I have not compile-tested my patch alone-out-of-stack, booo)
Dilvish wrote:I also see various places where you check to ensure the planet is unowned, at some point you'll probably want to also allow it if the planet is owned by player and has zero pop (is an outpost).
I'll look at adding that, and repost with dependencies sorted out.

Edit : Here are the 2 pieces:

[The extension diff has been deactivated and can no longer be displayed.]

This patch is the base for a later encyclopediadetailpanel.cpp cleanup...

[The extension diff has been deactivated and can no longer be displayed.]

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!

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#27 Post by vincele »

Forgot to add that the popcout == 0 should also be handled now...
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!

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Giving more than one order possible ?

#28 Post by Dilvish »

Perhaps I am just not understanding how you meant for these last two patches to be applied, but it seems like the quilt must have been incomplete again. I had to make several additional changes to get it to compile:
* add #include "../util/Export.h" to ObjectListWnd.h so it could use the FO_COMMON_API macro
* add #include "../universe/Suitability.h" to ObjectListWnd.cpp
* add empire_id as first parameter to GetSuitabilitiesForSpecies call in ObjectListWnd.cpp.cpp
* change a dest_planet_id to object_id in ObjectListWnd::ObjectRightClicked of ObjectListWnd.cpp.cpp

After those changes it compiled fine & in a very brief check the right click send colony ship seemed to work fine.

Was the suitability column value for ObjectListWnd meant to be part of this? I'm not seeing it in the list of choices.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: Giving more than one order possible ?

#29 Post by vincele »

Dilvish wrote:Perhaps I am just not understanding how you meant for these last two patches to be applied, but it seems like the quilt must have been incomplete again.
Hmmm, yes I probably screwed the ordering again, next time I'll compile & runtime test what I post, it'll just take longer... Sorry
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!

yandonman
Creative Contributor
Posts: 699
Joined: Thu Aug 30, 2012 12:32 am

Re: Giving more than one order possible ?

#30 Post by yandonman »

@Dilvish - did you submit vincele's patch with your edits? If not, could you post here?
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.

Post Reply