User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Mode7EX sprite mapping of active objects help

  1. #1
    No Products Registered

    Join Date
    May 2008
    Location
    NSW Australia
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mode7EX sprite mapping of active objects help

    Hello,

    I am working on a fake-3D game at the moment (hi, dragonguy!) and I'm trying to adapt the Mode7 sprite mapping examples to work with active objects instead of active pictures.

    The fact that active pictures and active objects have different functionality, combined with the fact I don't entirely understand the code means my current attempt has not worked so well...

    I'm wondering if anyone has done this successfully, and possibly has an example file I could take a look at.

    I'm happy to provide what I've got so far when I'm back from work.

    Thanks for any and all help!

    -FungalGrowth

  2. #2
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    So what exactly is the problem?

  3. #3
    No Products Registered

    Join Date
    May 2008
    Location
    NSW Australia
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    Ok, well basically the problem seems to be with the scaling. I used the spritemapping example and ported the code from the active picture object to an active object I have. The problem is that they don't have the same functions.

    For example, the active picture object can scale the X and Y dimensions independently, actives only have one (whole image) scale. Also the active picture object has an "Original Width" and "Original Height" option, which the active doesn't. I tried to work around these by storing the original dimensions and only using one value to scale, but obviously I've screwed something up.

    What has resulted is fascinating, and difficult to describe, but ultimately not what I want. :P As you walk towards a sprite, it shrinks smoothly, and gets larger in "jumps"! When the sprite is off screen sometimes it scales to such a huge extent that a HUUUGE black bar of death (A massively scaled one-pixel black line) descends from the top of the screen and crashes my project! Fun

    It's something that needs to be seen to be enjoyed This is definately not the kind of issue that can be resolved without me posting what I have, so I'll try and do that tonight. I just thought maybe someone had already got Mode7 sprite mapping with active and could post an example.

  4. #4
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    something like this should work:

    GetMapWidth( "Mode 7 ex", X( "2Dobject" ), Y( "2Dobject" ), 32, 32) / ((X Right( "3Dobject" ) - X Left( "3Dobject" )) * 1.0)

    GetMapHeight( "Mode 7 ex", X( "2Dobject" ), Y( "2Dobject" ), 32, 32) / ((Y Bottom( "3Dobject" ) - Y Top( "3Dobject" )) * 1.0)

    the 32s obviously represent the original pixel dimensions of 3Dobject

  5. #5
    No Products Registered

    Join Date
    May 2008
    Location
    NSW Australia
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    Hi xyzzy,

    Thanks for the reply! I have tried implementing your method. The results are ...uh... interesting again

    The sprite gets angry as you get closer, then gets calmer and... deflates as you get closer... then BAM! It gets an epileptic fit of some sort... I sure hope the poor thing is not in pain... It then occassionaly dissapears, or continues to seize uncontrollably...

    You can have a look at my file here:

    fungalgrowth.net/SpriteMappingActives.mfa

    Just look for the group Sprite Placement 2, and thanks again, hope you enjoy my mad experiment gone wrong!

  6. #6
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    Quote Originally Posted by FungalGrowth
    Hi xyzzy,

    Thanks for the reply! I have tried implementing your method. The results are ...uh... interesting again

    The sprite gets angry as you get closer, then gets calmer and... deflates as you get closer... then BAM! It gets an epileptic fit of some sort... I sure hope the poor thing is not in pain... It then occassionaly dissapears, or continues to seize uncontrollably...

    You can have a look at my file here:

    fungalgrowth.net/SpriteMappingActives.mfa

    Just look for the group Sprite Placement 2, and thanks again, hope you enjoy my mad experiment gone wrong!
    it looks like the animation is doing it, for some reason; it works fine as long as it isn't animated

    not sure why it's doing that, since both animation frames are the same size

  7. #7
    No Products Registered

    Join Date
    May 2008
    Location
    NSW Australia
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    Hey, you're right...

    Gah!! Thats infuriating! Having animations is the whole point of using actives!

    Do you have any ideas of what to do?

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    you may have to go back to active pictures and make up a custom animation engine which loads the current frame into the AP... i did something like that a few years ago and it worked fine

    since mode7ex was originally released for MMF1.5, it wasn't designed to scale active objects (since MMF1.5 didn't have that capability anyway), so it's probably tripping up over the animations somewhere; MMF2 itself doesn't seem to reset or otherwise screw up the scale factors for the objects when they're animated, so i'm going to say it's more than likely a bug in mode7

  9. #9
    No Products Registered

    Join Date
    May 2008
    Location
    NSW Australia
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    That sounds like the most likely cause. I might try to contact Marcello from cellosoft. Hopefully he's still willing to work on this extenstion.

    The custom animation engine sounds like it'd work, but not really the ideal solution. Another benefit of actives is that I can use the 32 directions for rotation of the object (like if I render a 3D object in 32 directions).

    Also I was intending to write this engine so that it can be applied to a large amount of objects using fastloops. I havn't looked into the custom animation yet, but it sounds like it would make this project even more complicated than is manageable for me.

    Potentially, if I needed even more fastloops to apply the custom animation to each sprite.. it'll be even more strain on an engine I'm already struggling to keep as efficient as possible and running relatively smooth...

  10. #10
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Mode7EX sprite mapping of active objects help

    Quote Originally Posted by FungalGrowth
    That sounds like the most likely cause. I might try to contact Marcello from cellosoft. Hopefully he's still willing to work on this extenstion.

    The custom animation engine sounds like it'd work, but not really the ideal solution. Another benefit of actives is that I can use the 32 directions for rotation of the object (like if I render a 3D object in 32 directions).

    Also I was intending to write this engine so that it can be applied to a large amount of objects using fastloops. I havn't looked into the custom animation yet, but it sounds like it would make this project even more complicated than is manageable for me.

    Potentially, if I needed even more fastloops to apply the custom animation to each sprite.. it'll be even more strain on an engine I'm already struggling to keep as efficient as possible and running relatively smooth...
    the custom animation engine would just use objects' alterable values, so each object could have its own animation going and you shouldn't have to do anything weird with loops to make it work. you could even have directions implemented somewhat easily... all of your images might have filenames like:

    dir_animation_frame.bmp

    so '5_stopped_0.bmp' would be direction 5 and frame 0 of the Stopped animation

    so each object would have one AV for which direction it's facing, another AV for the current frame that animation's on, and an AS for the animation name

    EDIT: here is an example i made a while ago for someone else, which uses a similar concept

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Mod7ex Z Sprite Mapping
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th April 2010, 10:24 PM
  2. Sprite Mapping with Mode 7 ex
    By Atherton in forum Articles
    Replies: 6
    Last Post: 11th August 2009, 01:24 PM
  3. Sprite mapping in Mode 7
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th August 2009, 02:56 AM
  4. active sprite mapping with mode 7
    By Gabriel in forum File Archive
    Replies: 13
    Last Post: 26th January 2009, 03:08 AM
  5. Mod7ex/ sprite mapping
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th November 2008, 02:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •