User Tag List

Results 1 to 10 of 10

Thread: When an RPG building has a roof but then disappears when you go inside / HOW??

  1. #1
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    When an RPG building has a roof but then disappears when you go inside / HOW??

    Hello!

    Usually this would be pretty easy however the way I've structured my game I'm finding it really impossible to figure out how this would work. My hope is that somebody here has a method I haven't tried yet and I can use that in conjunction with what I have

    The problem is that I'm using two different sets of variables stored on two different Z axis of an array object (which then these values are xferred to a 7x7 grid of active objects to display the picture of the bottom level ground / floor, and etc). Z = 0 axis is for the ground or floor and Z = 1 axis is for the roof. There are 49 total active objects designated for each of these 2 actives and importantly they do not overlap each other and exist on separate layers. I bold this last part because otherwise I'd be able to do something like "If the bottom tile is a floor, and the roof active is overlapping it, AND you yourself are also outside on a regular ground tile then set the value of the roof array / picture to display a roof tile" else it'd assume you were inside the building and the roof tile would not be displayed because you're supposed to see what's inside when you're in the building!

    The tricky part is because I have multiple Z axis layers of the array, I can't just change a roof tile to a floor tile because there might be other items that exist on the floor tile like tables / chairs / etc.

    GUY OUTSIDE A BUILDING

    Here the roof is denoted by the red tiles, and you can't see what's inside.
    roof_ex1a.png

    GUY WALKS IN THE DOOR OF SAID BUILDING

    Now the guy moves 1 space up through the doory, and the roof tiles all disappear and you can see everything inside (floor are the brown tiles here).
    roof_ex2a.png

    But yeah.. AHHHHH!!! Tried for like 2 hours last night to do this and it just doesn't work at all. While this isn't the worst thing in the world I really do think it'd significantly improve this particular area of my game if I could figure it out.

    So basically any ideas would be greatly appreciated!

  2. #2
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I should've worded this a bit better here:

    "There are 49 total active objects designated for each of these 2 actives"

    What I mean to say is that there are 49 actives designated for drawing the floor and another 49 designated for drawing the roof tiles. And that each of these 49 are on separate layers from each other so they do not overlap.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    1,051
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Perhaps I need more coffee and maybe I am misunderstanding. Couldn't you create an invisible active that is always set to the player's position, but +1 on the z-axis so that collision checks can occur with the roof tiles?

  4. #4
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by piscesdreams View Post
    Perhaps I need more coffee and maybe I am misunderstanding. Couldn't you create an invisible active that is always set to the player's position, but +1 on the z-axis so that collision checks can occur with the roof tiles?
    Yeah it's very hard for me to word how my game displays everything but I can try:

    So what happens is that all of these actives to display pictures are forced into different directions using the value of the array itself in relation to the player's position -3 / +3 (each active has 32 different possible pictures, for each of the 32 directions - and direction 0 = blank / no picture). It's an ingenious method MuddyMole came up with years ago that I've adopted and don't fully understand how it works exactly.

    So when you move around, it uses the array's values for the 49 tiles directly around you and confers that info into directions for the ground actives to display pictures of different things on the ground, as well as the 49 tiles for what would be where the roof is and draws those as well on the other set of actives that exists on another layer above the ground.

    Since the guy himself is always drawn in the very center tile, he doesn't actually interact physically with the physical active tiles that are displaying these pictures. I tried using fastloops to see if the ground array was a "floor" and then set to roof array's spot to something that would tell the computer to draw a roof tile there but I can't get this info to those 49 active roof tiles properly. The best thing that happened- and I really mean worst thing that happened- was when I was outside a building it populated all 49 roof tiles with pictures of a roof. So it looked like an entire screen of roof tiles with my guy in the middle haha.

    I'm sorry I can't really describe it any better. I swear my head was gonna' explode last night, I was up until like 1am trying to do this haha.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    1,051
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I think I understand now. If it's dynamically updating all tiles around you based on the player position, that's tricky. I'd have to think on that or see an MFA to maybe have a better go at a solution.

  6. #6
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Okay well good news and bad news.

    The good news is that I was able to get this to work using some outside the box method and a listbox.
    The bad news is that this now essentially cripples my game because it runs so slowly. So much so I'm basically saying screw it I don't need any damn roof!

    Here are the pictures, and here's how I did it. Maybe this will be helpful to someone else in the future:
    OUTSIDE_HOUSE_TEST.png INSIDE_HOUSE_TEST.png

    Okay so first thing was to reset the listbox to empty and then use a ForEach loop on the 49 ground tile active objects. This checks to see if they're in the direction of (picture of a floor tile). If they are, a "1" is added to the listbox and if not a "0" is added.

    Second part was to use another ForEach and assign the listbox strings as values to the roof active objects. Something like RoofActive AltVal = Val(Listbox Line(ForEach current iteration)) So this would give the roof active objects a numerical value of either 0 or 1. This was cool because it's a neat way to pass values between actives on different layers when "Does active A overlap active B" can't be done.

    Third thing was to use another ForEach to go through all the 49 roof active objects and check their RoofActive AltVal. If it's = 1 then it sets the direction of that roof active to show a roof tile and if not it leaves it alone.

    ---

    So there's some more to it than that but that's the gist. I was so happy I was able to figure it out but it didn't last long as this slows my game to a crawl. Even when I made this only trigger when the player moves (it's a turn-based game so this is viable) it stutters pretty badly whenever he does.

    Anyhow, this was my exercise in futility for the day lol.

  7. #7
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,072
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    you have 2 layers; 1 is roof on top; the other is the "player layer" with walls of the house; on this layer also is invisible actives/triggers , so when you cross it - or land on it (eg, outside invis - place outside door) and ( inside invis - placed inside door) - whatever you like to trigger and show/hide layers using the layer obejct. - its the simplest way

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,398
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    If everything's grid based, then you don't even need to use normal collision detection - you can just look up a value from an array directly.

    The main thing is that each map tile needs a value to say which specific building it is part of (or "0" if it is not part of any building). Then every time the player moves, you look up this value from the array at their new position. If the value is 0, then you make all roof tiles visible. If it's greater than zero (ie. the player is inside a building), you set any roof tile with that value to be invisible, and all the rest to be visible. It can all be done with basic conditions - no loops or additional objects required.

    The other thing is that this is actually pretty uncommon in games. Most use separate maps for the interiors of buildings, with doors effectively acting as teleporters. That has the benefit of allowing buildings to be much smaller on the outside so villages and towns can still be quite compact, but with space for interesting details such as furniture, NPCs and puzzles on the inside.

  9. #9
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by danjo View Post
    you have 2 layers; 1 is roof on top; the other is the "player layer" with walls of the house; on this layer also is invisible actives/triggers , so when you cross it - or land on it (eg, outside invis - place outside door) and ( inside invis - placed inside door) - whatever you like to trigger and show/hide layers using the layer obejct. - its the simplest way
    Yeah it's a bit trickier than that for a couple reasons, but the biggest one is that the array I'm using for the roof ALSO is used to display things like crates and tables and stuff which can be both inside or outside of houses. I believe this is what they call not using enough forethought, but truth be told this is something I just tried to add really recently!

  10. #10
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    If everything's grid based, then you don't even need to use normal collision detection - you can just look up a value from an array directly.

    The main thing is that each map tile needs a value to say which specific building it is part of (or "0" if it is not part of any building). Then every time the player moves, you look up this value from the array at their new position. If the value is 0, then you make all roof tiles visible. If it's greater than zero (ie. the player is inside a building), you set any roof tile with that value to be invisible, and all the rest to be visible. It can all be done with basic conditions - no loops or additional objects required.

    The other thing is that this is actually pretty uncommon in games. Most use separate maps for the interiors of buildings, with doors effectively acting as teleporters. That has the benefit of allowing buildings to be much smaller on the outside so villages and towns can still be quite compact, but with space for interesting details such as furniture, NPCs and puzzles on the inside.
    The legend himself!

    Hey man, you would deffo know more about this since it basically uses your original design. So what I've done is I'm using the 0 Z axis for the ground and floor, 1 axis for objects like barrels or chests, 2 axis for enemies, 3 axis for temp values denoting on whether an enemy has moved yet or not, 4 axis for extra objects because I ran out of room with the "1" axis, 5 axis for whether or not an enemy loot sack has been dropped on that tile, and finally the 6 axis which is where I have yet MORE extra stuff like crates, tables, and this particular picture of a roof tile.

    This right here is probably why it's so friggin' complicated. I should've just had a Z axis for JUST the roof but since it's a newer idea I hadn't thought of this back then. So the roof axis shares a spot with other junk that can be both inside and outside.

    Ex- 0 Z axis direction 31 is the wooden floor tile, and 6 axis direction 31 is the roof tile (by sheer coincidence they both share the same direction here). When the guy is outside I wanted any of the 6 axis tiles that are on top of 0 axis wooden floor tiles to change direction to 31 (and thus any tables and etc that were inside the house would look like a roof until you went through a door). When I was screwing around trying to figure this out I could get it to work kind of however it'd mess up the 6 axis non-roof tiles outside the houses too.

    If it can't really be done efficiently enough that's OK I have made peace with this since the other day haha.

Similar Threads

  1. Is there a value roof?
    By Outcast in forum Fusion 2.5
    Replies: 5
    Last Post: 18th October 2014, 07:46 AM
  2. [BUG] - Backdrop disappears
    By Nico in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 20th December 2011, 09:01 PM
  3. A folder disappears?
    By RayMarble in forum The Games Factory 2 - Technical Support
    Replies: 0
    Last Post: 21st June 2008, 04:40 PM

Posting Permissions

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