peterigz

Forum Replies Created

Viewing 15 posts - 136 through 150 (of 174 total)
  • Author
    Posts
  • in reply to: Need help converting monkey 1 to monkey 2 code. #1439

    peterigz
    Participant

    Are you wanting T to be a generic type? I think you’re just missing the <T> after the class declaration..

    in reply to: MX2 Stability #1255

    peterigz
    Participant

    For something that’s still pre-release I’d say it’s very stable, and also very fast 🙂

    in reply to: Sublime Text 3 language file and snippets #1252

    peterigz
    Participant

    I use a javascript linter which basically underlines syntax and other common errors like undefined variables (picks out typos), and it also alerts to bad coding practices, like only putting an “end” instead of “end if” as I’ve been doing 🙂

    There’s some more info about the SublimeLinter here http://www.sublimelinter.com/en/latest/about.html

    in reply to: Sublime Text 3 language file and snippets #1242

    peterigz
    Participant

    That actually raises an interesting point, I always used a prefix for classes to avoid potential clashes with other mods, but now we have namespaces I guess that’s not so necessary.

    Thanks for the new version 🙂 I wonder how easy a monkey2 Linter would be to make…

    in reply to: Collision module and performance #1231

    peterigz
    Participant

    Thanks! All fixed now. Thought there might be other issues as I had to merge some changes but obviously couldn’t test 🙂

    in reply to: Collision module and performance #1228

    peterigz
    Participant

    Got this pretty much all working now 🙂 I do have one issue though, I just started updating the docs but now for some reason it hangs when compiling, doesn’t get passed “Parsing”:

    [/crayon]

    I’m not sure sure what I’ve done other then add in some docs. Latest version is on github: https://github.com/peterigz/timelinefx.monkey2

    in reply to: Sublime Text 3 language file and snippets #1227

    peterigz
    Participant

    Ahh the end if fixed most issues, thanks. It still doesn’t seem to highlight Interface or Class though eg:

    in reply to: Sublime Text 3 language file and snippets #1223

    peterigz
    Participant

    Thanks for this 🙂 For some reason sometimes things don’t get highlighted (see attched), any idea why that might be? Sometimes other things like Method or Class don’t get highlighted either.

    in reply to: Collision module and performance #1191

    peterigz
    Participant

    Thanks Mark, yes I actually realised what you meant about the += and edited my post before you saw I think. I did add that operator to my vec class and it did help so that’s good.

    That’s good about Top too, I was hoping it’d be the same as Last 🙂

    in reply to: Collision module and performance #1182

    peterigz
    Participant

    Thanks, fixed. Although I still have work to do on some of those quadtree methods. Is there an equivalent to .Last for stacks by the way? I’m guessing Top is the same as First?

    I see what you mean about += operator, yes that does seem to sort it. The Clone method really kills it though (about 500k less), a bit odd?

    [/crayon]

    But then again I get different results elsewhere and clone seems fine. I think I’ll just put it down to the compiler and how it evaluates things in its own exotic way!

    in reply to: Collision module and performance #1179

    peterigz
    Participant

    My latest round of optimisations is now up to 5.6mill/sec which I’ll settle for for now, really pleased with that. I’ve learnt quite a few things along the way, and also some oddities. It’s definitely ok to modify the fields of a struct in some cases so I won’t worry to much about that, for example this:

    [/crayon]

    worked out quicker than:

    [/crayon]

    So I guess if your struct already exists and you need to clone it or change values then it can be ok. But in this case:

    vec.Normalise()

    Where the normalise method modifies the fields of the vector was quite a bit slower than:

    vec = vec.Normalise()

    Where it returns a new normalised vec. It’s really nice that mx2 gives you that extra control to make a difference with the speed of a program.

    in reply to: Collision module and performance #1166

    peterigz
    Participant

    I think I’ll aim towards the immutable approach as that seems to make more sense to me, and it helps to make structs stand out more in my head. I’m happy that just using them as they are is enough for a big speed boost 🙂

    I looked at circular queues for particles; they look interesting but unfortunately my particles are quite complex with variable lifetimes, so will just have to use a normal stack I guess.

    in reply to: mapping input controls to key #1156

    peterigz
    Participant

    Try adding

    New AppInstance

    At the start of main, I think that initialises a load of stuff in mojo so it’s ready for use.

    in reply to: Collision module and performance #1155

    peterigz
    Participant

    That’s interesting, so if I have a method in a struct it shouldn’t modify the field values I should create a new struct with updated values and return that? It’s making more sense now, I still have it in my head that creating things puts load on the GC but of course that doesn’t happen with structs because they’re on the stack. It seems kind of the other way round with structs in that it’s cheaper to create and let them go rather then change their values.

    Thanks for the info on particles I’ll look into that 🙂

    in reply to: error: 't_std_geom_Vec2_1' does not name a type #1153

    peterigz
    Participant

    Vec2 in std needs a type to specify whether is an integer or a float vec, so you can use either 1 of 2 aliases:

Viewing 15 posts - 136 through 150 (of 174 total)