MegaMente Br's Forum Posts

  • 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)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • I understood how the Paster Plugin works!!!

    :DDDD

    But I found a problem, the Paster plugin don't work to copy the text plugin 'sprite', since it's not a... sprite. Anyway, it does work with SpriteFont, BUT! It does have a clip frustum or something (srry I don't want to use translate) -- It disappear when outside layout

    Anyway I searched for one plugin I saw one time, and found this: (https://www.construct.net/en/forum/construct-2/addons-29/behavior-sprite-effects-amp-46890)

    R0J0hound you were here way before me, did you by any change have already downloaded this plugin? Because it isn't available anymore. If not, I might ask the guy who created the plugin and test if it works.

    Afte all, if nothing works, I still can try making loading screen that would hide the Paster Plugin behind a sprite and the SpriteFont behing the Paster plugin to load every text inside the scene.

  • Nope, Nope, NOPE! I am giving up! I will go and try again with the paster plugin... I just asked Phinder AI to help tell me what Camera Orientation (ThetaXYZ) is and how to get it... The response:

    Here is how you can convert the rotation matrix to Euler angles:

    1. ThetaX (Rotation around X-axis): This can be calculated from the elements of the rotation matrix. Specifically, ThetaX is the arctangent of -orientYZ / sqrt(orientYY^2 + orientZZ^2).

    2. ThetaY (Rotation around Y-axis): This can be calculated similarly. ThetaY is the arctangent of (orientXZ / cos(ThetaX)) / sqrt((orientXX^2 + orientXZ^2) / >(cos(ThetaX)^2)).

    3. ThetaZ (Rotation around Z-axis): This is calculated as the arctangent of (orientXY / cos(ThetaX)) / sqrt((orientXX^2 + orientXY^2) / (cos(ThetaX)^2)).

    Also in the end it will be only a shot in the dark.

    Last Edit: I think I am starting to understand how the Paster Plugin works, the Tunel might have a light!

  • Why not have it simpler and have a speech bubble icon above object and when you approach it you'll get 2d speech bubble with text?

    Well, it's a good option and I think I might use this way. Although my objective it to create a '3D Game Template' and the way I am trying could maybe save a lot of time... or maybe just be a real shot in the dark...

    + With this I could also save a lot of memory since I won't need to save all the ballons sprites if I have a complex scene or if want to add a text typing effect.

  • I think I might use local variables then. I didn't want use them before because I thought it would make the debug window be messy.

    I will mess around with everything you told me and see what the result will be.

    ++ Try again with the Paster plugin with a can learn how to use it correctly.

    Do I have to position it behind the text

    Then I make its length the same of the text.

    Then I also I change the resolution to fit it's size

    Then? I use 'paste object'?

    This object must be a third object like a plane and that plane will 'screenshot' the area? Or the object selected must be the text?

  • Srry, What is scrollx?

    Plus, you talked about wikipedia and I search and found this:

    (I forgot it was translated, but here the link: https://en.wikipedia.org/wiki/3D_projection)

    ... let's see what I can get... (I should had listened to math class lol)

    ** I didn't understand how to get the E value {E xyz}? It's the depth? It's the FOV? How?

  • If I'd be doing a text bubble, I guess I'd work with billboards and would look for a way to turn text in to a texture. Would have to load in additional bubble graphics. Any thought how to do it with PASETER R0J0hound ?

    As for field of view, would love to make a 3d camera cone for tests, but if I won't I'll work with what c2 offers, so fov plugin. I think it's much better to work with what there is in c2 already and with additional events extend those plugins to work in 3d then inventing all of the systems from scratch if it isn't necessarry.

    I tried doing something with paster, but it looks like I have to always take a screenshot for it to work? I still stand trying to understand the Paster plugin.