Jump to content

Sonarpulse

Members
  • Content count

    307
  • Joined

  • Last visited

Everything posted by Sonarpulse

  1. Sonarpulse

    PortableRA Beta

    Who recreated that? Is there an original PSD?
  2. ...I wonder if PNG could ever sniff out the game's pallet automatically
  3. Sonarpulse

    A command line Mix editor

    Oh. Well that is not an intractable engineering issue.
  4. Sonarpulse

    A command line Mix editor

    But what's the downside of AOT all the time for release builds?
  5. Sonarpulse

    A command line Mix editor

    hmm? VMs definitely hamper performance. I guess you can run multiple programs under the same VM to save on process start-up time, but threads also solve that problem.
  6. Sonarpulse

    A command line Mix editor

    Oh that wasn't supposed to be a dig on c# in particular (and certainly not anything you wrote). Mono is a great project, but the idea of any language mandating that it must be compiled to a VM binary strikes me as a bad engineering. The performance impact is usually not an issue so that doesn't concern me. Edit: Also github is removing their download's feature. Stuff already there will be hosted for another 90 days but I guess I'll be putting new binaries on mediafire or something.
  7. Sonarpulse

    A command line Mix editor

    Yeah C is really not worth it in this situation. I mean installing virtual machines can be annoying, but there are plenty of languages that will give you a good old, self-contained, native binary. Haskell included. And if performance really becomes an issue, there is always the foreign function interface (or compiling Haskell to C, but good luck reading that!)
  8. Sonarpulse

    A command line Mix editor

    Thanks, and it's fine. If either of you ever change your mind the code will still be there to look at. And at least you did some scheme and presumably liked it more than Haskell.
  9. Sonarpulse

    A command line Mix editor

    (define (my-map f lst) (cond [(null? lst) '()] [(cons? lst) (cons (f (car lst)) (my-map (f (cdr lst))))])) myMap f lst = case lst of [] -> [] (( _ _) -> (( (f (head lst)) (myMap f (tail lst))) This first line a the type signature. It shows that myMap takes two arguments: a function of type a to type b and a list of type a. It also shows that it returns a list of type b. The type signature is usually optional (it is in this case for example) but sometimes it is useful of the code itself is ambiguous. the patterns to the left of the "->"s are used in pattern matching. Basically it's a way to dynamically dispatch based on type. You can achieve the same thing with predicates and cond in scheme (as I have done), but pattern matching is a bit more succinct, and limiting case to type-based branching helps the compiler optimize. This is probably the most foreign concept for schemers trying Haskell, but it's a nice feature once you get used to it. [] is an empty list : is cons. You can't use any old function in pattern matching, but you can use constructors, which are implicitly defined with data definitions. so the second pattern will match a non-empty list you can also use a pattern match for variable binding. That's how car and cdr were defined in my previous Haskell code. Here though i used "_" to signify I didn't want to bind any variables, and instead used head and tail in my code (same as car and cdr in lisp) in the call. Lastly, functions containing only non-alphanumeric characters are used in infix notation by default. By wrapping ":" in parenthesis, I show I want to use them in prefix notation. http://en.wikipedia.org/wiki/Pattern_matching EDIT: does anybody know why the latest version of IPB has serious bugs with leading whitespace in tags?
  10. Sonarpulse

    A command line Mix editor

    Aha, that example illustrates a couple types syntactic sugar in Haskell. It really is the same map as in scheme, except you can only map over one list with it. Maybe this will help: myMap :: (a -> -> [a] -> [b] myMap f lst = case lst of [] -> [] (( car cdr) -> (( (f car) (map f cdr)) Here's map, also in perfectly valid Haskell, but perhaps written in a more 'scheme-like' manner. There is a tool hlint (http://community.has...org/~ndm/hlint/) that works like C's lint in that it gives you suggestions on how to shrink your code. If you were to run it repeatedly on my code there, making it's suggested changes, I almost guarantee you would arrive at Wikipedia's version.
  11. Sonarpulse

    A command line Mix editor

    Well for one the compiler is much more advanced. Haskell binaries don't have the overhead of a virtual machine. Also unless you use some foreign code very intensionally, your code will probably be completely cross platform without any extra work. Many functional programmers would probably say the style is more intuitive, though if you are used to something else Ill readily admit that is pretty negated. I haven't used c# but my guess I like java it has no type inference. I did scheme first but I have grown to love static typing and type inference. I truly have grown quite lazy about testing my code because honestly, if it type checks it probably works. And type inference means you get all the benefits of type checking without having to type anything extra. Anyways you are right. Haskell does have a bunch of syntactic constructs that are very foreign for imperative programmers. I would start with scheme or some other lisp dialect, which all effectively have 1 syntax. Then once you are used to functional semantics, Haskell and its ML cousins will make much more sense.
  12. Sonarpulse

    A command line Mix editor

    Well, try it out! If you have never done any functional programming before, Haskell will blow your mind
  13. Sonarpulse

    A command line Mix editor

    Thanks! Feel free to fork me code or whatever, besides the bug I list below it's time to start on red alert mixes. Found an error: print doesn't like the arguments you need it. I happen to be on windows, so i'll upload the fix in a second (I know what the problem is).
  14. Well, then let's back it up! It's downtime should be a warning to us. The thing is hosted by dynamic DNS anyways.
  15. In the long run it would be interesting to see if we can get the game to read other video formats using the mpgdll interface. For now though, I am sure hifi will be thrilled to removed that one last pesky library from the game. Good work Iran!
  16. Sonarpulse

    A command line Mix editor

    OK, I did everything I said I was going to. there is now "mod" mode which supports adding and removing, "info" mode which can print the mix type or a list of IDs, and extract mode which will extract all files. You can also make the modified mix have a different name than the original. The name+ids bug has been fixed, along with the fact where I had it so if I was merging files and the ids matched but the strings didn't, the files would not be merged. Github should be updated new binaries shortly. The short story is for TD this should now be basically complete. I don't know of any bugs in it ATM. So please everybody test this. Edit: Binaries Updated: https://github.com/Sonarpulse/CnC-Red-Alert/downloads
  17. Sonarpulse

    Cannot install patch 1.03 - 4 on Win 7

    If you know how to use the registry, it should be sufficient to move the files where you want them and tweak the keys there.
  18. Sonarpulse

    CnC Sole Survivor

    damn it Nyerguds!
  19. Sonarpulse

    CnC Sole Survivor

    Honestly, people dismiss Soul Survivor. But doesn't it completely anticipate DOTA?
  20. does anybody have the source of RAED?
  21. Sonarpulse

    A command line Mix editor

    Well I was purposefully using that example to show "repairing" an invalid mix. But the problem is completely seperate from collisions. It's really a very simple issue, I must have been unclear: Lets say you have a mix with files a b c d, and you tell cncmix to remove files b and c. You end up with a c d in your mix, because the cncmix improperly ignored the second file to be removed. cncmix's delete command currently takes a list of file names and a list of ids: cncmix delete -I path/to/mix -n name1 name2 name3.... -i ID1 ID2 ID3 ID14 unfortunately that command will only remove files matching name1 or id1. even though you told it to also remove name2 name3 name4.. and id2 id3 id4... it doesn't do anything with regard to those names and IDs. My latest plan and yours for deleting and add/replacing together are very similar, except with mine you are stuck with the name the file has (else you couldn't recur into sub directories).
  22. Sonarpulse

    A command line Mix editor

    This issue is just for removing. Adding/replacing/creating mixes is not affected by this bug. It's supposed to see if a file matches any of the id's or names listed. The problem is simple, it only checks the first name and ID you listed as a argument. All files in the mixed are checked but because of this bug you can only match one ID and name at a time. If the multiple files match in the mix, however, they will still be removed. For exmaple: If I have a bad mix with two files named "eva1.aud", and another named "rules.ini", and i tell it to remove files named "eva1.aud" or "rules1.ini", the mix will be remade with both eva1.auds removed, but rules.ini still there because it never did anything with the second name listed. Ah ok. I think though to simplify things I will just combine create/add/replace and remove into one interface : --add [files] --remove [names and IDs]. Adding will take place before removing, because adding will also replace as before. This also means if you are creating a new mix you can easily add all the files in a folder (specify folder name/path) except a list of files you have it filter out after. Glad to help If you want I can also include a hashing function to work on file contents.
  23. Sonarpulse

    A command line Mix editor

    Add, Replace, and Create are all one interface, yes. I'll probably added "append" to combine to mixes, which will be a seperate interface, else you couldn't include mix files in other mix files. --safe starts with an empty list, and adds everyfile one at a time, checking for collisions each time. If there is a collision it replaces. There difference is more subtle with adding files to a mix: because it checks for collisions with the new files either way. However if the mix before adding contains a collision, you need safe to catch it. I should really read about what stage shells manage regex and quotes. I swear escaping and meta-programming couldn't be more complicated than in shell scripting. It's actually quite simple. You specify a list of names, and/or a list of IDs to filter the list of files by. Problem is, it is only using the first ID and the first name specified to filter. The rest are ignored. The name ID bug is the bug listed above. I've sort of hinted at in the above descriptions, but the way my tools is even more conceptually simple: Convert mix to list of files with with name (if it has one) and ID Use the list manipulating tools built into Haskell to manipulate the list Convert the list into a mix The only reason I didn't have filenames match files with the same ID but none/a diferent name is because I didn't want to expose my ID making function to the CLI. But I realized I have already encapsulated it in a function perfect for the task. Once I use it, you will be able to freely mix names and IDs in the filter list, just prefix the IDs with 0x. (it is the same function used to get the names+IDs from real file-names). The challenge for scripts is I never have more than a small part of the mix in memory. And yet If simply read an write back to real file multiple times, I end up needlessly unpacking and repacking the mix. The thing to do is to read the script as a seize of operations, compose those operation into a single operation, and then apply that operation to a real mix so it is only unpacked and repacked once. Haskell itself has an excellent method to compose operations listed serially/imperatively called Monads. The problem is using this in my own CLI. BTW, if you were planning on using this tool client-side in your installer, then that would be IMO a situation were modifying an existing mix (to save bandwhith and avoid extra "update*.mixS) is the best solution. If that is what you were thinking of all along, my apologies.
  24. Sounds good! Do you overwrite your history in your fork of 3.03p? If not I will try to pull your changes into my repo. BTW your fork isn't currently listed as a fork on github. You may want to change that for neatness's sake (or I am just OCDing).
×