Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 2 (47 posts) 1 2 Next >

New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

Last post 8/14/2010 9:43 PM by Furiant. 46 replies.
  • 6/18/2008 8:42 AM

    New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    The second tutorial for the new Role-Playing Game starter kit is now available. This tutorial provides step-by-step instructions on how to re-use the tile-based engine featured in the starter kit in your own game. For more information, check out the Role-Playing Game starter kit page, and also check out the first tutorial on adding a quest to the game.

  • 6/21/2008 4:13 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Pretty good rundown of the guts of the Map portion of the RPG sample. I am going to attempt to gut pieces of it as well however I am working on a turn based game which doesn't have the 'One Position of Importance' part of the RPG engine.

    - The game state engine needs to support 2 players, each taking 'turns'

    - Fixed board size (my map is height 24 squares, width 29 squares)
    - Entire map should fit on a 1200 x 800 display
    - Figures need to be placeable by either player and need to be able to remove themselves
    - Figures needs to move from Point to Point based on mouse input (similar to chess, highlight the figure, then choose move, then choose the target square)
    - MapSquares need characteristics beyond blocking, some can be harder to move through etc.
    - Eventually the Map and all the initial figures will be loaded from a server after 2 players begin a game

    The RPG starter cleared up some issues I had concerning rendering which is great.

  • 6/22/2008 11:45 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I'd just like to say thanks for your efforts in making this available - I got everything going with a minimum of fuss (some namespace problems with the ContentWriter and that was about it). Having something like this means making that action-RPG for my 5 year old is a little closer to reality :)
  • 6/24/2008 12:19 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Tonight I did a bit of playing around trying to understand why the PartyLeader would sometimes get stuck on edges and not be able to move up or down.

     I first added a spriteFont so I could dump some debug to the game screen. Next I modified ForestTiles.png and included some red and green tile borders. Then I modified TileEngine DrawLayers() method to render the borders around blocked tiles. That way, I could at least see what tiles were blocked, and what the current and desired TilePosition and TileOffsets were.

    Anyway, to cut a long story short, there is a documented relationship between the partyLeaderMovementSpeed and movementCollisionTolerance constants. That's fine, but what isn't explained is that these values should also evenly divide into the tile size. What can happen is that the initial test in CanPartyLeaderMoveUp(), CanPartyLeaderMoveDown() etc return true, even though subsequently applying the desiredOffset would take the position into a blocked tile. If you check the first map where sign with the down arrow is, and the trees narrow, you can reproduce this behaviour.

    I'm having trouble explaining this well, so I can either take some screenshots to help explain, or you can just set your constants so they divide evenly into the map tile size to fix it.

    Question: In TileEngine::Update(), what's the purpose behind the Vector2.Multiply(userMovement, 15f). I took it out and it appeared to make no difference.

  • 7/1/2008 8:11 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    sorry but I have follow tutorial until "Hooking it Up" topic , after edit game1.cs accroding to tutorial when i'm hit F5 im got run time error at command TileEngine.SetMap(Content.Load<Map>(@"Maps\\Map001"), null);

     

    say "Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader, RolePlayingGameDataWindows."

    everythings are work fine before enter this point. I have tried to follow0 the tutorial from the begineing for 2 times and got same problem if someone know how to fix this problem plz help me.

  • 7/2/2008 7:48 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Same error here.
  • 7/7/2008 8:10 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I ran into this problem myself. Do you have two Content nodes in your main game project? If so, it's very likely that you included the map and texture files in the main project, instead of the Content node as specified in the tutorial. At the end of the "Copying the Test Data" section:
    "Select the Content node in the game project, go to the Project menu, and click Show All Files."

    If you do have two Content nodes, you can move the asset files you just added from one to the other, then delete the now-empty one. The correct Content node is the one with References.

    You may encounter another error after this:
    There was an error while deserializing intermediate XML. Cannot find type "RolePlayingGameData.Map".

    Similar fix. You did not properly reference the pipeline project. More than likely, you are referencing the pipeline project in the main project, when the reference should be in the Content node. See this section at the end of the "Creating the Projects" section:
    "The game’s content project needs to know about the processor library so it can build the content. In Solution Explorer, right-click the Content node under game project node, and then click Add Reference. In the Add Reference window that pops up, click the Projects tab, select your pipeline project, and then click OK."

    Should work now. :)

    To the tutorial author:  I recommend you emphasize these points in the tutorial. Easy to overlook.
  • 7/16/2008 9:25 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I included them in the content node, not the main project but I have the same error. Can't understand. Could you upload your result here?

    PS: I wrote for windows, not xbox.

  • 7/16/2008 11:05 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    rygringo:
    I included them in the content node, not the main project but I have the same error. Can't understand. Could you upload your result here?

    PS: I wrote for windows, not xbox.

    Make sure that you have replaced the project names in the Pipeline project. 

    In RolePlayingGameWriter.cs change RolePlayingGameDataWindows

     (Around line 43) readerText += ", RolePlayingGameDataWindows";  to the name of your project name.

     (Around line 64) string typeText = type.FullName + ", RolePlayingGameDataWindows"; also.

  • 7/18/2008 4:46 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Thank you for your reply DLuke. I tried that. But not a chance. Still got the old error: "Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader, BomberMan."
  • 7/20/2008 11:08 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I'm also getting the same error. Does anyone have a solution? Not sure what we're missing.
  • 7/21/2008 3:07 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I can run my project now. have to be sure  It's a naming problem. We have to be sure that we changed in RolePlayingGameWriter the name of the DATA project, not the main project. Thank everyone. :D
  • 8/8/2008 2:12 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Nice tutorial. Everything worked on the first try. It was very easy to understand too. I have a question though that fits best into the category of this tutorial. I added my own animated sprite engine with my own animated sprite to go in place of the white rectangle. I used the input code that the tile engine has. My question is, how can I change the dimensions of the invisible rectangle (I assume that's what it is) that handles collision? You see, the sprite that I put in is slightly smaller than the sprite that was originally used in the RPG starter-kit. I would scale the sprite so that it would fill in the collision space, but then it would be a little to big for what I have planned. I don't think posting my code for my animated sprite class is necessary, but if you need it, just ask and I will. It's basically a modified version of the animated sprite class in the XNA Framework documentation. Thanks in advance.
  • 9/10/2008 9:42 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I really like this tile engine, but is there an IDE tool to help design the levels then export the design to XML?
  • 9/10/2008 4:41 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I got the same problem (Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader").
    Solution: Check the Assembly name (In the Solution Explorer-> right click on your Data Project -> select Properties -> choose the Application tab)
    You must change the following, in your RolePlayingGameWriter.cs.
    1. readerText += ", XXX"
    2.  type.FullName + ", XXX"
    "XXX" should match your Data Project assembly name.
  • 9/11/2008 7:16 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I'm having a strange issue at the Striping Down the Pipeline Types section of the #2 tutorial. I'm getting the error:

    Error 1 The type 'Microsoft.Xna.Framework.Point' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Xna.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=51c3bfb2db46012c'. D:\Documents\Visual Studio 2005\Projects\SOD\PipelineProject\MapEntryWriter.cs 48 13 PipelineProject

    When I build after I've cleaned up the code for that section. I've removed and re-referenced Microsoft.Xna.Framework but I continue to get the error.

    What am I missing?

     

    Additional Information:

    OK, in the output text its telling me that I have two versions of System (2.0 and 3.5) and it's confused, so it's using 3.5  I'm thinking this is part of the issues. I've removed and refrenced the same version in the Data and the Pipline but no change, or it just gets worse. Still have no idea what wrong.

     

    Even More Additional Information:

    I went back to the beginning again and started over. I belive my issues are what I was trying to do. I want to make this for Xbox, not windows. So I used the Xbox data project (there are two dta projects in the Xbox version of the starter kit), not the Windows data project, and they seem to be using two different versions of System. So, what is the best course of action here? Do I edit both the Windows and Xbox versions as per the document so I'd end up with four projects and not three just like the orriginal RPG Xbox template?

     

     

  • 9/13/2008 10:35 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Got it working. It was as I last thought. I copied the format of the orriginal Xbox template made up of the four projects (not the three in the Windows version) and everything worked.

     

    I did notice however that I was getting an additional error in the program area that the document didn't talk about. It was an error related to the Session and the chests. I just commented it out and everything was fine.

     

  • 9/25/2008 6:42 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    I've done everything up to the point where it says to run the game, (after we've run it with the cornflower blue blackground without the calls to the tile engine).

     

    When I try to run it now, I get an error from the map001.xml that says

     

     "XML Element Baselayer not found"

     

    Anyone know why or how I can fix it.

     

    When I double click the error it takes me up to the BaseLayer Grid in the map.

  • 11/5/2008 1:22 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    IronSnake:
    I got the same problem (Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader").
    Solution: Check the Assembly name (In the Solution Explorer-> right click on your Data Project -> select Properties -> choose the Application tab)
    You must change the following, in your RolePlayingGameWriter.cs.
    1. readerText += ", XXX"
    2.  type.FullName + ", XXX"
    "XXX" should match your Data Project assembly name.


    Hi IronSnake,
    It works, thank you.
  • 12/9/2008 4:18 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    my error message is different then the (Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader"), I've screen shotted it. http://drksummoner.angelfire.com/pictures/screen_shot.png
  • 12/9/2008 4:32 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    drksummoner:
    my error message is different then the (Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader"), I've screen shotted it. http://drksummoner.angelfire.com/pictures/screen_shot.png

    If the file is there, your path isn't correct.
  • 3/20/2009 6:30 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Jim Perry:
    drksummoner:
    my error message is different then the (Error loading "Maps\\Map001". Cannot find ContentTypeReader RolePlayingGameData.Map+MapReader"), I've screen shotted it. http://drksummoner.angelfire.com/pictures/screen_shot.png

    If the file is there, your path isn't correct.


    I get the same error, and I don't know where I went wrong, could someone please just run through how to fix this?
    Any trouble shooting advice would be appreciated.
    View the screen shot to understand what the problem is.



  • 3/20/2009 10:44 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine


    Well I think I figured out the problem. It' was my content folders. There is already a content folder in the solution explorer, but it doesn't have the beige color and an icon like
    the actual folders have. This is because it isn't a regular folder. But the maps that weren't being read need to be dragged into this content thing.

    A good idea is to drag the entire Maps folder, and Texture folder, and problem solved.
  • 3/20/2009 11:23 AM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Visual Studio manages your project separately from just the file system of the folder. To add files to your project, drag them into the file browser in Visual Studio, not Windows Explorer. To see the files that are in the folder but not added to the project, there's a "show all files" button on the project browser. Even if all the files are there, the project can't read them if they're not added to the project.
  • 3/20/2009 5:59 PM In reply to

    Re: New Tutorial: Role-Playing Game Tutorial #2 - Re-using the Tile Engine

    Sean McCafferty:
    To add files to your project, drag them into the file browser in Visual Studio, not Windows Explorer.

    Just in case you run into problems, if you're running Visual Studio as administrator, then drag-and-drop between Windows Explorer and Visual Studio doesn't work. Copy-and-paste does work, however.
Page 1 of 2 (47 posts) 1 2 Next > Previous Discussion Next Discussion