New Game/ Making maps

Need help making maps for a game

Page 1 of 1

5 Replies - 1454 Views - Last Post: 24 May 2009 - 11:51 AM Rate Topic: -----

#1 xnewix   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 211
  • Joined: 23-May 09

New Game/ Making maps

Posted 23 May 2009 - 04:50 PM

hum..Iv'e been making this simple console program..sort of a turn based statagey game. Having gotten most of the basic combat side of things out the way I decided to move onto the economics.
Each map that I make will have a number of sectors which contain in them buildings and all the other details. if youve ever played any of the Total War serries you might get what I mean.

Sector

Resources - this would state the resources that are avalible to be gathered in this sector
ResourceStockPile - this keeps a record of how many resouces are in this sector
Troops - The troops avalible, maximum garrison size.
Buildings - these would be Farms Housing etc which contribute to how many resources you bring in each turn


Map - Is made up of approx for example 6 sectors, 1, 2, 3, 4, 5, 6.

I'll post the code i've done so far in a minute

p.s Also I'd like to eventually move from the console text based screen to a more graphical view. What would be required to do this,

anyway all help is appreciated, chears

xnewix

This post has been edited by xnewix: 23 May 2009 - 04:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: New Game/ Making maps

#2 xnewix   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 211
  • Joined: 23-May 09

Re: New Game/ Making maps

Posted 24 May 2009 - 12:54 AM

perhaps im doing this the wrong way, I also thought of using array's but dont really know how to do them :angry:

#include <fstream>
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <cstdio>
#include <cstring>

using namespace std;


// MAP
Sectors
Sectors(Total) = 4
	// In this we will have
	Sector1(positioning goes in here later) as in X and Y
	Sector2(
	Sector3(
	Sector4(
*/

class SectorsMap {
	NumberOfSectors

		SectorMap(int 

		return 
	class Resources {

		// Resources
int RWood;
int RIron;
int RStone;
int RGold;
int RFood;


public:
	Resources(int RWOOD, int RIRON, int RSTONE, int RGOLD, int RFOOD) {
		RWood = RWOOD;
		RIron = RIRON;
		RStone = RSTONE;
		RGold = RGOLD;
		RFood = RFOOD;
	}
	int get_RWood()	{ return RWood; }
	int get_RIron() { return RIron; }
	int get_RStone() { return RStone; }
	int get_RGold() { return RGold; }
	int get_RFood() { return RFood; }

};

int main()
{
int a;
	Resources Sector1(1, 1, 1, 1, 1); // 1 indacates yes 0 = no
	cout << Test.get_RStone();
	cin >> a; // just so i can view the results at the end.
return 0;
}
/*
//// Each Sector Will need//
SR(
Sector1(


Class SectorResources

SectorResources1(1, 1, 1, 1, 1) // This sector has all 5 resources

Class SectorStockPiles
	SectorStockPiles1(10, 10, 10, 10, 10) // This sector has these resources

Class SectorTroops

Class SectorBuildings
		LumberHut
		IronMine
		StoneMine
		GoldMine
		Farm

		Baracks .....etc

	All I need to do is 
	SectorStockBuildingsOne(1, 1, 1, 1, 1) // Just the resource ones for now, the number indicates the level of the building
SectorBuildings(

Was This Post Helpful? 0
  • +
  • -

#3 bsaunders   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: New Game/ Making maps

Posted 24 May 2009 - 02:53 AM

Do you need help with your code?
Was This Post Helpful? 0
  • +
  • -

#4 GalenEvil   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 12-March 09

Re: New Game/ Making maps

Posted 24 May 2009 - 03:11 AM

If you are planning on making this into a graphical game I believe it would be easy enough to port to Dark Basic, which can be used easily enough through Visual C++ Express available through the Microsoft Website, currently for free. Using the Dark Basic suite, trial is free but the full version costs a bit, you can create a large array of game types in a graphical form. Look up also The Game Creators GDK. It contains useful graphical tuturials and gives an introduction through on-hand programming instruction.

I hope that my suggestions are of some help to you, or at least give you some ideas as to the options available for porting your game to a graphical interface.

Good luck, I will try to follow this thread to see how you progress.

GalenEvil
Was This Post Helpful? 1
  • +
  • -

#5 xnewix   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 211
  • Joined: 23-May 09

Re: New Game/ Making maps

Posted 24 May 2009 - 04:53 AM

View Postbsaunders, on 24 May, 2009 - 01:53 AM, said:

Do you need help with your code?


yes its in a bit of a mess. Its just this bit that I can't seem to do. What I wanted was to store all the details about a map so that. It can have any number of sectors (usually around 6) and then to be able to store information about eah sector. I was thinking I'd have to use inheratence and arrays.
Was This Post Helpful? 0
  • +
  • -

#6 Tom9729   User is offline

  • Segmentation fault
  • member icon

Reputation: 181
  • View blog
  • Posts: 2,642
  • Joined: 30-December 07

Re: New Game/ Making maps

Posted 24 May 2009 - 11:51 AM

View Postxnewix, on 24 May, 2009 - 06:53 AM, said:

View Postbsaunders, on 24 May, 2009 - 01:53 AM, said:

Do you need help with your code?


yes its in a bit of a mess. Its just this bit that I can't seem to do. What I wanted was to store all the details about a map so that. It can have any number of sectors (usually around 6) and then to be able to store information about eah sector. I was thinking I'd have to use inheratence and arrays.

You could use inheritance for this but you definitely don't need to and if you don't know how to use arrays then you definitely shouldn't be jumping into OOP.

Do you know how to use Vectors? If not you might want to read up on them, they're kind of like dynamic-arrays (meaning they don't have a fixed size).

I would recommend organizing your ideas with some type of UML/flowchart program first.

Ignore the people suggesting Dark Basic, you're already using C++ and you should stick with it. Switching languages won't make this any easier. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1