You must be logged in to post messages.
Please login or register

Caesar III: Game Help
Moderated by Granite Q, Gweilo

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Merging 2x2's, terrain graphics (and random walkers)
« Previous Page  1 2  Next Page »
posted 06-26-08 17:50 ET (US)   
In my post to 'Randomness of Random Walkers (continued)' I suggested that it might be possible to determine the random number (or at least the relevant part of it) associated with a tile by examining the terrain. I have investigated this further and I offer my findings. Frustratingly, I still await a bump on the other thread (where I would rather post). Since the information is relevant to the merging of tents I am afforded a work-around.

It has been documented elsewhere that the .map and .sav files for Caesar 3 contain a grid of apparently random numbers. Each tile on a map is associated with one of those random numbers. For our purposes, we are only interested in the last three bits of the relevant number, i.e. the remainder after dividing the number by eight. I'll call this the 'seed'.

According to Brugle (who got it from, I believe, Nero Would) a group of four tents arranged in a 2x2 square will merge if the northernmost tent sits on a tile whose seed is 4 or less, and it won't if the seed is 5, 6 or 7. My tests show that this information is correct. It has hitherto been thought that experimentation is the only practical way to determine where tents will/won't merge, the alternative being to examine the binary data, requiring a knowledge of the layout of the game files and an understanding of coordinates/offsets etc. I can now show that there is another way, and it's actually quite easy.

Some players may regard this information as being of the nature of a 'spoiler'. You must make up your own mind and decide your attitude before reading on.

Looking at the games's graphics, most buildable terrain (apart from meadow) is covered with a general overlay made up of composite blocks of texture. There is, however, a set of eight different tiles, each corresponding to a 'seed' in the range 0 to 7. Furthermore, each of those eight has an 'alternative' form which is used (in Central provinces) to add the appearance of tufts of grass and small bushes. This alternative form is associated with the distribution of data in another of the grids embedded in the game files - if a number 32 (or more correctly, a number with the 32 bit set) appears in that grid the alternative form is used on the related tile. Now, if the random number in a tile is less than 16 the appropriate graphic from this set is allowed to show through the overlay.

Confused? If you have it available, load up a save of the career 'Valentia' and select 'replay' to get an empty map. If you don't have Valentia, you can probably still follow the discussion using another Central map.

Move your view over towards the entry point, between the road and the cliffs. On my copy, the sheep are resting but there's not much else to see - yours should be the same. Now, you see in the landscape some distinctive, green, cigar-shaped tufts? The ones that look like big caterpillars? There's one immediately south of the road-end at the entry point, and you'll find several more like it if you look around.

Every one of those is a 3-seed. You can be sure that tents will merge if you place the northern one on one of those. You can also be sure that any building placed with its northern tile on one of those will send out a SE labor seeker first, and you can be sure that if you place an intersection on one of those a random walker hitting it on the sixth tile of his random phase will go NE (if he can), because 6 + 3 = 9, divide by 8 leaves 1, and 1 means NE.

You see inside the first bend of the road a tile that looks like a small crater (or maybe a gopher-hole)? That's a 2 if ever I saw one, and there are a few more of those dotted about. But if you want housing to merge, avoid using tiles like the bush next door to (SW of) the gopher-hole because that's a 5 and it won't work. It will, however, send a walker NW if he should happen to 'ground' in an intersection placed on it (5+1=6).

Well, that's fine so far, but we only have a few of these distinctive tiles poking through the overlay here and there. What if we don't happen to have one handy where we want to evaluate a tile? That overlay is fragile. You can poke holes in it with the delete tool (at no cost). Click around and you'll reveal the tiles underneath. Dragging has strange effects caused by the program rearranging the composite blocks it uses to build the overlay, and you'll uncover some tiles while filling in others. The best way is to drag along a single row of tiles at a time - that way you can uncover everything. The seed value of every tile can thus be determined - except where it underlies meadow. There you will have to resort to the old trial and error techniques.

How do you know which tile type relates to which seed number? I've prepared a test file (20Kb)for you. It's in .map format and it demonstrates all the available terrain textures. With a bit of experience you'll soon be able to spot the tiles which serve your purpose, whatever that may be.

Enjoy.

[This message has been edited by Trium3 (edited 06-26-2008 @ 06:19 PM).]

Replies:
posted 08-28-14 02:42 ET (US)     26 / 37  
I managed to get it work. I can read 2x2 data from any sav file and map file (by first creating a sav file from the map file).

I've put 2x2 data of CCK Valentia on an excel file along with a cleaned up CCK Valentia map file. It can be downloaded here.

Edit: new file in message #28

[This message has been edited by Philon (edited 08-28-2014 @ 09:27 PM).]

posted 08-28-14 04:15 ET (US)     27 / 37  
I created an excel file to read 2x2 data from any city. The excel file and Caesar Jan's Game Explorer (which is required) can be downloaded as a zip file here.

There are step by step instructions on the first worksheet of the excel file. The process is like this:
.map > .sav > .c3u > .txt > .xlsx

The security warning in excel is related to importing text from the text file into excel. There is no macro in this file. When finished the final results looks like this. This corner is the northern tile of CCK Valentia.



In message #18 above I was disappointed with this topic because there was nothing here that had any practical use to me. I'm not going use the delete tool to see if a terrain is suitable for 2x2. That has very little value. I can just build the tent and see it. Therefore this topic was totally useless to me until now.

Now I have a graphical representation of each tile's 2x2 ability. I can take a screenshot of that excel file and leave it in photoshop. Then I can design a block in another excel file, take a screenshot of that and use it as a semi transparent overlay on top of the earlier screenshot and move it around to find the best place to build the block. That is useful.

By the way, I finally understood why top left is North. When you import data into excel by default north is top left. So when Nero created those excel files by reading data from the code the orientation was like that. It is a shame I picked the wrong orientation when I started designing in excel. Probably I should try to change it.

[This message has been edited by Philon (edited 08-28-2014 @ 04:59 AM).]

posted 08-28-14 21:52 ET (US)     28 / 37  
Hi,

I did a little more work on this. I created an excel sheet for each enormous size CCK map. Then I compared how many red tiles each one has. Statistically 3/8 tiles should be red which is 37.5% and they are all close to this number.

Red tile (non 2x2) percentages of CCK maps:

37.94% CCK Valentia
37.50% CCK Londinium & CCK Tarraco (same 2x2 locations on both)
37.32% CCK Carthago
37.30% CCK Caesarea
36.87% CCK Lindum

Because you can edit everything of any CCK map (except map size) in the map editor including empire selection, it makes more sense to start from CCK Lindum because of the slightly lower percentage of red tiles.

Therefore I cleaned out CCK Lindum too and put it in the zip file. I also added a blank non-CCK map file. The 2x2 data of that map is also on the excel file. It has 37.68% red tiles. I added a PDF version of the excel file for those who don't have excel.

The new zip file is here.

[This message has been edited by Philon (edited 08-28-2014 @ 09:57 PM).]

posted 09-03-14 05:09 ET (US)     29 / 37  
I have more information on this. I thought I will write it here before I forget. This is one of those subjects an ordinary player might never use but those who like the background mechanics of the game might find it interesting.

I found three ways to make use of the red dotted CCK Lindum excel file I uploaded in my previous message. The first method is OK. The second one is good. The third one is better.

Let's start with the first. I did what seemed like the most obvious thing to do. I created an image file of the red dotted CCK Lindum excel file. I simply took a few screenshots and stitched them together. I put it in a photoshop layer. Then in another layer on top of that I put house designs where the northern tile of each 2x2 house is cut out so you can see through to the layer below. You can move the house around until you get less red tiles. It looks like this:



[As a side note, in the excel file in my previous reply North is top left but in the images here top right of each house is cut out. This is because I'm too used to working with top right but I don't recommend it and the excel file won't match it. In your designs top left of the house should be North to match the excel file.]

That was OK but it is nothing special. It only combines photosop with data from sav files. I guess this method could help if you had already build a city and had an area with tight space that needed a few 2x2 houses.

But this method was not very useful for me. It is also disconnected from excel and I do all my design work in excel.

This brings us to the second method. I was already thinking of a way to have the same "moving around until less red dots" feature in excel. But excel was not created as a design tool. It doesn't have layers. Everyone knows that you can't have one layer on top of another layer in excel.

Well, actually you can have one additional layer and I was very happy when I came up with the idea. Excel 2007 and 2010 has a background feature. On any sheet you can load a background image. As long as the cell doesn't have a fill colour you can see through to the image below. So I simply loaded the red dotted CCK Lindum image file to excel as a backgroun image. It looked like this:



I enlarged the A1 cell temporarily so you can see the background image clearly. This was better because now I could move the design around and change things. For example I might change a road or move one house which I couldn't do in photoshop.

But it is still not ideal because I need lots of fountains (around 90) and I'm not going move around 90 fountains square by square to find the best spots. A 160x160 map has 25.600 tiles. That is a lot of tiles to move around manually.

This brings us to the third method. If you downloaded the excel file in my previous reply you might have seen 1s for red tiles and 0s for green tiles. So I thought I will let excel do the checking for me. It is very simple really. You just do a design that has some 2x2 houses. For example I have 24 houses around a fountain. Then locate the northern tiles for each house and let excel add them up together.

In the image below you can see the formula that starts with =R145+T145+... It adds up those 24 tiles. The locations correspond to the 24 houses shown below around the fountain. Then you can drag the formula down and check the entire column.



I like this third method a lot because it connects these three aspects together for the first time:

1. Excel as a design sheet,
2. Excel as a data table,
3. Data from sav files.

In the past I could combine 1 and 2 (desirability calculations on excel, it is available in downloads section here) or 2 and 3 (reading walker numbers from sav files). But not 1,2,3. That is something new.

If I had programming knowledge I would probably write a software to automate this ever further. Because there are a few different designs and multiple orientations of each design, the software could consider those and decide which to put where.

[This message has been edited by Philon (edited 09-03-2014 @ 05:53 AM).]

posted 09-25-17 03:15 ET (US)     30 / 37  
Very interesting thread, let's see if I can use that in my next project: Mediolanum with only 1 Granary
posted 01-26-23 18:59 ET (US)     31 / 37  
I've prepared a test file (20Kb)for you.
Does anyone still have this file? I lost my copy and the links are no longer available. I'm a bit rusty on the desert terrain.
posted 01-26-23 19:39 ET (US)     32 / 37  
Does anyone still have this file?
I think I have those files. I'll send them soon.
posted 01-26-23 19:49 ET (US)     33 / 37  
I think I have those files. I'll send them soon.
Thank you!

Edit: Yes! Those were exactly the files I wanted. Thank you very much. Desert terrain is such a pain.

[This message has been edited by rFontana (edited 01-26-2023 @ 08:15 PM).]

posted 01-27-23 14:13 ET (US)     34 / 37  
Searching for 2*2 merger spots is one of the only remaining pain points I feel in Caesar 3. Have there been any advancements in mitigating the pain?

I'd personally love to edit the merger tiles to have a tiny pixel of pink on them (or something else easy to spot) but I have no idea how to edit the appearance of things in C3.
posted 01-27-23 15:21 ET (US)     35 / 37  
Searching for 2*2 merger spots is one of the only remaining pain points I feel in Caesar 3.
I used to feel that way, but now I usually find it more fun to avoid knowing them (and, often, any other "future history").

If you must know them in a not-too-large area (such as around a housing block loop road), they can be found in a few minutes by testing.
posted 01-28-23 09:17 ET (US)     36 / 37  
I'd personally love to edit the merger tiles to have a tiny pixel of pink on them (or something else easy to spot) but I have no idea how to edit the appearance of things in C3.
Well... there is(were) the tools from Pecunia/Trium. SGReader and C3Modder from the times of c3modsquad.
SGreader can be found on Pecunia's github [url=https://github.com/bvschaik/julius][/url]
Don't know if you can still find C3Modder. Maybe ask her. Don't think Trium is still around.

Also, if you do, mod the non-merging tiles. There are less of them
posted 01-28-23 10:18 ET (US)     37 / 37  
Don't think Trium is still around.
I haven't heard from Trium for a few years, but Trium's Utilities are in the Downloads.
« Previous Page  1 2  Next Page »
Caesar IV Heaven » Forums » Caesar III: Game Help » Merging 2x2's, terrain graphics (and random walkers)
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Caesar IV Heaven | HeavenGames