OlivierC's Forum Posts

  • look at the sample projects included with Construct, there is a version of Ghost Shooter with many effects, including a flashlight attached to the player's gun. Look at how it's made. It's a very interesting project to learn many tricks

  • One recent example: Two Souls has one of the best story and characters but is getting mixed reviews because it's pretty much a movie that you paid $60 for and that runs for 8 too many hours. The few parts where you get too play are not that great apparently.

    But that does not mean story is not important.

    One of my favorite game of all time is Another World. There was a story, it was simple, it's mostly told through gameplay (some cutscenes, but never longer than a few seconds), without the need of dialog. The action was great and rarely repetitive. Great graphic for the time (still holds up today), great atmosphere, many innovations, and all this made by one single guy, living at his parent's

    A great inspiration for me !

  • Thanks for the feedback. That's what I thought, that for security reason it cannot be overridden.

    I'd rather keep the pause bind to the esc key, it's more natural. I can live without fullscreen in web browser.

  • Like DatapawWolf says, I clearly remember seeing red cross in older games, especially fps, like half life or medal of honnor/call of duty. But it's true that it has become more rare in recent games, the cross symbol is still here, but generally in a different color (white or green). So maybe it's true, now that games a getting bigger and lawyers are involved, they are being more careful with those things.

    I don't think you'd get in trouble for using a red cross in a small indie game though. And your game blow up and become super successful, you can still quickly update the graphic

  • I did some research and it is not Construct related, it's just how the browser fullscreen feature works, when you request fullscreen with javascript, Esc becomes the exit key.

    Construct would have to check if the browser is in fullscreen mode and then, in that case only, prevent the default event from happening when you have an "on Esc key pressed" condition. But it might not be possible for some security reason.

  • here, I just typed "ejecta" in search field on the tutorial page: https://www.scirra.com/tutorials/627/how-to-export-to-ios-with-ejecta ;)

    Unfortunately the tutorial say you need a mac to use ejecta :(

  • So on the game I'm working on, pressing the Esc key pauses the game and brings the menu (resume, options, quit...), just like in many games on PC.

    I wanted to mess with the Browser plugin fullscreen feature. When the player click the Start button in the main menu, I request fullscreen. Works fine and all, except when I press the Esc key to pause my game, the browser exists fullscreen. Weird, I thought the fullscreen toggle key was F11. Plus I remember reading in the manual that Construct prevented the default browser behavior when you assigned an action to a shortcut key.

    But then I realized, the default fullscreen key is indeed F11, at least in chrome and firefox. If you press F11 or go to fullscreen using the browser's menu, it does say "press F11 to exit fullscreen" and pressing Esc does not cancel fullscreen. It's only when you request fullscreen through Construct (or more generally javascript I imagine) that Esc becomes the key to exit fullscreen. And since it's not the original default key for fullscreen, having an event assigned to that key in construct does not prevent from leaving fullscreen.

    So, is it that a bug or is it like this by design?

  • Well from what I understood, Cocoon does not support layout-by-layout loading. This means when your game starts, Cocoon will load all the sprites in memory, project-wide, regardless of which layout is being displayed. If you have a small game with two or three layouts, this should not be a big deal. If your game contains many layouts with many different assets, this is more of problem as it will load everything in the RAM, quickly reaching the phone's memory limit if you happen to use big images. Iphone "only" has 512mb of RAM, lots of which is already used by the OS and other process running in background. So if you happen to have over 200mb of images in your game loading at the same time, you're in trouble. Some people said their game won't load at all for that reason.

    I have read there are problems with some sounds not playing too.

    The big issue is that people of Cocoon don't seem to be in a hurry to fix those problems. Instead they prefer to add new features. Again, this is based on what I could read on this forum.

  • I also use many event sheets and groups, but I do agree the search tool could use some improvement. A "find next/previous" design like you find in any kind of editor or browser would be much nicer. If I decide to modify a function name, I need to find and update the events where I call this function. with the current search system, it's a pain in the ass

  • Thank you for your reply, you seem to confirm what I was afraid of, that loading animation dynamically is almost impossible, too much of a hassle compared to the actual benefits.

    Anyway, here is a link to my capx for people interested. I updated it, since I typed the message above, added a temporary start menu, just to check that I can actually load the dynamic layout from a different layout. Also added a loading layer that is displayed while images load.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Short version: I'm creating my layout completely dynamically, including loading sprite images, using XML. But is it worth the trouble? does it actually save initial download time and memory? How about animations? If you can't create them dynamically, why bother?

    Hello everyone,

    First of, let me say that I posted this here because I don't think it's a "how do I", I'm asking for advises and opinions, but if any admin think it should be moved, feel free to do so.

    So I started working in Construct about a month ago, I really like it. My project is to make an old school point and click game. The thing is, I want to make a long game, not something you complete in 10 minutes. That means many areas to visit, meaning many layout with many images.

    I already made some research about having many images and I know it can be problematic, because the game has to download everything first, and on iOS/android, Cocoon also loads all the images in memory, regardless of which layout is active, quickly reaching the phone's memory limits.

    Plus, having dozen of layouts can be difficult to manage, especially if they must all match the same template. If you decide to update it later because you forgot something, like adding an extra UI layer, that means updating all the existing layouts for compatibility

    So I decided to create one single layout for all the scenes, which already contains all the required layers and the pause screen, the player's sprite and then have everything else loaded dynamically with XML files. It creates empty "background" sprites on specific layers, set their size and position and load the images dynamically. Sounds overkill but I made a small proof of concept and it works!

    When you move from one area to another, you just set a global variable with the name of the XML file for the new area, and restart the layout.

    So far, it loads the background images, the player's initial position, the walk areas, invisible wall for collisions and layers parallax. It does not handle interactions with clickable objects yet, but that's the next step. Unique events that are proper to each layout will be loaded for a separate event sheets. I also need to add an opaque layer on top of everything, saying "loading..." that I show at the start of layout and hide once all the images are loaded, so you don't get to see a partially loaded scene.

    I'm not at home right now so I can't post the capx, but if you are interested to see it, I can post it later.

    To generate the XML file, I'd have a separate project with the same template (size, layers...), I'd just build the new scenes, and at runtime I'd call a function that loops through the scene elements to build the matching XML string and output it in textbox, that I can copy/paste into a file. That still needs to be done, but its' definitely not the hardest part.

    So that sounds cool an all but I still have some issues:

    I store the images to load in the project Files directory, so I don't have to worry about hosting them somewhere else and dealing with absolute URL in events.

    But the manual says: "When published, the file is also cached for offline use alongside the rest of the project".

    Does that mean that all the files in the Files folder are downloaded with the other assets when the game starts, or only the first time they are requested?

    The first case sounds a lot more probable and makes more sense. That means loading images on demands becomes almost useless if said images have to download first for caching, you still end up with the same initial download time as if the images where already inserted in the sprites. But it would still help with memory problem on cellphones though, because they would not be loaded in RAM until needed.

    The other problem is when it comes to animations: The dynamic image loading can only handle static images, which will do in most cases... But what if want to have animated sprites with several frames? Let's say I want to have a windmill in the background, with a looping animation. I know this could be done by rotating a sprite, but whatever, let's say I want it to be one animated sprite. As far as know, sprite animations can only be built in the animation editor. You can eventually replace an animation frame with the load URL action, but the frames themselves, even if they are blank, must be created manually first. Same for the looping option, it must be set in the animation properties.

    One workaround would be to have have several blank animated sprites, with various animation length (let's say 2,4,8 frames). Then you'd design your animations accordingly. Then on load, depending on the number of frames, you'd pick the appropriate sprite and load each frame dynamically. In theory that should work, but that's really overkill and less efficient than having one sprite sheet per animation, because it means one request for frame.

    The other solution is to simply create individual sprites for animated ojects, with the animations and images already set up in the project and to just not worry about download/memory, like you'd do on any small game, but still create them dynamically at runtime. But then I'm not sure, would I still have the memory issue on cellphones? I read that Cocoon does not load images layout by layout but all at the same time. Does that mean Cocoon loads all images in the project, regardless if the sprites are on any layout or not, or that it loads all the sprite that are initially on layouts but not the one that have not been created yet?

    Because if it's that last case, that might be the solution: prepare all the sprites in the project (regardless if they are stills or animations), without putting them on the layout and then create them dynamically at runtime. Sure you'd have to download everything ahead, but at least the memory problem would be avoided.

    The new problem here is that, unlike when loading images from URL, you can't have one function to create any sprite you want using a variable, since you must manually pick the specific sprite when you create the action.

    So if you want to go that way, you're just better off forgetting the generic loading through XML and just have a specific event sheet for each area that build the scenes (just what I wanted to avoid)

    So let me know what you think. What do you think is the better option? I'm missing something? Is it overkill? Am I wasting my time for nothing? am I over my head?

  • I think what he meant is he is more worried about people just copy/pasting his whole game and host it as is on their own server, making ad revenues with his game, without his consent, not actually stealing parts of the assets/code. Just like some sites do with images (9gags and such).

  • One way that could work (I have not tried, just came up with it, so I'm not sure) is to use the Browser plugin to check the domain name on which the game runs. Supposing you know where you're going to host it, you can have an array which contains a list of allowed domains. On layout start, check if the current domain belongs to that list. If it does not, that means the game is stolen, you can do what you feel like: prevent the game from continuing, display a warning message, redirect to your original host, force the browser to close the tab...

    The downside is that you have to plan ahead where it will be hosted. If you want to host it on a new site, you'd have to update the list of domain and recompile.

    Edit: You could have the list of domains in a separate xml file that you'd import with an ajax request, that would be easier to update, but it would defy the purpose, since you would have to host it with your game (no cross domain ajax!), so anyone who grabs your game, will grab this list too and can edit it.

  • Yes you can do it: Z order (at the bottom of the page)

    When you create an action, select the object you want to change the Z-Index, then in the available actions, scroll to the bottom, it should be there

  • Have you tried the Pin behavior? when it comes to positioning, it's very handy (pretty much removing the need to worry about any positioning at all). You just position your sprite in the layout view, pin them, and there you go.