StatsHelix / demoinfo

A library to analyze CS:GO demos in C#
MIT License
321 stars 78 forks source link

Plans on POV demo analyser #106

Open MrMinicop opened 8 years ago

MrMinicop commented 8 years ago

Hi, any plans on implementing POV demo analyzer? I've tested valve tool on github and it can read POV demos so I assume that it's not that hard to do if you already implemented GOTV, in terms of code adjustments. Or there are some issues with POVs?

0BuRner commented 8 years ago

You should be able to parse POV demo if you use the SLOW_PROTOBUF condition when compiling.

main-- commented 8 years ago

@MrMinicop What exactly do you mean? AFAIK both POV and GOTV demos use the same file format which demoinfo is able to parse. Are you getting wrong data from your POV demos? Is the parser crashing?

MrMinicop commented 8 years ago

@main-- I've tried to use demo project to parse POV demos but it generated no data. I'm not pretty sure but as far as I remember there was a note somewhere that POV demo parsing isn't working. Maybe demo project is for GOTV demos only?

@0BuRner I'll try, thanks. Is it documented somewhere?

main-- commented 8 years ago

@MrMinicop What exactly do you mean with that? Are you just not getting any gameevents? Are there never any entities or they don't move? We never consciously limited this project to POV demos and definitely ran some early tests with those, so I'd expect them to work.

Regarding the SLOW_PROTOBUF option mentioned by @0BuRner: All you need to do is clone the git repo, enable the SLOW_PROTOBUF compile option for the demoinfo project and add the protobuf dependency. However, this should not be necessary in practice as SLOW_PROTOBUF is not designed to have any use in production (it's mostly intended for demoinfo debugging). In particular, it doesn't change any major code paths.

MrMinicop commented 8 years ago

@main-- I'll double check POV demos again and get back with information

MrMinicop commented 8 years ago

@main-- Results are ready. I've used this demo project https://github.com/EHVAG/demostatistics-generator/blob/master/README.md#usage-of-demoinfo-public

When I open GOTV demo with it - it returns xls with stats. When I open POV demo - I get this error:

System.NullReferenceException: Object reference not set to an instance of an object.  
   at DemoInfo.DP.Handler.PacketEntitesHandler.Apply(PacketEntities packetEntities, IBitStream reader, DemoParser parser)  
   at DemoInfo.PacketEntities.Parse(IBitStream bitstream, DemoParser parser)  
   at DemoInfo.DP.DemoPacketParser.ParsePacket(IBitStream bitstream, DemoParser demo)  
   at DemoInfo.DemoParser.ParseDemoPacket()  
   at DemoInfo.DemoParser.ParseTick()  
   at DemoInfo.DemoParser.ParseNextTick()  
   at DemoInfo.DemoParser.ParseToEnd()  
   at StatisticsGenerator.MainClass.Main(String[] args) in E:\Downloads\demostatistics-generator-master\StatisticsGenerator\Program.cs:line 209

Line 209 is: parser.parseToEnd()

main-- commented 8 years ago

That does look like a bug to me - does this happen with all POV demos?

By the way, you can get a better stack trace if you clone the repo and add a project reference instead of using nuget.

MrMinicop commented 8 years ago

@main-- I've tried to record own pov demos and to download them from hltv.org - same result. Interesting fact - after error is thrown, new empty csv file is created with correct map name in the filename.

Also tried to build with project reference, here is the stack:

at DemoInfo.DP.Handler.PacketEntitesHandler.Apply(PacketEntities packetEntities, IBitStream reader, DemoParser parser) in E:\Downloads\demoinfo-master\DemoInfo\DP\Handler\PacketEntitesHandler.cs:line 47
   at DemoInfo.PacketEntities.Parse(IBitStream bitstream, DemoParser parser) in E:\Downloads\demoinfo-master\DemoInfo\DP\FastNetmessages\PacketEntities.cs:line 31
   at DemoInfo.DP.DemoPacketParser.ParsePacket(IBitStream bitstream, DemoParser demo) in E:\Downloads\demoinfo-master\DemoInfo\DP\DemoPacketParser.cs:line 38
   at DemoInfo.DemoParser.ParseDemoPacket() in E:\Downloads\demoinfo-master\DemoInfo\DemoParser.cs:line 653
   at DemoInfo.DemoParser.ParseTick() in E:\Downloads\demoinfo-master\DemoInfo\DemoParser.cs:line 633
   at DemoInfo.DemoParser.ParseNextTick() in E:\Downloads\demoinfo-master\DemoInfo\DemoParser.cs:line 544
   at DemoInfo.DemoParser.ParseToEnd(CancellationToken token) in E:\Downloads\demoinfo-master\DemoInfo\DemoParser.cs:line 529
   at DemoInfo.DemoParser.ParseToEnd() in E:\Downloads\demoinfo-master\DemoInfo\DemoParser.cs:line 520
   at StatisticsGenerator.MainClass.Main(String[] args) in E:\Downloads\demostatistics-generator-master\StatisticsGenerator\Program.cs:line 209
MrMinicop commented 8 years ago

@0BuRner btw, could you please help me, where do I use slow_protobuf exactly? I would like to try it with pov demos.

moritzuehling commented 8 years ago

Hey,

there are indeed two different bugs with POV-demos. One is fairly easy to resolve (as @0BuRner said, by enabling SLOW_PROTOBUF) - however the other one will be a bit nasty, and no demoparser implements it yet, and will lead to getting wrong data from demos.

This is definitively open for a pull-requests. Especially to make them at least parse with SLOW_PROTOBUF shouldn't be too hard. Sadly neither me nor @main-- can really help you on the details, for various reasons. However, if you have a pull-request we'll gladly review and merge it.

MrMinicop commented 8 years ago

@moritzuehling I would like to help with coding, but I'm not a C# developer :( I can help only with testing, so if someone needs to test something - I'm ready.

crimsdings commented 8 years ago

i ran into the same problem, but i fail to understand on howto enable SLOW_PROTOBUF - is there some documentation somewhere ?

moritzuehling commented 8 years ago

Hello Crimsdings, look at the Microsoft-Documentation on this topic: https://msdn.microsoft.com/en-us/library/4y6tbswk.aspx