Fires of Heaven Guild Message Board  

Go Back   Fires of Heaven Guild Message Board > Fires of Heaven Related Forums > Uberworlds Development Forum
User Name
Password
ForumSpy Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-26-2008, 03:47 PM   #1 (permalink)
Faille
Fires of Heaven Officer
 
Join Date: Jan 2002
Location: Melbourne, Australia
Posts: 2,658
+13 Internets
how to make a city building game?

I was thinking of trying to make a city building type game, somewhat like sim city, possibly more like caesar 4 with a dash of civ as well, but obviously create my own rules for it. Would it be better to try and mod an existing game, or program it myself, or find some middleware that would allow for it.

Any suggestions or ideas?
__________________
Faille
Fires of Heaven
http://www.fohguild.org/forums/uberw...lopment-forum/
Faille is offline   Reply With Quote
Old 03-26-2008, 06:32 PM   #2 (permalink)
Phelps McManus
I'm dangerous!
 
Join Date: Jan 2002
Location: Atlanta
Posts: 853
-4 Internets
Maybe you could mod Civ4 into it, but I recommend coming up with a design doc first. Good experience and then you can actually look for tools that support what you want to make rather than designing around what the tools will support.
__________________
If God didn't want us to eat animals, why did He make them out of meat?
Phelps McManus is offline   Reply With Quote
Old 03-27-2008, 06:50 PM   #3 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
I think it would also depend on your level of skill... if you can get something going yourself, that would prove to be the most flexable but the most time consuming.

If there is already a pre-built engine or easily mod-able game you can use, that would save time but give you limitations..
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 08:41 PM   #4 (permalink)
devoir
Registered User
 
Join Date: Apr 2007
Posts: 16
+0 Internets
Tile based city building game could be pretty swiftly written in XNA. Building placement as a control method would be relatively simple compared to some kind of realtime action sequence, and the simulation aspect would be just data pushing. Reason why I say XNA is that a lot of the graphics systems are brought to a very easy level to deal with.
devoir is offline   Reply With Quote
Old 03-27-2008, 09:02 PM   #5 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
actually i was thinking about it yesterday... the map editor I made for my RPG would be a good framework for a 2d top down sim city type game... except i've already modified it more to add enemies and stuff take those out and it would work though...
Cloud9_ is offline   Reply With Quote
Old 03-30-2008, 08:22 PM   #6 (permalink)
Faille
Fires of Heaven Officer
 
Join Date: Jan 2002
Location: Melbourne, Australia
Posts: 2,658
+13 Internets
Still working on the design doc, but some of the key features / aim I've already established are the following:

Needs to be story driven. This shouldn't be too hard, but at its most simple, might be a cut scene / narration between missions, but ideally would want them to occur within the mission as certain goals are met.

Would prefer not to do a mod, since I'm somewhat tired of them and want to take the next step, so to speak. Also, would like to have the fantasy of publishing the game and making some money! 8)

Turn based gameplay is something I haven't really considered since real time seems more suited, but don't want to rule it out entirely. Might reevaluate the decision once more of the design is fleshed out.

Space / distance / travel time is going to be key. I want to try and emulate the challenges of trying to build up the city with limited space as more technology becomes available.
__________________
Faille
Fires of Heaven
http://www.fohguild.org/forums/uberw...lopment-forum/
Faille is offline   Reply With Quote
Old 03-31-2008, 05:23 AM   #7 (permalink)
slitz
euro scum
 
slitz's Avatar
 
Join Date: Aug 2002
Location: Sweden
Posts: 808
-9 Internets
Don't really know your experience of code design, but this is a excellent example where OOP is needed:

Code:
public interface Building { public int getArea(); public int getFloors(); public int getCost(); etc... } public abstract class GovermentBuilding implements Building { private int area; private int numberOfFloors; public abstract int getCost(); public abstract double getTax(); public void setArea(int area){ this.area = area;} public void setFloors(int numberOfFloors){ this.numberOfFloors = numberOfFloors;} public int getArea(){ return area;} public int getFloors(){ return numberOfFloors;} } public class PoliceStation extends GovermentBuilding{ public PoliceStation(int area, int numberOfFloors){ super.setArea(area); super.setFloors(numberOfFloors); } public int getCost(){ return 500;} public double getTax(){ return 0.11d;} } etc!
A good code design will save you a lot of time later on when you want to create new buildings.
If you find this insulting, just ignore it 8)
slitz is offline   Reply With Quote
Old 03-31-2008, 08:48 AM   #8 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
whats the 'extends' keyword do? i understood 99% of the rest of that
Cloud9_ is offline   Reply With Quote
Old 03-31-2008, 11:56 AM   #9 (permalink)
x1hundredregrets
Reactor Zero
 
x1hundredregrets's Avatar
 
Join Date: Dec 2002
Posts: 307
-5 Internets
Quote:
Originally Posted by Cloud9_ View Post
whats the 'extends' keyword do? i understood 99% of the rest of that
In his example, it looks like Building is a pure virtual class.

And PoliceStation is derived from GovernmentBuilding.

Thus,

impliments = implementation of a pure virtual class

extends = derives from a class
x1hundredregrets is offline   Reply With Quote
Old 03-31-2008, 12:09 PM   #10 (permalink)
Froofy-D
upper management material
 
Froofy-D's Avatar
 
Join Date: Nov 2002
Location: Orlando, FL
Posts: 1,997
+8 Internets
Thumbs up

If class B extends class A, you create a class hierarchy where:

- class B is a "subclass" of A
- class A is a "superclass" of B

What this means is:

- class B automatically inherits all the variables and functions of A (you dont have to re-write code!)
- additionally, you can add extra functionality to B, beyond that of class A

So the building system is indeed a good place to apply a class hierarchy. You can have multiple, named building types each with unique functionality. But the best thing is (imho), you can can stick all those different buildings into the same containers.

For example, consider weapons (in extremely simplified pseudo-code):

Code:
class Weapon {float damage, float weight}; // super class class Sword extends Weapon{damage =5; weight=5}; class Mace extends Weapon{damage=8; weight=10}; class ShortSword extends Weapon {damage=3; weight=1};
Then I can stick all those weapons into the same container:

Code:
List[Weapon] weaponList = new List[Weapon](); Sword s = new Sword(); weaponList.add(s); Mace m = new Mace(); weaponList.add(m); ShortSword ss = new ShortSword(); weaponList.add(ss);
Cloud, I think you mentioned you are currently figuring a way to to deal with monsters and items systems. This is a good way. In my space game I'll be using a class hierarchy for weapons and ships.

Last edited by Froofy-D : 03-31-2008 at 12:25 PM.
Froofy-D is offline   Reply With Quote
Old 03-31-2008, 12:24 PM   #11 (permalink)
Froofy-D
upper management material
 
Froofy-D's Avatar
 
Join Date: Nov 2002
Location: Orlando, FL
Posts: 1,997
+8 Internets
Actually, a better example is RPG inventory. How do you implement a Backpack full of stuff? Just make the backpack a list of inventory items:

Code:
class InventoryItem{}; // super class class Rope extends InventoryItem{}; class Compass extends InventoryItem{}; class TinderBox etc...
So, you could make a backpack a simple list of inventory items. You add an item to the backpack by adding it to the list.

Code:
class BackPack{ // contents of the backpack List[InventoryItem] contents = new List[InventoryItem]; // max number of items int capacity = 10; public void Add(InventoryItem item) { // make sure there is enough room in the back pack if(contents.count < capacity) { contents.add(item); } } }
Froofy-D is offline   Reply With Quote
Old 03-31-2008, 12:45 PM   #12 (permalink)
x1hundredregrets
Reactor Zero
 
x1hundredregrets's Avatar
 
Join Date: Dec 2002
Posts: 307
-5 Internets
This thread feels like a seminar or course in OOP principles.
x1hundredregrets is offline   Reply With Quote
Old 03-31-2008, 12:54 PM   #13 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
what language is that? because i'm pretty much doing that exact same thing... except it looks like this;

Class BaseItem
{
//whatever here
}

Class Weapon : BaseItem
{
//weapon stuff here
}

class Armor : BaseItem
{
//armor stuff here
}
Cloud9_ is offline   Reply With Quote
Old 03-31-2008, 01:59 PM   #14 (permalink)
Froofy-D
upper management material
 
Froofy-D's Avatar
 
Join Date: Nov 2002
Location: Orlando, FL
Posts: 1,997
+8 Internets
oops, extends is a java keyword. In C# its the colon.
Froofy-D is offline   Reply With Quote
Old 03-31-2008, 02:06 PM   #15 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
lol nice.

It is good to know that the ideas of programming can be used with whatever language you learn... so it would be easier to pick up C or C++ or Java if i wanted to, now that I am learning C#
Cloud9_ is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
uberguilds network



All times are GMT -7. The time now is 07:04 PM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6