Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to select ai karts (bots) from the lobby in network games #4147

Closed
doitux opened this issue Nov 27, 2019 · 17 comments
Closed

Option to select ai karts (bots) from the lobby in network games #4147

doitux opened this issue Nov 27, 2019 · 17 comments

Comments

@doitux
Copy link

@doitux doitux commented Nov 27, 2019

It would be great to have the option to select ai karts (bots) from the lobby in LAN games like you can do it in local games.

@doitux doitux changed the title Option to select ai karts (bots) from the lobby in LAN games Option to select ai karts (bots) from the lobby in network games Nov 27, 2019
@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

Not interesting

@Benau Benau closed this Jan 27, 2020
@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

Really sad! For some online games with less players it would be a great fun to have bots with you, like in other online games.

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

Because playing with weak bots is not fun, also you said about lan games.

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

For me it is especially when playing on my own dedicated server with friends. Is there any option in the gui to add bots there which i was just missing until now?

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

There is for lan server in 1.1 stk

Did you create private wan server?

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

SuperTuxKart_2020-01-27-22-25-25
This is 1.1 stk

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

I'm running a dedicated server on my private server.
In the server config i have set:

The server is also 1.1:

[admin@huxiwe ~]# cd games/supertuxkart-1.1-src/cmake_build/bin/ [admin@huxiwe bin]# ./supertuxkart --version [info ] main: ============================== [info ] main: SuperTuxKart, 1.1. [info ] main: ============================== [admin@huxiwe bin]# ./supertuxkart --server-config=your_config.xml --network-console
When i connect the client i click "online" --> "enter server address". Than i type the IP of my server there.

This is how the lobby looks like:
lobby

And this is how the settings look like:
settings

I would love to have on options for bots there. Is there a way to get it? Any switch in the server config file i was missing?

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

Not possible because the ai process is seperated (and really complicated to add such functionality)

You need to use another terminal and run bin/supertuxkart --connect-now=127.0.0.1:2759 --network-ai=x

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

I tried this before but i get:

`[admin@huxiwe bin]# ./supertuxkart --connect-now=127.0.0.1:2759 --network-ai=6
[verbose ] main: Error messages and other text output will be logged to /home/admin/.config/supertuxkart/config-0.10/stdout.log.
[info ] [FileManager]: Data files will be fetched from: '../../data/'
[info ] [FileManager]: User directory is '/home/admin/.config/supertuxkart/config-0.10/'.
[info ] [FileManager]: Addons files will be stored in '/home/admin/.local/share/supertuxkart/addons/'.
[info ] [FileManager]: Screenshots will be stored in '/home/admin/.local/share/supertuxkart/screenshots/'.
[info ] [FileManager]: User-defined grand prix will be stored in '/home/admin/.local/share/supertuxkart/grandprix/'.
[info ] [FileManager]: Asset 0 will be loaded from '../../data/challenges/'.
[info ] [FileManager]: Asset 1 will be loaded from '../../data/gfx/'.
[info ] [FileManager]: Asset 2 will be loaded from '../../data/grandprix/'.
[info ] [FileManager]: Asset 3 will be loaded from '../../data/gui/icons/'.
[info ] [FileManager]: Asset 4 will be loaded from '../../data/gui/screens/'.
[info ] [FileManager]: Asset 5 will be loaded from '../../data/gui/dialogs/'.
[info ] [FileManager]: Asset 6 will be loaded from '../../data/replay/'.
[info ] [FileManager]: Asset 7 will be loaded from '../../data/shaders/'.
[info ] [FileManager]: Asset 8 will be loaded from '../../data/skins/'.
[info ] [FileManager]: Asset 9 will be loaded from '../../data/ttf/'.
[info ] [FileManager]: Asset 10 will be loaded from '../../data/po/'.
[info ] [FileManager]: Asset 11 will be loaded from '../../data/library/'.
[info ] [FileManager]: Asset 12 will be loaded from '../../data/models/'.
[info ] [FileManager]: Asset 13 will be loaded from '../../data/music/'.
[info ] [FileManager]: Asset 14 will be loaded from '../../data/sfx/'.
[info ] [FileManager]: Asset 15 will be loaded from '../../data/textures/'.
[info ] [FileManager]: Asset 16 will be loaded from '../../data/tracks/'.
..:: Antarctica Rendering Engine 2.0 ::..
FreeBSD 12.0-RELEASE-p10 hostBSD 12.0-RELEASE-p10 DMR amd64
[info ] HTTPRequest: Sending userid=56497&token=************************ to https://online.supertuxkart.net/api/v2/user/saved-session/
[info ] GrandPrixManager: Loading Grand Prix files from ../../data/grandprix/
[info ] GrandPrixManager: Loading Grand Prix files from /home/admin/.local/share/supertuxkart/grandprix/
[info ] STKHost: Host initialized.
[warn ] LayoutManager: Widget 'timeout-message' has a height of 0 (left_space = 0, fraction = 1.000000, max_width = )

[info ] ConnectToServer: SETUP
[info ] ProtocolManager: A 15ConnectToServer protocol has been started.
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 58524, retry remain: 3
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 58524, retry remain: 2
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 58524, retry remain: 1
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 58524, retry remain: 0
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 24498, retry remain: 10
[info ] ConnectToServer: Trying connecting to 127.0.0.1:2759 from port 24498, retry remain: 9
`

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

Do u know what is the server port (replace with 2759), the server log will tell you the private port of server

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

Mon Jan 27 17:06:45 2020 [info ] STKHost: Host initialized.
Mon Jan 27 17:06:45 2020 [info ] STKHost: Server port is 2759
Mon Jan 27 17:06:45 2020 [info ] ServerLobby: Resetting the server to its initial state.
Mon Jan 27 17:06:45 2020 [info ] ProtocolManager: A 11ServerLobby protocol has been started.
Mon Jan 27 17:06:45 2020 [info ] main: Creating a LAN server 'HL-Arena'.

So, it seems to be 2759, right?

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

Do you run that command in the server?

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

Yes! ;-)

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

try type your public ip address in server?

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

I tried this and than i get:
[info ] ConnectToServer: SETUP
[info ] ProtocolManager: A 15ConnectToServer protocol has been started.
[info ] ConnectToServer: Trying connecting to my.pub.lic.ip:2759 from port 49484, retry remain: 3
[info ] ConnectToServer: Connected to my.pub.lic.ip:2759
[info ] ProtocolManager: A 11ClientLobby protocol has been started.
[info ] STKHost: Listening has been started.
[info ] ProtocolManager: A 15ConnectToServer protocol has been terminated.
[info ] ClientLobby: Synchronous message of type 2
[info ] ProtocolManager: A 11ClientLobby protocol has been terminated.
[info ] STKHost: Listening has been stopped.

The server console displays than:
Mon Jan 27 17:37:42 2020 [verbose ] ServerLobby: Player refused: invalid player

@Benau
Copy link
Member

@Benau Benau commented Jan 27, 2020

well i don't understand why your freebsd is blocking loopback connection...

you can edit your server_lobby.cpp in server

    if (((encrypted_size == 0 || online_id == 0) &&
        !(peer->getAddress().isPublicAddressLocalhost() ||
        peer->getAddress().isLAN()) &&
        NetworkConfig::get()->isWAN() &&
        ServerConfig::m_validating_player) ||
        (ServerConfig::m_strict_players &&
        (player_count != 1 || online_id == 0 || duplicated_ranked_player)) ||
        (peer->isAIPeer() && !peer->getAddress().isLAN()) ||
        (peer->isAIPeer() &&
        ServerConfig::m_ai_handling && !m_ai_peer.expired()) ||
        (peer->isAIPeer() && m_game_setup->isGrandPrix()))

to

    if (((encrypted_size == 0 || online_id == 0) &&
        !(peer->getAddress().isPublicAddressLocalhost() ||
        peer->getAddress().isLAN()) &&
        NetworkConfig::get()->isWAN() &&
        ServerConfig::m_validating_player) ||
        (ServerConfig::m_strict_players &&
        (player_count != 1 || online_id == 0 || duplicated_ranked_player)) ||
        (peer->isAIPeer() &&
        ServerConfig::m_ai_handling && !m_ai_peer.expired()) ||
        (peer->isAIPeer() && m_game_setup->isGrandPrix()))

to allow ai connection from any address

@doitux
Copy link
Author

@doitux doitux commented Jan 27, 2020

Thx that works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants