• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:34
CET 06:34
KST 14:34
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !10Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
Local food delivery apps in Panchkula – worth it? Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament
Tourneys
$100 Prize Pool - Winter Warp Gate Masters Showdow $5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BW General Discussion FlaSh on: Biggest Problem With SnOw's Playstyle soO on: FanTaSy's Potential Return to StarCraft BGH Auto Balance -> http://bghmmr.eu/ Anyone remember me from 2000s Bnet EAST server?
Tourneys
[Megathread] Daily Proleagues [BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1065 users

pyreplib - Python library to read .rep files - Page 2

Forum Index > BW General
Post a Reply
Prev 1 2 3 Next All
Raithed
Profile Blog Joined May 2007
China7078 Posts
July 02 2008 17:40 GMT
#21
On July 03 2008 02:31 evanthebouncy! wrote:
Ahh not sure if it's possible but is it possible to make a Starcraft screensaver that plays replays?

OMFGGGGGGGGGG
DrainX
Profile Blog Joined December 2006
Sweden3187 Posts
July 02 2008 17:47 GMT
#22
On July 03 2008 02:31 evanthebouncy! wrote:
Ahh not sure if it's possible but is it possible to make a Starcraft screensaver that plays replays?

I think that would be hard without having a script or something that actualy starts starcraft :S Unless you have starcraft running in the background or something I think it would be anoying having it start everytime you dont move your mouse for 5 minutes
gnuvince
Profile Joined June 2007
Canada73 Posts
July 02 2008 17:52 GMT
#23
CaucasianAsian: The idea is that this will be a library, so people can use it to build programs. You could see a clone of bwchart or, as was mentionned, plugins for IRC bots. Anything's possible really. I have a plan for meself, but I won't talk about it just yet Also, Python is more easier to use than C++, so this may get more people interested in toying around.

Raithed: Lots of difference. Python is a very high-level language, C is low-level; Python is dynamically typed, C is statically typed; Python is object-oriented, C is not; etc. Basically, Python allows a programmer to concentrate more on the task at hand than on details such as memory management, memory alignment, etc.

overpool: Different people, different tastes. That's why there are so many languages And it's the whole idea between the JSON, XML and YAML dump: give something easy to work with to programmers who prefer Perl or Haskell or Scheme or Java or... Out of curiosity, what language(s) do you like?

evanthebouncy!: It's doubtful. IIRC, on Windows a screensaver is basically a program (.exe) whose extension was changed to .scr.
DrainX
Profile Blog Joined December 2006
Sweden3187 Posts
July 02 2008 18:05 GMT
#24
You can program object oriented in C though even if it has no support for it =P
gnuvince
Profile Joined June 2007
Canada73 Posts
July 02 2008 18:46 GMT
#25
DrainX: you can, but then, why not use a real OO language?
DrainX
Profile Blog Joined December 2006
Sweden3187 Posts
July 02 2008 19:04 GMT
#26
On July 03 2008 03:46 gnuvince wrote:
DrainX: you can, but then, why not use a real OO language?

I want to ask my professor that
anotak
Profile Blog Joined March 2008
United States1537 Posts
July 03 2008 01:54 GMT
#27
On July 03 2008 02:52 gnuvince wrote:
You could see a clone of bwchart

that's what i was going to work on actually, bwchart needs a lot of improvement

gnuvince
Profile Joined June 2007
Canada73 Posts
Last Edited: 2008-07-07 16:47:06
July 07 2008 01:27 GMT
#28
Hey everyone,

I worked really hard this week on pyreplib, and I'm happy to give you the Google Code URL (if you didn't find it already ) to checkout the latest version:

http://code.google.com/p/pyreplib/source/checkout

This should not be considered as an official release; I am putting it out there so that people can start toying around with it and give me feedback. This is mostly for other developers, there's nothing user friendly about it at the moment. In the next few days/weeks, I'm going to try and improve the design as some parts of it (especially in pyreplib.actions.Field) bother me, so you can expect the API to change, maybe significantly. I would advise against starting projects that use this library just yet.

To those who want to lend a hand, I won't accept patches just yet (because of the overhaul that may be forthcoming), but here are some things that could greatly help me:

  • Trying the library with Python 2.3 and 2.4
  • Trying the library on Windows and MacOS X
  • Usability problems with the API (e.g.: performing x operation is awkward.)
  • Comments on the code from Python experts, particularly on pyreplib.actions
  • Tips, hints, advice, etc. from other developers who worked on .rep-related tools


There's not a whole lot of documentation yet, so here's the gist of it:


>>> from pyreplib import replay

>>> rep = replay.Replay('prog/python/pyreplib/misc/StorkKal.rep')

>>> rep.humans

[<Player: Stork (Protoss)>,
<Player: STX Siz)Kal (Protoss)>,
<Player: Mani and Tasteless OWN (Zerg)>]

>>> rep.map_name
'\x04Andromeda \x051.0'

>>> rep.players[0].apm_stats() # Min, Avg, Max
(212, 279, 455)

>>> rep.players[1].apm_stats() # Min, Avg, Max
(305, 367, 490)

>>> rep.players[2].apm_stats() # Tasteless is _so_ slow!
(8, 24, 46)

>>> len(rep.players[1].actions)
8595

>>> from pyreplib import actions

>>> sum(1 for a in rep.players[1].actions if isinstance(a, actions.Hotkey))
4225


Thank you, I'll keep you informed on my progress.
HeadBangaa
Profile Blog Joined July 2004
United States6512 Posts
July 07 2008 02:15 GMT
#29
Python! IDLE!

I've been using Jython scripts lately as helpers/glue in my Java environment (mostly for builds and testing). eg, you can write objects in Java and use/extend them in Python environment. It's 100% Java backend; pretty awesome. Could even use the C/Win32 API calls, if you use a Microsoft JVM.

Thanks for sharing your source, I'm curious how it works. Gonna take a look later. =]
People who fail to distinguish Socratic Method from malicious trolling are sadly stupid and not worth a response.
Slithe
Profile Blog Joined February 2007
United States985 Posts
July 07 2008 02:16 GMT
#30
Looks like a pretty awesome job you've been doing so far. And it's in python, which is practically pseudocode :D. I'm gonna start playing around with this asap.
Slithe
Profile Blog Joined February 2007
United States985 Posts
July 07 2008 02:26 GMT
#31
Regarding C vs python, You can probably get a lot better performance in C. However, for something like this there probably isn't much advantage in using a low level language.
gnuvince
Profile Joined June 2007
Canada73 Posts
Last Edited: 2008-07-07 02:33:22
July 07 2008 02:32 GMT
#32
On July 07 2008 11:26 Slithe wrote:
Regarding C vs python, You can probably get a lot better performance in C. However, for something like this there probably isn't much advantage in using a low level language.


Most likely. However, I find it's much easier to code in Python, and since I use C for the unpacking, which is one of the heaviest part CPU-wise, I think performance can be reasonable. As it stands now, it's not really however: it takes slightly more than one second to load a replay file, so I'm gonna be looking at improving performance in the future, but not until I get my design right.

Remember:

1. Make it work
2. Make it right
3. Make it fast (optional)

and of course

"Premature optimization is the root of all evil."

Cheers, if you check it out, let me know what you think.
gnuvince
Profile Joined June 2007
Canada73 Posts
July 07 2008 02:36 GMT
#33
On July 07 2008 11:15 HeadBangaa wrote:
Python! IDLE!

I've been using Jython scripts lately as helpers/glue in my Java environment (mostly for builds and testing). eg, you can write objects in Java and use/extend them in Python environment. It's 100% Java backend; pretty awesome. Could even use the C/Win32 API calls, if you use a Microsoft JVM.

Thanks for sharing your source, I'm curious how it works. Gonna take a look later. =]


If you're interested in programming languages in general, I invite you to check out Clojure. It's a Lisp dialect built on the JVM (it has full access to all Java libraries), it has built-in support for concurrency and, well, it's a Lisp! Who doesn't love Lisp?
chebychev
Profile Joined May 2008
United States4 Posts
July 12 2008 20:59 GMT
#34
This is really great! I'm just starting to play around with it. One question: does it use a different algorithm from bwchart to determine APM? I'm not sure if there's a "standard" or not, but I'm getting slightly different numbers.
gnuvince
Profile Joined June 2007
Canada73 Posts
Last Edited: 2008-07-13 03:25:31
July 12 2008 21:16 GMT
#35
As I understand it, bwchart discards the actions from the first 80 seconds. Currently, pyreplib does not. In fact, I'm wondering if having an APM calculator in there is "right". It seems that calculating the APM belongs more to the application.
Slithe
Profile Blog Joined February 2007
United States985 Posts
July 14 2008 05:54 GMT
#36
Yeah I don't think you should put in an apm calculator. It would be unnecessary bloat imo. Keep the library as compact as possible.
gnuvince
Profile Joined June 2007
Canada73 Posts
July 14 2008 14:39 GMT
#37
Slithe: I think I'll add a utils module. I'll remove the APM methods from the Player class and move them as functions into this new module. This way, if people do not want to write their own, they can use what's provided, but people who wish to create their own APM functions can do so without a penalty.
RaGe
Profile Blog Joined July 2004
Belgium9949 Posts
July 14 2008 14:45 GMT
#38
On July 14 2008 23:39 gnuvince wrote:
Slithe: I think I'll add a utils module. I'll remove the APM methods from the Player class and move them as functions into this new module. This way, if people do not want to write their own, they can use what's provided, but people who wish to create their own APM functions can do so without a penalty.

That, indeed, sounds like the best way. You could talk to tec27 about the calculation algorithm, he's been doing a lot of research on that, although that was for live calculation.
Moderatorsometimes I get intimidated by the size of my right testicle
gnuvince
Profile Joined June 2007
Canada73 Posts
July 14 2008 14:58 GMT
#39
RaGe: I don't think doing APM calculation when you have the entire data is too complicated; number of actions / number of minutes. The only difficulty I can foresee would be to allow the user to specify a number of initial seconds to ignore to prevent early game spamming from skewing the numbers.

Doing it live (WE'LL DO IT LIVE!) does present a much greater challenge however.
alien3456
Profile Joined June 2007
United States115 Posts
July 14 2008 15:01 GMT
#40
Screensaver sounds possible, though it would be an entirely different project unrelated to gnuvince's pyreplib (which is an awesome idea, btw. great work). Code a program to load starcraft, macro the mouse clicks to the replay (hardest part would be identifying which replay to watch, because there's no way to type it in, you have to click through folders), and closing out of starcraft when the mouse moves. But unless it's a FPV replay, the screen is just going to sit there, making the screensaver kind of boring.

I program in Python for fun whenever I have a stupid idea. I'll try out pyreplib, sounds awesome.
Prev 1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 6h 26m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft747
RuFF_SC2 221
StarCraft: Brood War
BeSt 203
Leta 121
ggaemo 74
ZergMaN 40
Mind 29
Icarus 10
ajuk12(nOOB) 9
Bale 7
Dota 2
monkeys_forever368
LuMiX0
League of Legends
JimRising 616
Counter-Strike
summit1g4567
Super Smash Bros
hungrybox2186
C9.Mang0483
Westballz38
Organizations
Other Games
gamesdonequick980
BasetradeTV13
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• practicex 20
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki23
• Diggity8
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush940
• Lourlo936
Upcoming Events
WardiTV Invitational
6h 26m
Gerald vs YoungYakov
Spirit vs MaNa
SHIN vs Percival
Creator vs Scarlett
Replay Cast
1d 3h
WardiTV Invitational
1d 6h
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
2 days
Sparkling Tuna Cup
4 days
Krystianer vs TBD
TriGGeR vs SKillous
Percival vs TBD
ByuN vs Nicoract
Replay Cast
5 days
Wardi Open
5 days
Liquipedia Results

Completed

Proleague 2025-12-22
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.