More Help Needed

Bert Pajou

Chieftain
Joined
Jul 25, 2013
Messages
21
Location
Cape Town
Hi All.

I'm trying to relocate a city two squares to the right.

I relocated the units inside the city (that I get right without problems)
I updated the X coordinate in the city record
I updated the X coordinate in the city table

The city disappear and I'm left with a Barbarian City named 'None' with a population of 0.

What am I still missing?

Can somebody assist please?:D

Ps.
I'm new to this. I wrote financial applications all my life and now that I'm retired I'm trying my hand on something new.
 
…
I'm trying to relocate a city two squares to the right.
…What am I still missing?

Along with changing the X & Y values in the city record you must alter some Map Descriptors in the MAP file, namely the improvement bit that indicates the presents of a city. Resetting that bit in the old location is probably a good idea also.

Additionally updating the “country city belongs too” byte in the Map file for that square.

Just a quick look at my code, there are other house keeping chores to make everything clean.
 
Hi All.

I'm trying to relocate a city two squares to the right.

I relicated the units inside the city (that I get right without problems)
I updated the X coordinate in the city record
I updated the X coordinate in the city table

The city disappear and I'm left with a Barbarian City named 'None' with a population of 0.

What am I still missing?

Can somebody assist please?:D

Ps.
I'm new to this. I wrote financial applications all my life and now that I'm retired I'm trying my hand on something new.

we built a settler and let the old town rot for eternity in the old days
 
we built a settler and let the old town rot for eternity in the old days

Whew, glad to read this! I was afraid I might be alone in my obsessive insistence on making sure that cities occupy optimum locations. If I capture a city and can see that it'd be better off somewhere else, it's hard to resist building a series of settlers in it, founding a new city next door, and draining the population from the old into the new...
 
How exactly are you doing your changes ?

Normally, changing the city record should be enough...

[ad]
By the way, JCivED will let you do all that directly, in case you didn't know :)
[/ad]

Cheers

Hi,
I' trying to use it but it won't run on my machine. What is it written in? Java? It bombs out ust as it starts.


PS
I'm using a piece of software I'm busy writing for lack of anything better to do. Sort of a scenario builder/cheat machine. I can perform most changes with it now, except for moving cities. And of course changing ownership and a few other things I did not think of yet.
 
Along with changing the X & Y values in the city record you must alter some Map Descriptors in the MAP file, namely the improvement bit that indicates the presents of a city. Resetting that bit in the old location is probably a good idea also.

Additionally updating the “country city belongs too” byte in the Map file for that square.

Just a quick look at my code, there are other house keeping chores to make everything clean.

Ok, I hear you, but what code are you referring to? Where can I look to find it?
 
Ok, I hear you, but what code are you referring to? Where can I look to find it?


I was attempting to make the point that it will require more than a few lines of code to move a city. The program I wrote TerraForm is available on civfanatics here it will perform this function and more. The source is not available
 
Hi,
I' trying to use it but it won't run on my machine. What is it written in? Java? It bombs out ust as it starts.

Yes it's in Java, it requires Java 7, and if you care to be more precise than "it bombs out" I'll be happy to troubleshoot your issues :)

That said, JCivED is rather a Civ-Swiss-knife, you will still need to perform all the editions that Dack is talking about manually one-by-one to move a city, i.e. it doesn't contain a single shortcut that will do everything for you at once...

Just try out TerraForm and/or JCivED and see what works for you.

Cheers
 
Yes it's in Java, it requires Java 7, and if you care to be more precise than "it bombs out" I'll be happy to troubleshoot your issues :)
/////
Just try out TerraForm and/or JCivED and see what works for you.

Ok, I installed Java 7 and it is working now. Very Smart! Makes me envious. Remember, I'm a (retired) programmer and like to do these things for myself!

Such a pity it cannot place and relocate units and cities, but then I guess it was not written for that purpose.

I still cannot try TerraForm as I'm not in posession of the key code and I don't want to wake the trolls by asking again too quickly - I'm not sure if I asked in the right way.

Thanks for the help so far. :)

I have learned a lot from your notes. It is just the layout of the map file that is still tripping me.
 
Such a pity it cannot place and relocate units and cities, but then I guess it was not written for that purpose.

You're not the first one to ask for such functionality, so let me reply by quoting myself:

Of course it would be a very nice feature, and I've been thinking about it for a some time: the current JCivED approach is kind of a "hacker mode", in that it aims to give you total freedom in changing any data down to the byte and bits, at your own risks... Functions like "add city/unit" imply a higher layer of logic that must take into account the actual game rules to create correct data: this is another approach, which I would call "safe mode", that will come afterwards, and requires much more work in terms of GUI/graphical design.

For JCivED itself, my top priority is to decipher 100% of the SVE content - which doesn't seem so far away now :)

So it willl come, at some point!

I have learned a lot from your notes. It is just the layout of the map file that is still tripping me.

Not sure what's your progress on the MAP format so far, here is the "knowledge path" I recommend you to follow - which is basically the one I followed myself:
  1. Know that the .MAP format is the same as the .PIC format, used to store Civ's graphical art
  2. Get introduced to the PIC format by reading the description made by Joel McIntyre's available here: http://www.darklands.net/files/PicFileFormat.txt (originally for DarkLands art, but it is the same format for Civ)
  3. Know that the compression algorithm used to store the pixel data in the M0 chunk is LZW (Joel McIntyre did not figure this out at the time, more than 10 years ago)
  4. Document yourself on LZW: description on Wikipedia, sample implementations in various languages on rosettacode, random tutorials via Google ...
  5. If you have any proficiency in Java, look at the open-source code of JCivED, that deals with PIC's LZW de/compression, freely available on sourceforge.net
  6. Finally, you may get some insights about the actual game data contained in the MAP file from this post I made a long time ago

Remember, I'm a (retired) programmer and like to do these things for myself!

Now I believe you have everything to do so! :)
 
Now I believe you have everything to do so! :)

Quite so! Thank you very much.

I spent a lot of time on the web today looking at all your links and some things are starting to make sense, but I fancy it is time for me to master Java. (Ja, I know I'm becoming a pain in the back!):mischief:

I think your stuff is the best shortcut, but I dont know where to find the code amongst all those files. I think I will do better with an IDE.

I have looked at some free Java compilers and Eclipse seems to be the most popular. Will it run and/or compile your source code?
 
I spent a lot of time on the web today looking at all your links and some things are starting to make sense, but I fancy it is time for me to master Java. (Ja, I know I'm becoming a pain in the back!):mischief:

I am definitly NOT going to teach you Java :) There is an overwhelming amount of resources to learn Java on the web...

I think your stuff is the best shortcut, but I dont know where to find the code amongst all those files. I think I will do better with an IDE.

I have looked at some free Java compilers and Eclipse seems to be the most popular. Will it run and/or compile your source code?

Eclipse is actually an IDE, and relies on the standard JDK (Java Development Kit) provided by Sun Oracle for compilation.

As a matter of fact, I use Eclipse to develop JCivED, and the whole Eclipse project is available as-is on sourceforge.net ... All you have to do is download it (or export it with an SVN client) and then load the project in your Eclipse.

The whole 0.0.12a Eclipse-ready source code can be downloaded as a tarball with this link: http://sourceforge.net/p/jcived/code/10/tarball?path=/tags/jcived-0.0.12a
 
I am definitly NOT going to teach you Java :)

:lol: :lol:
No I could hardly expect that, but as a fellow programmer you would understand that once you understand the logic of programming the language does not matter any more. It is just a matter of mastering the new IDE and the language elements. I do expect some problems with the Object Oriented nature of Java, but I should get over that.

However, I don't intend to switch to Java now. I merely want to acquire a basic understanding of it; so I can read and understand the source code.

But all just the same, you guys had been most helpfull. I appreciate it.

PS
Dork sent me the keycode for TerraForm. Oh, how I wish the two (Jcived and Terraform) were one. What the one lacks in functionality it more than makes up for in a great interface. Marvelous work by the two of you.:goodjob:
 
Back
Top Bottom