Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Enemy map revealers not included in frame 0 #279

Open
edran opened this issue Jul 18, 2018 · 4 comments
Open

Enemy map revealers not included in frame 0 #279

edran opened this issue Jul 18, 2018 · 4 comments

Comments

@edran
Copy link
Contributor

edran commented Jul 18, 2018

When using maps/empty.scm (in develop) with combine_frames=1 and the map hack, the enemy map revealers are not included in state.frame. On the second frame, they correctly appear.

This can be easily tested by running examples/py/create_kill.py with that map.

@edran edran changed the title nemy map revealers not included in frame Enemy map revealers not included in frame 1 Jul 18, 2018
@ebetica
Copy link
Contributor

ebetica commented Jul 18, 2018

Should they? They are invisible to other players afaik, even if they have detection.

@edran
Copy link
Contributor Author

edran commented Jul 18, 2018

@ebetica Actually, now that I think about it, the map hack command is sent just before that frame, so maybe it takes one additional frame for that to be working?

@ebetica
Copy link
Contributor

ebetica commented Jul 18, 2018

It's possible you can't see map revealers even with MAP_HACK? @tscmoo do you have any ideas? I think this is OpenBW.

@edran
Copy link
Contributor Author

edran commented Jul 18, 2018

Actually, the map revealers are not seen only when state.frame_from_bwapi is 0, so maybe it is a TorchCraft problem?

The example does:

cl = tc.Client()
cl.connect(args.hostname, args.port)
state = cl.init(micro_battles=args.micro_battles)
returned = cl.send([
    [tcc.set_combine_frames, skip_frames],
    [tcc.set_speed, 0],
    [tcc.set_gui, 1],
    [tcc.set_cmd_optim, 1],
    [tcc.map_hack],
])
state = cl.recv()
>>>print(state.frame_from_bwapi)
0
>>>print(state.frame.units)
{0: [<torchcraft.replayer.Unit object at 0x1071d7d50>,
     <torchcraft.replayer.Unit object at 0x1071eafb8>,
     <torchcraft.replayer.Unit object at 0x1071eaf80>,
     <torchcraft.replayer.Unit object at 0x1071c9e30>,
     <torchcraft.replayer.Unit object at 0x1071c9c70>,
     <torchcraft.replayer.Unit object at 0x107201e30>,
     <torchcraft.replayer.Unit object at 0x107201260>,
     <torchcraft.replayer.Unit object at 0x107202228>,
     <torchcraft.replayer.Unit object at 0x1072021b8>,
     <torchcraft.replayer.Unit object at 0x107202378>,
     <torchcraft.replayer.Unit object at 0x107202340>,
     <torchcraft.replayer.Unit object at 0x107202490>,
     <torchcraft.replayer.Unit object at 0x1072020d8>,
     <torchcraft.replayer.Unit object at 0x1072023b0>,
     <torchcraft.replayer.Unit object at 0x1072024c8>,
     <torchcraft.replayer.Unit object at 0x107202538>]}
>>>print(state.units)
{0:[]}
>>>print(cl.send([]))
True
>>>state = cl.recv()
>>>print(state.frame.units)
{0: [<torchcraft.replayer.Unit object at 0x1071d7110>,
     <torchcraft.replayer.Unit object at 0x1071d7d50>,
     <torchcraft.replayer.Unit object at 0x107202e68>,
     <torchcraft.replayer.Unit object at 0x10720cc70>,
     <torchcraft.replayer.Unit object at 0x10720c8f0>,
     <torchcraft.replayer.Unit object at 0x10720cb58>,
     <torchcraft.replayer.Unit object at 0x10720e9d0>,
     <torchcraft.replayer.Unit object at 0x10720ea40>,
     <torchcraft.replayer.Unit object at 0x10720e0d8>,
     <torchcraft.replayer.Unit object at 0x10720ebc8>,
     <torchcraft.replayer.Unit object at 0x10720e960>,
     <torchcraft.replayer.Unit object at 0x10720eca8>,
     <torchcraft.replayer.Unit object at 0x10720e8f0>,
     <torchcraft.replayer.Unit object at 0x10720e998>,
     <torchcraft.replayer.Unit object at 0x10720e810>,
     <torchcraft.replayer.Unit object at 0x10720ece0>],
 1: [<torchcraft.replayer.Unit object at 0x10720ed50>]}
>>>print(state.units)
{0:[], 1:[]}
>>>print(state.frame_from_bwapi)
1

@edran edran changed the title Enemy map revealers not included in frame 1 Enemy map revealers not included in frame 0 Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants