mikehive's Forum Posts

  • Can you not spawn the turrets etc in the first frame when the ship is created and is in a 'neutral' pose, set the left/rights, and then attach them to the ship thereafter so that they continue to be left/right turrets even though the ship later goes on to rotate?

    In other words, always spawn ships at 0 degrees, attach the turrets to the right places, THEN set the angle to whatever you want.

  • Ohhh, I see what you're trying to do. Okay.

    From squinting at your ship sprite in the screenshot, the thought occurs that if all of your spaceships are drawn facing in the same direction - and the origin point is set to the centre of the ship - you could determine whether an image point is to the left or right hand side of the ship pretty easily by comparing the Y coordinates.

    You know... maybe something like this?

  • Dictionary needs to load from LocalStorage.ItemValue

  • Dictionary shouldn't be loading "Achievements.json". It doesn't know what that is. You need to tell it to get the data that you just pulled via AJAX.

    It should be Dictionary > Load JSON: AJAX.LastData

  • This is legitimately amazing. What is this witchcraft??

  • Honestly, my main goal when optimising a game with 40000 sprites would be trying to think of clever ways to not have 40000 sprites.

    I'm not saying you should delete stuff from your game, but there might be a smarter way to do this. For example, if you've got a giant map with 5000 tree objects on it - do you really need to have all those trees in memory given that you can only see a few of them at once? Maybe you could just have an array that remembers where the trees are, keep a stock of say 100 trees, and then just teleport them into position when necessary. Looks the same to the player, but waaay less stuff sitting around in memory.

    Or: are there any sprites that you don't really need to have in memory? Eg. maybe you have a bunch of invisible spawner objects that populate the map with enemies or whatever. Well, once the spawners have done their job they can be deleted, right? No need for them to be taking up memory any more.

    You can also put objects that don't move a lot (eg scenery items) onto a layer together and enable render cells for that layer. This might improve your performance, but it doesn't always - you should test.

    If you let us know more details about your game, how it looks and how it works, we can make more detailed suggestions for ways you can optimise it :)

  • Having one large layout with the entire city is much more difficult to do, but it is possible. So it's up to you what kind of experience you want the player to have.

    Some things to consider if you want to do it the hard way and have the whole map on one giant layout:

    1) This is more feasible if you have small / low resolution graphics (eg pixel art). You can get away with loading in more things if they are small and don't take up much memory.

    2) You may be able to make use of render cells on some layers with a lot of static objects to cut down on the performance overhead.

    3) You may be able to set up some sort of fancy optimisation systems such as saving the entire city grid in an array and repositioning objects to give the illusion of a vast city (eg. in reality there is only like 50 buildings but you keep shuffling them around behind the scenes whenever the player gets close to things so it looks like a huge location).

    4) You can enable / disable groups of events when certain things are on screen or not. For example, you might have a group of events that makes a bus drive around the city: you could just disable those events if the bus is not on screen. This sort of thing helps make sure the player's computer isn't tied up thinking about things it doesn't need to be.

    5) C3 has good memory management features that mean you can (eg.) unload an object's sprites from memory (which normally only happens when you exit a layout). This might be handy for certain things (eg. if the player collects the last powerup, you could unload the artwork for that item from memory since there is no need for it any more).

    If all this sounds too technical, though - the much easier way to do it is just to build the city across multiple layouts with loading zones :)

  • Yes, you can export the whole Dictionary as a JSON string and put it in LocalStorage.

    I guess you may or may not need to do this given that your JSON data is already saved in achievements.json? Not sure how your setup works :)

  • I don't believe it's possible to reference image points by name, only their index (maybe somebody will correct me).

    However, there will certainly be an alternative way to do what you're trying to do. Since you have to manually place the image points yourself anyway, why not add 2 instance variables to the sprite and store the count for left / right image points there? You'll know yourself if you just added four, six, or whatever points to the image, so it's just a matter of writing it down somewhere you can retrieve it later.

    I must admit to not being quite sure why you're trying to do this with image points anyway. Can you give any more information about what you're attempting to create? Perhaps we can find a better way to do it :)

  • Your post is worded slightly ambiguously - I'm not 100% sure if you're trying to put dictionary data in a JSON file or load a JSON file into a dictionary. I'm guessing it's the latter?

    There's two parts to this: getting the contents of the file, and putting them into the dictionary.

    To get the contents of achievements.json, you can use the AJAX plugin > Request achievements.json (tag "loadAchievements")

    AJAX is asynchronous, meaning this request will take a small but indeterminate amount of time to complete. That means we have to test to find out when the data has been loaded and is ready to use.

    AJAX > On "loadAchievements" completed: Dictionary > Load from JSON string AJAX.LastData

    Note the Dictionary accepts JSON in the following format:

    {"c2dictionary":true,"data":{"item1":"whatever","item2":0,etc}}

  • Right-click on the layout's name in the Project Toolbar and select "Duplicate".

    Bear in mind that it'll use the same event sheet as the copied layout by default (I can't tell you how many times I've got myself in a pickle by forgetting that admittedly very simple and obvious fact!). 🙂

  • Uhhh, I guess my image disappeared for some reason??

    https://hosthive.cc/web/crash.png

    Here's a reupload to my own server.

  • You could give the slider an instance variable that stores the last value.

    Eg. On start of level: Slider value is 0, set lastValue to 0 (or whatever)

    Later,

    If slider value != lastValue: play sound effect, set lastValue to slider value

    This ensures that the slider just remembers what it was set to and plays the sound if the user changes it to anything else. 👍

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey guys. Working on a C3 game which is going pretty well - apart from the fact that every so often (only occasionally) it'll freeze and lock up. And every time I change something and think I've fixed it, it'll happen again when I'm not expecting it... grr!

    I've been trying to get it to crash when I can access Chrome's console to see if any errors are logged (and of course, it's been refusing to break all afternoon) - but I did finally get it to happen.

    Suddenly the game locks up, and the console immediately fills with about 300 messages like this:

    I have to be honest... I don't really know what to make of these. I can see mentions of "MoveTo" and "Fade" behaviours in there... does that mean something is going wrong with those? Why would that be the case?

    It also seems like maybe it's trying to reference the properties of an object it can't find? Not sure why.

    I know that freezes are often the product of infinite event loops and things like that - something that I think I've been careful to avoid.

    I don't really know what my next move is. Anybody have any ideas where to look next? 🤔

  • Marketing is a pretty broad spectrum and our product spans such a wide range of use cases it's impossible for us to address them all. We're doing a lot in education right now which will be pretty invisible for the B2C market but we're making great progress there.

    For B2C B2B markets we're not doing a whole lot of active marketing, we find it quite tricky. We experiment from time to time but nothing has really stuck. Regardless, we're growing slowly and steadily in both product usage and revenue so we're in a good place and are happy with how things are going.

    Oh, yes - I have heard a lot of teachers and schools using Construct, that's true. I'm pleased to hear you guys are doing really well with that :D

    As far as B2C goes, yeah, that is a tricky one...

    I would think this sort of thing would be mostly a pull rather than push type of marketing project. If people have already decided they want to learn Unity or something then they'll go and do that. Perhaps it's the people who aren't sure which platform they want to use could be good targets.

    For example, I was looking at SEO. Right now, results for queries like "easy game creation software" are horrible (top result is a blog that says you should learn Unreal or Unity, or something?? Not helpful at all).

    Maybe there could be some opportunities to put Construct more strongly in front of people who are actively searching for non-scary game development platforms to try out. Whether search optimisation, social campaigns, paid ads or whatever - I guess you'd need to think about it. 🤔

    Some number we're pretty proud of to illustrate:

    • ~920k users tried C3 in 2020
    • Avg 3.8 sessions per user
    • 25 min avg session time
    • 200k new projects created in C3 monthly
    • 60k games exported monthly

    Those are impressive numbers indeed! 920k users??? As in nearly a million? That's incredible. Makes it all the more mysterious that C3 isn't more of a household name.