tunepunk's Forum Posts

  • I linked this thread on the idea request page.

    construct3.ideas.aha.io/ideas/C3-I-55

    If it's not too much work turning something like this in to a working 3D sprite plugin, it would be a welcome cool addition to C3's capabilities while still being a 2D game engine.

    As described previously it's just tedious and memory hogging to pre render sprites many many frames just for smooth rotations of objects.

    If anyone else supports this kind of 3D sprite concept...

    go to link above and upvote and comment.

    A big thanks to Nepeo R0J0hound for making these examples. They are really fun to play around with.

  • Just tried to lerp from 0 to -infinity.

    lerp(0, -infinity, 0.01) so you would get 100 steps from 0 to infinity, but that didn't compute as i expected... lol

  • dropbox.com/s/mo3wkpd8abngcpj/movettest.c3p

    Here's another example..

    Like you said.. you have to select one target, once a target is selected you can then move towards the target... instead of using pathfinder you can restrict how fast it can turn by using anglelerp like in this example.. sometimes it overshoots and turns around...

    Hope it helps..

  • Nepeo Awesome job! and thanks again R0J0hound for the initial example. Took me whole weekend getting halfway of what you did. (I'm not much of a coder so it's trial and error for me)

    Yeah. I'm, hoping at some point getting some help turning it into a plugin.

    The concept of a 3D sprite... similar to the gif attached above. Is what I'm after. There is a lot of cases where it would be preffered to have a simple 3D model instead of sprite with lots and lots of frames, if you want a smooth rotation, or rotate stuff freely in any angle. Simple surface shading like in the example would give the rendered object that 2D look as well, without shadows, lights, highlights, bump etc.

    Since construct doesn't support any rotation other than in XY you're forced to use pre-rendered frames.

    I've often wanted to rotate sprites in YZ angle to get trapetzoid shapes, to get a feeling of depth and perspective. Or flip cards and sprites. Currenlty not possible.

    With the new Z-order elevation, it would be cool to have simple buildings using this 3D sprite method, to create games similar to GTA1 & 2. youtu.be/Z9ZZX1uO7Hg

    Thanks again for the help guys! I'm going to play around with this some more!

  • Not sure, but there might be a slight overhead if you want to pick those 1000 objects using families. Families has a very slight cost to performance, but not very much.

    But it's more easy to work with instances than 1000 seperate objects.

  • No problem at all Sir. The latest example is super as it is too.

    Just found the first example a but more user friendly, since the sprite boundries would give you a hint of where and approximately how big the 3d object will be in your game. Giving you a bit more sense of scale and position when plasing these 3d sprites around the map.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another find here.

    Seemls like something Ashley could make use of. construct using requestAnimationFrame also.

    codetheory.in/controlling-the-frame-rate-with-requestanimationframe

  • Good news? Found this.

    scirra.com/tutorials/9624/limit-your-framerate-build-to-60-fps

    Something similar should maybe be possible on mobile too?

  • R0J0hound

    By the way? is it a big job to change so that the drawing is done within the specified (uid) sprites boundries, like previous example and also renders at the same resolution as the widht and height of the sprite.

    So if you scale up this "3d sprite" the pixel density will stay the same. not blurred when upscaled.

    If it's not too hard to change.

    The "3d sprite" concept is really great and behaves well in the editor.

  • Thanks R0j0

    You're right. i just saw that in the comments in the capx, the uid and the function setting.

    I noticed that this approach was a bit different from the old example. There you were drawing within the boundries of a sprite instead of the whole layer. The only problem with this new approach is that scrolling is not taken into account, i tried to scroll the layout but didnt work as expected.

    One thing i liked about the old example was that it was "3D sprites" that you can move around and scale like any other object. Translation like position and scale can be controlled from the editor more simply. The only thing you would need to control with code is rotation. This new approach might be useful in certain cases, and maybe more performant, but i think the 3d object as a sprite is more user friendly.

    Anyway! It's really cool work. I'm going to play around with this some more this weekend. Very interesting indeed. Opens up a world of possibilities.

  • Simply Amazing! R0J0hound Did you write this from scratch?

    The events are fairly easy to understand. The js I'm starting to grasp parts of a bit, so I will do my best to see if i can get it working in c3.

    One thing that's hocus pocus to me is the sprite boxes in C2's layout. what controls if they are behind or in front of the drawn 3d? I could not figure that out.

    I would need some way to contol where the 3d is drawn. some might be on top of everything, like in a character selection screen, where you can rotate the character.

    Some might be in the world behind a tree in the foreground, but in front of the background, in a platform type setting.

    Edit: And I'm guessing when exporting an obj, 0,0,0 will be the pivot point of the object when rotated? Offsetting the object before exporting should change the pivot when rotating the object in construct?

  • tunepunk Thanks! Now I feel like a fool :)

    Not a fool. I just stumbled across the effect a while back while checking what some of them do. I still havn't tried all.

    Just so happens that particular one would be kind of useful in this case, so i made a quick test and it seemed to be doing what he was asking for.

    I just got lucky.... if i didn't stumble across it i would be scratching my head as well trying a similar approach to what's been suggested here.

    Not bad solutions... this one was just a lucky shortcut for that kind of effect.

  • Don't need to overcomplicate things.. Just use the polka dot effect... change frame of the sprite depending on color with different collission polygons.

    Here's an example:

    dropbox.com/s/kvk30fhfuypjsdi/LED.c3p

    if your color matches you can survive in the same color... if not you die.

  • R0J0hound Thank's for the long detailed reply.

    Yes currently it's well above my skill level when it comes to creating plugins. So my first step was to edit this example for c3 (with brute force, vaseline, trial and error) to create a proof of concept and then hire a developer with the knowhow to create and maintain an actual plugin for me.

    Only two shader options. Surface shader and lambert. Surface shader would have the look of the coin below. No lights are taken in to account.

    The specs for such a plugin is quite simple:

    1. Ability to choose model and texture file.

    2. Option to choose between Orthographic and perspective projection.

    3. Ability to set the rotation of the object in all angles.

    4. Any collissions are not necessary as a dummy sprite could do that job if needed.

    5. Object is just using surface shader.

    6. Bonus (not required) 1 directional light source. If off using surface shader, if on using labert)

    Edittime requirement: Just show a visual representation of the models default rotation setting.

    No specularity bump or anything else like that.

    The main purpose of this plugin is to use simple 3d objects for various elements that would have the look and feel of a 2D sprite object (hence the primary surface shading model) but can be rotated in any angle.

    Anyway that's my goal by fiddling around with this old example. I dont' think C2 or C3 should ever become a 3D engine, but simple 3D objects (rendered as sprites) can be very useful, for UI, pickups, card flips, etc etc.

  • Thanks R0J0hound.

    I'm trying to understand this example and get it working to have some objects like coins and other simple 3D elements in games, and rotate them in more than one axis.

    I don't need anything as fancy as Q3D but getting some simple 3D elements in the game. Especially for HUD and UI elements.

    There is a C3 plugin that includes jQuery, so that helped me a bit on the way, but getting errors like the ones you mentioned, so have to try to change them one by one..

    "cr_getC2Runtime is not defined" is probably one of those things I have to replace.

    Hopefully once i understand it better I might be able to (with some help) make a simple "3D sprite" plugin out of it someday using a similar approach.