2025-08-04 16:20 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004113Spring engineGeneralpublic2013-11-04 14:00
Reportersilentwings 
Assigned ToKloot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionunable to reproduce 
Product Version94.1.1+git 
Target VersionFixed in Version 
Summary0004113: when hosting an AI team, GetMyPlayerID and GetMyTeamID return the pID,tID of the AI
Descriptionheres what I was doing:

i hosted a battle, 2 allyteams, first allyteam contained just me, second allyteam contained one human player and a NullAI hosted by me.

once ingame, when i called Spring.GetMy***ID(), it returned the information relating to the AI i was hosting and not my own info.
Additional Informationit might have mattered that the AI had a numerically lower pID and tID than me?
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0011951

silentwings (reporter)

Last edited: 2013-11-03 22:03

View 2 revisions

this was with Spring 94.1.1-1452 and latest SL dev build

~0011954

silentwings (reporter)

Last edited: 2013-11-03 22:18

View 2 revisions

correction: GetMyPlayerID seems to return correctly, GetMyTeamID returned the AIs teamID

~0011955

Kloot (developer)

Sounds like myTeam is set twice, once for you and once for the AI hosted by you.

Look in infolog if there is more than one "User number %i (team %i, allyteam %i)" message to confirm this.

~0011956

silentwings (reporter)

Last edited: 2013-11-03 22:47

View 4 revisions

There's only one such message in the infolog but the teamID it gives corresponds to the AIs team.
I tried:
local myPlayerID = Spring.GetMyPlayerID()
local _,_,_,myTeamID = Spring.GetPlayerInfo(myPlayerID)
but this gives the same incorrect teamID as Spring.GetMyTeamID()

~0011957

silentwings (reporter)

script.txt is http://pastebin.com/eEqKfQip

I spotted that two teams that have different allyTeams are given the same teamleader - that strikes me as a bit odd?

~0011960

Kloot (developer)

Somewhat, the leader is the player "in charge" of a team (not allyteam). For AI teams (friend or foe) hosted on the same machine that gets weird but it shouldn't affect one's team number, AI's cannot displace humans.

According to the script three teams should have spawned, I assume that still happened normally?

  player 1 in team 1 in allyteam 1
  player 2 in team 2 in allyteam 0
  "player" 3 (AI 0) in team 0 in allyteam 1

~0011961

silentwings (reporter)

yes the alliances were correct & all three spawned

it seems non-reproducable after closing and re-opening my battle, no matter how many AIs i add :/ if i can make it happen again i'll re-post

~0011962

abma (administrator)

https://github.com/spring/spring/commit/28987712f5fd0432929e74d24dd8bff2f3313617
+Notes

-Issue History
Date Modified Username Field Change
2013-11-03 21:58 silentwings New Issue
2013-11-03 21:59 silentwings Note Added: 0011951
2013-11-03 22:03 silentwings Note Edited: 0011951 View Revisions
2013-11-03 22:17 silentwings Note Added: 0011954
2013-11-03 22:18 silentwings Note Edited: 0011954 View Revisions
2013-11-03 22:32 Kloot Note Added: 0011955
2013-11-03 22:35 silentwings Note Added: 0011956
2013-11-03 22:35 silentwings Note Edited: 0011956 View Revisions
2013-11-03 22:37 silentwings Note Edited: 0011956 View Revisions
2013-11-03 22:42 silentwings Note Added: 0011957
2013-11-03 22:47 silentwings Note Edited: 0011956 View Revisions
2013-11-03 23:09 Kloot Note Added: 0011960
2013-11-03 23:29 silentwings Note Added: 0011961
2013-11-03 23:43 abma Note Added: 0011962
2013-11-04 14:00 Kloot Status new => closed
2013-11-04 14:00 Kloot Assigned To => Kloot
2013-11-04 14:00 Kloot Resolution open => unable to reproduce
+Issue History