Can't erase AI startpoint anymore.

Can't erase AI startpoint anymore.

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Can't erase AI startpoint anymore.

Post by zwzsg »

I have the following widget:

Code: Select all

function widget:GetInfo()
  return {
    name      = "Start Point Remover",
    desc      = "Deletes your start point once the game begins",
    author    = "TheFatController and jK and zwzsg",
    date      = "Jul 11, 2007",
    license   = "GNU GPL, v2 or later",
    layer     = 0,
    enabled   = true
  }
end

function widget:GameFrame(f)
  if f > 5 then
    for _,t in ipairs(Spring.GetTeamList()) do
      local x,y,z = Spring.GetTeamStartPosition(t)
      Spring.MarkerErasePosition(x or 0, y or 0, z or 0)
    end
    widgetHandler:RemoveWidget()
  end
end
It erases my own startpoint marker, but not the AI startpoint marker anymore (since 0.80.5. or so). Please fix. I want to make a game that looks like a polished product and not like some ugly debugger.

Also: I am blue and the AI is red. The AI startpoint is blue and I can delete it manually.

Using:
Spring.Echo("Deleting ("..(x or "nil")..","..(y or "nil")..","..(z or "nil")..")")
I got:
[ 7] Deleting (1024,100,1024)
[ 7] Deleting (nil,nil,nil)
[ 7] Deleting (nil,nil,nil)
I suppose that means there are three teams (Me, the AI, and I guess Gaia) but that only me got the startpos set.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Can't erase AI startpoint anymore.

Post by SirMaverick »

rts/Lua/LuaSyncedRead.cpp
line 920:

Code: Select all

if (!IsAlliedTeam(teamID)) {
  return 0;
}
No cheating.
Last edited by SirMaverick on 08 Nov 2009, 17:12, edited 1 time in total.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Can't erase AI startpoint anymore.

Post by zwzsg »

I have tested using both StartPosType=4; ("choose before game") and StartPosType=1 (fixed), in the AI startpoint aren't erased in either case.

But, weirdly enough, when I am speccing AI battles, the startpos marker are erased fine.

You are not being helpful, SirMaverick. Maybe you are telling me players are not allowed to use widget reading the enemy team start pos? If so, that is the most fail fix I have every seen, since the enemy start pos are marked by a giant glowing beacon nevertheless, and that your fix in effect prevents any hope of ever automatically deleting it.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Can't erase AI startpoint anymore.

Post by SirMaverick »

zwzsg wrote:You are not being helpful, SirMaverick. Maybe you are telling me players are not allowed to use widget reading the enemy team start pos?
Yes.
If so, that is the most fail fix I have every seen, since the enemy start pos are marked by a giant glowing beacon nevertheless, and that your fix in effect prevents any hope of ever automatically deleting it.
The bug is, that it is drawn in the first place.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Can't erase AI startpoint anymore.

Post by zwzsg »

Also mantised: http://springrts.com/mantis/view.php?id=1722
SirMaverick wrote:The bug is, that it is drawn in the first place.
I would be fine with the marker not being drawn in the first place.

I partially workarounded it by moving the code to a gadget, nevertheless there is a stupid bug in the engine that must be fixed in the engine.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Can't erase AI startpoint anymore.

Post by hoijui »

i responded in the mantis report.
basically the problem here is (at least i think its that) that springs only allows players to draw. that means, htat AIs, when drawing, have to draw with the color of a player. for Skirmish AIs, thats the host player, for Lua AIs.. i dont know.
the fix is non trivial as explained in one of the related mantis reports, in that it invloves network protocol and a lot of other stuff to be changed.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Can't erase AI startpoint anymore.

Post by zwzsg »

Then follow SirMaverick suggestion and just don't mark AI startpos in the first place. There are already enough bugs created by trivial fixes, so don't attempt non trivial solutions.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: Can't erase AI startpoint anymore.

Post by R-TEAM »

Hi,
zwzsg wrote:Then follow SirMaverick suggestion and just don't mark AI startpos in the first place. There are already enough bugs created by trivial fixes, so don't attempt non trivial solutions.
agree 101% ;)
have noticed this long ago (0.80.1x or so..) and think only "mmh.. one more widget that is not running 100% under 0.80x", it erases my startpoint so its doing anything ;)

Better -> a server option to draw start points AT ALL (player or AIs)
I realy dont see a "musst have" for startpoints....
(dont understand why it is usefull to see my startpoint or helpfull by a game that hides other players units by LOS/fogofwar and then i see its startpoint ...maybe in special situation ....but then i can this enable server side ..)

Regards
R-TEAM
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Can't erase AI startpoint anymore.

Post by Argh »

1. Why not just delete all the map-marks on frame 1?
2. Why is Spring auto-marking startpoints in the first place? This is something that should be a Widget or Gadget, period.

Oh, and lastly... convert to a Gadget... get the UnitCreated() events, and get the Commanders, since that's the same location XYZ, then pass to unsync to erase. Should work. If you're stuck, let me know, I wrote something like it awhile ago and it still works just fine.

Seriously, though. I just took a look, and it appears that map-marks aren't being stored in a Lua-accessible place. My vote: delete that entire functionality from the engine, we can do everything that we do with map marks with Lua, and then we'll never have this conversation again. Map-marks have been broken and re-fixed, same with this initial-position stuff, more than once, and it shouldn't be in the engine at this point anyhow.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Can't erase AI startpoint anymore.

Post by zwzsg »

Argh wrote:Oh, and lastly... convert to a Gadget... get the UnitCreated() events, and get the Commanders, since that's the same location XYZ, then pass to unsync to erase. Should work.
I already did. (Your method is way overcomplex btw. Unsynced of gadget can simply read startpos.).

But I should not have to add gadgets to my mod to work around engine bugs. Especially for bugs that concern all and every mods.
If you're stuck, let me know.
I resent that! :evil:
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Can't erase AI startpoint anymore.

Post by lurker »

...submitted to springbash.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Can't erase AI startpoint anymore.

Post by Argh »

<shrugs> I wrote a solution in about 15 minutes and 15 lines of code. And until Mapmark or the relevant callouts get deprecated, it will just work, regardless of the fix made to Spring.

I guess you don't need it though :roll:
Post Reply

Return to “Help & Bugs”