Stolfenwein 3-D - RayCast Engine for Construct2

From the Asset Store
Make your dream action platformer game effortlessly with this template!
  • Hello again I fixed problem with walls they now render but wonky.

    and in middle they look like one side is further than other.

    Thanks in advance.

    This looks like either math is wrong or a pixel rounding issue (wall render stripes being not integer widths).

    Which files do I have to look at in your shared folder?

  • I solved this apieriantly I set iamge points wrong and thats made it render wrong now it works

    No need to worry.

  • > Hello again I fixed problem with walls they now render but wonky.

    >

    >

    >

    > and in middle they look like one side is further than other.

    >

    > Thanks in advance.

    This looks like either math is wrong or a pixel rounding issue (wall render stripes being not integer widths).

    Which files do I have to look at in your shared folder?

    Colonel Justice do you have a c3p files about this ray cast method? Can you share this for construct 3? Thanks.

  • Colonel Justice do you have a c3p files about this ray cast method? Can you share this for construct 3? Thanks.

  • Hello I just gonna ask for pure optimization questions.Is it possible to render not in 640x360 resolution but something smaller like 1/4 of that because I need really long rays for some places due the fact its kinda open world kind project. I saw in your teasers that you have textures on floor and ceiling so if its plugin or something else? Will this engine transparency? Because if will then I could use just walls for roads in my project.

    Thanks.

  • Colonel Justice do you have a c3p files about this ray cast method? Can you share this for construct 3? Thanks.

    Still working on it, I'm having not that much spare time for the last couple of months, business and private-wise, so there might be a c3 example in some time, covering the basic methods.

    The C3 version also is using a different raycasting method which eliminates the distortion artifacts you see in the C2 build. Reason is that I was following the Permadi method, which is not built on vector math, which you should use.

  • Hello I just gonna ask for pure optimization questions.Is it possible to render not in 640x360 resolution but something smaller like 1/4 of that because I need really long rays for some places due the fact its kinda open world kind project. I saw in your teasers that you have textures on floor and ceiling so if its plugin or something else? Will this engine transparency? Because if will then I could use just walls for roads in my project.

    Thanks.

    You can basically lower the project resolution and tell via global variables to use fewer rays, e.g. 320 px. Therefore you could utilize longer ray distances. The key performance boost is to test against fewer instances. The C2 version uses sprites as walls, and you have to test against each instance.

    The C3 version uses a single tilemap object (as showcased in the Youtube videos), which is a single instance. With some clever math figuring out the texture and wall angles, this means a massive performance boost.

    The floor and ceiling textures are not raycasted. In fact, they are rendered through sprites with the mode7 effect applied, then more or less correctly altered through player position and angle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello I just gonna ask for pure optimization questions.Is it possible to render not in 640x360 resolution but something smaller like 1/4 of that because I need really long rays for some places due the fact its kinda open world kind project. I saw in your teasers that you have textures on floor and ceiling so if its plugin or something else? Will this engine transparency? Because if will then I could use just walls for roads in my project.

    Thanks.

    On transparency: Unfortunately, the engine to date cannot render (semi)transparent walls effectively. That would mean, for each ray, you would have to test against walls until the ray hits a wall that has no transparent texture component, then stack each transparent wall and render it to a, for instance Paster instance, including the last hit wall which has no transparency. This is not feasible right now with C2/C3 plugins and would require a plugin to be written from scratch. Again, time is of the essence.

    The semitransparent components shown in the Youtube showcase are composed of striped sprites spawn in the correct order, e.g. the gate style textures you can see before doors, the laser fence, etc.

    Again, while this works in principle, it takes a heavy toll on the engine performance. I have yet to figure out a clever way to create and render these walls at runtime.

  • > Hello I just gonna ask for pure optimization questions.Is it possible to render not in 640x360 resolution but something smaller like 1/4 of that because I need really long rays for some places due the fact its kinda open world kind project. I saw in your teasers that you have textures on floor and ceiling so if its plugin or something else? Will this engine transparency? Because if will then I could use just walls for roads in my project.

    >

    > Thanks.

    You can basically lower the project resolution and tell via global variables to use fewer rays, e.g. 320 px. Therefore you could utilize longer ray distances. The key performance boost is to test against fewer instances. The C2 version uses sprites as walls, and you have to test against each instance.

    The C3 version uses a single tilemap object (as showcased in the Youtube videos), which is a single instance. With some clever math figuring out the texture and wall angles, this means a massive performance boost.

    The floor and ceiling textures are not raycasted. In fact, they are rendered through sprites with the mode7 effect applied, then more or less correctly altered through player position and angle.

    So using Mode 7 I could create floors. OK I have plugin and effect but in video is this repeated texture or one large? because for creating road like effect I'll need use large texture or chunks of said texture? And how proper use that effect because I kinda tried but if I set it as one its just white floor or just flys in very quick speed, anyway mode 7 for floor.

  • > > Hello I just gonna ask for pure optimization questions.Is it possible to render not in 640x360 resolution but something smaller like 1/4 of that because I need really long rays for some places due the fact its kinda open world kind project. I saw in your teasers that you have textures on floor and ceiling so if its plugin or something else? Will this engine transparency? Because if will then I could use just walls for roads in my project.

    > >

    > > Thanks.

    >

    > You can basically lower the project resolution and tell via global variables to use fewer rays, e.g. 320 px. Therefore you could utilize longer ray distances. The key performance boost is to test against fewer instances. The C2 version uses sprites as walls, and you have to test against each instance.

    > The C3 version uses a single tilemap object (as showcased in the Youtube videos), which is a single instance. With some clever math figuring out the texture and wall angles, this means a massive performance boost.

    >

    > The floor and ceiling textures are not raycasted. In fact, they are rendered through sprites with the mode7 effect applied, then more or less correctly altered through player position and angle.

    So using Mode 7 I could create floors. OK I have plugin and effect but in video is this repeated texture or one large? because for creating road like effect I'll need use large texture or chunks of said texture? And how proper use that effect because I kinda tried but if I set it as one its just white floor or just flys in very quick speed, anyway mode 7 for floor.

    The best bet is to use a single big texture. You have to flip the image / rotate it though, as the sprite gets transformed by the mode 7 effect.

    Also:

    You have to factor in the players viewport angle.

    Therefore :

    mode7 x: Player.X / scrollingfactor + cos(Player.Angle)

    mode7 y: Player.Y / scrollingfactor + sin(Player.Angle)

    scrollingfactor is related to player viewport height and screen resolution / mode7 object height and has to be tweaked.

    Also keep in mind for FPS purposes, the horizon line has to be at Y viewportheight /2.

  • OK so I decided to imply mode7 into a project but got into a problems with my knowledge level. So this is how it looks with single image set 0

    Texture size

    So what I need to do to make this texture to work properly because I can't find any way to make it possible. Car and camera are two different objects, car is rendered on screen like any other object. If you could just make example of event I would be grateful if not well I am gonna just make road black and set game at night.

  • I too use Mode 7 to do floors and ceilings, and it works pretty well after manually adjusting the numbers a lot, but it's not "rock solid" like actual floor casting.

    When turning the floor angle drifts a little.

    For a while when I got the scrollfactor right for moving forward or backward, then side to side motion is f-ed up. There's a "just right" kinda balance I found but the angle thing still happens.

    I got it to be not that noticeable, but it would be nice to get it spot-on. In fact that would open up possibilities like having more than one level.

    Also really interested in how you get a performance boost with the tilemap. I get 60 fps with not a ton of objects, but it goes down with any higher resolution than 256 lines.

  • I too use Mode 7 to do floors and ceilings, and it works pretty well after manually adjusting the numbers a lot, but it's not "rock solid" like actual floor casting.

    When turning the floor angle drifts a little.

    For a while when I got the scrollfactor right for moving forward or backward, then side to side motion is f-ed up. There's a "just right" kinda balance I found but the angle thing still happens.

    I got it to be not that noticeable, but it would be nice to get it spot-on. In fact that would open up possibilities like having more than one level.

    Also really interested in how you get a performance boost with the tilemap. I get 60 fps with not a ton of objects, but it goes down with any higher resolution than 256 lines.

    What kinda formula you used because mine is getting proper speed and angle but location on texture is way off.

  • The location on the texture is based on the scale x and scale y. I haven't done it on C2 --for that, I've only had just infinite scrolling the same texture floor so location didn't matter.

    Also For C3 I had to set the max sprite sheet size to the texture size for the floor/ ceiling or it would get other object textures mixed with it..

  • imgur.com/a/ofwBY7b

    getting this error in latest c2 version on testing.

    also shooting and axe slashing wont deal any damage to enemies. is that normal ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)