add planet destroyer cannon ?

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.
Message
Author
dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: add planet destroyer cannon ?

#31 Post by dbenage-cx » Sat Sep 30, 2017 4:37 pm

The Silent One wrote:So if it has is an unresearched unresearchable prereq, a partially unlocked tech should not show?
Yes, to reword it a little less precisely for others (because it is even confusing to type): A tech with a hidden prereq should also be hidden.

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

Re: add planet destroyer cannon ?

#32 Post by Vezzra » Sun Oct 01, 2017 2:45 pm

dbenage-cx wrote:A tech with a hidden prereq should also be hidden.
Yep, definitely!

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#33 Post by The Silent One » Thu Oct 05, 2017 2:14 pm

dbenage-cx wrote:Yes, to reword it a little less precisely for others (because it is even confusing to type): A tech with a hidden prereq should also be hidden.
Done.
dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I've started working on this, but need a little help. My plan is to refresh a planet destruction order if (a) the ship has not been destroyed, (b) still in the system, and (c) the planet hasn't been destroyed. (In all other cases, the ship's or planet's destruction status is reset.) The code for this should execute at the start of a new turn - not sure where to put it, maybe here: ServerApp::PostCombatProcessTurns()? If I put it there, however, I can't issue a new order for destruction, adding #include "../client/human/HumanClientApp.h" needed to issue an order leads to a dozen of "unresolved externals"? Current status of code is on github.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

o01eg
Space Kraken
Posts: 162
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#34 Post by o01eg » Thu Oct 05, 2017 5:53 pm

dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I've started working on this, but need a little help. My plan is to refresh a planet destruction order if (a) the ship has not been destroyed, (b) still in the system, and (c) the planet hasn't been destroyed. (In all other cases, the ship's or planet's destruction status is reset.) The code for this should execute at the start of a new turn - not sure where to put it, maybe here: ServerApp::PostCombatProcessTurns()? If I put it there, however, I can't issue a new order for destruction, adding #include "../client/human/HumanClientApp.h" needed to issue an order leads to a dozen of "unresolved externals"? Current status of code is on github.[/quote]

I built code without any issues on graphics-less system even with uncommented

Code: Select all

CleanUpDestructionStateInfo();
. Which errors you gets?
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#35 Post by The Silent One » Thu Oct 05, 2017 7:06 pm

I get lots of these:

Code: Select all

1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static class HumanClientApp * __cdecl HumanClientApp::GetApp(void)" (?GetApp@HumanClientApp@@SAPAV1@XZ)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledCheckBoxRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledCheckBoxRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledCheckBoxRepresenter::BeveledCheckBoxRepresenter(struct GG::Clr)" (??0BeveledCheckBoxRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledRadioRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledRadioRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledRadioRepresenter::BeveledRadioRepresenter(struct GG::Clr)" (??0BeveledRadioRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::GL3DVertexBuffer::activate(void)const " (?activate@GL3DVertexBuffer@GG@@UBEXXZ)".
"Nicht aufgelöstes externes Symbol" = unresolved external symbol

Code: Select all

#include "../client/human/HumanClientApp.h"
What's the trouble with this?
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

o01eg
Space Kraken
Posts: 162
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#36 Post by o01eg » Thu Oct 05, 2017 7:40 pm

The Silent One wrote:I get lots of these:

Code: Select all

1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static class HumanClientApp * __cdecl HumanClientApp::GetApp(void)" (?GetApp@HumanClientApp@@SAPAV1@XZ)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledCheckBoxRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledCheckBoxRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledCheckBoxRepresenter::BeveledCheckBoxRepresenter(struct GG::Clr)" (??0BeveledCheckBoxRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledRadioRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledRadioRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledRadioRepresenter::BeveledRadioRepresenter(struct GG::Clr)" (??0BeveledRadioRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::GL3DVertexBuffer::activate(void)const " (?activate@GL3DVertexBuffer@GG@@UBEXXZ)".
"Nicht aufgelöstes externes Symbol" = unresolved external symbol
Looks like you trying to do something with UI in server process.
The Silent One wrote:

Code: Select all

#include "../client/human/HumanClientApp.h"
What's the trouble with this?
It will break headless compilation.
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#37 Post by The Silent One » Sat Oct 07, 2017 5:26 pm

dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I'd like to do something about this, but I'm unsure how to tackle it. Basically, the information about ongoing planet destructions must be stored somewhere, since old orders are discarded at the end of the turn. What would be the right location for that? Maybe in the empire class, with something like empire->LastTurnPlanetDestructionOrders()?
And secondly, orders must be recreated/refreshed at the start of next turn. Also not sure where in the code this should happen. Can someone who's more familiar with the code than me give me a hint?
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

o01eg
Space Kraken
Posts: 162
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#38 Post by o01eg » Sat Oct 07, 2017 6:07 pm

Do you want to decrement countdown by Order system?

Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#39 Post by The Silent One » Sun Oct 08, 2017 7:27 am

o01eg wrote:Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?
I'm looking for a solution that can be used for bombardment as well.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

LGM-Doyle
Programmer
Posts: 219
Joined: Mon Feb 29, 2016 8:37 pm

Re: add planet destroyer cannon ?

#40 Post by LGM-Doyle » Sun Oct 08, 2017 2:14 pm

The Silent One,
You could try this. I don't know if it will work for sure, but it is where I would start.

In Orders.h add a protected virtual function shouldOrderPersist() with a default implementation similar to UndoImpl() that by default does not persist an order (i.e. returns false). Orders like bombard, colonize and destroy would then implement an override that checks their particular conditions for persistence and returns true when the order is still not completed, but possible to complete.

Then in OrderSet.h add a function ResetNonPersistenOrders() that removes all orders that return shouldOrderPersist() false.

Then in ClientApp::HandleTurnPhaseUpdate() change the Message::WAITING_FOR_PLAYERS case from m_orders.Reset() to be m_orders.ResetNonPersistentOrders().

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#41 Post by The Silent One » Sun Oct 08, 2017 4:23 pm

Thank you, I'll try that.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

Post Reply