Recreate location as player moves

Get help using Construct 2

Post » Tue Jun 02, 2015 1:32 am

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.
Last edited by XpMonster on Sun Sep 25, 2016 9:34 pm, edited 8 times in total.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Tue Jun 02, 2015 9:05 am

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
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jun 02, 2015 11:39 am

@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.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Tue Jun 02, 2015 11:45 am

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jun 02, 2015 12:02 pm

@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)
Image

Should be around 1000 objects here.
-----------------------------------------
Engine

Image
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Tue Jun 02, 2015 1:55 pm

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.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Jun 02, 2015 2:12 pm

@Magistross I'd be grateful if you could show some simple example of using an array in that situation.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Tue Jun 02, 2015 3:57 pm

B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Jun 02, 2015 4:04 pm

@Magistross Thank you for all your assistance! :)
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Tue Jun 02, 2015 4:25 pm

Just updated with an additional distance check on line 3 so it won't create blocks too far from the sprite.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Next

Return to How do I....?

Who is online

Users browsing this forum: PROxMTswatTR and 19 guests