Hey all,
I am hoping someone might have programmed something like this before. Basically it is the same as any rts, where the screen is only focused on one part of the map, but can be scrolled, and actions still take place offscreen.
I'm still pretty new to c++, but I am wondering if you could use an 2D array to store data for the map, and then call data from that array based on the position of the screen relative to the map?
The map I have in mind will be somewhat big, so I was hoping to create something that has no lag and doesn't hog memory/cpu time. Any ideas would be appreciated. 1 Map 2 Park and Senior Center Information 3 Guide for Exploring :: File Format: PDF/Adobe Acrobat - View as HTMLscroll, twist, hot punch, draw file, and heat treat by completing some simple Using our eagle eyes, deer ears. and bear noses, we’ll explore nature’s http://www.co.whatcom.wa.us/parks/pdf/parks_winter2006.pdfHOME | Software Download: Pacman-style:: Allow user to define Clip Size in runtime or design time. Allow user define Vertical or Horizontal scroll bar in thumbnail view. Supports BMP, GIF, ICO, http://www.sharewareconnection.com/titles/pacman-style11.htmHOME |
Thank you,
Cedwyn
Scratch what i said. B & C ComputerVisions myatari.com ataristp.txt Last update 01/26 :: Jan 26, 2000 PST315 STE GRAPHICS DEMO - 3-D SCROLL and SUNNY - a graphic demo. . (1 Meg, DS) PST330 GAME HINTS - Maps and hints for Cadaver, http://www.myatari.com/ataristp.txtHOME | Kovels' Online Antiques And Collectibles Price Guide:: Town Harbor, Ships, Benjamin Hill Horn, C.1760, 11 In. Etched Scroll Design . Fort Meigs Map, Eagle, Dan Hanks, September, 1813, 10 In. http://www.kovels.com/priceguide/kovels_powderhorn/HOME |
Units: [[id(type), #(relative to number onscreen), hp(health), x, y]]
-Where X, Y are true pixel cords on the map. Pangalactic Federation Battleship, Star Trek: Armada 2 Downloads :: Jul 23, 2007 And paste into C:\Program Files\Activision\Star Trek Armada II\Textures\ Scroll down to the following lines: (Note: It is not very far) http://armada2.filefront.com/file/Pangalactic_Federation_Battleship;81210HOME | Damoclash:: Scroll down to read my addendum on this blatant act of censorship! . I know for a fact that Bojana Cvejic has been keeping an eagle's eye on the stuff I http://www.damoclash.nl/showPage.php?p=495HOME |
Buildings: [[id(type), #(relative to number onscreen), hp(health), x, y]]
-Where X, Y are tile locations on the map.
This will allow tiles hit detection to be altered when a building is created above the tile or if it is destroyed. And units movements along the nodes (nodes are in the center of every passable tile.
Also if your doing the tiles as ISO (such as starcraft), then these ideas may not work.
^with C++ your not going to be killing your CPU that much for simple array modifications ect. But for this type of thing I would make a multidimensional array for.
Array: [[id(type), #(relative to number onscreen), hp(health), x, y]]
Basically then when you have Type soldier attack type soldier (of the enemies multidimensional array) you can use basic math to find if they are on the screen if thats true then use simple math to simulate a bullet firing between the units sub from their hp in each array.
Note that the types would have to be defined with properties such as Total HP and damage range (x1 to x2). Game design takes a lot of time so make sure your spending more time thinking than you are coding or you will end up wasting dev time.
I hope this give a brief example and design logic to go from.
/edit, additional information.
Tiled world with free from movement. Tiles will give you a very clear estimate on hit regions and path finding while allowing for a more realistic unit movement style (remember RTS tiles are usually larger around 100x100pixels to 150x15pixels.
Thank you for your help, that is what I had in mind. I was thinking of using a tiled array system, where a single array cell counts as a tiny tile, but wasn't sure if a huge array of many small tiles would create any processing problems :)
As for the coding, I'm thinking of making each cell in the array (if it has a unit on the tile) be a pointer to an unit object. I figure this is better for the system as I can delete pointers when a unit dies, as well as allow selecting multiple units. Ie. An array called 'selection' holds the pointer data for all units selected.
If anyone has anymore thoughts or ideas, please share :)
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market
|