Zamargo's Forum Posts

  • Way to go R0jOhound! That is the straightest bullet Solution I have seen yet, thanks. This provides a nice platform for me to build a first person accuracy mechanics and have it truthfully provide the center of the cone! :D

  • I would think the angle the player is facing would be highly involved in playing audio from location!

    If your right then I think you are going to have to make your own sound handling events, The 8 direction sprite example should help you because it has angle vs angle math and the word MODULO is what your looking for.

    Also there is a lot of discussion going on with getting the 3-d shot to fly straight, It seems to be a little more to it than meets the eye, starting with the word...Zscale and ending with the phrase shared velocity.

  • I think this is roughly new territory we are in for c3, but I have some ideas and am going to be trying to figure out more. It mentions that some of these 3dCamera properties return "3d unit vectors" which may be referring to some unique value like a string of multiple numbers. I am going to have to test that soon.

  • From my experience the suggestion of Sami424 is actually correct.

    1Z elevation is 17.4px. So if you wannt to raise the bullet 1px/tick you set the z elevation to self.zelevation+1/17.4 also you should take deltatime into account... you can then check the zhigh of an object against the zheight of the bullet and determine if they collide or not at a given point. How fast the bullet raises or falls is determined by the angle, but i have no idea how to calculate that, let me know if you can figure it out :D i would do some trial and error... but must be quite complicated. shooting straight is no problem tho.

    But as you are making a shooter, have you come up with an idea how to determine sound positions? this is quite important for an fps but with the current system C3 has for audio pos its very hard to do...

    1z elevation is not 17.4, it is different for every viewport size, that is what the Zscale function was made for. Also Construct 3 has a "play audio at position" action in the basic events for Audio.

    The reason that shooting straight in first person view using the 3d camera is not as easy as your thinking is because the Zevevation per tick creates a velocity that has to be subtracted from the speed because bullet speed behavior = X/Y ONLY and a bullet shooting almost straight up isn't going anywhere so far as bullet.speed or X/Y position wise.

  • Thanks r0j0hound, I haven't thought of trying it that way. Also sorry sami if I sounded frustrated thanks for replying too!

    Update: 3DCamera.Forward properties don't seem to work for me

    These values are always the same no matter what I do with the camera

    3DCamera.ForwardX = 1

    3DCamera.ForwardY = 0

    3DCamera.ForwardZ = 0

  • A bullet flying forward in this way wouldn't actually be in the game world so there would be no way to know when it is hitting a wall. So the calculations you would make to detect when it does hit something require you to come up with a formula that could have made the original bullet fly legitimately in the game world without faking it 2-d so none of this makes any sense.

    Your suggestion sounds like you haven't even tried the 3d camera very much otherwise your advice might contain the world ZScale in it, as somebody calculating angle would need to convert it to pixel in the first place to have a chance at all of working.

    The code I have in my example works fine just not at extreme angles the original poster here would probably be better off following the example in my question on this same subject than this advice.

  • I don't find what your suggesting to make sense. Zelevation controls the ALTITUDE of an object viewed with a 3-d camera, it only controls depth if you are in 2-d. So if you are suggesting that we use a 2-d (HUD ATTACHED) bullet then it would literally move with the screen and not be inside the game world.

    The only way is to assign a Zelevation per tick based on CameraYRotation to keep it center screen, which after a few tries reveals itself as being a ratio of speed to Zelevation as a bullet fired straight up isn't going anywhere x/y wise.

    I would love to hear an improvement on my formula or a further explanation if I am misinterpreting your suggestion but it sounds like your taking a guess at it and about 15 steps behind the trial and error ladder I am on.

  • This is the closest I can come to getting a projectile to fire straight in a 3-d world, any suggestions?

  • I have it working now thanks to you guys.

    Eventually as a side project I want to learn to process the tasks using a fps kept in calculation by rotating logo. Maybe even one using cpuutil expressions. Ultimately I think keeping track of progress in the current task/loop and only operating enough per tick to be limited by cpuutil or fps and reporting the progress at the end of the tick would be the best way to report loading and one day I shall make it happen.

  • The wait command doesn't seem to work It seems more like it is issuing 100,000 wait 0.1 second commands all at the same time. I might rework this to only continue to generate level under a certain amount of FPS. cpuutil or some command like that if that.

    UPDATE: It seems to work very easily in segments outside of the loops. I can cycle through generating terrain, ore, trees and update the player before each task by using a 0.1 wait just like you said! Thank you!

  • I have a huge, extensive function that generates a 100,000 tile map, but I cannot for the life of my figure out how to display the loading progress to the user. I have tried making a loading bar and updating it from inside of the loops but it seems to skip past everything and still just freezes for 12 seconds. My suspicion is that everything is happening inside of one game tick, but if that is true what is a good way to give the game time to update the visual for the user in between?

  • I can't seem to make a progress bar work the game just freezes I don't know how to make it wait long enough to update the visual.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I am creating a rather big project and have eventually ran into the problem of having too many sprites laying on the ground that the player could pick up. They were all so close to each other that it was causing a million polygon checks a minute, mostly because all these items were occupying each other's bounding box. It was considered regular decorative trash (spent items), but I wanted it to be picked up again by the character. This ultimately was the cause of 95%+ CPU use and resulted in a game that quickly becomes unplayable.

    So that led me into a quest for efficiency! I will explain the ways I have found to get around this and would love to also hear everyone's feedback on what techniques they have used. My biggest problem is finding a way to not have to go from collision to polygon for dropped items testing EACH OTHER while laying closeby! Some things below are alternative methods and some are ideas for efficiency to the collision detection item pickup.

    #1 Using the mouse click or a button to pick up these items to avoid collision detection pickup and have collision on these items turned off.

    #2 When the player comes to a stop testing all items for Distance(x1,y1,x2,y2) to do a pickup event.

    #3 Turn collision off on items outside of the screen since the player is the only target for these tests.

    #4 Delete trash sprites in X seconds, attempt to limit pickup items that can be walked over by making them merge together if they are crossed in bounding boxes (overlapping) the same UID they are the same item and paired into a "stacked" item using a family instance variable.

    #5 Stop items that have finished "bouncing" to 0 speed on ground collision and push them outside of the solid that they interact with by sending them back to their last recorded X/Y which saves itself every tick on an instance variable

    Thank for any replies ahead of time!

  • Okay, I have a space game where I have generated planets that you dig and build on terreria or starbound style. I am just now reaching the point where I want to add scorch marks,grass,ore and other things attached to either dirt, rock, wood ect. So my question is:

    Is it better to make a new frame inside of my tilemap which each different land type holding the same ore, or drawing the ore as a sprite that just lies on top of the tilemap?

  • I would have hoped that there would be a difference between changing the collision polygon and completely removing the object. As you said about a new "collision instance" is created when you change the polygon, but nothing new is created when you erase something so I personally consider this to be a bug or something that needs work within the utility. If I was animating things I would just use the invisible collider, but removing them from the game world bringing up the same issue looks to me more like problematic built-in physics. Either way still loving construct.