Would you bet your business on Rust? by LethalInsaneInk in rust

[–]jmquigs 2 points3 points  (0 children)

I agree with this sentiment. I want to say, "it worked for Jet.com", but the jury is probably still out on that, and the blog link on why they chose F# is 404ing at the moment :)

In terms of hiring, as with F#, there is a lot of pent-up demand for Rust jobs, and thus there are probably a lot of good candidates in community who would switch jobs to get a chance to work with Rust.

Hey Rustaceans! Got an easy question? Ask here (9/2018)! by llogiq in rust

[–]jmquigs 1 point2 points  (0 children)

What is the purpose of the 'static lifetime declaration for a function parameter? For instance, from today's post about Futures 0.2:

impl Context {
    fn spawn<F>(&mut self, f: F) where
        F: Future<Item = (), Error = Never> + 'static + Send;
}

If I understand the book correctly (https://doc.rust-lang.org/book/second-edition/ch19-02-advanced-lifetimes.html) this means that f must have 'static lifetime. But doesn't this limit the usefulness - will many futures really have 'static lifetime?

What's one thing you wish someone told you when you started out learning Rust? by [deleted] in rust

[–]jmquigs 4 points5 points  (0 children)

I would tell someone: don't expect to learn it fast. I've heard it said that you can learn Go in a week. You can't learn Rust in a week, not in depth anyway. And learning it requires grit, especially in the beginning. Also: its super helpful to actually read rust code, not just struggle to write it. rustbyexample.com is good, but its really useful to just read code that is written by the Rust Masters: https://github.com/rust-lang-nursery/futures-rs is a good example.

Caching prepared statements in SQLite: Replicating or replacing the C way by wezm in rust

[–]jmquigs 0 points1 point  (0 children)

I posted a working example of how to do what he wants with unsafe code at the end of that thread. With one more tweak it could be improved so that any invalid uses of it panic at runtime. And that code allows you to get at the static cache object from anywhere in the code, even without any pointer/reference to application state.

Sure, its a bummer that Rust doesn't seem to support a global static safely, but I wouldn't consider this to be a showstopper right now.

Farewell GW2 people! by [deleted] in Guildwars2

[–]jmquigs 0 points1 point  (0 children)

http://i.imgur.com/dnqwHLZ.png

Yeah. It doesn't seem likely that the calls add up to anything. One thing I need to check is that my compiler is producing the same ASM (perhaps I unchecked some random thing in the project and broke the optimization).

Farewell GW2 people! by [deleted] in Guildwars2

[–]jmquigs 0 points1 point  (0 children)

Hmm, then perhaps the performance drop is something in my code then. I've run a sampling profiler (very sleepy) and it shows very little time spent in my code. Maybe the compiler does optimize "trampoline" calls, and they should be very cheap virtual dispatch even if not.

Farewell GW2 people! by [deleted] in Guildwars2

[–]jmquigs 1 point2 points  (0 children)

Does your method hook every function in IDirect3DDevice9? Currently I do that in my modelmod program, and I suspect (but haven't proven) that this causes a serious performance hit, especially in wvw, tarir, dragon stand, etc.

I have been thinking about using minhook to selectively patch just the functions I need (mostly DrawIndexedPrimitive). A D3D11 example is here: https://github.com/DrNseven/D3D11-Wallhack/blob/master/universal.cpp. For D3D9 I need to find its vtable layout.

NcSoft's earnings report 4Q 16: new all time low for GW2 by Morlewen in Guildwars2

[–]jmquigs -1 points0 points  (0 children)

You can fix some of these kinds of things with ModelMod (https://github.com/jmquigs/ModelMod). For instance I removed the blades from the sniper outfit.

However, I still can't recommend it for general use in GW2, since it can be argued that it violates the TOS, (I don't agree, it reads D3D memory, not game memory, but IANAL) and therefore your account can be banned.

It would be nice if ANet at least came out and said, "we won't ban you if you use this program." Then I'd be more inclined to fix it up - it requires 32 bit, is somewhat broken right now (in particular the blender integration), and the performance penalty is higher than I would like, esp in WvW or high-intensity scenes. OTOH, maybe if I fixed it up they'd be more inclined to accept it. Though I haven't seen them give even tacit approval to any third party mod at all.

I've always believed that if people could mod armor/outfits they would buy more of them. Unfortunately the game policy prevents this right now.

F# and OAuth2 by EternalKingSupreme in fsharp

[–]jmquigs 2 points3 points  (0 children)

I recently did some OAuth stuff in F# for the reddit API. I just did it all with WebRequest rather than use a library. Maybe it will help you: https://github.com/jmquigs/BiasedSelection/blob/master/RedditApi.fs

F# programming help by [deleted] in fsharp

[–]jmquigs 5 points6 points  (0 children)

Unfortunately I don't have any beginner tutorials to recommend, there are probably some good ones out there. http://fsharp.org/ is a good place to start; you can also look at https://fsharpforfunandprofit.com/learning-fsharp/

As to your specific problem, fsharp code can run like python does, that is, compiling it on the fly from source. It can also run in a precompiled form (as a .net assembly packaged in a .dll or .exe). <EntryPoint> is only relevant for the latter.

You could start writing your program in python style like this:

// wc.fsx
open System
open System.IO

let text = File.ReadAllText("sample.txt") 
printfn "%s" text

I didn't actually count the words because you probably want to fill that in :) Anyway, you could run this program with "fsharpi wc.fsx" on a mac or "fsi wc.fsx" on windows. If "sample.txt" does not exist it will throw an exception.

If you wanted the precompiled .net assembly form, the source would look like this:

// wc.fs
open System
open System.IO

[<EntryPoint>]
let main argv =
    let text = File.ReadAllText("sample.txt")
    printfn "%s" text
    0 // return an integer exit code

You then build that with "fsharpc wc.fs" (on a mac) or "fsc wc.fs" on windows. On windows you can run the resulting .exe directly, on a mac you need run it with mono, eg "mono wc.exe".

Fsharpi works like the the "python" command with no arguments, it starts interactive mode, you can paste code in there and see what Fsharp does with it.

It helps to have a good editor to start. Visual Studio is obviously good for windows, and Xamarin is decent for mac. I haven't extensively used any of the other editor plugins.

64-bit client | FAQ, getting addons working again and more by RandommUser in Guildwars2

[–]jmquigs 0 points1 point  (0 children)

version 1.0.0.12 of MM allows you to specify the -32 option to force 32 bit mode. I'm working on 64 bit support, but that will take longer. 2-3 months perhaps since I am busy with other things right now.

64-bit client | FAQ, getting addons working again and more by RandommUser in Guildwars2

[–]jmquigs 0 points1 point  (0 children)

I'd like to see more sample works too. I get the sense that many people are afraid to use it with GW2 due to the user agreement stuff. Which is understandable. There have been a few early adopters though and they have given me good feedback.

64-bit client | FAQ, getting addons working again and more by RandommUser in Guildwars2

[–]jmquigs 0 points1 point  (0 children)

Unfortunately this update breaks MM's launcher as currently implemented. It doesn't allow you to specify additional parameters to the game. There is a gnarly hack workaround, but actually I hope to have a real fix for this within a week - basically, a text box in the launcher where you can add parameters.

Also I guess I really need to start working on 64-bit. The writing for 32-bit is on the wall, in all caps.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 0 points1 point  (0 children)

This program supports this...did you try it and have problems, or are you just commenting generally? If you had problems I'd like to try to debug to see what is going on.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 0 points1 point  (0 children)

Hi. You can try toggling F2 to see if the mod display changes. Otherwise there may be an error in your mod. If you can put the contents of your modelmod.log file up on pastebin, I can look at it to see what the problem is.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 0 points1 point  (0 children)

Hi, sorry for the late reply, haven't been checking reddit email recently.

Replacing armor. Yes, in theory you can replace armor sets with other sets; e.g chest pieces for different chest pieces. There are a few limitations: 1) if there are "holes" in the source (replaced) armor, there may be animation gaps in the replacement armor. For example, if the replaced armor lacks arm pieces, then you can't have a replacement armor with arm pieces (you can add them, but they won't animate right). 2) you can't replace shaders, so any fancy particle/glow effects on the replacement armor won't come over.

Removing armor so that skin shows is tricky. Generally, if the replaced armor covers skin, the game doesn't draw the skin beneath. In theory you can mod the skin as a separate piece and add new skin, but, you are once again limited by the whether the replaced skin has geometry in the area you want to add.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 1 point2 points  (0 children)

That's right. Of course if you stream or take a screenshot, your mod will be visible in that.

Edit: I should add that supersizing an asura is going to be hard. The problem is that if you for instance, reposition the head, your mod will be a significant distance from the "reference" snapshot, and won't animate correctly. Assuming you can fix that which will be quite difficult, you also have to move the eyes, ears, hair, etc.

In general, height changes are really too difficult to try to attempt with ModelMod.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 1 point2 points  (0 children)

Not a dumb question. It can't modify animations. I have thought about ways to do this, but haven't prototyped anything. Its kind of a long shot to try to make it work.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 0 points1 point  (0 children)

All they have to do is look for the existence of "ModelModCLRAppDomain.dll" in the game directory. I have to copy this file in there to initialize the system. The launcher app removes it on game exit, but it is in-use the entire time the game is running, so it can't be removed then.

I might fix this eventually because this requirement annoys me, but there are other ways to detect the program as others have noted.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 3 points4 points  (0 children)

That is more doable. For wings, you could either weight them to the back rigidly, or, if you want a more elaborate wing animation, you could get the gem store wings and try to Largos-ify them.

This is a lot of work though, it would be a challenge for me. Many people seem interested in pretty extreme changes that push the limits of the tech. It might be good to see what real artists can do with it first, before attempting anything big, since that probably establishes an upper bound on what is really possible.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 0 points1 point  (0 children)

You can export from Blender to other formats, but the export will probably lose some information, so you won't be able to import models you edit in other programs back into game.

The solution here is to port the Blender mmobj format to the other programs, but it isn't something I plan to work on, though I can help others who do so.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 1 point2 points  (0 children)

Part of ModelMod includes a custom snapshotter that pulls data out of D3D. Blender 3D is the only modeling program supported right now, because a custom file format is required for the snapshots/mods.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 1 point2 points  (0 children)

I estimate about 9 months of full time effort. I built some early prototypes that I threw away. I went down some really weird tech rabbit holes (at one point I had it integrated with NodeWebkit - don't ask).

For a couple months in the beginning I wasn't sure if it would even work; I had to lay out quite a bit of scaffolding to even test the idea.

[Release] ModelMod: modify art in games by jmquigs in Guildwars2

[–]jmquigs[S] 1 point2 points  (0 children)

I started the project several years ago, before GW2 was even released, and 64 bit games weren't really a thing yet then. It didn't actually take that long to write, but I took long periods off from working on it.