A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 44

Thread: Weirdness

  1. #1
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    I know this not directly related to games but.
    This board seams to be eating strings?

    With lots of good info on them people could of learned a lot from a string that FlashGuru, Mad-Sic, Myself, end many others where posting to all day just went a way?

    And this concerns me! Are we just wasting are time here, or are we riley helping people?


    P.S. I hope, I no effendi any one I have seen “he/she” in books as a non-gender discrimination effort.

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Thsi forum doesnt get as many viewers as it used too!! and i am concerned too!!!It seems to always be the same people!!maybe we should do a big mass project between us all and then place the code in here to get some more interest??!?!?!

  3. #3
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Hi people,
    we can continue here. As I sad:
    === to flashCat === good point you made. ill try to do implement that code. I think you dont do games from yestarday do you? Siamese ????

    ==== FlashGuru === why touchy man. I did not say that distance measurment is bad. I use this as well. i think that there is no good or bad strategie rather than favorite one. I prefer using tiles without the table look up and it does the job fine for me my games are simple. what you think?

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Hi all…

    FlashGuru might be on to something, if we all work together we could stage a big publicity stunt. That might get more people interested in pushing flash gaming to the “next level” and generate more traffic for this forum. That would benefit us all!

    I must admit this has bin a fun string even if it went away, we have only began to scratch the at the possibilities of TBW’s (Tile Based Worlds) in flash.


    And you are totally right FlashGuru & Mad-Sic there are limitless possibilities, and no one way of doing something can be right or wrong. It is threw collaborations like this that we learn of new was to think of the problems at hand.

    Mad-Sic, you can see right threw me cant you? LOL… yep I think that I learned a grate deal cloning old games but it is time for me to move no.

    Well back to the fun stuff! I have come to a place in my game work where I must create a hilly versatile map file structure and would love some input from the two of you, and any one else that would like to jump in?
    The basic map.txt would go something like this:

    --------------------
    MapFileHdr= //map file header.
    &EngName= //map engine name.
    &EngVersion= //map engine version.
    &MapName= //map short name (fill name).
    &MapAuthor= //author name, authored date.
    &MapDeesc= //map long description.

    &MapWidth=# //width of the map.
    &MapHeight=# //height of the map.

    &L1Height=# //height of Layer1.
    &L1Width=# //width of Layer1.
    &L1Zindex=# //count of total Layer Levels.

    &SetL1Z1=name //name of tile set to be loaded in to location.

    //the tile data is used to set up a dynamic map, the attributes are a parallel lookup table for things like collision detection.
    &TileL1Z1X16Y16=0,0 //map coordinate structure(Tile,Layer,Zindex,Xaxis,Yaxis=TileID,Typ e).
    &AttrL1Z1X16Y16=0,0 //map coordinate structure(Tile,Layer,Zindex,Xaxis,Yaxis=TileAttrib utes,Data).
    //this only shows one tile, in actual map there would be hundreds of values, but you only need value for the occupied tiles, if a value is non existent my engine will assume nothing is there.

    &MapFileFtr= //map file footer. "= MapFileHdr"
    --------------------

    Well any suggestions, things you think might make a better map/game?

  5. #5
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Listen generating a map file that whay will be way much pain espetialy when you start generating the map coordinates. What I have in mind is a game engine wich will generate this file on the Fly. Lets think for a sec. You have a black background stage on wich we position black tiles with white borders this we do manualy and each tile has a specific name like Tile_1 and so.... Off the stage you have all your tiles. Now with drag and drop we can create something like snap to grid. Each time when you position a tile the one which is underneat gets specific values like coordinates, type of the tile on top stuff like that. Press a button generate and it will export all the data to a textfile icluding the mapcoord. Now useing a ready to go lib in the new flash move you can recreate the whole think without the grid under and with a look up table ready to go.
    mad_sci

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Yep yep… that’s part of the reason I am asking you guys. I have already got a basic map editor as part of the game engine. But in order for me to come up with the best file type I can, I have a lot of thinking to do for instants I could set up a bite structure map.txt that would look something like this:

    Row1=000000000000000000000000000000
    Row2=007000000360000000000000000000
    Row3=007000007777000000000000000000
    Row4=007000000000000000000000000000
    Row5=007000000000000000080003000000
    Row6=007000000077777777777777777777
    Row7=007000000000000000000000000000
    Row8=007000000000800030000000000000
    Row9=007777777777777777777777777777

    But the game would have to sub string to get the values, and empty tiles would have to be marked with something like 0’s.

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Ooop sorry, every number would represent a tile, numbers & letters could be used. In addition parallel bite structures would be necessary to achieve other functions like collision detection.

  8. #8
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Well if you look at your code you can use the same table for collsion dection as well. it all matters what tiles you use. For example one and the same tile can be either 1 or 2 1 for grass for example 2 is a walking tile total value of 3
    1 for grass and 1 for nonwaking tile or total of 2. See what I mean now if you get a tile with a number of 3 you can subtract the 1 wich is for grass the other will give you walking or not. Does this make sence ?
    But FlashKitten im still reluctant to use look up tables. im still convinced that using a regular tiles with build in code is an alternative way to go. Here is what I did:
    A simple maze were I positioned >50 tiles I did not see any delay. It was working realy fast and thight. I used 15 x 15 px tiles.
    so in your example are you going to use;

    the row will represented by the _y coord.
    teh coll will be eval function of the current row with index using the _x is this the way you code it.
    Mad_sci

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    The reason I prefer to make a parallel bite structures is simple if you want to load in dynamic tile sets you don’t have to fix the values of the tile set this would allow for more flexibility in game, for things like secret passages, and more. Your collision map could have different functions like:
    1= impassible tile
    2= item tile
    3= tile that damages player (traps, fire, spikes)
    4= pits or holes

    waiter else you can think of would be in this bite map, so you could do more with your collision detection.

    Why use a lookup method? Well its simple if you need to know the characters current position to move him about the map you already know where he is! And if you have a map structure that’s easy to access you already know where he can move and where he cant just by looking it up. You don’t have to calculate any thing like distance, and you don’t have to look at all the tiles just the one in question.

  10. #10
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    I realise this the problem is that you anyway have to look in the table each time when the hero moves and you have to do additional calculation to get the tile number and after this to look in the other table and see what is this tile and so on. My approach is to build all tiles as a MC on the stage. Each one will look for the heros -x and _y if the hero is whitin a tile a sequence of commands will be sent to the hero were the main AS will be. There is no calculations involved in this because calculating the tile boundaries you do only once cos the tiles dont move. See what I mean ? Each time when you want to create a new tile you simply copy and paste the AS frames and configure the instruction variables. Thats it. One line of code. Dont you agree with me that is way simpler? Now you know why Im reluctant to use tables. Having the tiles build I make a maze with full collision detection as matter of hours. if I want a new file and maze just select all tiles copy and you are all set.
    Mad_sci

  11. #11
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    O and one more thing i put tiles only where they are needed. For example next to the walls. for the rest I use tiles with no collision detection just as a background regular graphs. So using tables you have at least one unnecessary calculation if you are over a tile wich does nothing to your hero or for the game in general a tile wich is artdeco.
    mad_sci
    [Edited by Mad-Sci on 07-11-2000 at 02:01 PM]

  12. #12
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    That sounds like a good time saver for most games, very cool! But what I am talking about is I structure that can handle thousands of tiles. It’s only necessary to run collision detection when an object is moving from one tile to another. The map is basically variables that tell the game where to place the tiles, and what the tiles do if any thing at all. The structure would basically support an "eval (var)" to get the map beavers.

    In addition a map structure would be used to buffer the off screen tiles.

  13. #13
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    ??? But would your 50 tiles containing code all be running collision detection at the same time???
    As, apposed to just one calculation to move your object?

    I don’t get what it is your doing, pleas explain?

  14. #14
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Here is how I do it; I build a Mc 15x15 px
    In the movie AS layer has 3 frames
    frame 1 I call init frame it containes the;
    My_x,my_y my_top and so on.

    frame 2. is acutaly the 'collision' code.
    if heros-x and hero-y are insde me between top bottom left right
    set variable hero-move left=0

    frame 3 go to play frame 2.

    Basicaly the tile is looking for hero-x and -y coord. you have to step on a tile and a lets say move will be disabled. move_left=0 or you can add move_right=0
    on the main stage I have one empty Mc which has 2 frames only. i call this hero-properties. and it contains everything which you waant to know about the hero. _x _y top bottom etc. if you whant to get properties you look there. So I made in total 4 restriction tiles top, bottom, left and right if you want to get a combination you overlay 2 or 3 tiles on top of eachother.
    Mad_sci

  15. #15
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Cool I like the simplicity of your method a specially overlapping the command tiles. But all 50 of your tiles are running 1 line of code at the same time that means your running *50* lines of code? You would have a riley hard time with bigger mazes.

  16. #16
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    FlashCat actually this is not the way the if then statements work. for example if the first condition is
    if hero_y >my_top if this is not right half of the tiles will not execute the statemet. the other half will get the next condition if hero_y < my_bottom if this is not right all tiles below will be disabled and so on till you reach only one tile wich executes one if then statement. This is why the code goes fast. You start from a big number and naroow down to one tile. See what I mean.
    mad_sci

  17. #17
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    FlashCat dont get me wrong Im an amateur who is lazy, unpatient and wants the game done yestarday. If you wnat to build something which is realy good and impressive your method is the way to go. And it will payback at the end. he he he. I do simple games and try to keep the size down to a minimum and I dont put to much of an effort anyway the computering is not what I do for living but is my favorite hobby. he he he.
    Mad_sci

  18. #18
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Yep yep… I see now, very interesting. I look forward to seeing what you produce with this method. It will be fun to compeer notes.

    Well other wise you don’t have any more ideas on an effective map file format?

  19. #19
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    That’s a sham your not trying to be a game designer, you would be a good one! You know what you talking about!

  20. #20
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Ha ha ha FlasCat I was banging my head about that it seem that that tiles and maping are the way to go. Whait let me tell you some other ideas they do work but are not very tight.
    1. the hero in general cannot move. Even if you press the buttons. so it needs 2 permitions for doing that.
    A. button pressed
    B. A direction to move.

    so you start from a spot on stage which gives you permition for moving in all directios. Once you leave that spot 2 of the movements are disabled. let say you want to go right you press the right button and once you leave the spot you end up only with right and left movement. go back to the spot and pick up= you end up with up-down permitions. all you have to do is to build your maze and posiotion those spots here and there. he he see what I mean.

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