Project Cortex

Page 10 of 15 FirstFirst ... 23456789101112131415 LastLast
Results 136 to 150 of 223
  1. #136
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex



    You can now sit/lay in rooms.

  2. #137
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: Project Cortex

    Are you using a library like PixiJS or Phaser? Or did you create your own canvas "game engine"?

    I can't wait to see the code, this looks so good. It'd be extremely educational (at least for me)

  3. #138
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex

    Quote Originally Posted by Biesmen View Post
    Are you using a library like PixiJS or Phaser? Or did you create your own canvas "game engine"?

    I can't wait to see the code, this looks so good. It'd be extremely educational (at least for me)
    I'm rendering everything on my own, no libraries but jquery for the interface is used.

    - - - Updated - - -



    Not a perfect transition yet, but it's a start. Rewrote the server sided path finder execution as well, should be a bit smoother in the background now.

    - - - Updated - - -



    Scratch that, repaired it.

  4. #139
    Proficient Member billsonnn is offline
    MemberRank
    Jan 2013 Join Date
    157Posts

    Re: Project Cortex

    Quote Originally Posted by KittyChloe View Post
    I fixed an issue I noticed with the hit registration, I also increased the hit registration canvas rendering performance by quite a large bit.



    Did some adjustments to the hit registration, left one is the live render, right one is one with the contrast turned up so you can see what's actually happening. Users are now rendered with the RGB values of: 255x255x[user index] and walls are rendered with the constant value of 255x255x255. 255x255xZ being the reserved ones.

    I used to do my hit registration similar to this as well, its pretty inefficient. I suggest instead creating a hitmap and storing 1 hitmap for each texture (your texture should ofc be reusable). Here's the order of how it should work

    1) Before wasting any resources make sure the (x, y) being checked is within the bounding rectangle of the sprite being checked
    2) If point is found within the bounding rectangle, check if a hitmap has already been created for it (sprite.texture.hitmap or similar)
    3) If it doesn't, generate it
    - Create the hitmap & iterate pixel data of the texture, setting any alpha pixels below our threshold (127) to 0
    Code:
            const imageData = context.getImageData(0, 0, width, height);
            const hitMap    = new Uint32Array(Math.ceil(width * height / 32));
    
            for(let j = 0; j < height; j++)
            {
                for(let i = 0; i < width; i++)
                {
                    const num       = j * width + i;
                    const num32     = num / 32 | 0;
                    const numRest   = num - num32 * 32;
    
                    if(imageData.data[(4 * num) + 3] > 127) hitMap[num32] |= (1 << numRest);
                }
            }
    
            texture.hitMap = hitMap;
            texture.hitMapWidth = width;
    4) Using the hitmap, find pixel data relative to the point being checked and test if the value does not equal 0
    - I'm unsure of how your code is written but getting the pixel data from the hitmap should be something like this
    Code:
         const hitMap         = texture.hitMap;
         const dx               = Math.round((x + texture.frame.x));
         const dy               = Math.round((y + texture.frame.y));
         const num            = (dx + (dy * texture.hitMapWidth));
         const num32         = ((num / 32) | 0);
         const numRest       = (num - (num32 * 32));
    
         return ((hitMap[num32] & (1 << numRest)) !== 0);
    Doing it this way will entirely remove the need of having a separate canvas, redrawing and coloring pixels. The hitmap is reused across all sprites with the same texture so you only ever need to generate it once per texture. This will drastically improve rendering performance.

  5. #140
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex

    I don't render the hit registration all the time, only when needed, I draw a spritesheet of each furniture upon the creation of tee furniture, with its defined rgb colors. It doesn't take more than some millisecond to draw the hit registration.

  6. #141
    Enthusiast Matheeus is offline
    MemberRank
    Feb 2018 Join Date
    30Posts

    Re: Project Cortex

    Quote Originally Posted by KittyChloe View Post
    I'm rendering everything on my own, no libraries but jquery for the interface is used.
    Please don't use jQuery for the UI, beyond the fact that jQuery is going to be deprecated in modern web applications, but it doesn't suit complex structures like Habbo Client because after little time it becomes a nightmare of functions, unmaintenable (I know because my first Client UI was only jQuery).

    The best way to write the UI, as it must manage really much data, is by using a Frontend Framework like Vue or React with a solid state management system like Vuex or Flux.

    If you need, I can help you with this side.

  7. #142
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex





    Not a lot of progress but it's coming together.

  8. #143
    Novice CDL is offline
    MemberRank
    Feb 2019 Join Date
    4Posts

    Re: Project Cortex

    This project has much potential. I really hope you finish this one out. Keep up the great work.

  9. #144
    Member Rubber is offline
    MemberRank
    Apr 2015 Join Date
    ValkenburgLocation
    91Posts

    Re: Project Cortex

    Any update?


    - Via Tapatalk -

  10. #145
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex

    Quote Originally Posted by Rubber View Post
    Any update?


    - Via Tapatalk -
    increased performance within the room renderer and image processing

  11. #146
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex

    I haven't been posting a lot recently because I took 1 (or 2?) weeks to chill to not wear myself out, which by the way, if you're a developer, you should considering taking breaks through your projects, it helps!!!

    Either way, I've begun a process of working with performance issues, I brought room rendering down from 200ms(don't even ask me how it got to 200ms LOL) to less than 20ms no matter the scenario.


  12. #147
    01010010 01011010 Biesmen is offline
    Super ModRank
    Apr 2007 Join Date
    2,517Posts

    Re: Project Cortex

    I know exactly how you feel. Doing a lot of development after work hours myself - it may eventually break you if you do that on a daily basis. Take care of yourself. You're doing great work. Can't wait to see more progress!

  13. #148
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    Re: Project Cortex

    Quote Originally Posted by KittyChloe View Post
    I haven't been posting a lot recently because I took 1 (or 2?) weeks to chill to not wear myself out, which by the way, if you're a developer, you should considering taking breaks through your projects, it helps!!!

    Either way, I've begun a process of working with performance issues, I brought room rendering down from 200ms(don't even ask me how it got to 200ms LOL) to less than 20ms no matter the scenario.

    What about a lot of different types of furniture with animations?
    Do you know what the most expensive furniture calculations are?

    When will you add furniture shades :D ?

  14. #149
    Proficient Member KittyChloe is offline
    MemberRank
    Jul 2019 Join Date
    162Posts

    Re: Project Cortex

    Quote Originally Posted by The General View Post
    What about a lot of different types of furniture with animations?
    It'll be the same deal: (do ignore the speed of the ice elephants, I think they were converted while the converter was still being written and it's missing a piece or another, will look into it)


    Quote Originally Posted by The General View Post
    Do you know what the most expensive furniture calculations are?
    Honestly, I don't know what would take up the most performance right now, but it all looks kinda basic at the moment, they all work with a furniture_animation visualization type from what I've seen and the way I've written it for basic animations are pretty simple: add a sequence index to all layers where the animation is to be updated (e.g. not static, has animation, etc), if the frame in the sequence differs from the old frame, then render the new state, which, judging by the current stats and output (^), seems to be working just fine.

    As for the transitionTo and transitionFrom, they'll be pretty simple to implement, like I did before.

    Quote Originally Posted by The General View Post
    When will you add furniture shades :D ?
    Lol, I'll look into why they aren't shown!

    Edit:

    There is some clear issue with the data generated for the ice elephants, which I'm pretty sure is from the early stages of the converter. Specifically the animation sequences.



    As for the pre-processing/drawing performance:


    Pre-processing = it's the part before drawing the new frame, this is where the updates are done to let the graphic entities render the furnitures with new animations.
    Drawing = the time it takes to draw the pieces on the canvas.

    Do let me note that these messages are not displayed for every frame, they're only displayed when the process takes over 20ms.

    Edit #2:


    Shadows added! (currently set to 0.25 opacity, not sure what it needs to be, gonna check in a minute)
    Last edited by KittyChloe; 25-05-20 at 11:31 PM.

  15. #150
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    Re: Project Cortex

    Quality is in the small details so shadows is something you cant leave out :D



Advertisement