add planet destroyer cannon ?

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

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 »

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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: add planet destroyer cannon ?

#32 Post by Vezzra »

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

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

Re: add planet destroyer cannon ?

#33 Post by The Silent One »

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
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#34 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: add planet destroyer cannon ?

#35 Post by The Silent One »

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
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#36 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: add planet destroyer cannon ?

#37 Post by The Silent One »

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
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: add planet destroyer cannon ?

#38 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: add planet destroyer cannon ?

#39 Post by The Silent One »

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 »

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: 1129
Joined: Tue Jul 01, 2003 8:27 pm

Re: add planet destroyer cannon ?

#41 Post by The Silent One »

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