jatin1726's Recent Forum Activity

  • Nice one as always R0J0hound. This should solve the performance issue.

    The only thing that needs to be added is to limit the angle of the road, like in my last .capx where the imagepoints x position is compared, or to adjust all objects when the road leads outside the layout on the X-axis:

    Can be made a little softer with lerp.

    Hi Kriand,

    Thanks a lot for looking into this issue and it has been big help. Also as u said with ROJ solution, road goes out of layout in X-axis and I tried your solution but it didn't work for me that much. I am sure I am not able to implement is correctly. Can you help in limiting the road inside game screen only. One more issue is the bg which is kept below road looks very fake as road is floating above it. How can I make it more realistic like road is created as part of some tiled background.

    Thanks again.

  • But why are you creating roads every tick?

    The straight parts of the road can be done with single stretched rectangle sprites, and the rounded turns can be done by putting a circle sprite at the turns. It ends up looking the same as in the video of your game anyway, plus only uses maybe 20 or so sprites at any given time.

    You shouldn't be generating road by time intervals anyway. Just add more as the end of the road gets too close to the top of the screen.

    Destroying the road should be as simple as just checking when the y is below the bottom of the screen and it's off screen.

    https://www.dropbox.com/s/8c3u8prum0sh63u/infinite_road_round_turning.capx?dl=1

    At any rate this is how any similar games you've seen would do it.

    In the example the view is fixed and all the sprites are moved down. You can do the opposite, leave everything fixed and just scroll down. The only real change other than not moving the road would be to to reference the top and bottom in the view instead of using fixed y positions.

    So instead of y>-100 use y>viewtop-100

    and instead of y>480+100 use y>viewbottom+100

    I apologize if that's not the names of those expressions, but the actual one's should be similar.

    RJ...always nice to hear from you and your solution is also very close to my requirement. Best part is less cpu consumption that makes a lot of difference. Also, as kriand stated it is going out of layout most of time I am facing the issue. His provided solution I couldn't implement, my bad not an expert of construct 2. One more problem is when I put some tiled background below it then it looks like road is floating above tiled bg and not at all real. Any solution for this?

    Also, apologies for couldn't replying early as I was so frustated with the issues in the zombie game that I left it for sometime and started developing other sniper shooting game. Output is really good. You can try it here and feedback is always welcome bit.ly/affleeq2

    Now I am back to zombie game. gonna work harder this time.

    Thanks :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Enlarge the layout. When the screen already shows the whole layout panning makes no sense.

    I have created a sniper shooting game and when user sees through scope, I need panning to be activated and stopped at the edges.

    I have already created this game.

    Minor glitches are there but enjoyed developing it using construct 2. Try it here.

    bit.ly/affleeq2

    After playing it hopefully you can understand my requirement. Currently The issue I am facing on going extreme right after zooming is not working correct (max area is not reachable though works fine in non zoomed mode)

    Any suggestion?

    And this is my best game ever made from construct 2 felt like playing on console ...heee kinda weird praising myself but feeling proud.

  • Click on the layout and set 'Unbounded scrolling' to 'No'.

    This stops panning completely. cant do this.

  • Have you tried objects recycling ?

    Sorry no idea about that. Could yoo please let me know how to do that?

  • Hi Friends,

    There is a touch panning example in construct 2. I need urgent help where I need that when image is max visible at right then no more panning should be availalble. This will avoid user seeing blank white areas after image on left or right of screen.

    Please help me.

    Thanks

  • I don't know if something like that was posted already or if it's really helpful for you. but have a look:

    https://drive.google.com/uc?export=download&id=1_ocC3-EDQx3Rp__iaubIUFTrGLGGcjZj

    Thanks for sharing this example but I feel it is quite different from my requirement and yes cpu consumption is spiking up too in destroying objects though it was supposed to be reduced. I am facing same issue in my project too.

  • With particles it is faster then with sprites but not as fast as with TBGs, at least in my attempts. I really think the fastest and best suited way for a mobile game is to use animations and fixed road parts:

    https://1drv.ms/u/s!Ap_-qxoGKbDcg3HteBHYrBIHUG4b

    Thanks for the capx. looks nice. but still waiting for solution for my issue.

  • You could try something like this, and play around with the sprite by adding different images.

    This will give you low cpu usage.

    https://www.sizzle-games.com/road.capx

    Thanks a lot. Though it is bit different from my requirement but really nice one. I will surely keep for using in future game.

  • > youtu.be/tcgMAigbFdg

    towards the end of video, there is a cpu clutter caused by the objects count, as cpu spikes cause of to many objects (probably more then 1000 you had initially) and makes you lose fps ... you sure the items you are coded to get destroyed are actually getting destroyed? im thinking you are not destroying the items properly. or not all of them.

    Also when i said to many objects continously depending on position or calculations, that also apply to your zombies spawning outside screen trying to get to the car... those add up if you have to many... since they will always try calculate the path to the car... and imagine 100 of them doing that + 1000 objects in screen,... don't know why you have 1000 objects in screen when you could fake that gameplay and quality with 5-10 static objects.

    That gameplay done properly just what i seen in the video, should cost around 5% cpu or less on pc around 10% on mobile... optimization, look for stuff you missed out destroying, maybe the road itself? or zombies/bushes?

    Hi Thanks for the suggestion, just want to share few info. As of now the main issue is road only because road is what continuously constructed and thus destruction is required and this destruction is consuming lot of cpu. Leaving all other object zombies etc aside. I am focusing on road construction only. I think ashley is already aware of it and as shared in above post he has optimised it for C3 but C2 is still pending. This is one of the drawback of construct 2 where we can't create heavy games on mobile and we have to create casual games only. Just for the info, all objects are destroyed to save RAM plus avoiding calculation method to reduce arithmetic pressure on CPU. trying to destroying object with less cpu consumption but focus is on road construction only.

    Thanks for the efforts. Really appreciate it.

  • Have you not tried particles yet?

    Hi,

    I think particle cannot be used for creating road. Can you share capx example to show me how it will be done? that will be very helpful.

  • Did you look at my example? Using a 'for each' loop does not make things better. Use the 'wait' property of the fade behavior. It works a little faster then comparing the Y coordinate to destroy the road.

    Hi Kriand,

    I checked your sample, thanks for sharing it. I noticed that your capx is consuming more cpu than my sample capx within first 15 seconds. You can cross check it in debug console. So that method didn't work. But appreciating your effort to look into issue. Still looking for more solution.

jatin1726's avatar

jatin1726

Member since 27 Oct, 2014

Twitter
jatin1726 has 4 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • x25
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies