saiyadjin's Recent Forum Activity

  • ok, i did some checks, here's what i found out:

    http://imgur.com/a/PALKg

    images show measurements and what events trigger how:

    here's a short explanation - if you have a object that collides with something - if you check vs family - it checks for all objects in that family each instance on screen - for example red and green squares are 7 = so checking 1 blue vs 7 objects (2 are in family, but red has 5 instances, and green 2)

    if you add "on collision" - it checks for collision whole time, but if you want additionally to check if it's collided with something and nothign else, adding not overlapping under it won't be checked until collision happens. when using overlapping - it checks the same thing - if there is collision / overlapping, but triggers every time there is, not just once like event trigger on collision.

    and finally the sexy part - if your object moves (for example with bullet and some speed) - and you want to check if he overlapps when it stops, put bullet speed = 0 first, because then collision checks do not happen until your object stops - after that speed = 0 and checks activate.

    there's probably much more combination but these are some common and happen the most, so designing your game for reduced colly checks should be taken with much care, hopefully someone will find use of these graphs and images..

    if anyone has questions, pm / write here

  • blah, i guess i'll just have to do everything myself.

  • Ashley - i wasn't asking for debugging, just for concept. you said that having multiple checking for collision in events multiplies checks. the screenshot provided just a few checks of cannonball colliding with some objects - 2 triggers and 4-5 overlapping conditions. i was wondering does trigger collision check cause multiplying of collision checking and does overlapping cause it too? which is worse and why? how to fix that? i don't need you to copy paste the exact code, just some tips like you provided before (subevents), how would you change the existing checks into a better one to reduce collision checks? that's all i need to know. the concept. thnx again, and sorry if i'm boring you..

  • because i did it on last stable version (before 228 came), and i've done them in such typing so that they can be just replaced (For example - i've fully replaced function segment intersection with mine), so it's technically save backup of file, copy paste mine over existing, test, if good gg if not revert to old file.

    that's not the point, i won't be doing anymore of this, i just want Ashley to explain me if this is correct what he said on the example before, and i'm all fine.

  • what? what messages?

  • Ashley anything? can you at least look 2 posts behind and answer to that? thnx

  • it would be great if we had objects per layouts view.

    then we would just drag 'n' drop repeating objects to the layout 2 folders, and those which do not repeat would stay in the first layout only. of course on export they would be all the same object (grass in layout 1 and layout 5) still exports as 1 grass texture.

    currently you can only create lots of folders and stuff, but that doesn't make it cleaner :/

  • yes you can.

    most of the games today work on this principle:

    • you have a server that accepts connections
    • players search match and when they are found by some rules they are put on 1 instance on that server
    • they are all connected to the same IP with instance ID
    • when someone moves (let's say it's a real time fps) - server
    • processes data and predicts future movement and sends that data back to all players (except the one who's input it did)
    • players see change with some delay (ping, depends on how far you really actually are from server and connection speed and so on (but this is not the point)

    and that's about it. ofcourse server has to process data from every user, and it's a lot of job so server are usually hardcore PCs, dual xeon and so on, with good connection speed, etc.. also, they can handle more then 1 instance, for example - let's say a game takes 10 players, and server handles 100 instances - 1000 players on that server. also you have to know how much data you send to server so that if it's full it can handle, and how much it sends. for example - max data sent to server from each player could be ~100kB * 1000 players = 100 000kB = 100mB /s connection speed for download on that server so that's another thing to watch, but usually data packets are smaller and speeds today are big.

    that's how it's done in real - time games. but in turn based games you have a bit of an advantage, and that is that you don't have to calculate prediction on server,

    you just have to send new positions / game data to server, and he dispatches it to other players so they update their view. and you do it only on the end of the turn. the only thing to handle here is some combat between players / interactions and so on.

    and yes, you can have a pc which creates an instance of the game, and people can join / leave while game stays in the same state as it is, but you've got to design the game carefully, and it's a tough job really.

  • Ashley - also, what else is performance unfriendly in engine?

  • Ashley - i agree, but when i wrote code on forum i've pasted function as it appears in (for example) common_prelude.js, both original and changed, retaining variable names, return values and so on (but okay). p.s. didn't think about the copyright, since i'm doing it out of my own will so it's more of a helping hand (and not sure if i need copyright when taking something from stackoverflow or such pages).

    collisions thing - i'm destroying objects when they leave screen so they shouldn't count. the thing i didn't know is that it counts events? so when i have cannonball checking for each other object that can hit it multiplies? 1 cannonball = checks if hits boat/island/mine = 3 collision checks? and then 10 cannonballs = 30 collision checks? is this right?

    could family help with that? (example - 1 event for checking if cannonball hits family (of boat/island/mine) ) so it's 1 check and 10 cannonballs does 10 checks?

    this sounds pretty false to me, but is it working like this / could it?

    anyway here's an image, and i'd love if you could explain a bit in detail what is causing the increased collisions there:

    http://imgur.com/Y0CAccx

    this is a part of code (ignore the comments) which does collisions with objects for cannonball. i've used 2 families (enemies (boats and other) and objects (islands mines and bouyes except crates) ) to check if canonball hits any of these objects, if it does.. it does it's thing (we're not discussing actions here so no need to look at them either)..

    so the problematic area then appears to be this "canonball is overlapping" and that is a collision check against 2 more objects? and instead of this it should be that bullet = 0 should be the first condition to check instead of collision because we want "watery explosion" when bomb stops and doesn't overlap anything (meaning it's on water). or should it be subevented when bullet = 0 ?

    thanks <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Ashley also said that he won't be checking this things out, that he used a lot of time to optimize things for general purpose usage. And i believe him. So why would i waste more time for this then he already did. Also if he believes that he can't optimize further (i think he can, but it's time consuming) then i'm fine with it. In the end it all comes to how your game performs on different platforms and in the end it's not about the engine, it's about the product that is made with that engine. For some tower defense games and such stuff that i am preparing to do, the engine itself is more then enough good. A lot of people complain about performance and such issues but they mostly come from compilers and wrappers (xdk / crosswalk / etc..) or users creating huge games that are overblown in size, etc, not following image usage and so on and so forth..

    i've built one game for PC as my own testing of engine and i've noticed that even with loads of objects and over 100 000 collision checks per second everything works fluidly.

    but particles are badly optimized, also for some reason, collisions appear to be higher then they should be, i mean collision system is pretty bad and every optimization is godlike for that - why? because when you have a screen like this:

    http://imgur.com/J2lEi4e

    you don't expect 1095 collisions per tick, let alone 60 000 per second, and CPU usage of 30%.

    Ashley - can you elaborate this?

    for more info - ignore the object count - it's particles mostly and most of those objects have collision disabled.

    these objects have collision enabled:

    boats, player boat, islands and cannonballs, and that mine up there.

    so if you count all the "collidable" objects the count of them on this image is - 26.

    how do i get 1095 / 60 000 collision checks from 26 objects?

    forgot to mention this is on a gtx980M 8GB ddr and 4860HQ processor (3.6GHz) - and 30% usage ? wtf?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    so what you're telling me i should just give up and go make some games?

saiyadjin's avatar

saiyadjin

Member since 19 Jul, 2014

Twitter
saiyadjin has 2 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies