Foxmander's Forum Posts

  • Hello.

    The question may be very common, but I need help in my particular case.

    In my game there is a large location which has a lot of randomly created objects like trees, stones, and so on

    How can I store their positions and states as efficiently as possible so that I can load them later?

    Thanks!

  • Hello, thanks for reply!

    I've just implemented your method, and it worked! But it seems to be even more laggier than without any tweaking..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unfortunately, I didn't handle it. Seems too complicated for me.

    I would be very glad if someone could help me and do this. Thanks a lot!

    .c3p's attached

    drive.google.com/file/d/1vteALHtVnmeg78QsvM7r32BkxfK1toaf/view

    Thanks again

  • Hello. What I am currently doing is playing with Advanced Random and 3DShape plugins. Of course I have tried to make some kind of Minecraft's terrain generation, and the result satisfies me.

    However, the lack of performance pushed me to the idea of ​​optimization. One of the ideas was to disable faces that collide with each other.

    So, what can I do to achieve this? Any ways to check "If 3DShape on %side%" or something? Thanks for advice!

  • Thanks! That actually worked.

  • Hello C3 users.

    I would like to know if you have encountered problems using 3DCamera's ForwardX/Y/Z expression? For some reason it does not work for me, even in built-in 3D platformer example.

  • r271 still haven't fixed this issue.

  • Oh strange. I didn’t test it but that sounds like a bug then.

    Guess you could move the camera forward by one, save it’s position to variables. Then move back one and subtract the position from the same variables. That would give you a forward vector xyz.

    Thanks again. I apologize if I do not understand something, but this solution does not work either.

  • do you want to shoot the bullet in the direction the camera is facing or do you want to shoot towards the enemy no matter what?

    For both first you need to add three instance variables to the bullet sprite for the velocity. I like to use vx,vy and vz.

    Then to make the sprite move you'd add an event like this:

    every tick
    -- sprite: set x to self.x+self.vx*dt 
    -- sprite: set y to self.y+self.vy*dt 
    -- sprite: set zelevation to self.zelevation+self.vz*dt 

    Now to shoot forward you'd set the velocities like this when you create the bullet:

    on click
    -- create sprite at (3dcamera.cameraX, 3dcamera.cameraY)
    -- sprite: set zelevation to 3dcamera.cameraZ
    -- sprite: set vx to 100*3dcamera.forwardX
    -- sprite: set vy to 100*3dcamera.forwardY
    -- sprite: set vz to 100*3dcamera.forwardZ 

    The 100 is the speed.

    To just shoot toward the enemy you'd do this:

    global number factor=0
    
    on click
    -- create sprite at (3dcamera.cameraX, 3dcamera.cameraY)
    -- sprite: set zelevation to 3dcamera.cameraZ
    -- sprite: set vx to enemy.x-3dcamera.cameraX
    -- sprite: set vy to enemy.y-3dcamera.cameraY
    -- sprite: set vz to enemy.zelevation-3dcamera.cameraZ
    -- set factor to 100/sqrt(sprite.vx^2+sprite.vy^2+sprite.vz^2)
    -- sprite: set vx to self.vx*factor
    -- sprite: set vy to self.vy*factor
    -- sprite: set vz to self.vz*factor

    Thanks for your response! It seems like ForwardX/Y/Z does not change for me when I move my camera. I even tried ths expressions in Scirra's "3D Platformer" example, but unsuccessfully.

  • tan(angle) will get you the slope of your camera angle. Multiply that by the distance and zscale to get the z height at any given distance. Remember to also add the z height of the origin/camera as well.

    Thanks for your response! Your solution will work with raytrace, but what I am trying to achieve is to make flying visible bullet, which may be a little harder to implement.

    I tried multiplying bullet's Z elevation by 3DCamera's LookZ every tick, but it seems to be wrong. Any ideas?

  • Hey. With C3's recently added 3D camera feature I started experementing with it's possibilities and stuck on making shooting FPS mechanic.

    Imagine an enemy, standing on the high ground. How do I reach him from below?

    How do I make a bullet that will fly up and down in the direction of my view?

    Thanks

  • Hey!

    Recently I've spent a few hours to implement raycast technique in Construct 3. So I've got a question: is there a way to create items like medkits in doom of ammo in wolf3D? And how do I actually calculate height of the walls? Currently I am using screen.height-ray.width, but is seems like it's curved and weird sometimes

    If anyone got interested, I could pin .c3p file.

  • Well I meant its features like improved vibration and adaptive triggers

  • Hello! Any news 'bout Dualsense and it's features support?

  • For some reason I can't make a post in the General Discussions thread, so I decided to ask here

    Is there now or are there plans to support DualSense? I mean its features like adaptive triggers or advanced vibration.