Rojo3d. 3D engine for Construct 2

From the Asset Store
Casino? money? who knows? but the target is the same!
  • (sry my bad english i'm not native)

    I will post updates of my project here, if anyone doesn't mind.

    Rojo! I don't exactly what could be error I was getting (about the clipped objects). But What I know is: I found the solution!! :))

    I just changed everything and made it bigger (changed all objects scales to 2x it's size). Now I am not getting clipped objects anymore, at least I hope. Sooner I might post here the:

    "Default 3D Game Template for Construct 2"!

    (Hope it can help grew again this community)

  • Rojo I am having quite a huge problem... may you or someone can help me?

    I am having a lot of issues trying to make this https://www.youtube.com/watch?v=w-Bk8a4F9mw....

    It's because it almost doesn't have any comments at all, and for me whom english isn't the native language, it gets really complicated...

    I don't know how to describe the problems I am getting, but as far as I know... I did something wrong.

  • Pretty much any c3 example of raycasting won’t work with this plug-in. Raycasting isn’t supported.

    Two options would be to either:

    * modify the plugin to access the vertices and triangles of the objects. With that you’d need to then transform the triangles into world space and then do some math for each tri vs a ray.

    * or just skip the plug-in, make an obj loader, transform triangles into world space…etc. basically the same steps.

    This plug-in really doesn’t provide anything that would make ray casting easy to do. I’d recommend doing other things instead of raycasting.

  • I thought it would be possible, I mean, the guy from the video only used C3 default 3d plugins (and there is a way to download the game project from the video going into the website linked in the video description).

    Before I tryed doing something similar to what that guy did, I did my own 'raytracing laser'

    But it's not optimal, here is what I got so far:

    - Create a 3D block right at camera's front

    - Then Make this object independent (give it the necessary variables to 'survive' without the camera variables)

    - Make the object move in the 3D space and in a certain 3D angle.

    - Repeat the process

    Result, the laser moves like a 'rope' and not like a stick (or how laser was supposed to rotate and move)

    I mean, the results at my point of view is cool of watching, but it's not what I am looking for.

    I figured out that what I did and what that guy from Youtube did is almost identical, but he is using array and json, and I am doing it using 'voxels' to simulate a laser.

  • Eureka!!!

    I think I found the solution! I will mix my 3D Raycast with the youtuber's one and see what happens... also I figured out why it was behaving like a rope and fixed it! Now I positive about it!

  • Hey R0J0hound

    I did some work in project and I had an idea: Do you think it would be possible to "update" the plugin using any AI Bot for programmers? I will ended trying anyway, but because I have almost no knowledge in javascript I just wanted to ask you... :)

    P.S.: I think the "Template for 3D" project it's half way there, and I think with this template it will even possible to recreate games like Fall Guys, Fortnite and Minecraft... (but those games would be almost be a voxel-style game with custom 3D objects)

    I mean, I am having a bit of issues with optimization, but I am positive about it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to try an ai coder then go for it. I wouldn't be interested in trying since it would create more work for me to verify made working changes and if it broke it I'm not interested in debugging it.

    I'm happy you've found enjoyment in using this plugin, but at this point I'm not likely to revisit it at all. I'm more likely to make a stand alone tool independent of Construct since most of what I want to do in Construct requires workarounds and once I made such a tool I'd probably disappear from here rather quickly.

  • If you want to try an ai coder then go for it. I wouldn't be interested in trying since it would create more work for me to verify made working changes and if it broke it I'm not interested in debugging it.

    I'm happy you've found enjoyment in using this plugin, but at this point I'm not likely to revisit it at all. I'm more likely to make a stand alone tool independent of Construct since most of what I want to do in Construct requires workarounds and once I made such a tool I'd probably disappear from here rather quickly.

    I'm using your plugin still. I am in the middle of programming map systems. I agree about the amount of wark-arounds. Those are painful, since many of those systems could have been implemented from the get go. But regardless, with so many years doing prototypes in c2 I've learned it to the degree I am making my own 3d game in free time and I don't want 11 years to go to waste. I'm creating everything from vertexes instead of importing objects. This way I can create large map and save it as single object and enjoy really good performance. But I would love to see your tool, which would borrow the best aspects of construct but would improve on it, add things, and allow to make 3D games easily, have 3d editor, dynamic vertex shading etc. There is a program called Manu being developed. It is very promising but the way you program in it is a bit hit and miss. But check it out.

    I have a couple of questions: 1. I'm thinking of storing each map vertex in 3d array to use it for collisions, but to be frank I have no idea how I'd have to go about it, other then I know I'd have to nest arrays inside arrays for performance sake. Any Idea how to do do vector calculations with that? Or in general how I can calculate a vector from 4 vertexes? 2. Do you remember what LOAD action exactly do in your plugin? I haven't tested it, but I wonder if I create 3d meshes and then download the state of the plugin, will loading that state recreate the meshes, instantly and I won't have to generate them with code?

    Thanks!

  • Hey MegaMente Br

    I did some work in project and I had an idea: Do you think it would be possible to "update" the plugin using any AI Bot for programmers? I will ended trying anyway, but because I have almost no knowledge in javascript I just wanted to ask you... :)

    P.S.: I think the "Template for 3D" project it's half way there, and I think with this template it will even possible to recreate games like Fall Guys, Fortnite and Minecraft... (but those games would be almost be a voxel-style game with custom 3D objects)

    I mean, I am having a bit of issues with optimization, but I am positive about it.

    Here's a tip. If you have more then 2000 objects loaded you will experience fps problems. Ideally around 1000 objects is where you will keep your performance smooth. So you will have to create an array that will keep positions of all objects in map and then pick from a pool of free objects first free one, tag it as busy and load a mesh in to it and position it. Once it is not in view you can unload the object and place it back in the free pool array.

  • It's a good tip, but unfortunately I am having problems with raycasting the player vision: detecting where the player is looking. Until now I got a acceptable result, but it's very unaccurate although still gets the job done.

  • Now, I could translate correctly, you are having issues with player Z colliding, right? In my template I did the way Construct 3 3D Platformer Template did and it's working pretty well. But I think you can also make Z collisions with Height map, you pre-render the map outside Construct 2 and get it's height map, and use some javacript or a plugin that can read colors, then you detect what Z Elevation the player should be depending on the Z Map Height.... It's hard to explain... did you get it?

  • megatronix

    Always nice to hear the plug-in being used. Time and motivation are the main obstacles of most of my projects. But anyways.

    I’ll look up that program. There’s always interesting ways different programs do things.

    Which load action? There’s one to load an image file, one to grab a sprite texture and one to load an obj file. Obj files are a simple text based 3d model format. You could probably generate a file from the vertices. Just save the xyzuv of the vertices to an array as you add them. Then you’d add two lines for each vertex in the file: “v x y z”&newline&”vt u v”&newline. Then you’ll need to add the faces. Every three vertices define a face so this would generate the face data:

    Var i=0
    Repeat int(vertexCount/3) times
    — set i=loopindex*3+1
    — append “f “&(i)&”/“&(i)&” “
    — append (i+1)&”/“&(i+1)&” “
    — append (i+2)&”/“&(i+2)&newline

    Collisions are a can of worms. Storing all the xyz’s of the vertices is the first step. Then if you transformed the object using that mesh at all you’ll need to transform those points too. Basically xyzVector *scaleVector *orientationMatrix+positionVector. After that, each group of three vertices define a triangle. And after that… I guess it depends on what kind of collision detection you want. There are a lot of algorithms different algorithms and I can’t do them justice off the top of my head. Tri vs Tri could be done with SAT, MPR, GJK or maybe calculating the line where the two planes making up the triangles intersect, clipping the line by the edges of both triangles and if there’s anything left it’s a collision. Those first three algorithms work with all the points of convex solids and will give some collision info such as normal vector and where.

    I don’t think I’m scratching the surface though. In general to make things faster you’d use a simpler collision mesh instead of the visual one, or approximate it with simpler primitives like spheres, bounding boxes, oriented boxes, capsules, height maps etc. However in the construct realm I think the simplest solution is just do all the collisions in 2d and have the 3d just be a visual. You can look at any 3d collisions people are doing in c3 for some ideas too.

    The process for implementing any of that is to find an algorithm online somewhere and adapting that to events. I can only give an overview here atm.

  • Making a voxel collision terrain would be a good idea, don't you think? Although some cases it isn't optimal for big maps and complicated meshes, it can pretty easily be handy for many cases.

  • megatronix

    Always nice to hear the plug-in being used. Time and motivation are the main obstacles of most of my projects. But anyways.

    I’ll look up that program. There’s always interesting ways different programs do things.

    Which load action? There’s one to load an image file, one to grab a sprite texture and one to load an obj file. Obj files are a simple text based 3d model format. You could probably generate a file from the vertices. Just save the xyzuv of the vertices to an array as you add them. Then you’d add two lines for each vertex in the file: “v x y z”&newline&”vt u v”&newline. Then you’ll need to add the faces. Every three vertices define a face so this would generate the face data:

    Var i=0
    Repeat int(vertexCount/3) times
    — set i=loopindex*3+1
    — append “f “&(i)&”/“&(i)&” “
    — append (i+1)&”/“&(i+1)&” “
    — append (i+2)&”/“&(i+2)&newline

    Collisions are a can of worms. Storing all the xyz’s of the vertices is the first step. Then if you transformed the object using that mesh at all you’ll need to transform those points too. Basically xyzVector *scaleVector *orientationMatrix+positionVector. After that, each group of three vertices define a triangle. And after that… I guess it depends on what kind of collision detection you want. There are a lot of algorithms different algorithms and I can’t do them justice off the top of my head. Tri vs Tri could be done with SAT, MPR, GJK or maybe calculating the line where the two planes making up the triangles intersect, clipping the line by the edges of both triangles and if there’s anything left it’s a collision. Those first three algorithms work with all the points of convex solids and will give some collision info such as normal vector and where.

    I don’t think I’m scratching the surface though. In general to make things faster you’d use a simpler collision mesh instead of the visual one, or approximate it with simpler primitives like spheres, bounding boxes, oriented boxes, capsules, height maps etc. However in the construct realm I think the simplest solution is just do all the collisions in 2d and have the 3d just be a visual. You can look at any 3d collisions people are doing in c3 for some ideas too.

    The process for implementing any of that is to find an algorithm online somewhere and adapting that to events. I can only give an overview here atm.

    Thanks for extensive reply. Your plugin is very cool addition to c2. Shame it is not completed, but I decided some time ago that I will just make what I can within its limits.

    Currently, since I am currently developing tile system for tile map use, my plan for collisions is to simply check neighbouring tiles and based on that place temp wall sprite tile here wall tile is. However, I was thinking of dropping this idea and replacing it with proper polygonal collision based on vertexes. Then I could use tilemap only for world creation. I will get back to the subject once I get to that point.

    I also would like to implement 2 shading features using vertex coloring: 1. AO, and 2. Static shadow system. The shadow implementation in the plugin is unfortunately not working as intended, so alternatively I am thinking of making my own simpler system. But I do think calculation pre drawing the polys would have to use the Array too since the system would have to reference other tiles being in the direction towards the light source. Although maybe this could also be done just with tile map I'm now realizing, thought somehow would have to consider the foliage and other elements on the map that would be spawn using noise values. But any thoughts on that?

    As for mesh building, I actually went with a simple system where I have a set of frames with image points. I place the sprite on a tile, set its parameters according to the tile and then just draw tris once after another using imagepoints. Its pretty good solution. But should work faster once the vertexes are being read from an array.

  • Now, I could translate correctly, you are having issues with player Z colliding, right? In my template I did the way Construct 3 3D Platformer Template did and it's working pretty well. But I think you can also make Z collisions with Height map, you pre-render the map outside Construct 2 and get it's height map, and use some javacript or a plugin that can read colors, then you detect what Z Elevation the player should be depending on the Z Map Height.... It's hard to explain... did you get it?

    Sure, but if you read my response to ROOJ you'll see what I'm after. And for the terrain Z I'm using noise+tile type :)

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