From: Luke L. <lin...@ho...> - 2002-10-06 19:15:29
|
----- Original Message ----- From: "frank.schmischke" <Fra...@t-...> To: <fre...@li...> Sent: Tuesday, October 01, 2002 10:46 PM Subject: [Freerails-list] maps for freerail Hi Luke, I have see, that you have built a map for south america for jfreerails. How do you want to store youre cities (and there names) and the height of field elements? Should it all be stored in the xml-file? I will try to implement it for c++-version (closed to yours). Thanks Frank Thanks for your message and sorry for the delay in getting back to you. I was planning to store the names and locations of cities in an xml file. E.g. <city name="London" x="10" y="20"/> I haven't really thought about the height at points on the map yet. I think RT2 let you import a greyscale image as a height map, perhaps we should have an option to do that. However, I not sure this should be a high priority - I'd rather get the basics working first. On a more general note, IMO the way things should work be something like this. At the start of a game the server would read an the XML storing the city names and locations and a PNG storing the terrain map, and create objects in memory to represent them. Then these objects would be serialised and sent to the client. At the moment jfreerails reads a png file for the map and xml files specifing the terrain types when you start a new game. But when you load/save a game, this is done by reading/writing serialised objects. If you agree that this is the right way to do it, the java and C++ versions of freerails will need to use classes with the same fields to represent the map. Luke |