The Maddog's Recent Forum Activity

  • 41kb per frame? So about 1MB (800KB) per sprite? Dunno....

    Try compressing better. Do you show it as 128px/256px? Or do you downscale? If so (for example, 64x64) the best thing to do is export the size u'll be using.

    Also, do you really need 20 frames? Tried already with lesser, to check smoothness?

    Will compress better and create size according to what I actually need. Unfortunately I have been resizing these sprites in the editor.

    Have you tried running the game in Debug Mode? What are the numbers for FPS, CPU, images memory usage?

    Try removing big portions of these grass sprites from the layout and see if FPS/CPU usage improves. Try deleting the entire grass object, disabling different event groups etc, and see what's affecting the performance the most.

    Thank you, I will reduce the number of sprites and check the FPS, CPU and image memoery usage.

  • Thanks plinkie, I'll try this out.

    Update: See 1st Post Above for Solution

  • Thank you both of you for your replies. I will see if I can fix this annoying issue once I have solved another annoying issue.

  • Hi all, I have spent hours trying to allow the user to drag a block in game onto the map. I have got it working so that the user can click on the block, drag it and drop it when releasing the mouse button. However, I would like so that when the user is holding the block that the user will be able to hold down the mouse button, and the block will duplicate and place itself. My aim is to allow the user to drag out a wall. Having to click & drag for each block of wall will likely turn future players against me.

    I have got the grid working so that it snaps to a grid size of 38 (block size is 38) and that the user can only interact with the drag and drop ability providing that the global variable of wood is =>1 otherwise it's disabled.

    Thank you all

    UPDATE

    I'll post this again in hopes of it not being deleted.

    I have managed to find a solution to the issue I had above. This is for all of those that end up in the same situation looking for answers. Of course your way of doing what I wanted to do and achieve will be different but I am hoping that you will find some help in the solution below.

    imgur.com/a/eJ75I0lA

  • So this is what I’m doing. When landing on the planet, it’s just a Tiled Background of dirt, sand, snow or yellow snow. There are seasons, the seasons affect the GlobalVariable of clock. The clock controls the growth and placement of random shrubs, grass and saplings, as well as the day and night cycle and temperature too, not to mention wind, rain, snow and sun. *cough* Firestorm...

    Per shrub and sapling has 20 frames, they are PNG. They are between 128 - 256px and range from 31kb - 41kb per frame.

    Below I have gone in depth so that I can get the help that, I want to make sure that you all understand exactly what I'm doing so I can get the help that I need.

    Thank you for your help.

    I am making a Rim World clone in Construct2 but with my own very unique style. I am copying certain gameplay aspects of Rim World. Your life on earth in the year 2522 is ripped away from you. As an independent trader vessel, your job was to transport goods to and from Earth & Mars. Unfortunately your warp drive has a 1 in a quadrillion chance of having a fatal malfunction, this bends space and fires you through into unchartered territory. During this time your vessel is being ripped to pieces and you don't feel so good. Surprisingly whilst at the speed of light, you manage to vomit your way into your escape pod and after the whole ordeal you lose consciousness and wake up plummeting to an unknown planet of unknown origin. Oh no you say to yourself, I’m plummeting into a planet full of cyanide gas, but fear not! The escape pod is a cryopod and will not dump the panicking traveller onto a planet of which cannot sustain life. The year is unknown, is it the past, is it the future, how long have you been asleep, how long have I been travelling? ...What’s my name?! in time you will come to know.

    On landing, you and your droid are to survive, build, prosper and launch a spaceship into space of your own design in the later future to try and get back home. You will of course need to learn how to do many things, such as design a warp drive, a propulsion engine, a phaser ect ect … But fear not, located in your escape pod is your phone, it has no signal but it has with it every book to have ever existed. What’s the pin?!” ...erm. So no need for a research table, just sit down whilst snacking on a sandworm in candle light and learn how to make a wheelbarrow to how to make a propulsion engine, it’s all there once you can unlock your phone. Your droid is there to help you too. It will defend you, it will help you build and many more things that I have yet to come up with.

    During endgame, having researched the technology and built a spaceship and having launched into space you will be able to navigate your ship into an endless void, however certain things are bound to go wrong whilst your up there. My plan is to have you live on the actual ship you made for a set amount of days whilst holding off attackers from an unknown AI or life form ?

    Eventually the nasty AI or aliens that are out to get you will unfortunately destroy your ship. Lucky for you, you've always got your droid and escape shuttle in standby ready to fire you off into the next planet of which will have many different aspects from the last. Some good, some most unfortunately bad. The game is designed to get harder as the, I'm just going to call them aliens. The aliens will follow you, hence the game will become harder.

    The first planet will be of course be the easiest planet, much like earth. The 2nd planet and all those after that will be completely different in looks, gravity, time, weather and seasons ect ect…

  • Are you seeing all of that 500 (or more) grass sprites on the screen? or are they spread across the big layout and you see only few of them on the viewable screen?

    They are spread across the layout of which is 4096x4096, anything outside of the screen is set to invisible but not sure if setting their opacity to 0 would be better for this and then have their opacity set to 100 when on screen?

    During the summer season there can be 500 animating sprites at any given time on the players screen.

  • Having spent hours looking around the forum for a way to make a tiled Background play a sequence of images, I have been forced to use sprite's. In my game I have designed in such a way that the entire game randomly teraforms itself based on a global randomising number.

    I have flocks of birds, trees, grass with leaves that rustle in the wind. I have lakes of water and mountain ranges that appear from meteorites. I have a day and night, a season system and a wind system with weather effects.

    But my number 1 limitation is having to use many many sprite's. To be able to have a way to use Tiled Backgrounds would be a huge improvement in overall performance.

    My game is being designed purely for the PC as I do not believe that phones will be able to handle such a huge amount of sprite's at any given time.

    I also have some issues as well.

    Each tree has a variable called TargetScale. This is set to 1. When a tree spawns, it's scale is set to 0.1 (sapling) overtime the sapling will grow into a tree. Now when the tree's TargetScale becomes 1, the tree will continue to grow. However I have a compare variable that checks if Greater than or = to 1 set scale to 1. The tree will grow to 1.01 but in a blink resize itself back to 1 and so on. Now I cannot figure out a way of preventing that from happening as disabling the grow function will disable all the other trees from growing.

    Is there a way please?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you're saying that I basically don't need to worry about having 1000s of sprites ?

    Also I cannot find any documentation on the sprite sheet at all.

    Thank you both for your replys.

  • Such an old thread, however is the only thing that I have found that could answer my question. I have 1000s of grass sprites around my map of which have 20 frames each to sway in the wind. The lag is unbearable, I cannot continue. The only way around this is to use Tiled Backgrounds. But I cannot due to not being able to animate them.

    I think I have found the solution here, but I do not understand your instructions Yann as I am still very young in Construct3. This problem of animating tiled backgrounds is the only thing stopping me from purchasing a personal license. It's preventing me from finishing my game. I could really use some help on this and I am stumped as to why they have not allowed us to actually animate our tiled backgrounds. It is such a vital feature that is lacking.

    I do hope you can reply, in the mean time I am going to try and replicate what you have said and try get something working.

    I have a math counter of which depending on the number spawns a sprite. This sprite has 20 frames of grass swaying in the wind. During the game depending on how much it rains, the weather and season new grass will spawn, at any time there can be 1000s, but the lag is unbearable and not possible. The only way that I can fix this lag is to find a way to have tiled backgrounds do exactly what the sprite is doing, minus the lag of course!

    nah you're doing it wrong

    first you don't use dt in the wait as it's already in seconds

    seconds don't create and destroy but toggle visibility

    third, well you might have the free version, but I'd use families to make things more code friendly (:

    Also I would use a timer variable something like

    Global number speed = 5 //frame by second
    Global number t=0 //timer variable
    Global number frameCount=3 //number of "frame" for the effect
    Every tick 
      -> add to t speed*dt
      -> tiledbg1: set invisible
      -> tiledbg2: set invisible
      -> tiledbg3: set invisible
    int(t)%frameCount = 0
      -> tiledbg1: set visible
    int(t)%frameCount = 1
      -> tiledbg2: set visible
    int(t)%frameCount = 2
      -> tiledbg3: set visible
    [/code:1x009smv]
    
    With family (myTiledBG), I would add a family variable named 'frame' of type number and manually set for each tiledBG in the family a number repr?senting the frame. 
    And then in event it would look like
    [code:1x009smv]Global number speed = 5 //frame by second
    Global number t=0 //timer variable
    Global number frameCount=3
    Every tick 
      -> add to t speed*dt
      -> myTiledBG: set invisible
    myTiledBG.frame = int(t)%frameCount
      -> myTiledBG: set visible[/code:1x009smv]
    
    As for perf, well, there shouldn't be any difference with animated sprite. That's more or less what they do, swapping texture. But yeah you'd have a little bit more object to handle, if it's less than let say 50 frames it should be ok.Yann2012-06-26 21:59:11
    
  • Hi all again,

    I have a map which randomly generates grass around the map depending on the season ingame. However having over 1000 sprites on a layer is insane.

    I've been told to achieve this by using Tiled Backgrounds. However, my grass was made using photoshop and animated and exported as a PNG sequence using After Effects. Now, I have just found out that I cannot animate a Tiled Background.

    Is there a way ? I cannot use Sprites, the game will lag.

    How can I achieve this please ? The grass sways in the wind and has 20 frames, it can be done via Sprites but having over 500 of these as well as having them animate is just absolutely insane. There must be a way, I am smashing my head on my keyboard, please help.

    Thank you all for reading and I hope a solution can be found.

  • Highly recommend using Tiled Backgrounds for this instead of a sprite. Depending exactly how many of these sprite's you intend on spawning that is.

    But assuming that you intend on filling your entire layout, then I'm afraid that using sprite's is the wrong way to go about it.

    I have a game of where overtime the actual layout teraforms itself depending on the season in the game. I was spawning 100s of sprite's but after hitting 500 I got worried. 100% CPU usage, stuttering FPS but only 13MB RAM usage ?? ... So I came here and I was told and taught how to achieve the exact same thing but this time using a Tiled Background instead of a sprite so I did just that.

    Last night I had 1000s and thousands of Tiled Backgrounds and my FPS stayed at 60, my CPU 3-5% but my RAM was still 13.

    Use Tiled Background for this.

  • Wow, that method right there is the way to go for free users. That's what I like best about Construct is how you can make almost anything work in many different ways.

    If sprite isn't overlapping tiled background then spawn and move on. If overlapping tiled background then don't spawn and move on. Could use this method for rocks and lakes too.

    I have a GlobalVariable set to 0. Every 1 second this number get's changed to a random number between 0-100. If it's <=5 then the group that spawns the grass is toggled once. But obviously I couldn't do this due to not knowing how to target a single instance of the silly tiled background.

    So thanks again, you have been of much help!

The Maddog's avatar

The Maddog

Member since 11 Feb, 2016

None one is following The Maddog yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies