Results 1 to 6 of 6

Thread: Simple Terrain

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    23

    Exclamation Simple Terrain

    I'm looking into making a simple 2D strategy game. It'd be tile-based. I've determined that each tile will take up apx 24 pixels and fit all together to make a grid.

    My dilema is finding the best way of accomplishing this. I'm comparably new to VB, However I know how to create classes, Modules, and other such things. My original plan was to have each Terrain block be a modified PictureBox. However, somehow drawing 256 picture boxes on screen just doesn't feel like the right way of doing things, and seems to leave a lot of room open for errors.

    Does anyone have any better ideas of accomplishing a tile-based terrain system that could provide for customizeable terrain types with various variables attached to them that could ideally be generated at runtime?

    A friend of mine suggested drawing a large, grass image to be the base terrain, and several Terrain blocks would be drawn on top of this larger image. This would cut back on the amount of pictures being drawn, and would seem to be a bit simpler to work with.

    My head is in a tailspin right now as this is the first graphically intensive application I've done, and am not really sure to begin here. Any expertise on the matter is greatly appreciated.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Simple Terrain

    You mentioned VB. VB6 or VB.net? If VB.net, then ignore the following

    Take a look at your help files for the PaintPicture method.

    Your form can be the gameboard or you may decide to use a picturebox as the gameboard. Each unique tile image can be loaded in a hidden image control or read from your resource file, if used, as needed. The bottom line is that you do not use 256 image controls, picturebox controls, etc. Just 1 per unique image.

    You also may want to download some posted games in this forum section and disect how they were done.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    23

    Re: Simple Terrain

    I'm guessing VB express 2008 is just good ole VB6.

    I was looking into DxICE, perhaps that would be a decent place to start my game off? My only problem is the lack of documentation that I can find on it.

  4. #4
    Lively Member
    Join Date
    Jan 2008
    Location
    South West Michigan
    Posts
    126

    Re: Simple Terrain

    DXIce seamed to be pretty good to me as well. There is a bit more documentation in their forums (must be come a member though). Although most of the documentation is for C# not VB.

    The one that interested me the most and I am just getting started with is SlimDX. It is a .NET object and currrently supports VS2010 but there there is little to no documentation just for VB.

    Under the Demo's there are a few projects that were created with VB2008 and earlier versions. I would recommend looking those over to see what they are using for game engines. One thing to keep in mind, with VB2010 doesn't support DirectX anymore, so don't upgrade. While you can bring in DirectX as a .COM object it is completly broken down so the unexperienced like myself are completly lost and support is hard to find.

    Good Luck!

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Simple Terrain

    Quote Originally Posted by Kraizer View Post
    I'm guessing VB express 2008 is just good ole VB6.
    Wrong guess I'm afraid... VB 6 was released in 1998, and was the final "Classic VB". VB 2002 and later are VB.Net

    As such LaVolpe's suggestions aren't quite right (I'm fairly sure PaintPicture doesn't exist), but the general idea is still on the right lines if you write your own code rather than using a pre-made engine (or helper like DirectX).

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    23

    Re: Simple Terrain

    I think I've come up with an idea.

    I'm currently using a classe called "Map" that is a picturebox derivative. It then "creates" small objects ("Terrain") on top of it in 24x24 grid units. Being a unit-based strategy game, the units also snap onto the Map just as the terrain tiles do by simply getting the player's click position on the map and dividing it by 24, the terrain/unit tile size in pixels. the X and Y are figured out and the unit snaps to the grid.

    In the process of tinkering with making Controls, I managed to clear out my toolbox . . . Any fies for this? Or will I ned to re-install VB2008?

    Feedback on m ymethod is also welcome. The most pressing matter for he time being now is my cleared toolbox

    EDIT: Toolbox fixed.
    Last edited by Kraizer; Nov 27th, 2010 at 02:07 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
  •  



Click Here to Expand Forum to Full Width