A Flash Developer Resource Site

Page 1 of 7 12345 ... LastLast
Results 1 to 20 of 127

Thread: TBW general questions, tips and tricks.

  1. #1
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Howdy guys, here are my questions :
    1. when doing grid based look up tables:
    A) what is the relation between movie size, tables size and hero size.
    B) How the hero_x and _y can be converted to fit in the grid table ( Xentor alredy posted and example but I want to explore this again )
    C) Is it a good idea to use linked list using layer definitions
    - example: map [layer][type] ( map_1_walk )
    or map _2_tree etc.
    D) what is the limit for importing data in flash using txt. files.


    So we continue exploring this topic if you are interested. Barely few people post here in the Games section ( compare to Anime ) I think because doing games is not so easy thing to do. I hope that this will bring some attention.
    What are you saying? . I will be happy if Xentor Ilumin and FlashCat join the group and share some wisdom. I hope to make this post 20 pages long. he he he.

    Mad_sci

    PS for the FlashCat Im 30y not 50. this is bugging me he he he he.

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Well, I think a lot of this depends on exactly what kind of game you're making... I have 3 main strategies I follow in top-down-view games:

    1) Complete Grid - Everything is positioned based on the grid coordinates.

    2) Free Positioning - No grid

    3) Partial Grid - Background objects like walls and barriers are positioned by the grid (Or stored as part of a large background image and their positions referenced in the grid). Foreground objects, i.e. anything that moves or can be variably positioned, is given a pixel location, but uses the grid for collision detection, etc.

    Obviously the coding speed and difficulty increases with each step... It's easy to code with a grid, a little more tricky with free positioning, and much harder to use the partial grid... This is assuming you're doing some kind of collision detection, of course

    As for the sizes... That's basically up to the designer... You can use a more detailed grid (And slower code) or large-celled grid (Faster code)... For instance, a chess or checkers game would obviously only need an 8x8 grid, but a maze-type game would clearly need more rows and columns...

    And you know... I never thought of using a LL in flash... I guess the Eval() function can act like a pointer... But what do you mean by using it with layer definitions?

  3. #3
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    I though that we can have multiple tiles at one place. Lets say you have ground tile on top of it key tile etc. so for one and the same cell you can have 5 tiles stacked and the cell right next to it will have only 1 tile for example. I though that we can use pointer to check a particular layer ( virtual ) like map_[layer number]_[tile type] thus we can load multiple txt files containing different tables and tile definitions and acsess only thouse wich you need. See what I mean. Does it make sense ?
    Mad_sci

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Yeah, that's possible... A lot of variables though, and would slow the game down... I think a bitmask would be easier if at all possible...

    1 = Wall
    2 = Grass
    4 = Tree
    8 = Something else
    16 = Player

    So a square with grass, a tree, and the player would be represented as 16+4+2 or 22

  5. #5
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    One more think Xentor "over" and "under" tiles. Example:
    bridge- you can go below= hero disapears but you can go on top if you will. And this will be one and the same tile which has to be refferenced 2 times. That might be a problem.

    Mad_sci

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Hi all,

    Lets get this party started, with some Q/A!

    It doesn’t mater what size your tiles are, be creative! You could use a combination of different tile sizes. I like to use tiles in multiples of 8 (16,32,64). I most commonly use 32 x 32 it just seams to provide a good balance of graphical quality and small file size. In most TBW games the objects (Player, Monsters, Items, Ext.) are made form the same size tiles just to keep things simple. But I like to make them a variety of different sizes to make the game look richer; it also helps to hide the grid.

    Layering is a grate way to add more depth to your TBW games. some of the best ways I have see to achieve this are Linked Lists, “unfortunately you have to emulate this in flash4”. Or my favorite is Parallel Tile Maps. I store my BG (BackGround) Data in one then the MG (MidGround) next the Objects Layer and finally the FG (ForeGround). I use this set up to set tiles on top of each other.

    As for file size in flash I don’t know but I have pushed in a lot of data and, well memory is cheap and most people have more then they need. A good thing for any web-based game though is small as possible. I have broken up my maps into smaller peaces so I can preload them in to game so that game play will not be dramatically affected by load time.

    In any project it is wise to think a head pot together some design documents so you have a plan of what you need and what you would like to do.

    When coding I like to build in as much flexibility as possible. That way I can add things in I hade not originally planed on with very little work.


    Ok I have one? I am ironing out an event structure or “Trigger System” for thinks like story line and intro moves using the game engine to keep file size down. Well I need to come up with a list of events that would be good to have in game play. Note: the Trigger System will also be used for thinks like opening locked doors and puling levers ext.

  7. #7
    Senior Member
    Join Date
    Jul 2000
    Posts
    323
    Hmm... Yeah, parallel maps can work, but it's processor-intensive... Then again, you can bypass most of that by using seperate MCs ONLY for moving parts... For example, the background can be one big graphic (Not tiles)... The mid-ground (I assume you mean things such as bridges you can go under or on top of) can be another graphic or layer...

    I suppose if you set the depth of the mid-ground layer to a higher number, you could respawn the player or monster clips to go above or below...

  8. #8
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Hey FlashCat, listen im a bit confused. Here is why:
    1. Movie size - 300 x 300px
    2. tile size - 10 x 10 px
    So I can use 30 tiles in row and 30 per collumn.
    if you use tiles 30 x 30 px you can use 10 tiles per row and 10 per collumn. Is it enough for building a maze ?
    Seccond: the hero is with size 20 x 20px and moves with a step of 8 the problem which I have is how to adjust the Hero-x and _y to match the correct row and coll in the variable list. Xentor and Ilumin gave me an idea wich I sc..... up in some way so ended up with nothing . Mad_sci

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Layering! Is quite simple riley! I keep all the data in parallel map for a reason. I like the effects that you can achieve with layers and like in “Super Mario Land for SNES” when the BG is paned at a slightly slower rate then the MG and the FG is paned much faster. It creates a feeling of depth. Beaus I am buffering the map I only need to update a layer when it has moved a cretin distance. So looking directly at the data for that particular layer saves processing time. The same method applies for groped layers.

    Mad-Sci, yep. The best way to determine tile size is by the game windows size, I get my 32 x 32 form screen resolutions. I have one more recommendation for small tiles “Sub Tiling” if you group up 4 10 x 10 tiles in to a 20 x 20 tile you will have a lot les math to do. All you need is a good naming convention that lets you pick the tile groupings you want.

  10. #10
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Thats cool, yea nice to know. Listen Ill try tonight to post a sample it will be generation of a play field using a look up table should not take to long to code. you think it will be usefull? The problem with the hero remains actually if I use step of 10 to move the buddy no problem ( tiles are 10x10 ) but i dont want to be fixed with 10 cos I wish to have let say some mud so he will slow down when stepping in the dirt. see what I mean.

  11. #11
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Ooo ops. I forgot the diagram. Lol..
    This would be a basic layering of a tile map, Top of the list is top, and Bottom is bottom.

    ---------
    Fore Ground (clouds, tree tops, things you go under, ext.)
    Object Layer (this is a special layer for dynamic object like characters, items, monsters, ext.)
    Mid Ground (basically the ground, walls, est.)
    Back Ground (just graphics for cool depth effects, any thing I the dissents)
    ---------

    you can use as many or as little layers as you would like to create the desired effects, your layers could have layers. Be creative!

    [Edited by FlashCat on 07-26-2000 at 02:21 PM]

  12. #12
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Mad-Sci, that’s your collision detention, I don’t know what exactly your doing. But I can tell you haw I do collision detention.

    A move object request calls the collision detection. If an obstacle is detected it then calculates the amount over witch is then subtracted from the objects desired location. Finely the screen is updated, the object placed as close to the wall as possible.

  13. #13
    Cats Moo!
    Join Date
    May 2000
    Location
    Boonies
    Posts
    148

    Thumbs up Help

    I would like to learn how to do TBW but i dont understand it to well... I looked at the weirdness post but i just cant make good sence of it... Could you tell me how to do this in terms i'd understand....
    Thanks in Advance

  14. #14
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    ChriSell, I am sorry, there is a base knowledge that, we just assumes every one knew, my apology. Ok lets see if we cant get you up to speed.

    Most all games that aren’t real time 3D are TBWs (Tile Based Worlds), blow the dust off any old consol game systems and take a closer look at a game. Look for tiling graphics, just try to observe the game, see how it works?

    Tile Based Games are everywhere, and there not all that complex. In most cases you would set up a Grid based on the tile size you would like to work with. Each variable or “emulated array in Flash4” would contain a name or pointer to the tile that is to be displayed in the corresponding coordinates.

    It could look something like this: 2=wall 0=ground
    Row01=222222222222
    Row02=200020002002
    Row03=202000200002
    Row04=202222222202
    Row05=200000020202
    Row06=222222020202
    Row07=200000020002
    Row08=202222222202
    Row09=200000020002
    Row10=222222020222
    Row11=200000020002
    Row12=222222222222

    Or you could make A List:
    TileX0Y0=Wall
    TileX32Y0=Wall
    TileX64Y0=Wall
    TileX0Y32=Wall
    TileX32Y32=Ground
    TileX64Y32=Wall
    TileX0Y64=Wall
    TileX32Y64=Wall
    TileX64Y64=Wall
    Ext…

    XXX
    X0X
    XXX

    And that’s just the beginning you can apply the basic concepts of TBWs to all kinds of things. Form character animation to Game UI (User Interface).

    I hope that helps a bit, I am not to good at explaining stuff to people but if you need more clarification just ask!

  15. #15
    Junior Member
    Join Date
    Jul 2000
    Posts
    20

    hmmmm....

    I started my game slightly differently, have a look at http://www.ceptic.net/cj/game/index.html
    I thought of doing it TBW stile with the Row1=02200200
    but at the time I made it, I did not know if reading from txt files was possible in flash. I believe the way I did mine is a little more complex and sloppy. I built it so there are multiple scenes. When you press an arrow key, the it calls a frame that checks if the next move in that direction will be a collision with something. If so, it doesn't move, it not, then it will move in that direction. I built the world by placing 25x25 pixel .gif's next to each other over each scene, which is quite time consuming. I agree that we should make this a very long thread. And let's put some links to examples. If anyone want's to get totally confused by seeing my .fla, just ask me.

  16. #16
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    An example is comming up tonight (east time). Title generation of tile based play field using look up table.
    Mad_sci
    seccond will be collision detection against obstacles
    MS

  17. #17
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    The best part of a TBW is the robustness. If code right you can do all kinds of complex stuff with very little processing power, and even less work. But if you go to fare down the wrong path, a lot of time can be lost and only amount as research. So plan! Before you work!

    Well since we are going retro, in the desiccation to provide a solid foundation for are games.

    *to invoke participation*
    What are some of the benefits/downfalls that are studio audience can see with different Map file formats. (Hint we have already talked about to types there are many more)

  18. #18
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Optimum fps for a game ? what you think ?
    Mad_sci

  19. #19
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Fps, The all-allusive timer mechanism.

    One important thing to remember is that flash cannot advance to the next frame until it has completed all the code on a frame. So a game with a high Fps might not run correctly on a slower computer. Personally I would recommend finding the lowest common denominator. I like to use 12 or 15 it just seems to work well.

  20. #20
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    http://savco.virtualave.net/table.swf
    Let it count to 10 and then press the spc bar. Ill explain later. It uses txt file to build entire screen.
    Mad_sci

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center