[patch] Everybody shoots

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: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Everybody shoots

#46 Post by Geoff the Medio »

Committed the v4 version of the patch.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: [patch] Everybody shoots

#47 Post by MatGB »

Pretty much speaks for itself, moved my mark 1 into the AIs first colony, no damage taken at all, no reduction in AI planet defences, no combat logged. They've got a ship inbound (that'll kill me anyway), will note if it triggers the planet to shoot.
Attachments
combat-enemy-planet.png
combat-enemy-planet.png (152.16 KiB) Viewed 1654 times
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: [patch] Everybody shoots

#48 Post by Geoff the Medio »

Do you have a save from the turn before?

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: [patch] Everybody shoots

#49 Post by MatGB »

Unfortunately not, I kept playing, the next turn the planet did shoot and took the ship out as it should have done the previous turn, I could see nothing in the logs and really should have loaded the autosave and turned verbose on. If it happens again I will do so.

It's obviously a very strange glitch, if it had been, say, an organic hull, with the new patch they're invisible until you've got at least one detection tech, but a basic mark 1 is spotable from the outset.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: [patch] Everybody shoots

#50 Post by Geoff the Medio »

There are reportedly compile errors with this patch.

I suggest considering using standard style serialization code as elsewhere in FO code...

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

Re: [patch] Everybody shoots

#51 Post by Dilvish »

I won't argue against having the serialization code be consistent throughout, but did want to note (as I did in that other thread) that I had gotten those same compile errors at first, but forcing a full clean compile got me past them. This was about the only time that the make system couldn't figure out well enough on its own what need to be recompiled / relinked.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Everybody shoots

#52 Post by Dilvish »

Hmm, well and also, apparently the full clean build approach did NOT solve the problem for that other guy
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
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [patch] Everybody shoots

#53 Post by Vezzra »

Dilvish wrote:Hmm, well and also, apparently the full clean build approach did NOT solve the problem for that other guy
Well, he's using boost 1.49, what version do you link against?

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

Re: [patch] Everybody shoots

#54 Post by Dilvish »

Ah, I had overlooked that somehow. I link with 1.53; boost very well might be his problem.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Everybody shoots

#55 Post by Dilvish »

another update -- I had misremembered what actually was responsible for solving this problem for me -- What does fix it for me is reverting my build type to the default blank, rather than Release.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Everybody shoots

#56 Post by Mitten.O »

I suggest considering using standard style serialization code as elsewhere in FO code...
What, specifically, do you refer to by implying that the serialization code I used was nonstandard?
All deviation I can recall were solutions to various issues I or you had compiling the thing.

Is there any other place in the codebase where any truly object-oriented serialization is being done?
What I mean is serializing derived objects trough pointers to their base.
As far as I remember the boost serialization documentation, especially the fact that
the derived classes are not guaranteed to ever be serialized by their
own pointers requires the extra effort in the serialization code.
Any code by me in this post is released under GPL 2.0 or later.

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

Re: [patch] Everybody shoots

#57 Post by Geoff the Medio »

Mitten.O wrote:What, specifically, do you refer to by implying that the serialization code I used was nonstandard?
Compared with the other FreeOrion serialization code:
-You use BOOST_CLASS_EXPORT_IMPLEMENT, while other code uses BOOST_CLASS_EXPORT
-You do something with boost::serialization::make_nvp instead of the FO-standard BOOST_SERIALIZATION_BASE_OBJECT_NVP
-You also mix template <class Archive> and template <typename Archive>, while other code seems to mostly use just <class Archive> (probably a non-issue)
Is there any other place in the codebase where any truly object-oriented serialization is being done?
What I mean is serializing derived objects trough pointers to their base.
The UnvierseObject hierarchy, the Order hierarchy, the ModeratorAction hierarchy... All in util/Serialize*.cpp files.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Everybody shoots

#58 Post by Mitten.O »

Yes, inspecting those details closer, and comparing to the other similar places,
most of the differences were in fact artefacts of the search for a solution,
not part of the final solution itself.

Whether aligning the code with the others fixes any compilations issues,
I cannot know, but it is a good idea nonetheless and seems to cause no issues for me.
Do any of the issues you had with this patch recur with these changes?
Attachments

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

Any code by me in this post is released under GPL 2.0 or later.

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

Re: [patch] Everybody shoots

#59 Post by Geoff the Medio »

Applies, builds, and runs OK for me.

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

Re: [patch] Everybody shoots

#60 Post by Dilvish »

Mitten.O wrote:Do any of the issues you had with this patch recur with these changes?
makes no difference on my machine, but here is some more specific info: it compiles and links fine with CXX flag -O1, but with -O2 I get the linker errors

Code: Select all

../../libfreeorioncommon.so: undefined reference to `void BoutBeginEvent::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, unsigned int)'
../../libfreeorioncommon.so: undefined reference to `void IncapacitationEvent::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, unsigned int)'
../../libfreeorioncommon.so: undefined reference to `void BoutBeginEvent::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)'
../../libfreeorioncommon.so: undefined reference to `void IncapacitationEvent::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)'
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply