dop2000's Recent Forum Activity

  • 3. Exactly. Only the images from the objects which are present on the layout are occupying memory. If you create and then delete a sprite, its images will remain in memory, so next time you create it on the same layout, there will be no lag and no additional memory usage.

    4. Hierarchy is a super powerful and useful feature in C3, I highly recommend studying it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Yes, it's better to use a single Enemy base object with 4 instances.

    2. The main object will be the invisible Enemy sprite, ideally it will be used in all game mechanics, AI etc. EnemyWolf, EnemyZombie are just 'skins', they will move with the base sprite and play animations.

    3. You still haven't told how big your animations are, how much memory they are using.

    If this is a web game, then I believe all graphics will be downloaded once on startup and cached. So the next time players launch the game, it will load quickly.

    Memory usage and download times are two very different things. To optimize memory usage you shouldn't create too many images on one layout.

    4. Pin attaches one object to another. Hierarchy is like an advanced version of Pin, I recommend reading about it.

  • I suggest using a single 'base' Enemy object, it may be just an invisible rectangular sprite. And create a bunch of 'skin' sprites containing animations for different monsters, for example EnemyWolf, EnemyZombie etc..

    Configure all behaviors and instance variables on the base object. And then in runtime spawn a skin sprite (say, EnemySkeleton) and pin it, or better yet connect it with hierarchy to the base object.

    This is a very common approach, you can find it in many tutorials and game templates.

  • Sorry for slightly misleading you with the "screen side", that's an old demo and you should have ignored that part.

    You almost fixed it, but not quite.

    I made a new simple demo, have a look:

    dropbox.com/s/h3oll7ewfjfh1j2/ThumbstickLeftRight.c3p

  • You can preload object images in advance if the sprite is large and you want to avoid a lag when it's spawned.

    load them ad-hoc as required from the server

    This I would definitely not recommend.

  • You can combine Car behavior with 8direction and use 8direction's "Set vector" action. Here is a demo, it's not very good but maybe you could improve it:

    dropbox.com/scl/fi/jiux4bukfunuy4dwndt5a/CarExplosions.c3p

  • Like I said, the important thing is the average size of these animations. I'm working on a low-resolution pixel art game where images are small (50x50 px or less), so I have sprites with hundreds of animations. Storing multiple animations in one sprite helps to better organize the project and the code.

    I can load the entire sprite because it doesn't use much memory. But in your case you might need to put all these abilities into separate sprites and combine them into a family. Then only spawn the abilities which are required on the current level to save memory.

    Regarding the object EnemyAbility, I'm quite confused about making a copy of the same object. Does it mean that they will be distinguished from one another using a variable like "EnemyID"

    Yes, correct, use instance variables.

    I currently have Player1, Player2, Player3 etc objects all nested into a family with family instance variables. Should I be tweaking my approach to using clones of a single object instead?

    Probably not, if each player sprite has a unique set of heavy animations, and you don't need all these players on the layout at the same time, then it's better to keep them as separate objects.

    Every game is different and there is no universal advice. It's normal to re-think the way you organize your objects once you start developing the game, I do this all the time - combining/splitting sprites etc. It's good that you are using families and instance variables already, you are on the right path.

  • Why do you want to load animations from the server? This may be a difficult task, I would only consider doing this if there were lots of animations too large to add to the project, or if I needed to update the images after the game is deployed.

    In other words, I don't recommend this approach. I suggest first estimating the memory usage for one animation - place it on an empty layout, run it in debug mode and check the "Image memory" stat. Depending on the results and the number of these animations you can add them to one or several sprites.

    Once the sprite is created on the layout, all its animations will be loaded into memory and ready to use. So if the memory usage is not too bad, you can even keep all animations in one sprite.

    .

    Also, whenever possible you should use a single object with multiple instances, not multiple different objects. For example, consider making a single EnemyAbility sprite with lots of instances (or copies) instead of Enemy1Ability1, Enemy1Ability2, Enemy2Ability1 etc.. This will make the programming job much easier.

  • Here is a demo with logarithmic function

    howtoconstructdemos.com/changing-sound-volume-with-distance-capx

  • Revolute joints will rotate, it's in their name.

    If you don't want the blocks to move, simply set them immovable. Connection with joints will never be 100% rigid, but you may make it more stable by attaching 2 or 3 joints to different image points.

  • That's because you are using Touch.X and Touch.Y expressions, and when multiple fingers are touching the screen, these expressions return coordinates of the first touch.

    You need to save the touch ID of the finger which is touching the joystick, and then use Touch.XForID(id, layer) and Touch.YForID(id, layer) expressions.

    Or loop through all active touches and pick the one which is touching the joystick - in this case use XAt/YAt expressions.

    See the links I posted earlier. Here is another demo project which demonstrates how to use multi-touch:

    howtoconstructdemos.com/air-hockey-game-template-for-two-players

  • You do not have permission to view this post

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies