Code Monkey home page Code Monkey logo

clarity-examples's People

Contributors

ganesshkumar avatar jlleitschuh avatar sosso avatar spheenik avatar whoeza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clarity-examples's Issues

How to dump the results into txt or json file?

What is the easiest way to dump the results into txt or json file?

By the way, here is an example:
"094220: CDOTA_Unit_Hero_WitchDoctor at index 264 has died"
What 'index 264' means?
And '094220' is the frame index the game, 30 frames per second. Am I right?

Private functions on annotations.

Putting an @OnEntityEntered or @OnEntityLeft annotation on a private function should do some non-zero number of these things:

  • raise a warning that a private function is annotated
  • throw a compilation error
  • still invoke the private function (ignore the private field)

How do I know the meaning of num?

Hello, your work is very helpful for me, but I still have some questions.
For example in gameevents there is 'event type = 21'
What does the number '21' mean?
Is there any file show the numbers' meaning?
Thanks!

Is there data for fights in the demo? The "show fight recap" button of dota 2 client

I'm looking if there's any data embedded in the demo associated with fights.
I'm talking about these when watching a demo:
image

It could be that the client is just simply collecting all the data by itself and the demo doesn't contain that info.
I also know that it could be doable based on kills, damage dealt, abilities used, etc - Opendota parses the demo and creates it's own thing where they decide what is a teamfight and what's not.

But what I'm wondering is that is the data already there? And if so, how should I go about looking for it?
If I know the tick of the popup, could I dump all of the demo's info close to that tick somehow and see if that contains anything?

I went through clarity-examples but no output seemed to contain this.

Any pointers?

How to get Buyback/Respawn information

Is there any way to get accurate buyback info, such as time left to respawn, gold lost from death, and gold cost to buyback? I've only noticed these properties within CDOTA_DataRadiant and CDOTA_DataDire:
m_vecDataTeam.000[x].m_fIBuybackCooldownTime
m_vecDataTeam.000[x].m_fIBuybackGoldLimitTime
m_vecDataTeam.000[x].m_fIBuybackCostTime

I'm not sure what the difference between these is or what BuybackCostTime and BuybackGoldLimitTime actually mean.

There are also the combatlog entries DOTA_COMBATLOG_BUYBACK and DOTA_COMBATLOG_DEATH, but I can't seem to extract gold lost from death or buyback.

I'm I looking in the wrong place? Thanks a lot!

How to get all the units controlled by one player

For example how should I access phantom lancer's illusions and get corresponding positions (or beastmaster's hawk)? My guess is to get all units spawned and check m_hOwnerEntity, but I am not sure if that works for all the cases.

About GameEvent

Hi,

I really appreciate your job and it is excellent. However, I am a noob to Java, so reading your code is kind of hard for me. My friends and I are interested in analyzing ward placements. SO I am wondering how can I get the wards information from your code. Thanks a lot!

Getting unit Entities from CombatLog

I'm using the CombatLog to get some information on targets and attackers, but the only unit information that seems available are the name and the team through getAttackerName/getTargetName, and getAttackerTeam/getTargetTeam. If, for instance, the target or attacker is a neutral/lane creep, is there any way I can get that specific unit's Entity? So if I get a "npc_dota_creep_badguys_ranged" from the CombatLog, how can I get its Entity so that I can extract other data like position? Thanks!

How to find the initial tick that corresponds to the game start?

Hi! I wanted to learn to convert timestamp and timestamp_raw into clock time. Is there a fixed offset that can be used to translate those two values into clock time? Or is there an event in the replay that refers to the switch from strategy time to match start?

How can I modify the combatlog example to include maximum health for getAttackerName and getTargetName?

Can I extend the combatlog example so that getAttackerName and getTargetName display the maximum health at the time of the event? I want to do this to calculate health percentages, and most likely getHealthPercent() would work here too, but I don't see how it could be applied since it's not in CombatLogEntry

I'm not well versed in the subject, so I apologize in advance for the stupid question D:

Item and ability names

Hi there,
I want to get hero abilities and items, but some of them don't have proper name.
like -> "class: CDOTA_Item". I don't mind if it is name or unique id as long as it is unique between different replays, too. I couldn't find any corresponding id or something.

this is an item entity:
dotaItem

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4

I'am trying to run skadistats.clarity.examples.particles.Main and i got error. Why does it occur?

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
at skadistats.clarity.model.s2.S2LongFieldPathFormat.down(S2LongFieldPathFormat.java:23)
at skadistats.clarity.model.s2.S2LongModifiableFieldPath.down(S2LongModifiableFieldPath.java:19)
at skadistats.clarity.decoder.s2.FieldOpType$8.execute(FieldOpType.java:55)
at skadistats.clarity.decoder.s2.S2FieldReader.readFields(S2FieldReader.java:56)
at skadistats.clarity.decoder.s2.S2FieldReader.readFields(S2FieldReader.java:14)
at skadistats.clarity.processor.entities.Entities.getBaseline(Entities.java:486)
at skadistats.clarity.processor.entities.Entities.processEntityCreate(Entities.java:372)
at skadistats.clarity.processor.entities.Entities.onPacketEntities(Entities.java:317)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
at skadistats.clarity.event.Event.raise(Event.java:41)
at skadistats.clarity.processor.reader.InputSourceProcessor.processEmbedded(InputSourceProcessor.java:247)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
at skadistats.clarity.event.Event.raise(Event.java:41)
at skadistats.clarity.processor.reader.InputSourceProcessor.processSource(InputSourceProcessor.java:174)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
at skadistats.clarity.event.Event.raise(Event.java:41)
at skadistats.clarity.processor.runner.AbstractFileRunner.initAndRunWith(AbstractFileRunner.java:39)
at skadistats.clarity.processor.runner.SimpleRunner.runWith(SimpleRunner.java:33)
at skadistats.clarity.examples.particles.Main.run(Main.java:173)
at skadistats.clarity.examples.particles.Main.main(Main.java:179)

Question: connect/disconnect logs

Hi,

Could you point me to right direction here how to get player connection/reconnection and disconnection logs. If there is not a built in event for listening those maybe you happen to know protobuf message class name(s) that is handling those events?

Is the allchat example still relevant?

package example.parser.allchat;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import skadistats.clarity.processor.reader.OnMessage;
import skadistats.clarity.processor.runner.Context;
import skadistats.clarity.wire.s2.proto.S2UserMessages;

public class AllChatProcessor {
    private final Logger log = LoggerFactory.getLogger(Main.class.getPackage().getClass());

    @OnMessage(S2UserMessages.CUserMessageSayText2.class)
    public void onMessage(Context ctx, S2UserMessages.CUserMessageSayText2 message) {
        log.info("%s: %s\n", message.getParam1(), message.getParam2());
    }   
}
package example.parser.allchat;

import skadistats.clarity.processor.entities.UsesEntities;
import skadistats.clarity.processor.runner.SimpleRunner;
import skadistats.clarity.source.MappedFileSource;


@UsesEntities
public class Main {

    public void run(String[] args) throws Exception {
        SimpleRunner runner = new SimpleRunner(new MappedFileSource(args[0]));
        AllChatProcessor processor = new AllChatProcessor();
        runner.runWith(processor);
    }

    public static void main(String[] args) throws Exception {
        new Main().run(args);
    }

}

Yields the following:

➜  dota java -jar target/allchat.one-jar.jar replay.dem
14:48:33.415 [main] DEBUG clarity.execution - require processor skadistats.clarity.processor.runner.SimpleRunner
14:48:33.430 [main] DEBUG clarity.execution - require processor skadistats.clarity.model.engine.DotaS2EngineType
14:48:33.450 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.sendtables.DTClasses
14:48:33.452 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.reader.InputSourceProcessor
14:48:33.456 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.stringtables.S1StringTableEmitter
14:48:33.460 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.gameevents.CombatLog
14:48:33.460 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.runner.AbstractRunner
14:48:33.461 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.sendtables.S2DTClassEmitter
14:48:33.462 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.entities.PropertyChange
14:48:33.463 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.packet.PacketReader
14:48:33.463 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.modifiers.Modifiers
14:48:33.464 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.stringtables.StringTables
14:48:33.465 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.runner.AbstractFileRunner
14:48:33.466 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.stringtables.PlayerInfo
14:48:33.468 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.entities.Entities
14:48:33.471 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.stringtables.S2StringTableEmitter
14:48:33.472 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.sendtables.S1DTClassEmitter
14:48:33.472 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.gameevents.GameEvents
14:48:33.474 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.tempentities.TempEntities
14:48:33.474 [main] DEBUG clarity.execution - provider found on ClassIndex: skadistats.clarity.processor.resources.Resources
14:48:33.475 [main] DEBUG clarity.execution - require processor skadistats.clarity.processor.packet.PacketReader
14:48:33.475 [main] DEBUG clarity.execution - require processor skadistats.clarity.source.MappedFileSource
14:48:33.475 [main] DEBUG clarity.execution - require processor example.parser.allchat.AllChatProcessor
14:48:33.477 [main] DEBUG clarity.execution - require event listener interface skadistats.clarity.processor.reader.OnMessage
14:48:33.477 [main] DEBUG clarity.execution - require processor skadistats.clarity.processor.reader.InputSourceProcessor
14:48:33.481 [main] DEBUG clarity.execution - register initializer interface skadistats.clarity.processor.reader.OnMessage
14:48:33.481 [main] DEBUG clarity.execution - register initializer interface skadistats.clarity.processor.reader.OnPostEmbeddedMessage
14:48:33.481 [main] DEBUG clarity.execution - register initializer interface skadistats.clarity.processor.reader.OnMessageContainer
14:48:33.481 [main] DEBUG clarity.execution - require event listener interface skadistats.clarity.processor.runner.OnInputSource
14:48:33.481 [main] DEBUG clarity.execution - require event listener interface skadistats.clarity.processor.reader.OnMessageContainer
14:48:33.481 [main] DEBUG clarity.execution - require event listener interface skadistats.clarity.processor.reader.OnMessage
14:48:33.484 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.processEmbedded(java.lang.Class,com.google.protobuf.ByteString) throws java.io.IOException to context
14:48:33.488 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.initOnPostEmbeddedMessageListener(skadistats.clarity.event.EventListener) to context
14:48:33.490 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.processSource(skadistats.clarity.source.Source,skadistats.clarity.processor.runner.LoopController) throws java.lang.Exception to context
14:48:33.490 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.initOnMessageContainerListener(skadistats.clarity.event.EventListener) to context
14:48:33.490 [main] DEBUG clarity.execution - bind public void example.parser.allchat.AllChatProcessor.onMessage(skadistats.clarity.processor.runner.Context,skadistats.clarity.wire.s2.proto.S2UserMessages$CUserMessageSayText2) to context
14:48:33.491 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.processServerInfo(skadistats.clarity.wire.common.proto.NetMessages$CSVCMsg_ServerInfo) to context
14:48:33.492 [main] DEBUG clarity.execution - bind public void skadistats.clarity.processor.reader.InputSourceProcessor.initOnMessageListener(skadistats.clarity.event.EventListener) to context

I derived this from the example on the README.md but can't seem to get this to work.

Update Clarity Examples?

Can you update the clarity examples?

For several examples (such as the info), they require
import skadistats.clarity.wire....

However, package wire appears to have been removed in the latest build of Clarity.

Cannot find symbol: class DOTA_COMBATLOG_TYPES

Hi! I have barely any Java experience but wanted to try out the examples here. I'm running into the following problem when trying to build any of the examples.

mvn -P info package

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project clarity-examples: Compilation failure [ERROR] /Users/drsolaris/code/clarity-examples/src/main/java/skadistats/clarity/examples/combatlog/Main.java:[13,57] cannot find symbol [ERROR] symbol: class DOTA_COMBATLOG_TYPES [ERROR] location: class skadistats.clarity.wire.s1.proto.DotaUsermessages

Apologies if this is something really simple. Thanks for the great work.

Problems with replays generated by the 'record' console command

I'm having issues parsing replays that is generated by the record console command which I thought would be supported with the 2.1-SNAPSHOT. Running regular replays works fine.

When running combatlog it finishes but no data is presented.

When running matchend I get the following exceptions:
http://caps.interactivesolutions.se/ss/3a74bf.png.

Is there something I need to keep in mind when creating a replay from the console in order for this to work?

How to get buff/debuff information

I'm looking through the clarity analyzer and I can't seem to find the correct property within CDOTA_Unit_Hero_[heroname] to get the information of any buffs, such as Greevil's Greed or Arghanim's Scepter Synth. I've looked at other entities, but nothing looks like it has that information. Where is buff information stored for each character? Thanks a lot!

Making showScoreboard() imitate the actual ingame scoreboard you see at matchend

Love that you can get the scoreboard from a replay in under a second just by building the example "Show stats at the end of the game" from https://github.com/skadistats/clarity-examples/

The ingame scoreboard also list additional detail such as:

  • Witch team won
  • What team each player belong to.
  • Items in inventory
  • GOLD/MIN
  • XP/MIN

Would you consider adding the above to the example?
If not, would it be fairly simple to extend the example for someone with limited programming experience?

Getting player to hero selection relationship

So I posted something similar in the main Clarity issues page, but I had an additional problem I'd like to solve. Since CDOTA_DataDire's or CDOTA_DataRadiant's m_vecDataTeam.000X.m_nPissibleHeroSelection seems to be returning -1 for the entire match on new replays, I noticed that I can at least see what heroes are being used with CDOTA_Unit_Hero_X where X is the hero's CDOTA name. The problem is the index values of the CDOTA_Unit_Hero classes seem to always be different, so I would have to search all indexes and compare them against all heroes in Dota 2 to find which are being used. Is there a way to retrieve all classes that begin with "CDOTA_Unit_Hero_" so I don't have to iterate through them all?

Can't run example (missing main class error)

Hello! Explain me please what i am doing wrong. I am not java developer (.net) but i want to use your perfect framework parse system. So I stucked at beginning stage after build.

Tech info:
Apache Maven 3.3.9
Java version: 1.8.0_71, vendor: Oracle Corporation
OS name: "windows 8.1", version: "6.3", arch: "x86", family: "dos"

Got example pom file from : https://github.com/skadistats/clarity-examples/blob/master/pom.xml
Ofc didn't modified that.

Run build output
image

Run jar output
image

I got 2 folders in "target": classes and test-classes. Both are empty.

Just in case... repository folder content is
image

Please, help me, what steps i missed ?

How to get current gold of each player at each tick?

Hi,

I would like to get current gold help by each player at each tick.
How can I get that?

The approach that I thought of is to listen for DOTA_COMBATLOG_GOLD event on onCombatLogEntry.
Then always update the player gold (i.e. if its negative he lost gold, if its positive he gained).
But this doesn't account for the 1 gold a player receives per second.

Is there a better way to do this?
Because I couldn't find any entity that exposes the current gold of hero per tick.

Thanks.
Harsh.

Abilities info

I found old abilities info parsing manual, but I don't know how parse this using clarity. Can someone help me?

Cannot build combatlog from the project root

After building it from the project root with
mvn -P combatlog package

Here is what I got from cmd:
[ERROR] /C:/clarity-examples-c824a92334456a7f462b177dabe176a02e7981d6/src/main/java/skadistats/clarity/examples/combatlog/Main.java:[8,32] cannot find symbol
[ERROR] symbol: class CombatLogEntry
[ERROR] location: package skadistats.clarity.model
[ERROR] /C:/clarity-examples-c824a92334456a7f462b177dabe176a02e7981d6/src/main/java/skadistats/clarity/examples/combatlog/Main.java:[31,44] cannot find symbol
[ERROR] symbol: class CombatLogEntry
[ERROR] location: class skadistats.clarity.examples.combatlog.Main

Coordinates for a given in-game entity

So I've found the property CBodyComponent.m_vec[X,Y,Z] but I'm struggling to see how these numbers relate to the actual game field. When I look at the CWorld entity's m_WorldMins/m_WorldMaxs properties, I get [-8391.375, -8320.0, -1072.4688] for mins and [9216.0, 8323.8125, 3584.0] for maxs, while m_vec data for any given entity never rises above around 250, and is never negative. Is there another property to tell an entity's position on the game field or a way to convert this value? Thanks!

Bug report - AllChatProcessor

Hi, after building and running AllChatProcessor from the examples, I get this error:

java -jar .\target\allchat.one-jar.jar .\target\replay.dem > output.txt Exception in thread "main" java.lang.ClassNotFoundException: skadistats.clarity.examples.allchat.Main at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:713) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at com.simontuffs.onejar.Boot.run(Boot.java:334) at com.simontuffs.onejar.Boot.main(Boot.java:166)

Not sure what's wrong...
I refactored the file with IDEA to call it Main.java and changed "replay.dem" into args[0], and it worked for me.

Exception in thread "main" skadistats.clarity.ClarityException: cannot determine last tick before engine type is known

I'm trying to run the matchend example using gradlew.bat matchendRun --args "my-replay.dem" and I'm getting the following error:

Exception in thread "main" skadistats.clarity.ClarityException: cannot determine last tick before engine type is known
        at skadistats.clarity.source.Source.determineLastTick(Source.java:178)
        at skadistats.clarity.source.Source.getLastTick(Source.java:194)
        at skadistats.clarity.processor.runner.ControllableRunner.getLastTick(ControllableRunner.java:347)
        at skadistats.clarity.examples.matchend.Main.<init>(Main.java:35)
        at skadistats.clarity.examples.matchend.Main.main(Main.java:24)
<=========----> 75% EXECUTING [3s]

I have not changed any code from the example. Other examples are working for me, such as the "info" example.

Any help would be much appreciated!

Problem with m_flMagicalResistanceValue

Hello,

I'm trying to get m_flMagicalResistanceValue from CDota_Unit and always see the default value=25.0

Could you please explain how to get updated values? (I use propertychange module)

Missing Main Class in Examples

Hi,
I am new in Java programming, so I might be doing something wrong here. I want to extract the combat log. I used the "mvn -P combatlog package" command and then "java -jar target/combatlog.jar replay.dem" to parse the combat log. But it says Error: Could not find or load main class skadistats.clarity.examples.combatlog.Main. I extracted the combatlog.jar file and it does not have the example folder. Can you tell me what I am doing wrong?

get java.lang.reflect.InvocationTargetException when try to get getDtClass() of an entity

I try to get property value of an ability and get this error in runtime.
I'v gon entity by its handler from Hero's entity.
ctx.getProcessor(Entities.class).getByHandle((int) getEntityProperty(e, handlerName,null));

then when I try to getDtClass I'v got this error:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.simontuffs.onejar.Boot.run(Boot.java:340)
        at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.NullPointerException
        at skadistats.clarity.examples.combatlog.Main.onUpdated(Main.java:124)
        at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
        at skadistats.clarity.event.Event.raise(Event.java:37)
        at skadistats.clarity.processor.entities.Entities.lambda$emitUpdatedEvent$4(Entities.java:539)
        at java.util.ArrayList.forEach(Unknown Source)
        at skadistats.clarity.processor.entities.Entities.onPacketEntities(Entities.java:357)
        at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
        at skadistats.clarity.event.Event.raise(Event.java:37)
        at skadistats.clarity.processor.reader.InputSourceProcessor.processEmbedded(InputSourceProcessor.java:247)
        at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
        at skadistats.clarity.event.Event.raise(Event.java:37)
        at skadistats.clarity.processor.reader.InputSourceProcessor.processSource(InputSourceProcessor.java:174)
        at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:86)
        at skadistats.clarity.event.Event.raise(Event.java:37)
        at skadistats.clarity.processor.runner.AbstractFileRunner.initAndRunWith(AbstractFileRunner.java:39)
        at skadistats.clarity.processor.runner.SimpleRunner.runWith(SimpleRunner.java:33)
        at skadistats.clarity.examples.combatlog.Main.run(Main.java:240)
        at skadistats.clarity.examples.combatlog.Main.main(Main.java:247)
        ... 6 more

when I log the entity, It's fine and I can see the properties and their values.

Where did I go wrong?

Hero Inventory

I am trying to get the heroes inventory at different times using the below code:

//get hero inventory
for(int slot = 0; slot <= 13; slot++){
    String slotNumber = String.format("%02d", slot);                            
    int item_id = (int)getEntityProperty(e, "m_hItems.00"+slotNumber, null);

    Entity item = ctx.getProcessor(Entities.class).getByHandle(item_id);
    if (item != null) {
        entry.items[slot] = item.getDtClass().getDtName().toLowerCase();
    } else {
        entry.items[slot] = Integer.toString(item_id);
    }
}

The issue that I'm having is that I'm getting a generic CDOTA_Item class for most of the items. Any reason why this might be happening?

Thanks in advance

Unable to use the "seek" runner

Hey,

I'm trying to run the "Seek" example. But it seems to get stuck after the very first runner.seek(nextTick) call.

This is the exception trace I'm getting:

---START---
Exception in thread "clarity-runner" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Baseline for class CWorld (696) not found.
at skadistats.clarity.event.Event.raise(Event.java:25)
at skadistats.clarity.processor.runner.AbstractFileRunner.initAndRunWith(AbstractFileRunner.java:23)
at skadistats.clarity.processor.runner.ControllableRunner$3.run(ControllableRunner.java:207)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Baseline for class CWorld (696) not found.
at skadistats.clarity.event.Event.raise(Event.java:25)
at skadistats.clarity.processor.reader.InputSourceProcessor.processSource(InputSourceProcessor.java:139)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:72)
at skadistats.clarity.event.Event.raise(Event.java:23)
... 3 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Baseline for class CWorld (696) not found.
at skadistats.clarity.event.Event.raise(Event.java:25)
at skadistats.clarity.processor.reader.InputSourceProcessor.processEmbedded(InputSourceProcessor.java:248)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:72)
at skadistats.clarity.event.Event.raise(Event.java:23)
... 6 more
Caused by: java.lang.RuntimeException: Baseline for class CWorld (696) not found.
at skadistats.clarity.processor.entities.Entities.getBaseline(Entities.java:235)
at skadistats.clarity.processor.entities.Entities.onPacketEntities(Entities.java:154)
at skadistats.clarity.event.AbstractInvocationPoint.invoke(AbstractInvocationPoint.java:72)
at skadistats.clarity.event.Event.raise(Event.java:23)
... 9 more
ERROR: transport error 203: Timed out waiting for connection
JDWP exit error JVMTI_ERROR_NONE(0): could not connect, timeout or fatal error [transport.c:326]
ERROR: transport error 203: Timed out waiting for connection
JDWP exit error JVMTI_ERROR_NONE(0): could not connect, timeout or fatal error [transport.c:326]
---END OF EXCEPTION---

This is the replay I'm testing on: 2626915181.

The "Info" example works just fine on the same replay. The "Tick" example crashes after 7000 ticks or something as well, but I guess this is a discussion for another issue.

Thanks for all your work!

Two different class names used in different replays

I noticed after downloading a replay from gosugamers that their replays all had classes that begin with DT_DOTA instead of CDOTA. Also, the replays that used DT_DOTA only had 2048 indexes for entities, whereas replays with CDOTA had 16384 so it seems that either some information is missing in DT_DOTA games or most of the classes are combined. They seem to be very different, I'm just not sure why. Any ideas?

Can I extract the key press times?

Hi, I apologize in advance if this is a silly question, but is there any way to extract the key press time on the keyboard while playing?

Duplicates in new combat log example

Hello again :),

I'm currently trying to classify the positions of the players from the replay ("Bot, top, mid, jungle") and want to look at last hits on neutral creeps to decide if a player was jungling since the positions overlap with normal lane positions.

To do this I used your new example for the combat log, but noticed that the problem that I previously only knew from the chatlog applies: I get multiple messages for the same event.

Example for a single kill:
950.1229: npc_dota_neutral_ogre_mauler was killed by npc_dota_hero_furion
950.1229: npc_dota_neutral_ogre_mauler was killed by npc_dota_hero_furion
950.1229: npc_dota_neutral_ogre_mauler was killed by npc_dota_hero_furion
950.1229: npc_dota_neutral_ogre_mauler was killed by npc_dota_hero_furion

This was just a single neutral, but I have four messages nonetheless.
I know that a similar problem exists with chat messages and can be solved by checking if the next peek is a NetMsg. Is the solution to this problem here the same?

If any good fix is known I'd suggest to include it into the example as well.

Getting names associated with m_iUnitNameIndex

So I'm looking at CDOTA_BaseNPC_Creep_Neutral entities and I'm looking to get the name of the creep, I'm guessing located at the m_iUnitNameIndex of some stringtable. The problem is, I've tried a couple of the stringtable types that make sense (for @OnStringTableEntry("type")), and none of them seem to be giving me the right names. I've tried "EntityNames" and "CombatLogNames" and I'm getting random names for non-creeps. Is there another stringtable I'm missing or a different place to grab the names from? Thanks!

dtinspector is not working

Hi,

I cloned the example repo, and run "mvn -P dtinspector package" then "java -jar target/dtinspector.one-jar.jar 2367566543.dem", afterwards error pops up.

Here is the detail call stack. Can you please help me?

java.lang.ClassCastException: skadistats.clarity.decoder.s2.S2DTClass cannot be cast to skadistats.clarity.decoder.s1.S1DTClass
at skadistats.clarity.examples.dtinspector.TreeConstructor.(TreeConstructor.java:42)
at skadistats.clarity.examples.dtinspector.Main$1.run(Main.java:28)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Jump to tick at n-th effective minute mark

Greetings.

For a project of mine, I'm trying to read player status (gold, last hits, items ...) at the 5th, 10th, 15th minute of play. Is there a way to do so ? it is possible to jump to the tick at the n-th minute mark ?

Thanks

Seek Working?

Awesome stuff. Is the seek code done (i.e. maybe I have bad data?)

$ mvn -P seek package
$ java -jar target/seek.jar ../dota2/3.dem 
index built in 1.067s
Exception in thread "main" java.lang.IndexOutOfBoundsException: toIndex = 1
    at java.util.ArrayList.subListRangeCheck(ArrayList.java:962)
    at java.util.ArrayList.subList(ArrayList.java:954)
    at skadistats.clarity.parser.DemoIndex.prologueList(DemoIndex.java:90)
    at skadistats.clarity.parser.DemoIndex.prologueIterator(DemoIndex.java:98)
    at skadistats.clarity.examples.seek.Main.main(Main.java:26)

I got the .dem here

Building dumpbaselines builds combatlog

Building the examples (I've done like 7 of them not all of them) have all worked fine with the exception of dumpbaselines. Example code for building and running a different example that works fine:

mvn -P tick package && java -jar target/tick.one-jar.jar "C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota\replays\1782181262.dem"

The one issue I've had is trying to build dumpbaselines. Get the following warning message after running:
mvn -P dumpbaselines package && java -jar target/dumpbaselines.one-jar.jar 28517 "C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota\replays\1782181262.dem"

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.632 s
[INFO] Finished at: 2015-09-19T12:35:20-08:00
[INFO] Final Memory: 11M/244M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dumpbaselines" could not be activated because i
t does not exist.
Error: Unable to access jarfile target/dumpbaselines.one-jar.jar

In the clarity-examples\target directory, rather than a dumpbaselines and dumpbaselines.one-jar being built the corresponding one for combatlog is built. As a workaround I took the code in the dumpbaselines Main example, put it into dump and was able to build "dump" successfully and run the dumpbaseslines code under the jar name of dump and it had the desired results.

Reading the Game info

Hey!

I want to parse out the hero names at the beginning of my parsing process to be able to map them to the CDOTA_DataRadiant/Dire. They are in the PlayerRessources, but on the EntityCreated they are not yet initialized, so i was thinking why not use the Demoinfo, which looks like this:

playback_time: 4133.167
playback_ticks: 123995
playback_frames: 61997
game_info {
dota {
match_id: 2275953964
game_mode: 1
game_winner: 3
player_info {
hero_name: "npc_dota_hero_magnataur"
player_name: "Js7"
is_fake_client: false
steamid: 76561198278114357
game_team: 2
}
player_info {
hero_name: "npc_dota_hero_lina"
player_name: "Survarium"
is_fake_client: false
steamid: 76561198284699594
game_team: 2
}
...

it seems to be kind of JSON but isnt. Is it just a string fromatted this way?
I just want to read out several values like player_info->hero_name.
Problem is i could not find anything which allows me to do that, and parsing the String one by one seems a bit too much.
Does something like info.getKey("hero_name) exist and am I just to stupid to find it?

Kind regards and thx in advance
Peter

Hero net worth

Hi again,

I would like to start by thanking you for all the help in the previous issues I had. I got a new question that I would need some help on. Is the net worth value stored somewhere as a variable? I can get the gold earned, reliable gold, unreliable gold etc but I'm missing the net worth.

Thank you again.

Getting hero items

I was wondering how I would go about getting the players items at the end of the game. I looked at the example for getting the end of game stats, but am unsure how to go about getting the list of items a player has in their inventory when the game is finished.

I suspect i have to tell it the field path but am unsure what that would be or how to get it.

Thanks

Gold/XP Reasons?

The combatlog appears to support information about gold/xp sources. Is there documentation somewhere on what these IDs mean?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.