Ashley's Recent Forum Activity

  • I'd advise against going over 1024x1024 since the runtime requires temporary textures the size of the window and some video cards will create a 2048x2048 surface for anything bigger.

  • I think I've said this before, but simply the existance of a large number of objects can slow down the event engine and collisions engine, so you might want to avoid that anyway if you can... why might someone need to create thousands of objects anyway? What's the purpose of all of this?

  • vectors in particular seem to have a bad reputation in game dev use

    I keep reading that vectors, and the stl in general are very inefficient

    and that they are strongly discouraged in game use, and forbidden in some studios altogether

    I'm one of the complete-disagreers. The STL, especially vectors, are no slower than the equivalent code with ordinary arrays and new/delete, and sometimes faster, because they are very cleverly written. In MSVC++, though, you need to define _SECURE_SCL as 0 otherwise it adds a lot of security checking to the STL containers, which is where the myth about the STL being slow may have come from. There's another define for iterator debugging, which is invaluable for debug builds, but should also be off in release builds. Then the STL runs perfectly fast, and it's so invaluable to writing code I honestly don't know what I'd do without it, so I wouldn't hesitate to use it thoroughly in games.

    You do have to be careful sometimes though - there are some tricks for optimal performance. Vectors have to resize their internal memory if you insert too many items, which means allocating new memory, copying everything, and freeing the old memory. If you clear() a vector it frees all of its memory, then if you push_back 1000 times it will need to keep resizing its internal memory to fit in the new data. This can be slow, but a useful tip is calling resize(0) returns the vector to an empty state, but keeps the memory capacity, so you'll need to add at least as many items as it used to hold before it reallocates. So if you bear that in mind you'll find vectors are overall at least as fast as not using vectors - so use them!

    [quote:324uqtj5]

    C: what is sizeof(CRunObject*) can I make a thousand or 2 of these without a crippling ram impact?

    The size of any pointer on a 32 bit system is 4 bytes! The size of CRunObject, on the other hand, is not specific - plugins have different sized classes and the runtime never assumes they have any particular size.

    Creating a thousand Construct objects is almost universally a bad idea and I can't imagine why you'd want to do that. What are you trying to do?

  • Just those simple formatting tags. It won't show full pages.

  • Maybe post a .cap of a simple WAV file playing not working.

  • Deadeye's right, anything that changes continually over time needs to use timedelta, including acceleration, rotations, opacity, sound effect volumes (eg. if fading out), effect parameters etc. etc. Otherwise, your opacity based fade is tied to the framerate, and the framerate could be anything. The Fade behavior is, of course, framerate independent.

  • I think Rich made that object, maybe he can comment. In the meanwhile, is there anything on the bug tracker about it?

  • The sound files were originally .wav. I had to convert them to .wma because it won't work any other way. If I try using them as .wav, and use "autoplay resource", the sound won't play. Just silence.

    Then you should submit a bug report for that and try and get that fixed, because 'play music' certainly is not intended to play your sound effects, which may well be the source of this problem.

    Note that only WAVs with certain codecs work with XAudio2, see the wiki for more info.

  • Mort is right, you can't combine Physics with other movement behaviors, otherwise the Physics sees the object as teleporting short distances every tick.

  • Would that be doable with a custom plugin?

    No, there is no interface provided to plugins to do this, and the runtime doesn't support it. The SDK doesn't have the capability to fundamentally change the way the runtime works, it merely communicates.

    Besides, if you could, how would you add events to the new object type? It couldn't possibly appear in the event sheet editor.

  • I don't know, you could try, but I doubt it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Even so, you wouldn't be able to refer to the same object in two threaded event sheets, the plugins would have to be specially written as to not use single threaded data, and even then the performance gain is nothing unless the threaded events are a significant time consumer.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,538,260 followers

Connect with Ashley

Trophy Case

  • 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
  • Forum Mega Brain Made 20,000 posts in the forums
  • x109
    Coach One of your tutorials has over 1,000 readers
  • x69
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x38
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs