Updated on: Apr 19, 08
DEVELOPMENT

OpenCity 0.0.6 beta - development plan

	Use less triangles to render water    (done)
	Improve alpha display                 (done)
	Improve culling calculation           (done)
	Remove unused OCM model               (done)
	Add 1 state button                    (done)
	Add new query icons                   (done)
	Improved query circle                 (done)
	Improved selection calculation        (done)
	Improved selection hot zone           (done)
	Add heightmap into the release        (done)
	XML parameters accessors
	Save file version check
	Crime
	Review the message system
	Review the agent creation process
	Police agent system
	Mouse cursor support
	Unblocking networking layer
	ZeN online map loading
	Earthquake

OpenCity 0.0.5 beta/stable - development plan

	Remove -no-dl option                  (done)
	Fullscreen config variable support    (done)
	Fullscreen high resolution autodetect (done)
	Add --fullscreen                      (done)
	Global city dimensions variable       (done)
	Global settings structure             (done)
	Water texture                         (done)
	TinyXML 2.5.2 integration             (done)
	Fix path building bug                 (done)
	Fix graphist's special test feature   (done)
	Add GetFloat() to Conf class          (done)
	Add --noaudio                         (done)
	Reduce CPU usage when iconified       (done)
	Fix bug #1596555                      (done)
	Fix building resize bug               (done)
	Add label alignment attribute         (done)
	Add population computation            (done)
	Save file format version              (done)
	Save ressource statistics             (done)
	Fix the income system                 (done)
	Fix terrain highlight bug             (done)
	Fix load/save toolcircle bug          (done)
	Add the coal power plant              (done)
	TinyXPath 1.2.4 integration           (done)
	Add save/load file versioning         (done)
	Fix TinyXPath 1.2.4 64 bits bug       (done)
	Add map generator commandline options (done)
	Basic LOD                             (done)
	Basic 3D object culling               (done)
	Improved 3D object culling            (done)
	Fix STL comparison functor bug        (done)
	Toggle terrain/water/structure display(done)
	Mini RCI map                          (done)
	Create trees on the map at start      (done)
	Add SimpleOpt as command line parser  (done)
	Add MapMaker as global class          (done)
	Fix culling algorithm while dragging  (done)
	Add main menu                         (done)
	
	Integrate the new status bar          (done)
		Add speed button                  (done)
		Add RCI bars                      (done)
		Fix RCI bars ratio                (done)
		Fix P bar ratio                   (done)
		Add toolcircle button             (done)
	
	XML metadata migration                (done)
		Load model dimensions             (done)
		Load model direction              (done)
		Load cost                         (done)
		Load property attributes          (done)
		Load RCI, WEG, TN values          (done)
	
	Review the licensing                  (done)
	Variable name clean up                (done)
	LBS/FHS layout                        (done)
	Add the manual page                   (done)

Design issue

The current UML class diagram is here. Everything in green is not implemented yet. All the yellow classes are more or less implemented and the pink rectangles are the interfaces. For the more complete, lastly updated UML design, download the file UML.xmi from the source repository. It is made with Umbrello, an Open Source UML design program that you can download here. I would like to notice you the UML design is not constantly accurate but it can improve the codes' understanding. Here is the collaboration diagram when the program starts up, and this one is when the city class displays a layer.

The UML is mainly for design purposes. And, you're right, there should be no "const", "&" or other language specific key-words in it. The reason is, at the beginning, I have used the built-in code generator of Umbrello. If I put some of those language specific key-words, I manage to get a functional codes directly from an UML class diagram. Besides, I'm very strict on using C++ key-words, that's why I decided to put them in the UML class diagram. They remind me how I should implement them later in the codes.

Usually, I work on the design of the classes before implementing them. In addition, I use the Standard Template Library (STL) as much as possible. However, in some cases, the STL is too slow for OpenCity. That's why I prefer the plain old C-style array instead of a vector of objects. In the near future, each class will be fully documented (er... I didn't do it for all of them yet ;-)). Since OpenCity is a 3d city simulator developed under Linux, it will run on most of Linux distributions. However, my program is coded in the way that makes it easy (I hope so) to port it to other OS. Currently, OpenCity can run on Win32 without any problem.

The following STL classes are used currently in the codes:

	std::vector
	std::map
	std::pair
	std::deque

3D issue

I have a very limited experience with OpenGL and I learn it on the fly. More advanced functions will be used in the future as long as the development of OpenCity progresses in order to speed up rendering functions and to display better graphics. For the moment, the current version uses very basic OpenGL primitives such as:

	GL_POLYGON
	GL_LINES
	GL_TRIANGLE_STRIP
	...

The whole terrain is drawn as an unique GL_TRIANGLE_STRIP for speed optimization. The algorithm that I used is quick and dirty. For more information, you can read the comments in the code sources.

The old 0.0.3beta version uses the object coloring method for model picking. This method is described in the "OpenGL Programming Guide" or the "Red Book". When the player clicks in the window, it assigns a different RGB combination to each object in the back-buffer. Then it reads the RGB values of the pixel which is right under the cursor's position in order to determine which object is picked by the player. This method is quite easy to be implemented and it can process very fast. Furthermore, as it is used with depth checking, you don't even have to handle the depth of the objects because only the nearest object can be picked by the player. The limits of this method are the number of bits per pixel available and the double-buffering. OpenCity requires 32bpp and double-buffering because of this selection method.

In the new 0.0.3stable version, OpenCity uses GL_SELECT mode for object picking. That's why the 32bpp or 24bpp video modes are not required anymore.


Coding style

Sometimes, you can see "//TOKILL" in my codes. As you can guess its meaning easily, it's the opposite of "//TODO" :-D The codes which follow a "tokill" mark often work perfectly. However, they are no more used in the current version of OpenCity and will be "killed" in the near future. I left them there for reference purposes. Anyway, they won't slow down the game since they are all commented out.

Each variable is prefixed with its type, for example: "uiCityWidth". It's a variable of type "unsigned int". More details are given in the design document: "OpenCity_Design.sxw" and the "CodingStyle.*" files. You can download them from the CVS repository.


Other city simulators

I have searched on the Internet to find out about the other city simulators. There are of course, the so famous SimCity, from 1 to 4. Under Linux, there're a lot of SimCity like too. However, in contrast of SimCity, they're free, and often abandoned projects... except three: LinCity, PocketCity, and Simutrans. If you are wondering what the other projects are, here is the list: TheCity, TransitExecutive, FreeReign, LCitySim and SimBlob.

I'd like to drop few lines to LinCity-NG which is an updated version of the old LinCity with new graphics. You can check it at Berlios.

All those projects are great and they make me dream of a huge ambition: integrate their best aspects into OpenCity.