Jump to content
  • Advertisement

Tudor Nita

  • Content Count

  • Joined

  • Last visited

Posts posted by Tudor Nita

  1. Unity's fbx import will convert it, but have non zero values in the rotation fields, with no way to set the default rotation to identity (0,0,0).

    Especially when writing scripts to instantiate objects

    I'll have to agree on that. Was thinking from a manual import POV. However I remember you can get a 0,0,0 rotation if you pre-rotate the object/ pivot in 3DS Max before exporting. Will have to check this out again as my memory is not to be trusted.

  2. I wouldn't use iostream. Something like this works for me. Imagine an input file like:

    # a comment
    a 3.5 3.5 yay_some_text
    a 3.2 4.5 yay_some_more_text

    [source lang="java"]FILE *pFile = fopen(filePath, "r"); // the file to load

    char buffer[512]; // character buffer
    char temp;
    // read each line into the buffer
    while (fgets(buffer, sizeof(buffer), pFile))
    // switch based on leading type
    switch (buffer[0])
    case '#': // do nothing, it's a comment biggrin.png
    case 'a':
    // set ambient color ?
    sscanf(buffer, "%c %f %f %s", &temp, &someFloat, &someOtherFloat, &aString);

  3. Pong

    "stupid long mathematical equation"[/quote]
    That doesn't sound good regardless of how much I spin it around in my head.

    Anyway, you could just go with some simple conditional statements and inverse the direction of the ball. If you want something more complex you'd have to do some vector maths with at least the ball's direction vector, the paddle's forward vector and the position the ball hit the paddle.

    [source lang="cpp"] // edge of playing field
    if (pong.ball.centre_y > 0.6f)
    pong.ball_velocity_y = -ball_speed;
    } else if (pong.ball.centre_y < -0.6f)
    pong.ball_velocity_y = ball_speed;
    // ball hit a paddle on the right side
    if (pong.ball_velocity_x > 0 && collides(&pong.ball, &pong.bats[1]) )
    pong.ball_velocity_x = -pong.ball_velocity_x;
    // ball hit a paddle on the left side
    if (pong.ball_velocity_x < 0 && collides(&pong.ball, &pong.bats[0]) )
    pong.ball_velocity_x = -pong.ball_velocity_x;

  4. As a long-time user of Unity:


    • Although it's amongst the best in asset management, the module does have its quirks and can ruin your day if you're not careful.
    • Hard to "patch" asset/ scene files since they are binary (see 500mb comment above ). [They are switching to a text-based scene format so this will change very soon ]
    • Some web-game developers complain about users leaving the game page once they see the Unity logo [ which in the free version has to be there ]. This is a side-effect of so many people having access to the free version and so much shovelware being developed. I have my doubts about it.
    • Jack of all trades dilemma. It does everything but doesn't really shine in any particular category. It's not exactly a downside but surely not an upside either.
    • Really bad GUI implementation. The inbuilt GUI system is a performance drain at best. [ This is bound to change with ver. 4.x ]
    • Binary SDK. As a c++ enthusiast, source code access would make my day.


  • Extremely easy-to-use. I love UDK, Corona, Cocos2D and even ShiVa but they just aren't in the same ballpark when it comes to ease-of-use.
  • Awesome cross-platform support. [ with 4.0 ] Linux, Web ( plugin and flash), Windows, Mac, iOS and android. And all of them free [ basic versions anyway ].
  • Well documented scripting. Some of the best documentation this side of a complex engine.
  • Decent to great performance on mobile devices. Couple of tricks to make it run great but it eventually gives.
  • Great community. They've got their trolls and whiners but overall the community is great.
  • Asset management. Both a blessing and a curse.

    [ Daaark ] Getting the correct orientation is not a bug nor an inconvenience. It's just the coord. system they use ( common y-up system ). The problem lies rather with the authoring tools [ z-up for 3ds max for example :| ]. Nothing some decent planning won't take care of.

  • Not exactly an answers, more like a guess but:

    From a (very) quick look at the code, I assume you are taking a single sample per pixel. That will always generate edge artefacts. Try subdividing the pixel. You could start with a 2 by 2 and just average the results.

    This is an assumption based on no data though ( can't see your raycast loop ) so take it as is.

    Bacterius makes a valid point too. I hit that block early as well. Wald's paper might help
    This was also an eye opener when I was building my raytracer. Probably the most performance oriented intersection technique ( still using barycentric coords.)

  • 1st approach

    For a 2D-only implementation, in unity, you could try writing a simple lighting algorithm that pokes bits in a custom texture with texture.SetPixel(); You'd have to poll all shadow casting objects and write into some secondary texture attached to them.

    To speed things up, you could create the texture at lower resolution and "jitter" the pixels for some simple blurring.

    Problem is, this will still be slow. Quite slow. And to do custom shadows from what I assume are alpha-textured quads is not only even slower but decently complicated as well.

    2nd approach
    Use the alpha buffer to build your own 2d shadowing system. There's a great article on 2D Shadows right here.
    Should be fairly easy to do for basic polygonal shapes. Not so for alpha-textured quads.

    Corona comes to mind. UDK might be ok too but UDK's overhead and requirements are a bit harsh for a 2D game.

    p.s: someone built an alpha-buffer based ( stencil buffer unavailable in free ) hard-shadowing plugin. Could try that first.
  • ×

    Important Information

    By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

    GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

    Sign me up!