Why doesn't the ai give its ships names ?

Describe your experience with the latest version of FreeOrion to help us improve it.
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
xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Why doesn't the ai give its ships names ?

#1 Post by xlightwavex » Wed Sep 21, 2016 2:06 am

I just realized in the test build the ai isn't giving its ships names they are all named after the ship design. Is their a quick fix for that ?

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

Re: Why doesn't the ai give its ships names ?

#2 Post by MatGB » Wed Sep 21, 2016 12:42 pm

All ships are actually named, but enemy owned ships have their names replaced in the client display (in a similar way to all "Deep Space" systems actually having a name that isn't displayed)

I don't know why this decision was taken and I would prefer it if ships did have names displayed, but I never got around to ask.
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: 12280
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Why doesn't the ai give its ships names ?

#3 Post by Geoff the Medio » Wed Sep 21, 2016 1:02 pm

The idea is that if a player names a fleet or ship in order to help them remember what they are planning to do with them, they don't need to worry about this tipping off other players about their intentions.

xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Re: Why doesn't the ai give its ships names ?

#4 Post by xlightwavex » Thu Sep 22, 2016 7:40 pm

Is there a way i can flip this behavior back off temporarily, while testing it's making tracking which ai ship is effected by what difficult when not in battle for my particular tests.
Last edited by xlightwavex on Thu Sep 22, 2016 7:57 pm, edited 1 time in total.

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

Re: Why doesn't the ai give its ships names ?

#5 Post by Geoff the Medio » Thu Sep 22, 2016 7:48 pm

Not without C++ code edits.

With them, edit name copying to not require full visibility:

https://github.com/freeorion/freeorion/ ... t.cpp#L117

xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Re: Why doesn't the ai give its ships names ?

#6 Post by xlightwavex » Thu Sep 22, 2016 8:09 pm

Geoff the Medio wrote:The idea is that if a player names a fleet or ship in order to help them remember what they are planning to do with them, they don't need to worry about this tipping off other players about their intentions.
It's sort of strange for the ai though, shouldn't it just use one of the names in the ship names list for display. I see like fleet rock... ship rock...

Maybe you could have two names per ship to say a ship could have a ...

"self_displayed_ship_name" to display to the player who owns the ship

then a

"enemy_displayed_ship_name" that you see for other players or ai's that just picks a name from the names lists in the en.txt files on creation randomly or by species or something and never changes.

Basically just a extra short name label for ai or players that gets assigned automatically on creation of the ship. but if you own the ship you see the real name.

Anyways i don't think im wanting to build the code for that it'll throw me off track while learning the scripting.

xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Re: Why doesn't the ai give its ships names ?

#7 Post by xlightwavex » Sun Oct 02, 2016 4:59 am

Ok so im going to build with the code for that.

from

Code: Select all

if (vis >= VIS_PARTIAL_VISIBILITY) {
            this->m_owner_empire_id =   copied_object->m_owner_empire_id;
            this->m_created_on_turn =   copied_object->m_created_on_turn;

            if (vis >= VIS_FULL_VISIBILITY) {
                this->m_name =          copied_object->m_name;
            }
}
to

Code: Select all

if (vis >= VIS_PARTIAL_VISIBILITY) {
            this->m_owner_empire_id =   copied_object->m_owner_empire_id;
            this->m_created_on_turn =   copied_object->m_created_on_turn;
            this->m_name =                  copied_object->m_name;

            if (vis >= VIS_FULL_VISIBILITY) {
                
            }
}
Is that right ?
Anything else i need to change ?

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

Re: Why doesn't the ai give its ships names ?

#8 Post by MatGB » Sun Oct 02, 2016 6:04 am

Geoff the Medio wrote:The idea is that if a player names a fleet or ship in order to help them remember what they are planning to do with them, they don't need to worry about this tipping off other players about their intentions.
I'm 100% on board with this for fleet names.

But not for ship names, famous naval battles and important SF/space opera battles have names ships and rivalries, etc. It adds flavour.

If players want to name ships (I never do, the random defaults are fine) then that's up to them, it'd be kinda nice if they did display for that purpose: "doom ship #1" or "planet killer", etc would add a different type of flavour.
Mat Bowles

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

xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Re: Why doesn't the ai give its ships names ?

#9 Post by xlightwavex » Sun Oct 02, 2016 6:56 am

MatGB wrote:
Geoff the Medio wrote:The idea is that if a player names a fleet or ship in order to help them remember what they are planning to do with them, they don't need to worry about this tipping off other players about their intentions.
I'm 100% on board with this for fleet names.

But not for ship names, famous naval battles and important SF/space opera battles have names ships and rivalries, etc. It adds flavour.

If players want to name ships (I never do, the random defaults are fine) then that's up to them, it'd be kinda nice if they did display for that purpose: "doom ship #1" or "planet killer", etc would add a different type of flavour.
My first point is only for testing, i need to see the ai's actual ship name or a unique identifier.

Second point is that in actual play your don't really need to see what the player actually named his ship to see some random ship name that could be generated into a extra displayed name field.

You may however or in this case 'i do', need to designate a separate target id for the ships that are being affected by the script to compare with the sitrep, don't really care if that means all the ai or enemy players ships names are "bob" as long as i can tell "bob #1" from "bob #2" when my planetary gun in this case takes a pot shot at them so i can check if that ship took actual damage.

So my suggestion was that each ship be given a outward name (like a extra target name designation) from the list of names in the encyclopedia, that can be quick toggled or selected from either a button to see it, or the main menu options as well as given in sitreps that other people can see that also do not give away any secrets but can be used to track what is were.

In that manner both problems are addressed and solved.

That code didn't work btw and it took like 2 hours to compile :( acckkk.

User avatar
em3
Vacuum Dragon
Posts: 510
Joined: Sun Sep 25, 2011 2:51 pm

Re: Why doesn't the ai give its ships names ?

#10 Post by em3 » Tue Oct 04, 2016 1:14 pm

Do game objects have some internal ID? It could be exposed in UI (possibly with an option) for script debugging purposes. Either display it alongside the name or instead of it.
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

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

Re: Why doesn't the ai give its ships names ?

#11 Post by Geoff the Medio » Tue Oct 04, 2016 1:19 pm

em3 wrote:Do game objects have some internal ID? It could be exposed in UI (possibly with an option) for script debugging purposes. Either display it alongside the name or instead of it.
Yes, as indicated by the objects list "ID" column:
Attachments
Objects_list.png
objects list with ID column visible
Objects_list.png (79.81 KiB) Viewed 305 times

Post Reply