Mark Sibly

Forum Replies Created

Viewing 15 posts - 526 through 540 (of 1,431 total)
  • Author
    Posts
  • in reply to: Ted2Go IDE #10170

    Mark Sibly
    Keymaster

    I have noticed a minor issue with the new errors window: when building modules, it doesn’t seem to clear the errors from the last build.

    in reply to: ARCore and ARKit Support? #10169

    Mark Sibly
    Keymaster

    Yes, I’m very intersted in AR too, and I already have the required hardware!

    I think the first step here would be too build a light/fast version of mojo3d for mobile – just something that only handles one light (which is what all the samples/test use) should be pretty easy to get going ASAP. I can soup it up in future as required.

    This renderer would also be useful for VR, which also needs to be nice and fast as its twice as slow.

    in reply to: Mojo3D: Built-in VR support #10168

    Mark Sibly
    Keymaster

    Oculus were giving out the full retail version to people who supported them via kickstarter

    Alas I missed the kickstarter so had to buy a dev version outright, so no freebie for me!


    Mark Sibly
    Keymaster

    Can someone please send me, or otherwise host, some content that triggers this problem?

    And also – precise instructions for how to reproduce, as I am having a hard time causing any spam filters to trigger. Do I just copy/paste ‘as is’, or do I put it in a code div or what?


    Mark Sibly
    Keymaster

    I will try (again) but I really don’t know how.

    This is the site’s anti-spam plugin, which I don’t want to just completely turn off as wordpress sites are apparently easy targets for hackers/bots etc – we used to get multiple spam signups a day until the plugin was added.

    I *hate* being webmaster! I suck at it, and it consumes a fair bit time. So please be patient with me.

    in reply to: Draw image #10151

    Mark Sibly
    Keymaster

    I recommend avoiding the use unsigned values unless you are dealing with binary ‘bit patterns’ (for example, 32 bit ARGB values) or extern APIs that use unsigned values.

    The main problem is that math works differently with unsigned, which can lead to unexpected/surprising results. For example, unsigned numbers can never be <0 as they’re always positive so you can run into trouble ‘looping backwards’ quite easily. Also, subtracting an unsigned number from any other integer will always give you an unsigned result (ie: >=0 ) as both are converted to unsigned before the subtraction.

    Even if you expect values to always be >=0, eg: the layerId variable above, I would still recommend using plain old Int just to minimize the chance of surprises. I would not expect there to be any practical use for unsigned in the stuff you are doing here. Just because a feature is there doesn’t mean you have to use it!

    Unsigned can be useful for dealing with bit masks an so on, but it should be used very sparingly IMO.

    in reply to: Ted2Go IDE #10109

    Mark Sibly
    Keymaster

    Ok, just pushed lastest ted2go master – that little ‘errors’ window in the build tab is way cool!

    in reply to: Ted2Go IDE #10095

    Mark Sibly
    Keymaster

    One design concept I disagree is relayout whole app each frame. Maybe that’a a drop in the sea..

    This would defnitely be nice to improve on, but I think really it’s just a drop in the sea.

    Try adding this at the top of the LayoutWindow method in window.monkey2:

    Here, it makes no apparent difference to CPU usage whether or not I hold down F9. If layout was having any kind of major impact, holding down F9 should reduce CPU usage, right? You can tell it’s working too by holding down F9 and resizing the window.

    So codemap looks like it’s the major CPU slayer – I suspected it wasn’t gonna be quite that easy! This should probably be pre-rendered to a separate image, and updated only when TextView emits LinesModified() so you’re only drawing the lines you need to. Offscreen image could even be double buffered so you ‘insert’ and ‘delete’ range of lines via DrawImage from current buffer (advanced!).

    Just pre-rendering the codemap alone should make a big impact anyway, even if you don’t get too fancy. Its using a lot of CPU even if you’re not typing, so I assume you’re re-rendering the entire codemap all the time? Just updating a pre-rendered version when the document changes should be a big improvement on its own.

    Just read Hezkore’s bit – is the new codemap in ted2go master branch? If so I’ll pull it ASAP and include in the next release.

    This is also starting to make a really good case for the ‘profile’ config I’ve wanted to add for ages. It would be much nicer if we could just see what’s taking the most time visually!

    in reply to: Ted2Go IDE #10089

    Mark Sibly
    Keymaster

    You should definitely comment out GCCollect(), although if the app is idle it’s probably not hurting much.

    I’ve also just experimented a bit with adding optional clip rect params to App.RequestRender (defaults to entire window) and View.RequestRender (defaults to view bounds, view+border etc). This appears to be working quite well so far (window repainting is no longer always ALL the window) but needs a lot more work. At the very least, it should mean entire TextView (currently entire window) isn’t redrawn everytime cursor blinks!

    Reducing CPU usage is likely to be an ongoing mission that will likely involve myself and nerobot working together on it over time. I don’t actually have any complaints re: ted2go performance myself, it uses about 5% on Windows 10, 10% on macos and I’m OK with that. Although it’s true I don’t use the ‘micro view’…

    in reply to: Mark – troubling memory leak #10086

    Mark Sibly
    Keymaster

    Yes, window clearing is enabled by default.

    in reply to: Cast object to int Handle and back?? #10085

    Mark Sibly
    Keymaster

    Another question: How do I recieve default parameter values from a function DeclInfo?

    You can’t, DeclInfo doesn’t know about default parameters.

    in reply to: Cast object to int Handle and back?? #10084

    Mark Sibly
    Keymaster

    This isn’t really recommended as the GC is not aware of ‘handles’ so may reclaim the object at any time if there is not a variable somewhere containing the object while you’re using the handle. Also, an Int wont be big enough to hold an object address on all targets. You’re better off using a Ptr type which will always be exactly the right size.

    But here’s a way to do it anyway. This relies on the fact that, while you can’t currently cast an object to a Void Ptr or similar (perhaps one day), you *can* use Varptr with object variables.

    Note that the ‘New C’ is assigned to a global, not a local. This ensures that the new object is ‘kept alive’ and not prematurely GC’d while you’re hacking around with its ‘handle’.

    I use a similar technique in mojo3d-physics to set the bullet rigidbody ‘user data’ ptr to the Entity the rigibody is attached to. This allows me to quickly find the Entity involved when bullet reports a collision between rigibodies or something.

    It’s safe because the Entity is being kept alive by being in an internal global Scene stack. Destroying an Entity both removes it from its stack (allowing it to be GC’d) and sets its rigidbody ‘user data’ ptr to null.

    This is pretty much the most efficient way to do this sort of ‘binding’ of monkey2 objects with external objects that provide a ‘user data’ ptr or similar, so I think it’s worth people knowing about, but it *is* a bit dangerous so be careful!

    But in general, most games will store Entities in a global stack or list somewhere, in which case it’s generally safe to use ObjectToPointer() on them – until, that is, they are removed from their global stack/list, usually via explicit Destroy() call or similar. After this, the Entity becomes ‘usafe’ as it may be collected by GC at any time, so any pointers to it should be considered invalid. But you don’t generally need the pointer any more anyway as the Entity has been destroyed!

    in reply to: Mark – troubling memory leak #10082

    Mark Sibly
    Keymaster

    Woah, not sure why Windows 7 has so much extra overhead – the app itself should be allocating exactly the same amount.

    Try adding the 2 GCCollect()s to OnRender – this should give you some idea of real memory requirements, and should ‘settle’ immediately (but as mentioned above, will be slower).

    You can also try messing with GCSetTrigger() – perhaps with 65536 (64K), 1024*1024 (1M) etc…

    in reply to: IAP module #10078

    Mark Sibly
    Keymaster

    Ha ha side tracked again, this time with rewarded videos for admob! Have them 99% going and just want to make sure I don’t need to tweak next release yet again to support them.

    in reply to: Mark – troubling memory leak #10077

    Mark Sibly
    Keymaster

    Not seeing any major leak here.

    Memory use hits about 35M (27M on macos) and stays there (give or take).

    If you add 2 GCCollect()s to OnRender or something, you can keep memory use down to about 33M. This has greater overhead though as GCCollect is of course happening more often.

    You can also use GCSetTrigger() to cause GC to happen more (or less) frequently. In this example, it’ll be taking quite a while before a GCCollect() is automatically triggered as gc trigger defaults to 4M and your app is not actually allocating that much memory, and only on at 60hz. So you will see memory use tick up gradually until a GC happens, but it should even out over time.

Viewing 15 posts - 526 through 540 (of 1,431 total)