Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc2printer wrong magic #7

Closed
g4borg opened this issue Mar 20, 2011 · 7 comments
Closed

sc2printer wrong magic #7

g4borg opened this issue Mar 20, 2011 · 7 comments

Comments

@g4borg
Copy link

g4borg commented Mar 20, 2011

the magic in sc2reader is as follows:

#!c:\Python27\python.exe

this is not good, it should be:

#!/usr/bin/env python

possibly followed by:

coding: utf-8

or else it only works if you have python there installed :) which is not an issue on windows, but an issue on unix, where this directory does not exist. :)

@GraylinKim
Copy link
Owner

Hey g4borg, good catch!

I develop about half and half in Windows and GNU/Linux but I guess I've never run sc2printer on linux to catch the error.

I notice you've made a fork, are you looking to contribute? There's always work to be done and we'd love to have you on board!

If so I'll gladly handle your pull request, otherwise I'll fix it myself.

@g4borg
Copy link
Author

g4borg commented Mar 20, 2011

yeah wrote you a message about the fork, so you can close this bug later with the cool closes #bug stanza !! :D
i would not touch your main code, I want to branch it to test out some other replays. see message.

you fix it :) i am still a github noob.

@g4borg g4borg closed this as completed Mar 20, 2011
@g4borg
Copy link
Author

g4borg commented Mar 20, 2011

ah i closed that, omg.

@GraylinKim GraylinKim reopened this Mar 20, 2011
@GraylinKim
Copy link
Owner

Opened it again. You can (I think github gives you permissions) change the status of the issues with the actions pull down at the top of the issue thread.

@GraylinKim
Copy link
Owner

I fixed the magic in commit: 29828cd

@g4borg
Copy link
Author

g4borg commented Nov 13, 2012

since i am now at writing my first network engine, i still study sc2 mechanics and mainly look at how your reader is going on (i dont know if you remember, but we talked about the magic once, and i forked sc2reader since i wanted to implement sc2 reading for starbattle maps back then)

what i noticed about learning how to write an engine is, that sc2 works as a predetermined state machine and sends only inputs, which in fact is how the replays might be saved, so basicly, your reader gives me a lot of clue now, how the sc2 engine seems to work

you would help me a lot if you would clarify me following questions:

  • you learn the second of any game event as a combination of frame >> 4, which leads me to believe, that there are 16 frames per second in the engine. am i right? that means, the sc2 integrator steps forward 16 times per second, and interpolates all movement inbetween mostly linearly to fit the fps i guess.
  • do you also track movement with your reader? (I guess no, since i didnt find any code which leads me to any sort of state integration, therefore i guess, you only scan for game events and recalculate the game by your own ruleset?)
  • maybe if my engine works flawlessly, i will try to play around wrapping some classes and moving some dots around with the replays, but i am not sure, if your reader already exposes that kind of data. is it in the stream? well if not, i am not disappointed, mostly, i study the state machine of sc2 mainly, because it helps me to see if i do my own engine right, but mostly my engine is way simpler and also not predetermination safe and works with 0.2 integration instead of 1/16th.

you can email me also directly to gab@g4b.org

i hope the questions are understandable, i would be very happy if you take your time to give an answer them, even if just short "I assume yes" :)

anything i can help, i will

c ya

Gabor Guzmics
<>< http://www.g4b.org

@GraylinKim
Copy link
Owner

since i am now at writing my first network engine, i still study sc2
mechanics and mainly look at how your reader is going on (i dont know if
you remember, but we talked about the magic once, and i forked sc2reader
since i wanted to implement sc2 reading for starbattle maps back then)

Ah, okay. You should definitely make sure to keep your fork up to date!

Also, keep in mind that there are no guarantees that event parsing for
custom games like Star Battle works. Custom maps are not currently
supported and if they work then it is sheer coincidence. If you are able to
make changes to improve custom map support I'll gladly accept them though.

what i noticed about learning how to write an engine is, that sc2 works as

a predetermined state machine and sends only inputs, which in fact is how
the replays might be saved, so basicly, your reader gives me a lot of clue
now, how the sc2 engine seems to work

Yes, the Starcraft II client is a deterministic state machine with the two
primary inputs:

  • The s2ma file - contains all the pathing info, initial unit info,
    trigger info, custom data, etc.
  • The sc2replay file - contains all the lobby parameters and
    non-derivable game events to drive the engine. Non-derivable basically
    means player initiated events, events generated by the game engine are
    generally not recorded (some exceptions).

Starcraft just loads up the initial game state and replays the events in
order.

  • you learn the second of any game event as a combination of frame >> 4,
    which leads me to believe, that there are 16 frames per second in the
    engine. am i right? that means, the sc2 integrator steps forward 16 times
    per second, and interpolates all movement inbetween mostly linearly to fit
    the fps i guess.

There are 16 frames per game second in SC2. Events come in on a frame
granularity though, so when replaying the events through an engine you'll
want to stay on the frame level. Seconds are only pulled to be more
meaningful to a human reader.

  • do you also track movement with your reader? (I guess no, since i didnt
    find any code which leads me to any sort of state integration, therefore i
    guess, you only scan for game events and recalculate the game by your own
    ruleset?)

Movement tracking would be a monumental effort. You'd need to create a very
accurate reproduction of their game engine as well as improve upon efforts
to read information out of map files. I did run into one pretty advanced
map reading tool the other day that you can check out: TL
Threadhttp://www.teamliquid.net/forum/viewmessage.php?topic_id=132627,
Unofficial Source https://github.com/RFDaemoniac/sc2-map-analyzer,
Documentationhttp://www.sc2mapster.com/assets/sc2-map-analyzer/pages/analysis-details/
.

  • maybe if my engine works flawlessly, i will try to play around wrapping
    some classes and moving some dots around with the replays, but i am not
    sure, if your reader already exposes that kind of data. is it in the
    stream? well if not, i am not disappointed, mostly, i study the state
    machine of sc2 mainly, because it helps me to see if i do my own engine
    right, but mostly my engine is way simpler and also not predetermination
    safe and works with 0.2 integration instead of 1/16th.

sc2reader exposes raw event information as best as it possibly can. Past
that it currently has two primary services for replay files:

  • Datapacks for standard games that map raw unit/ability type ids to the
    actual abilities they represent. These datapacks are now also starting to
    support additional meta data like costs and build times.
  • Active selection and hotkey buffer tracking for every frame of the
    game.

You might want to look into creating a special datapack for your custom
games if you intend to use sc2reader for this. That way the custom units
and abilities with what ever meta data you want to give them can be
accessible via the replay just like the current standard data is.

you can email me also directly to gab@g4b.org

i hope the questions are understandable, i would be very happy if you take
your time to give an answer them, even if just short "I assume yes" :)

anything i can help, i will

c ya

Gabor Guzmics
<>< http://www.g4b.org


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-10335483.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants