0 Favourites

Recreate location as player moves

  • Hi, lads.

    I have open world game with top-down view. It's not some fresh idea to make this game I'm working on it slowly for already two years and expect to spend a lot more time on it. As I do find my concept worthy.

    What i want:

    Real-time level editor inside my game to create, change and delete objects. Simple enough

    All work should be stored inside some document which is always used inside the game. So game should load from it fast as possible.

    In Construct Classis there were *INI files, but haven't loaded information quick. Is there some better alternative in Construct 2?

    Can't design inside Construct 2 as not possible with huge world such as this one.

    You please do try to design levels on layout with properties 100,000 X & 100,000 Y pixels. Not that simple, huh?

    So why bother when you can make unbounded scrolling, create only 1,000 pixels of layout (more/less for your comfort), add loading screen for game's start and that's it!

    In real-time you view world you've created, change it and play. No wasting memory! No hurting for your project as it will load and work just as good as always.

    Must be thousand objects all with their position, angle, variables. It won't be just some background, but interactive objects, characters and so on.

    I suppose I'm not the only one who might have been or still might be interested in this. Maybe someone have a solution for me, maybe someone can point me in the right direction. Anything would be useful.

    There will be dialogues in game as well. I want to store them the same way. Very useful also for a translation.

    Question is: I can't understand how to save and load objects. That's the only problem I have currently.

    Current status: NOT RESOLVED

    P.S. Currently my game is in tech-version so no testers or info spreading allowed. When I reach early alpha I'll make a topic for my project on the forum.

  • What do you mean by unique, they are all the same sprite, right?

    If you mean you only want to create a block if it isn't overlapping an already existing block, you could try adding an event like:

    block is overlapping block

    Block pick top/bottom instance

    Block destroy

  • LittleStain quite interesting result. Tried before & trying now.

    Those objects keep deleting every tick by 5 or 20 objects, but the problem is - around me 500 objects, so every second +500 objects on the screen.

    I think option to create them and then destroy - it's a wrong one.

    Should be more focused on "Determination", so game will not create object if it's already exist.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Yeah, I agree, your method of creating objects is not optimal..

    Adding more precise conditions would be a lot better..

    A For each block create a new block isn't really working..

    Adding a trigger would work much better, Then it would only do it once and when needed..

    Although I'm not quite sure what you are trying to do here, so I can only react to the code and not your intentions with it..

  • LittleStain Well, all i'm trying to create - it's optimisation, that i know will be only if i solve this problem.

    I even started to create project from that, 'cause it's all relies on that.

    Here is the screenshot from the game and C2.

    (In-game scale - 0.2) [Left corner - FPS, Right corner - count of objects)

    Should be around 1000 objects here.

    -----------------------------------------

    Engine

  • The "Recreate initial objects" has no way of determining if the recreated object already exists, so you won't be able to use it unless you systematically destroy objects that are about to be recreated.

    If the blocks were perfectly aligned on a grid, I'd say using a tilemap would be best, or an array solution could work too.

  • Magistross I'd be grateful if you could show some simple example of using an array in that situation.

  • Magistross Thank you for all your assistance!

  • Just updated with an additional distance check on line 3 so it won't create blocks too far from the sprite.

  • Magistross It's working even better than i hoped!

    Now i can go forward in my project, thanks to you

  • The "Recreate initial objects" has no way of determining if the recreated object already exists, so you won't be able to use it unless you systematically destroy objects that are about to be recreated.

    If the blocks were perfectly aligned on a grid, I'd say using a tilemap would be best, or an array solution could work too.

    Magistross Awesome work! However, I wonder now why would tilemap be best? Isn't this partially similar to how render cells work? So wouldn't destroying parts of tilemap and recreating them ultimately hinder performance, since it could make C2's "render cells" optimization inefficient as your solution would duplicate it partially? Or am I missing something here?

  • striimix

    The screenshot i showed - not from the game. Just for example .

    His method is more universal. Can be used in many ways as long as objects lies on the grid.

    He used spawn, but i change it back to recreatiation which did work perfectly for me.

  • striimix I believe that the tilemap would still be best especially if all tiles are the same, fewer draw calls would be issued. We should probably do a comparative test just to see if any difference would be noticeable.

    edit: Just did it, I can't profile on my current computer since I'm at work and don't have a license there... <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed"> but it does seem to run with a steadier and higher FPS. If anything, it's far less convoluted event-wise and much more easier to edit the level design with a tilemap !

    https://dl.dropboxusercontent.com/u/700 ... lemap.capx

  • Magistross

    or anyone else who can help.

    Tilemap and even array doesn't seems to work in my project as I need it.

    I have to address my issue once again, but I will explain it again so everyone could better understand it.

    *Please read first post in the topic

    What I need is many different objects. Different by the size, variables and everything else.

    Is there any way of storing this data into some document and then load it? I mean you can see in other games files for different locations.

    They often use those to load location by parts. If you would play GTA V for example on old computer you could see how your old computer hangs

    when you move fast on the location that's because it loads it and the faster you move - more it hangs as it can't catch up with you.

    I need exactly the same system they've developed for their game. I know it's possible only don't khow how this should be done in Construct 2.

    I'm thinking of creating the level-design engine inside Construct 2 so I could create locations for my game, store them into some file and then load it as player moves close to it.

    As my world is pretty much titanesque (There's no better word for it). I'm talking about millions of pixels and so of course I cannot design it all inside Construct 2. It's unpossible.

    I can create a location in my level-design engine, save it and load it inside the game when needed.

    This feature is what on my whole game lies upon. I've resolved most of the root features, but this one is pretty hard for me.

    I have to do it and pretty important to do it without damage to perfomance.

    Please do not hesitate to ask questions.

    Thanks everyone for attention!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)