Question about doing a whole game on only one layout

Get help using Construct 2

Post » Sat Sep 20, 2014 10:41 pm

Hi everyone,

I'm currently working on a project that uses only one layout (except for loading and title screen). I was just wondering if this was possible or if I need to make transitions via another layout with maps or such things, to keep everything running smoothly.
To give you an idea the project is around 6000 events and will have about 100 levels, so it's not a small game. There are sort of world maps (not animated) between each level that I create on a foreground layer, then delete them when going back to the game (which is still running in the background).

My question is to know whether or not this has technical downside. Will the game start to slow down after a while because I use always the same layout?

Thanks !
B
33
S
6
G
1
Posts: 355
Reputation: 2,850

Post » Sat Sep 20, 2014 10:54 pm

6000 events?
It would takes hours just to scroll that.
Anyway, if you keep the memory use to a reasonable level, and reuse all the same graphics, then yes one layout is doable.
Image ImageImage
B
172
S
50
G
182
Posts: 8,432
Reputation: 115,083

Post » Sun Sep 21, 2014 10:51 am

All of my game/project will only have one layout
and they have many levels too
you should let your game levels to Script
and read them from somewhere
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Sun Sep 21, 2014 1:16 pm

How long have you been working to reach that 6000 events? Must be a really big game... MMO?
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sun Sep 21, 2014 1:49 pm

Hi !
Thanks for your replies. I'll definitely keep the whole game in only one layout.
To answer your question I started the game about 2 month ago, and it's not an MMO or anything like that. I suppose an experienced construct 2 user would do the same game with much less events. Still, I have many characters/enemies and most of them need a good bunch of events to describe their behavior.
B
33
S
6
G
1
Posts: 355
Reputation: 2,850

Post » Mon Sep 22, 2014 11:28 am

I had the same question!!

I am creating an Isometric game where the Level scrolls downwards, I create tiles at the top of the screen and destroy them when the exit the screen below. is

I have written all my game logic in a single Layout - Platform and background(environment) Scrolling , Collision detection, Enemy logic and other standard game events.

Now my question is, when the player reaches the End I want to load a new set of Tiles and Environment image (eg: from Desert -> Snow -> Jungle). What is the most efficient way to do this?

I read that C2 loads required images/objects only when the Layout is loaded. So how to I group my Tile images?
Can I create a common Platform Sprite and have each Level images grouped under various Animations?
Will C2 still load all the level images into Memory even if I am not calling the animation?
Or Do I have to create separate Sprite objects for each Level?
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564

Post » Mon Sep 22, 2014 2:16 pm

I read that C2 loads required images/objects only when the Layout is loaded.

I guess this means that C2 doesn't load every image in the whole project but, just images from current layout.

You can load images at runtime using load image from URL which might be a bit misleading when actually you can load images from your project files using "DesertGroundTile.png" for example but, it seems you cannot specify the path. If you are using NodeWebkit and want to load textures from files externally you can use "NodeWebkit.AppFolder&"Textures/Desert/GroundTile.png". And of course you can also load them from URL.

Just note that if you are using Sprite object you cannot create frames at runtime (at least not at the moment) but, something I've been using is to make tiny 2x2 frames where those images can be loaded. If you have predefined amount of different tile types you should't have to do this.

Can I create a common Platform Sprite and have each Level images grouped under various Animations?
Will C2 still load all the level images into Memory even if I am not calling the animation?

Don't put all your tiles into animations they are all loaded no matter if you use the animation or not.

About the actual levels. If you want to keep everything inside the project one way to do this is if you have another project just for level building. Then you run the map layout just that it exports to JSON or Array or some format and store those map files inside your actual project to "Files/Maps" for example. Or if you use Node-Webkit then to their own file. To load new level, handle the loading process in the beginning and when loading a new level just restart the layout and point with global variable or something that which level will be loaded.

Also one option is to make your own editor. The plus on this would be that you can ship that with the game ;) of course this would be much more work if you want to make it user friendly. I personally like this approach on large projects. It can also make some things a bit easier.
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Mon Sep 22, 2014 2:37 pm

Hey @Katala

Thanks for the detailed explanation. Really Appreciate it :)

My game is like an endless Runner. The map is very random and I do not wish to pre-generate the map information. Using set of tiles and Environment objects (Grass, Trees, Barrel, stones,rocks) I am creating Random scrolling maps.

The only thing that I like to change is the Base Platform tiles (eg: if current level City, next should be Forest). The environment images will probably be used across all levels.

Don't put all your tiles into animations they are all loaded no matter if you use the animation or not.

I think this is the most important thing I wanted to know! Looks like I will separate each level under its own Sprite Object and use a common Transparent "Spawn" sprite to spawn object over it (Just an idea right now).

Do you think that will be possible?

Can do this (not actual C2 code)?:
PlatformSpawnSprite.SpawnAnotherObject ( "Level" & CurrentLevel).Frame(0)
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564

Post » Mon Sep 22, 2014 3:01 pm

@SamRock
Well it all depends how many images and how large they are. If you don't have that much I think it should be ok to have them all in one Sprite animations. Just keep an eye on your image memory usage and if it starts to get high make some more sophisticated systems.
B
34
S
9
G
3
Posts: 517
Reputation: 5,276

Post » Mon Sep 22, 2014 3:15 pm

Thank again @Katala :)

I been looking for the "best practices" in Construct2 or organizing images, but cant seem to find one :D

With just 1 level , my image memory usage is already about 32MB! I think I will have to scale down the images and work on the resolution.
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
60
S
14
G
2
Posts: 427
Reputation: 5,564


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Yahoo [Bot] and 9 guests