MegaMente Br's Recent Forum Activity

  • I tried doing what you said and now I am getting at maximum 20.000 collisions checks, I thinks this might be better :D

    Unfortunately, after a few new implementations I still got some issues with lagging. I will wait until the 'optimizing day' arrives again :)

    + I am trying to add a skybox. Everything went well, but is there a way to remove this white dots? It's a 'perfect' cube mesh, I don't thought I would get them, there is anyway to fix? (I will try using a sphere mesh later on and If I didn't work I will come back)

    And just a Chit-chat, What is a light that emits black light called?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > > Also, I'm not sure if your game is like minecraft and it needs all those boxes to be separate objects. Because if you have some static elements, then it is much better to create them using verts inside the plugin and to keep track of them just use tilemap with variables Z.

    > I saw some videos of 'recreating Minecraft' on YouTube and they talked about it... But to be honest I cannot imagine the solution on how to do it. Also, I think if I do this way the project my not be able to support lights? I mean every block have it's on info (light RGB, pos, behaviors) and I wouldn't be able to use the 'prebuilt' animations (rotation, scale and moving)

    If you are using sprites to control blocks, then it probably wouldn't be a problem.

    > I think I was getting about 1000 collisions checks per second lol. I think it was the physics behavior and all those objects is set to immovable, so I think they might be always colliding or something 😂

    Yeah, you want to deactivate the behaviour where it is not needed. ROOJ chipmunks physics is much better in that regards too. But the system I showed you, unless you are rotating around Depth axis and not using sprites, but code, will work better than physics. It has less to calculate.

    >

    > Again I am away from my PC, but I remember only these:

    > Specs:

    > - it's a 11 years old PC

    > - 4 gb ram

    > - Intel i3 (3.50 GHz, 1 socket)

    > - About 20gb left in memory of 140gb.

    > - Windows 10

    > - bonus: The CPU usage (at project debug) is around 40-79.

    That's an old machine. you should at least upgrade cpu to i7 that uses same socket. You will get much better performance then i3 and they are cheap now. What gpu?

    I would like to try your project, out of curiosity, see if there's anything I can suggest to get you a better performance. I'm using Construct since 2007, so I kind of know a lot about it.

    My bad, I looked again here and I actually the game is doing 300.000 to 410.000 collisions per seconds (WHAAAAT??? LOL) 😂😂😂😂

  • > > R0J0hound Re Paster, I can't figure out how to paste object on the the paster canvas without paster object being placed exactly above the sprite. Is this the only way, or there's some other option? Tried quads but quads don't paste glfx.

    >

    >

    > sorry to intrude again... Why placing paster over a sprite is being a problem?

    Firstly, what specs do you have? Secondly, that still quite low performance for only 138 objects. you must be doing too many things at once. And instead of every second condition, it's better to create tick counter and use that, ie every frame tikCounter=(tikCounter+1)%10 . Once it will get to 10 it will instantly become 0 and counting starts again. And then you just create conditions if tikCounter = 0,1,2... etc and do events. It's much more precise then every second and you can plan updates much better.

    With paster I noticed that when pasting in to a quad it doesn't copy the fx. When just pasting it copies only one effect. But also, there's resolution which actually has to be high in order to paste the image faithfully. Oh well, will continue with what I have.

    Edit@ Here, this is a collision system made by ROOJ long time ago, but it's surprisingly versatile and light. Thanks ROOJ! With this system you can disable collision of your sprites, create more efficient way of picking which objects you want to check collisions with.

    You need to have player sprite and box colliders in one family and do PICK NEAREST, FOR EACH PICKED, or keep boxes/3dobjects id's you can create when spawning objects and put them in array if you are not using sprites, and then check distance against them. But example shows how to do it with sprites. If i remember well ax and ay is object's position from family "t". Creating your own basic movement system is also very easy. The advantage of that is that you can create it specifically for 3D while thinking in 2D.

    Also, I'm not sure if your game is like minecraft and it needs all those boxes to be separate objects. Because if you have some static elements, then it is much better to create them using verts inside the plugin and to keep track of them just use tilemap with variables Z.

    I saw some videos of 'recreating Minecraft' on YouTube and they talked about it... But to be honest I cannot imagine the solution on how to do it. Also, I think if I do this way the project my not be able to support lights? I mean every block have it's on info (light RGB, pos, behaviors) and I wouldn't be able to use the 'prebuilt' animations (rotation, scale and moving)

    I think I was getting about 1000 collisions checks per second lol. I think it was the physics behavior and all those objects is set to immovable, so I think they might be always colliding or something 😂

    Again I am away from my PC, but I remember only these:

    Specs:

    - it's a 11 years old PC

    - 4 gb ram

    - Intel i3 (3.50 GHz, 1 socket)

    - About 20gb left in memory of 140gb.

    - Windows 10

    - bonus: The CPU usage (at project debug) is around 40-79.

  • R0J0hound Re Paster, I can't figure out how to paste object on the the paster canvas without paster object being placed exactly above the sprite. Is this the only way, or there's some other option? Tried quads but quads don't paste glfx.

    sorry to intrude again... Why placing paster over a sprite is being a problem?

  • MegaMente Br I see you have 38fps. Can you give me details of your project: nwjs or chrome, something else? your specs? Resolution? Number of objects? Thanks

    Yep, on the last image, I got 38 fps before some optimizations, now I am getting about 40-46 fps.

    - I have in total 106 of those 'MeshLoaders' and 4 of them are lights, 1 is a continuous animated mesh (piston), and 1 is a 3D text, 2 of them are entities (with 3d anti-overlapping) and finally 1 that is a Ghost Block to prevent placing a block where a entity is standing.

    - Currently I am using Google Chrome.

    - I am playing with aspect ratio of 16:9 (1280x720) (unfortunately I wasn't able to use other screen sizes or the game screen would be stretched)

    - If I do remember correctly it's in total 136 objects.

    - All the 'MeshLoaders' have by default size of 16x16 on Construct 2 Editor.

    - The big equipment on my screen is just a 2D image on the normal screen with 2 Sine behaviors.

    - And finally a raycast with 4.5 blocks (1 block =16x16) radius with 288 steps in total every 1/24 seconds.

    Edit: I forgot to say... Also, the 'player' is using Construct 2 physics as collision. I am planning to change that but will be very far in the future.

    + I can push the other entity (blue box) over other box and it have collisions to detect if it is nearby/overlapping a block when beeing push and 'jump' to be over it.

    Edit 02: I forgot to say again... From the 'MeshLoaders' I have 4 which is in a constant loop (using sine behavior values) playing PreBuilt Animations

    1: (Floating; RotationZ; StretchZ)

    2: (RotationX)

    3: (RotationY)

    4: (Floating)

  • The textures still won't show on by objects.

    Here is the capx:

    https://www.mediafire.com/file/80xfg39nn35vltz/3Dte.capx/file

    Now I am away from my computer, but it should look something like this:

    'tqw@' = Condition

    '$' = Event

    "" = Inside the Rojo Code it means the 3D world (set almost everything you do with this and might work)

    @ On Start of Layout

    @@ Blank

    $$ Rojo3D: Load [sprite] as [meshtexture]

    $$ Rojo3D: Load [mesh url] as [meshtag]

    @@ Blank

    $$ Rojo3D: Create [meshtag] relative to: [""]

    $$ Rojo3D: Set [meshtag] pos X Y Z

    $$ Rojo3D: Set [meshtag]Scale X Y Z

    $$ Rojo3D: Set [meshtag] Color 1 1 1 1

    $$ Rojo3D: Set [meshtag] texture as [meshtexture]

  • Also, Merry Christmas Everybody!! :D

    Update (Thanks God! I was able to somehow sum different light colors... I don't even know it is working, I guess I'll just follow the first code rule: "If it is working, don't touch it!")

  • R0J0hound is there a way for you to help me with getting textures to work? I tried to get a texture from a sprite and put it on a 3D object, but I just get errors or it doesn't show up

    Sup! Welcome aboard! Excuse me, if you allow me...

    I tried loading a texture from a sprite before and it didn't seem to work too, but you can also load texture from

    1) - Png images on project folder or...

    2) - Using the Paster Plugin

  • You need to pathtrace or raytrace from ach object within the range of the light to the light source and if there is a collision with block on the path ( assuming each of your blocks has it's own sprite object ), you test weather the path is between min and max z of the object, and if it isn't, it continues the path till it eventually reaches the source. You already did raytracing I think.

    Bro? 💀💀

    You suggested me to do Raytracing for each light?

    My Raycaster does a ray in one direction and it cost about 7 fps. What would happen to my PC I make the raycast in all directions at the same time and for literally each light in the scene? Idk maybe I am exaggerating, but IDK... I might test it anyway, but this week I don't think so

  • Any tips for 3D lighting?

    What I was able to do so far:

    - On Start: Function "CallLights"

    - Function "CallLights": for each Light object - Function "UpdateLight"

    Param (0) = light level

    Param (1) = redcolor

    Param (2) = greencolor

    Param (3) = bluecolor

    Param (4) = alphacolor (I did nothing with this until now...)

    Param (5) = light.posX

    Param (6) = light.posY

    Param (7) = light.poxZ

    - Function "UpdateLight"

    -- For each object that isn't a ligth object (this condition is only for my project, as I said, Meshloader load/placehold everything that is 3D)

    -- (param(0)*10)/Distance3D(obj.x, obj.y, obj.z, param(5), param(6), param(7))

    -- obj red color = Function.Param(1)*Self.LightLevel

    -- obj green color = Function.Param(2)*Self.LightLevel

    -- obj blue color = Function.Param(3)*Self.LightLevel

    Image :D

    Problem? Here: I need to make this to verify if ther is a block blocking light, since a light on the ground cannot reach a cave level.

    I saw that it could load light block per block... How am I supposed to that mid-air? I have to place every non-block with 'air placeholder'?

  • megatronx

    If you don't understand any part, you can ask! :D

    *Currently I *Gave 3D Texts the....

    * Inside my project the MeshLoader Loads basically everything from 2D to 3D, like a placeholder

  • Rojo: No it's the the Paster that have the culling problem, but the text object, although it's a good idea since C2 events works fast as a tick it would be almost invisible.

    Megatronx: thanks for the plugins, I think I might have a look for each of them. The insert text inside sprite behavior didn't work or I Just didn't understand how to use it correctly.

    I did a few more tests and figured out that if the Sprite font (hotspot: bottom-left) is located at (0; 0.1) the culling doesn't happen. So I still can have 1 line of text.

    Today I am away from my PC and I am going to sleep, I don't know you guys live because times changes, but for me it's already time for sleep.

    Tomorrow I might give you the code on how I did it.

MegaMente Br's avatar

MegaMente Br

Member since 4 Nov, 2020

Twitter
MegaMente Br has 2 followers

Trophy Case

  • 4-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • 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
  • Email Verified

Progress

10/44
How to earn trophies