Gifting mechanics

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderators: Oberlus, Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
swaq
Space Floater
Posts: 44
Joined: Tue Aug 20, 2019 1:56 pm

Gifting mechanics

#1 Post by swaq » Mon Oct 07, 2019 10:33 pm

I am experimenting with the gifting mechanics and have been having trouble getting them to work. If I am in an alliance with the player the menu doesn't pop up at all. If I am at peace I get the menu to gift the fleet or planet to the other player but when I click it nothing happens.

Version: 2019-10-01.2681499
Attachments
save-20191007_152459.zip
(36.38 KiB) Downloaded 20 times

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

Re: Gifting mechanics

#2 Post by Geoff the Medio » Tue Oct 08, 2019 5:52 am

Gifting is an order that works like scrapping; you have to end turn for it to take effect.

The issue with peace but not alliance allowing it is a good point, though.

Edit: hopefully fixed: https://github.com/freeorion/freeorion/ ... ac14a48995

User avatar
alleryn
Space Kraken
Posts: 198
Joined: Sun Nov 19, 2017 6:32 pm

Re: Gifting mechanics

#3 Post by alleryn » Tue Oct 08, 2019 12:22 pm

Geoff the Medio wrote:
Tue Oct 08, 2019 5:52 am
Gifting is an order that works like scrapping; you have to end turn for it to take effect.
I was testing with swaq.
Ending turn didn't cause the gifting to process. Also i believe there is supposed to be an icon (like with scrapping/colonization/invading) that appears when you intially order the gift. We weren't seeing any icons. Note that all our testing was done locally, each of us "playing against ourself".

User avatar
swaq
Space Floater
Posts: 44
Joined: Tue Aug 20, 2019 1:56 pm

Re: Gifting mechanics

#4 Post by swaq » Sat Oct 12, 2019 10:43 pm

I went ahead and did more extensive debugging and found the culprit to be a sanity check that was incorrect. Something like "if any of the objects in the system are owned by recipient then return error" when it should be NOT that condition. After fixing that I found a crash when trying to cancel gifting of a fleet. Not entirely sure on the cause but mimicking the code for ungifting a planet made it not crash.

[My very first] pull request: https://github.com/freeorion/freeorion/pull/2590

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

Re: Gifting mechanics

#5 Post by Geoff the Medio » Sun Oct 13, 2019 9:18 am

swaq wrote:
Sat Oct 12, 2019 10:43 pm
After fixing that I found a crash when trying to cancel gifting of a fleet. Not entirely sure on the cause but mimicking the code for ungifting a planet made it not crash.
That code was looping through a container (of orders), examining them and then removing the current item (by rescinding the order), which invalidates iterators to the removed item, which causes the looping to fail. By making a copy of the orders and iterating through that, but removing (rescinding) orders from the original container of orders, the iterators don't get invalidated.

Do you have a "real" name you want to be credited as, other than "swaq" or "swaqvalley"?

User avatar
swaq
Space Floater
Posts: 44
Joined: Tue Aug 20, 2019 1:56 pm

Re: Gifting mechanics

#6 Post by swaq » Sun Oct 13, 2019 12:53 pm

Ahh, that makes sense.

I will PM you my real name.

User avatar
JonCST
Pupating Mass
Posts: 90
Joined: Sat Dec 15, 2018 4:28 am

Re: Gifting mechanics: how to designate a gift?

#7 Post by JonCST » Tue Oct 15, 2019 12:57 am

Hi all. I am currently running 0.4.8 build 2019-10-08.

I'm trying to give a planet and a ship to an ally, and cannot figure out how.

I have tried right and left clicking on everything i can think which might make sense, and a bunch which don't make sense: Planets, ships, empire names, pedia entries...

Does it just not work in this build? Or have i not used the correct sacred herbs and magic words yet?

A screen-shot might do wonders, if you have a version in which it works.

Thanks

Jon

User avatar
alleryn
Space Kraken
Posts: 198
Joined: Sun Nov 19, 2017 6:32 pm

Re: Gifting mechanics: how to designate a gift?

#8 Post by alleryn » Tue Oct 15, 2019 1:03 am

JonCST wrote:
Tue Oct 15, 2019 12:57 am
Hi all. I am currently running 0.4.8 build 2019-10-08.

I'm trying to give a planet and a ship to an ally, and cannot figure out how.

I have tried right and left clicking on everything i can think which might make sense, and a bunch which don't make sense: Planets, ships, empire names, pedia entries...

Does it just not work in this build? Or have i not used the correct sacred herbs and magic words yet?

A screen-shot might do wonders, if you have a version in which it works.

Thanks

Jon
This thread is about how gifting was broken. It isn't fixed until geoff's (10/8) and swaq's (10/12) commits, so your 10/8 version probably won't work...

Also the empire you're gifting to has to have a presence in the same system as the object you are trying to gift. Then right click the planet or fleet (not ship) you want to gift and the context menu will display an option to gift.

Post Reply