Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How would you do pac-man?????

Discussion in 'Editor & General Support' started by RandomCharacters, Sep 16, 2016.

  1. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I was wondering something. If you were to write pac-man with unity, how would you do it? I mean how would you keep the guys on the correct path?

    1) Use AI behavior and keep the guys away from walls. So just let the pathfinding keep them away from walls. Set a distance and let pathfinding do the rest.

    2) Make points along a path, then at each point have the ghost decide what to do. So each dot would be a point. When a guy touches it, then a choice of options. So a ghost touches a dot. The dot is 1-2-3 or 4 way. So at that point the ghost decides how to move to the next point. Maybe there are just 2 ways to go. Sense a ghost can not reverse course, then he must move along path to next point.

    3) Something else.

    I've been thinking about the old school games and how they would be done today. Something like tempest as well. How would you keep the guy on the track as he moves left and right and around the tunnel?
     
    theANMATOR2b likes this.
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Forget all of that. Do it the same way it was done old school. Set up an array the size of the map. Populate it with array with map data. Then render each Sprite in the position provided by the map.
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Great! Now I have to go look up array information! :)
    Seriously though - would this array data be pixel/screen dimensions? Wouldnt that require the refresh rate to match the frames per second so there was no jittery movement?
    Just ignore if the answer is simple to understand once Ive looked up array info.
     
  4. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    ^^This
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Make the array the size of the map in tiles. It's pretty much how all 2D tile based games are made.
     
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Pacman map is a grid.

    So you can forget all that^^^.

    And use grid-based pathfinding algorithms. The simplest grid-based pathfinding algorithm is that when you assign numerical values to each cell of the grid. At the first cells, don't have numbers assigned to it. You put "1" at first end of the path, then go through every unprocessed cell, and assign to it "minimum neighbor value +1" and keep doing that untill the other end of the path had a value assigned to it. Once done, you read value at your goal and walk through neighboring cells so their assigned values would decrease in increments of one. That will result in path to the target.

    I forgot what this algorithm is called, though.

    Having said that pacman game can work without pathfinding just fine.
     
    theANMATOR2b and Kiwasi like this.
  7. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    They are spot on... data structures are the key to making dev easy.

    You don't want to use Unity physics, waypoints, etc for this. Just build your level as a map. I use SpriteTile for this although I sometimes also create arrays for shadow maps as well.

    It's not pac-man but this is what I did for my last game Treasures of Ali-Gar which navigates a similar kind of level layout...
     
    Last edited: Sep 16, 2016
  8. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    The Tempest movement I'd just do it in Unity the same as outside of Unity.

    Again just a simple data structure. This time an array or list.

    Basically you just create the segments and lay them out to create the shape you are traversing. The Editor would actually work well for this.



    Then define arrays/lists of Vector2 positions for where the player is positioned and angle of rotation for each segment in order clockwise. When moving clockwise increment to next position in list. When moving counterclockwise decrement to previous position in list. Wrap around on both ends of list to the opposite end.

    Actually I'd just draw these shapes and save them as images that would be a sprite in Unity. Then map the player positions and rotations. Enemies simply move straight from the center to the player position in the given "tunnel". Then you can easily scale the sprite level shape up for the start and end of level zoom FX.
     
    Last edited: Sep 16, 2016
    theANMATOR2b and ADNCG like this.
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Those arcade games were great and hope you got to play all of them on the real actual machines.

    There is a book called:

    Classic Game Design: From Pong to Pacman with Unity (Computer Science) by Franz Lanzinger
    ISBN: 978-1937585976

    Franz Lanzinger, the author of this book wrote the Atari coin-op Crystal Castles which is similar style of maze game as pac-man. There is a GDC post mortem on his design of Crystal Castles which is very interesting.


    If you look at @MV10's thread speed and difficulty of older games there is quite a bit of discussion of vector games.

    http://forum.unity3d.com/threads/speed-and-difficulty-of-older-games.419200/

    Someone posted an Asteroids clone with source in this thread.

    http://forum.unity3d.com/threads/asteroids-clone.282022/

    It would nice to have a Tempest style clone in Unity too.
     
    theANMATOR2b, MV10 and GarBenjamin like this.
  10. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    ali-gar seems like what I am asking. So let's say it is a 10x10 grid. On each point in the array I set up a wall or not a wall. Then I start the good guy at 1x1 and a bad guy at 9x9. How do you get it so the good guy moves through the maze from 1x1 to 2x1 to 3x1? and the bad guy too? Do you put colliders on the walls? but if you do then how do the guys stay perfectly aligned on their path as opposed to curuving around the corners? SO what I'm really asking is how do you move the guys along the paths in the 4 directions from 1 point on the array to the next?
     
  11. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @longroadhwy wow I never noticed (or don't remember if I did) this Vectrosity asset. Clearly that is the way to go. Can easily design all levels as series or vectors and just draw them.

    Actually be useful for all kinds of things. I will likely grab it at some point. His SpriteTile is a great 2D map editor.
     
  12. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    You don't use colliders. Just check the map cells directly.

    So player requests to move up you check the map cell at the corresponding location. If it is a wall they cannot move. Same for down, left and right. Enemies move same way. If they come to a wall they examine options. Then they can either randomly choose an option or choose the path that heads in direction of the player. In ToA the enemies also have a 20% chance of turning when they haven't reached a wall dead ahead and they are at a junction.

    You can do this same kind of stuff in 3D as well although it sounds like your interests are in 2D.
     
    theANMATOR2b and Kiwasi like this.
  13. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    But how do you keep the firing gizmo on the path in tempest? The firing, bad guys and all of that is easy to do. I was wondering about the path. You mentioned putting them in an array. Not sure of what this means.
     
  14. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Yeah. Is you want to do asteroids or battlezone, then vectrocity would be cool to have,
     
    GarBenjamin likes this.
  15. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    So this is basically what I originally had suggested. At each point in the grid a decision is made.

    OK, so maybe I said it wrong. So in puck-man you have a 10x10 grid (not really) with pellets and walls. However, the array is 100x100. So the check would be 10 times between pellets? Maybe this is where I am confused. I was thinking the checks would be made on a 10x10 grid so was confused on how to get from 1 point to the next. Is this right?
     
  16. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Vectrosity was the very first Unity asset I purchased. The main reason was the TankZone example included with the product which is a Atari coin-op BattleZone style game. I was also thinking of Atari'sTempest style game would be a fun game to write using that asset.
     
    GarBenjamin likes this.
  17. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    On cell atm so can't easily make drawing etc to illustrate.

    Basically imagine in Unity Editor you have one of the Tempest level designs. It could be just an image displayed in Unity Sprite.

    Then you take the player object (create player sprite if do not have one). Position player on first segment. Note position. Move to next position clockwise. Document it as well. Continue moving around full shapes. There are a small number of segments to travel across in each level so this is quick and easy. And if centered at 0,0 often when doing top you will also get bottom offset and when doing left will have right. Not always but when you can use it.

    This list of positions are your movement positions.

    In practice is easier... just set up public Vector2 array or list in game object with monobehavior then drag player over for each movement. This will map the Vector2 position to the array (at least as I recall it should.. worst case is you manually type it in).

    Now you have the path defined. When player moves clockwise you increment a variable say CurPlayerPosIndex and use that get the coords of the next position to move to. For counterclockwise movement decrement CurPlayerPosIndex. When that variable (CurPlayerPosIndex) is less than 0 or >= LevelPositions.Length set it equal to other side of array boundaries. Meaning <0 becomes LevelPositions.Length - 1. And the other way becomes 0.

    You can either manually handle rotation to point toward center and store array of zAngles as well OR you can simply calculate (actually Unity even has a method for it) to handle rotate to face center dynamically in your movement code.
     
    Last edited: Sep 16, 2016
    theANMATOR2b likes this.
  18. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    Holy crap, I've been looking for that game for years!

    That was like, the first game I ever played on a Windows 95 machine at someone's house when I was a little kid

    You gotta give this kid credit though, he skipped the step where we tell him to make tetris or pac man and just skipped straight to step two, he's ahead of the class.
     
    theANMATOR2b and GarBenjamin like this.
  19. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
  20. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    If the level is only 10 cells wide and 10 cells high that's 100 cells total yes.

    There are different ways you can store this data. I'd just use a one-dimensional array if I wasn't using SpriteTile. So in this case it would be int[] aMap = new int[100];

    When moving up you'd get current position based on player position converted into cells. Meaning dividing x and y by size of cell and probably taking into account some offset for each. Once you have player cell (aka tile) position I'd convert it into index into map array.

    If player wants to move left check playerCellIndex-1, for right playerCellIndex+1, for up playerCellIndex-10 and for down playerCellIndex+10. You can of course also just do the normal row X map_width + col to get index of each check too if preferred.

    Enemies do the same. Only in their case I check ahead first (unless the random 20% chance says they want to change direction). If blocked then check left and right. If only one path open take it. Otherwise randomly decide which (or move toward player). If no other option turn around 180 degrees and head back other way.

    Hopefully that is fairly clear. It'd be a lot easier if I was on my laptop instead of cell.
     
    Last edited: Sep 16, 2016
  21. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    On lunch break I started knocking out a little demo project to illustrate the above for one way to do something like Tempest using sprites. Using Vectrosity would definitely be the way to go with something like this. But it can be done with sprites as well.

    I ran out of time due to (as usual) creating the graphics. lol

    But I think I have everything I need now. So after work when I get a chance I will finish it off.
     
    iamthwee likes this.
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Hmm...PacMan...SpriteTile...back in a bit.

    --Eric
     
    GarBenjamin likes this.
  23. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Okay, I threw together a project to show what I saying earlier about Tempest movement using an array to define the path.

    You can grab the Unity project source here.

    I probably should have used a more interesting shape because for a circle like this you simply use sin/cos to sort out the movement around it. You can define the shape to be anything you like and populate the Positions array and the player will travel it.

    I didn't implement this the way I would actually do it. I did this using what I think is the Unity Way. Monobehaviour scripts on the objects. Wiring up dependencies in the Editor. So it should be very easy to follow.

    And here is a video showing it running in the Editor:


    All I do is highlight the section the player is on. Of course, you could grab the SpriteRender for that current section and easily do a glowing (fading in and out) FX or whatever.
     
    Last edited: Sep 16, 2016
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    OK, here's what I got done after an hour and a half. (If I'd remembered about the tile flip feature in my own editor in time I could have saved some bother. :p) No sound, or ghosts...hey, the AI in the original took months to program. ;) I slightly hacked the character controller from one of the demos in SpriteTile to save time. Attached is the project, you'll need SpriteTile though. (And when adding SpriteTile, hook up the TileManager in Plugins/SpriteTile/Resources first, if it doesn't work automatically.)

    WebGL

    pacman.png

    Behind the scenes in SpriteTile, an array is used to represent the level. Movement basically consists of going from one tile to the next, and checking the contents. Walls are marked as colliders, so it's more or less just this:

    Code (csharp):
    1. if (Tile.GetCollider (mapPos + dir)) // see if collider tile exists at current position + attempted direction
    The move function in the PacMan script is this (the dir and characterWasMoving variables are because of the character controller script but aren't used for this game):

    Code (csharp):
    1. function StartMove (dir : Int2, mapPos : Int2, characterWasMoving : boolean) {
    2.     var tile : TileInfo = Tile.GetTile (mapPos);
    3.     if (tile.tile == TileType.Dot) {
    4.         gameControl.AddScore (10);
    5.         Tile.DeleteTile (mapPos);
    6.     }
    7.     else if (tile.tile == TileType.Pill) {
    8.         gameControl.AddScore (50);
    9.         Tile.DeleteTile (mapPos);
    10.     }
    11. }
    Presumably you'd add an appropriate PowerPillEaten() function when adding ghosts.

    --Eric

    Edit: tweaked project to use tile flipping, since it was bugging me. :p
     

    Attached Files:

    Last edited: Sep 17, 2016
  25. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    See, kids? This is why when we tell you to make tetris or pac man instead of your multi-million dollar ultra realistic AAA knockoff, you should do it. Then everyone comes out of the woodwork and writes a bunch of really cool code for you.
     
    theANMATOR2b likes this.
  26. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Cool I will check out the Pac-Man right after this message.

    I decided to go ahead and add the Glow FX on the current section:


    Updated Source here.

    Obviously this all is just a proof of concept. I would spend more time on the graphics if this was something to be released into the wild instead of an example here.

    I definitely should have set up the order of drawing for the sprites. Player should be on top. But that is a very simply 5 second thing to do.
     
    Last edited: Sep 17, 2016
  27. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @Eric5h5 You did a great job on the Pac-Man. I'm amazed you finished the graphics for this in 90 minutes! Looks sharp.
     
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I used a screenshot of the arcade game for reference. The tiles are very simple, and there are not that many; could have been fewer if I'd used the tile flip feature like I mentioned.... (Also I cheated and the center box isn't really right. ;) )

    --Eric
     
    GarBenjamin likes this.
  29. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    I feel like this could come in handy for fancy menu graphics of some sort as well

    I may have to remember some of this for the future
     
    GarBenjamin likes this.
  30. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Holy crap you all. I never even expected anyone to answer back. I'm gonna take a look at some of this stuff. eric and gar both have interesting stuff. If you can kick this out over lunch then it show you how I suck. However, this is good learning material for people wanting to learn simpler games (I'd take puck-man or berserk over some 3d game any day). Although a 3d berserk games sounds kinda cool too.. intruder alert. I did do a space invaders clone 'BLATO! Space Bombardiers' a couple of years ago with unity. I just have never gotten around to doing a maze game like KC-Muchchin (Odyssey 2 anyone?).

    I'll get back to you all after taking a look at this stuff in greater deatil, but feel free to keep this thread going. Maybe they could do live training sometime on this stuff.
     
    GarBenjamin likes this.
  31. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    1) pointing to center would be easy. Set a empty game object at center of screen and always face towards it.
    2) So to clarify.
    A) Put a guy on the path to travel in the editor. Make a path of x-y positions by moving the guy and writing down the x-y cords.
    B) position 1 (1,1), position 2 (2,2), position 3 (2,3) and so forth to position 50 (0,0). Ok, it's a weird shape.
    C) Play game. Start out at position 1. If player moves right, go to position 2 in array (2,2). So if left, then go from position 1 to position 50, then 49 then 48. On each position, set the guy on the x-y cord and point towards center.

    I would assume you would need a ton of x-y positions around the tempest tunnel.


    Man, now I wish I had learned arrays a little better in school.
     
    GarBenjamin likes this.
  32. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    It definitely can. I plan on doing that kind of thing at some point. That's what I was saying in another thread around here someplace last night I guess. Once you get into the habit of making data structures for things the sky is the limit. You can just map everything out and many things become very simple look ups. I got into this habit long ago on the C64 just because it was much faster (performance wise) to precalc and predefine things but it also turns things that can otherwise be complicated into things that are very simple.. just a bit of up front set up work.
     
  33. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    That is it basically. There really are not that many positions. Only one per unique section edge. The player actually jumps from section to section. An animation of "walking effect" can hide that jump. Of course, you could just smoothly move from position to position too.



    Looks like level 1 has 16 positions.
    Level 2 has 16 positions.
    Level 3 has 16 positions.
    Hmm... I think I see a pattern here. ;)

    That makes sense. I have 8 sections in my test. So doubling that to 16 would make it much smoother. And while playing the game you wouldn't notice the jumps. Too busy killing and staying alive.
     
    Last edited: Sep 17, 2016
  34. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Sorry if this is off topic, but on my youtube channel I do have some videos like this. I reviwed them a while back. I have hundreds of videos on video games, but here are some on Tempest 2000 and Puck-Man.

    1994 SCES (I interviewed jeff minter, Atari jaguar, tempest 2000)



    Atari 5200 Pac-Man
     
    Last edited: Sep 17, 2016
    GarBenjamin likes this.
  35. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Awesome stuff. Jeff Minter! C64 Attack of the Mutant Camels. He was always making cool games. Although I didn't think about it at the time now I am fairly sure he was simply inspired by the huge AT-AT walkers in Star Wars. And giant mutant camels were a way to have something like those walkers without being at any risk of a lawsuit.
     
    Last edited: Sep 17, 2016
    theANMATOR2b likes this.
  36. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That is great to get an interview with Jeff Minter. Atari Jaguar's Tempest 2000 was a fantastic job by Jeff. He really came up with great variation on the original Atari Tempest game.

    @Eric5h5

    Since you have finished PacMan are you starting on a Tempest clone (using Vectrosity) next?
     
    GarBenjamin likes this.
  37. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    GarBenjamin seems to have that covered. ;) Also the PacMan is more "started" than "finished", but I'll leave that as an exercise for the reader.

    --Eric
     
    theANMATOR2b likes this.
  38. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    I'm done too. Getting back to my own game project. It would be cool to see your Tempest test in Vectrosity though. I need to buy that and am sure I will very soon. A wireframe rpg would be so cool. Have not seen one of those in about 30 years.
     
  39. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    You all mention "SpriteTile,". I know it's an asset that is on my wish list, but how would that help here? I guess putting the objects in place so far apart, but you all make it sound like it does more.
     
  40. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I looked at your pac-man game. Wow and fast.

    You mention tile sprite. I have not used it. Am I to understand that it makes an array 2d of the grid and you are moving pac-man from tile to tile? SO you place the objects on a tile grid and it makes an array for you? This as opposed to typing in coordinates into an array manually.
     
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It has an editor for building tile-based levels, and an API for doing stuff with tiles. (The editor is built on it, so anything in the editor can be done with code.)

    Screen Shot 2016-09-16 at 9.59.31 PM.png

    Yes, basically.

    You still use coordinates, but all the details are handled for you, so you don't have to manually poke around with arrays.

    --Eric
     
    theANMATOR2b likes this.
  42. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @wheretheidivides Another example of how good @Eric5h5 's SpriteTile map editor & API really are is my Treasures of Ali-Gar game shown previously in this thread. I used SpriteTile for that game.

    It sounds like @Eric5h5 and I implemented our movement systems very much the same. In ToA the players and enemies also move the distance of one tile they just do so smoothly.

    Not sure how he did it. All I do is when the player or an enemy starts a move I calculate the coords of the new position. The objects then are moved a bit each frame until they arrive at the destination coordinate.

    If you're serious about making 2D tile map games of nearly any kind (well platformers, roguelikes, shmups, maze games, etc) I highly recommend you buy SpriteTile or another tile map editor. 2D tile maps are an ideal data structure for 2D games. A cube map would be ideal for 3D games.

    Speaking of which @Eric5h5 I've tried a couple 3D map editors and didn't care that much for them. Any chance that you will make a 3D map editor sometime? A cube map would be ideal for 3D games. But I need it to work like SpriteTile as far as the API being first and foremost. Meaning the visuals need to be driven by the data not the other way around.
     
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I hadn't thought about it; it seemed like that area was well-served from what I've seen, but I haven't actually tried any. I don't need that sort of thing for any of my projects, so I'd have to see if there was a lot of interest first to make it worthwhile.

    --Eric
     
  44. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Well I only know you'd definitely make one sale. lol I can understand that is not much motivation to take on such a project though. Surely there would be others that would like it though. I'm not saying the ones I tried are outright terrible. Just they are not nearly as intuitive as SpriteTile and in some cases simply place GameObjects into the Editor. As in just a placement tool. Actually most are this way. Just a building tool but not true map editors actually creating ya know maps that you can read, create on fly, update etc.

    Anyway, if you ever get bored some day... :)
     
  45. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    That picture of the pac-man tiles was worth 1 BILLION points sir. I get it. I'll buy tilemap and mess a round with it. It seems like it was meant for 2d maze games really well. I do have a really good 2d/2.5 game engine (I forget which one. Its not cogi) but that is more for side scrollers. really cool with scoring, coins, rope, ladders, bad guys and such.

    One of my issues was how to get from tile1 to tile2. I had thought about setting up a grid of empty objects under all of the dots, then when a guy touches it decide what to do. The other issue I had was how do you keep the guys on the same hor or vert path and not get to close to the walls. This is why I thought about pathfinding and all. So I was sort of close but you all helped me out a lot.

    Now the guy on tempest was basically what I thought. I looked at the script and I get it too. You have to tell it coordinates, although I am not sure why you'd type them in and not use empty game objects. So have an array of empty game objects and use those for positions on the tunnel. Sort of like waypoints.

    LOL. Gar kept saying 'ToA' and I have been thinking 'Temple of Apshai". I thought you had programmed it. But you weren't talking about that game. I think I still have the ToA trilogy for the Atari 8 bits around here somewhere.

    I did read the guide on how to make pac-man in unity. Very interesting. Not how you all would do it, but does get into animations and stuff. I think the cords or tiles that you all talk about is better.

    Thanks all.

    Now I pose another question. If pac-man had a tail that go longer and longer on each dot, how would you do it? So the tail gets really long and is like a chain. If pac-man is going right then up, some of his tail is still going right. So he would not be a solid sprite but a series of pieces added onto the tail. Kind of like that old game of snakes.

    KC Munckin Magnavox Osyssey2
     

    Attached Files:

    Last edited: Sep 17, 2016
    GarBenjamin likes this.
  46. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @wheretheidivides LOL! Temple of Apshai. Great games. Played them on my C64. I think one of my enhanced retro games will be inspired by one of those.

    I still (and probably always will) remember haggling with the merchant. Great stuff. Only text but had far more character than any modern graphical RPG I have played.

    ------------

    The reason I don't like to stick GameObjects out in the scene just to get data is because it just seems wasteful to me. All I need are the coordinates not actual GameObjects or even Transforms.

    Of course, had I approached it in a different way... using an array of SpriteRenderer GameObjects I could have enabled and disabled each to get the movement around the shape. But again that seems like a wasteful approach to me.

    I think the other big reason is that in this case it only took a couple seconds to type the position in for each section. If it was something where manually doing it took a couple minutes for each of 8 things then I'd consider just using GameObjects.

    There is nothing really wrong with using them I guess.
     
    Last edited: Sep 17, 2016
  47. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    One of my most favorite retro arcade games was Robotron.... hint. hint. :D
     
    GarBenjamin likes this.
  48. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    I had a professor in college who LOVED Robotron, ha ha

    He said it was one of his favorite games as a kid and always tried to explain game AI in terms of Robotron basically, regardless of if it fit the scenario or not, it boardered on obsession, ha ha
     
    theANMATOR2b and GarBenjamin like this.
  49. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    This thread seems like it should be in the 2D forum... ?

    Maybe @Eric5h5 or another mod can move it over there if they agree.
     
  50. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    What, are we trying to make this the most moved thread of all time?