google-code-export / bwapi

Automatically exported from code.google.com/p/bwapi
0 stars 0 forks source link

Update some BWAPILIB Type Info for Use Map Settings #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call cloak() on hero unit

What is the expected output? What do you see instead?
In single player mission, some hero(e.g. Kerrigan in Episode I Terran 5)
cannot cloak when called cloak(). 

What version of the product are you using? On what operating system?
r1661

Please provide any additional information below.
in
[http://code.google.com/p/bwapi/source/browse/trunk/bwapi/BWAPI/Source/BWAPI/Uni
tImpl.cpp?spec=svn1661&r=1657
UnitImpl.cpp] line:1571 and 1522
only Terran_Wraith and Terran_Ghost are allowed to cloak. 
UnitTypes::Unknown should also be added to the allow list.
however heroKerrigan->getType().isCloakable() is false.(donnot know why)

Original issue reported on code.google.com by neoedmund on 28 Nov 2009 at 9:18

GoogleCodeExporter commented 9 years ago
useTech also need allow heroes

Original comment by neoedmund on 28 Nov 2009 at 12:42

GoogleCodeExporter commented 9 years ago
Remove non-standard constants in (for example)
http://code.google.com/p/bwapi/source/browse/trunk/bwapi/BWAPILIB/Source/UnitTyp
e.cpp

Values need to be read from Starcraft memory as in BWAPI. The functions are 
there but
for some reason this is creating its own incorrect tables.

Original comment by AHeinerm on 28 Nov 2009 at 4:27

GoogleCodeExporter commented 9 years ago
You mean reading UnitType table from Broodwar memory produces a false table? If 
yes, 
where is this faulty function?

Original comment by goo...@teabix.com on 28 Nov 2009 at 4:43

GoogleCodeExporter commented 9 years ago
I'm saying the UnitType table provided in BWAPILIB is faulty, and it SHOULD be
reading from Broodwar memory.

Original comment by AHeinerm on 28 Nov 2009 at 4:45

GoogleCodeExporter commented 9 years ago
This will
A) Once again make UMS maps compatible with BWAPI.
B) Allow BWAPI to use Hero units.
C) Allow BWAPI to be used for mods or conversions that alter any data.
D) Put me at ease so that I can die happy.

Original comment by AHeinerm on 28 Nov 2009 at 4:48

GoogleCodeExporter commented 9 years ago
I totally agree. I hope someone else out there already found the offsets...

D: I'd like you not to die at all ;)

Original comment by goo...@teabix.com on 28 Nov 2009 at 5:05

GoogleCodeExporter commented 9 years ago
The offsets are already there in BWAPI's UnitType.cpp but not BWAPILIB.

Original comment by AHeinerm on 28 Nov 2009 at 5:14

GoogleCodeExporter commented 9 years ago
I think UnitType.cpp is pretty much finished and soon we won't ever need to 
touch it
again, since support for heroes and ums maps wasn't part of the plan (until 
now?),
but if you want to rewrite it to make it communicate with BWAPI.dll, go ahead. 
Just
let me state why I don't think this is a good idea:

1. I expect that this change will slow down AI Modules once we move the AI 
Module to
another process, since rather than simply looking up a value in local memory, 
the AI
Module would have to request information over the shared memory table or 
socket, and
then wait for a response. If the AI Module is trying to get lots of unit type
information (such as the name of every unit type), then this will likely cause a
noticeable slowdown, since it would need about 200 communications between the 
Agent
process and the Broodwar/BWAPI.dll process.

2. Whatever the situation, we'll need to hardcode information for a lot of 
fields
that either aren't provided by BW::UnitType, or are incomplete/inaccurate (such 
as
the topSpeed). So in some ways this would only be moving the problem from one 
file to
another. BW::UnitType already has whatBuilds and requiredUnits hard-coded, so 
you'd
probably end up writing similar functions for special abilities and upgrades. 
Also I
edited some of the names to make them more consistent (so the names of all the 
Terran
units start with "Terran "). Similar data would need to be hard coded for
TechType::whatUses, TechType::whatResearches, UpgradeType::whatUses,
UpgradeType::whatUpgrades, etc.

3. Also every time you want to get info on a unit type, instead of typing 
something like:
int maxhp = UnitTypes::Terran_Marine.maxHitPoints();

you'd now need to do:
int maxhp = Broodwar->getUnitType(UnitTypes::Terran_Marine)->maxHitPoints();

which is more typing than should be necessary.

4. It doesn't make sense to change BWAPI::UnitType without changing other type
information classes like UpgradeType, TechType, WeaponType, UnitSizeType,
ExplosionType, AttackType, DamageType, and PlayerType.

Original comment by lowerlo...@gmail.com on 28 Nov 2009 at 7:46

GoogleCodeExporter commented 9 years ago
0: I agree, heroes and such should not be of any priority for BWAPI.

1: The bridge does not request anything. Tecnically, the memory that contains 
the 
UnitType array will be just mapped to Agent's processes address space, but it 
physically only exists once in RAM.

2: If the data is not just an array in Broodwars memory, then you're totally 
right. 
If it is just an array, it would be worth it reading it.

3: I had doubts posting it, but now I'm sure. Forked to issue 146

4: But it would be the first step to perfection.

Original comment by goo...@teabix.com on 28 Nov 2009 at 8:06

GoogleCodeExporter commented 9 years ago
3: with accepted issue 146, the code will still the short version, it will just 
implicitely fetch the data from broodwar.

Original comment by goo...@teabix.com on 28 Nov 2009 at 8:14

GoogleCodeExporter commented 9 years ago
Just to be clear, I'm fine with this change, but I'm also happy with how things 
are now.

Original comment by lowerlo...@gmail.com on 29 Nov 2009 at 12:18

GoogleCodeExporter commented 9 years ago
lowerlogic, I disagree with your objections.

1. If this change will cause a noticeable slowdown, we can add a simple caching 
mechanism, since these values shouldn't change per scenario.

2. If true, you will still need to hardcode less information.

3. It is only a question of how you build the interface. Both forms a possible.

Original comment by erez27 on 29 Nov 2009 at 8:20

GoogleCodeExporter commented 9 years ago
Thanks teabix and erez27 for addressing my concerns. I now see that this change 
won't
affect the speed, and it will still be possible to have the current interface, 
so I
no longer have any objections to this change. It wouldn't hurt to have support 
for
heroes and custom stats on UMS maps, and in the end this will make BWAPI's unit 
type
information more comprehensive and useful.

Original comment by lowerlo...@gmail.com on 29 Nov 2009 at 10:08

GoogleCodeExporter commented 9 years ago
We can grab the values in the initialization functions to avoid the "more 
typing than
necessary" issue.

There is no incomplete or inaccurate field in Starcraft. It's like the law. 
We're
just making our own statistics to be accessed.

Original comment by AHeinerm on 30 Nov 2009 at 1:53

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 9 Dec 2009 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Mar 2010 at 5:05

GoogleCodeExporter commented 9 years ago

Original comment by lowerlo...@gmail.com on 17 Jul 2010 at 4:29

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 12 Sep 2010 at 11:10

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 12 Sep 2010 at 11:11

GoogleCodeExporter commented 9 years ago
(todo) add hero units, powerups, and special building types to current system

Original comment by AHeinerm on 23 Oct 2010 at 11:13

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Nov 2010 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Nov 2010 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Nov 2010 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Nov 2010 at 5:11

GoogleCodeExporter commented 9 years ago
Added hero units/beacons/powerups

Original comment by AHeinerm on 8 Nov 2010 at 5:18

GoogleCodeExporter commented 9 years ago
Todo: 
Updated the unit type info which includes the following:

[Units]
Max HP
Max Shields
Armor
Time Cost
Ore Cost
Gas Cost
Availability (bool, Player-specific)
Name?? (Perhaps used for text messages to send to other players, as 
"getModifiedName" or rename the original to "getOriginalName")

[Weapons]
Damage
Bonus Damage increase

[Upgrades]
Time Cost
Ore Cost
Gas Cost
Time Cost Increase
Ore Cost Increase
Gas Cost Increase
Max Level (Player-specific)
Starting Level (Player-specific)

[Technologies]
Time Cost
Ore Cost
Gas Cost
Energy Cost
Available (bool, Player-specific)
Researched (bool, Player-specific)

Original comment by AHeinerm on 23 Nov 2010 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 26 Nov 2010 at 5:27

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 26 Nov 2010 at 5:31

GoogleCodeExporter commented 9 years ago
Remaining since r3783
[Units]
Max HP
Max Shields
Armor
Time Cost
Ore Cost
Gas Cost
Name (alternate)

[Weapons]
Damage
Bonus Damage increase

[Upgrades]
Time Cost
Ore Cost
Gas Cost
Time Cost Increase
Ore Cost Increase
Gas Cost Increase

[Technologies]
Time Cost
Ore Cost
Gas Cost
Energy Cost

Original comment by AHeinerm on 1 Aug 2011 at 3:11

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 1 Aug 2011 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 23 Jul 2012 at 3:57

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 16 Dec 2012 at 5:03

GoogleCodeExporter commented 9 years ago
The BWAPI project is slowly undergoing the migration to GitHub. All issues have 
been migrated to the GitHub issue tracker located here: 
https://github.com/bwapi/bwapi/issues

In order to receive updates on your issue, please head over to the GitHub issue 
tracker and subscribe to your issue.

Original comment by AHeinerm on 15 Apr 2014 at 7:46