|
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
|
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
|
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.
|
You can program object oriented in C though even if it has no support for it =P
|
DrainX: you can, but then, why not use a real OO language?
|
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
|
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
|
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.
|
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. =]
|
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.
|
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.
|
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.
|
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?
|
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.
|
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.
|
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.
|
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.
|
Belgium9949 Posts
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.
|
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.
|
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.
|
|
|
|
|
|