C3C New Movement Possibilities

Antal, has anyone told you that you are a genius lately?
 
Can you use this function to change the way railroad are working?
Maybe implement several levels of roads?
Like "roads" with brown graphics, and where speed is half of normal, and "paved roads" where it is 25%?
 
Finally, I've managed to modify game rendering. Here is the first step of implementing canals:


The following things were changed, rewritten or added
- Canals and Bridges images are loaded along with other PCX resources. It's stored in Patch Framework memory, not in the game original's one.
- The function, responsible for loading map images (class_Map_Renderer::m72_Load_Tile_Images) is fully rewritten. It includes now new subfunction, which loads canals and bridges images
- The function, responsible for rendering tile buildings (such as mines, outposts, and so on) is fully rewritten. It includes now new subfunction, which renders canals
- I added new tile overlay flag (0x200) which defines a canal.

The followings things are to do:
- Rewrite function (class_Unit::Can_Pass_Tile) responsible for unit's movement abilities.
- Add new worker job (first step is to provide hard coded job, second step is to modify Civ3ConquestsEdit to make it provide new job)
- Add new unit action button (requires new button image, new shortcut, rewriting functions, responsible for initializing Main GUI Form's controls and procesing of Control Click Event)
- Add bridges over canals
- Modify trade net logic to forbid land unit moves over canals without bridged
- Forbid roads and railroads over canals
- Make the Trade Net thinking that bridge over a canal is like a land tile with roads/railroads depending on neighbour tiles.
- Add canals over land bottlenecks. Requires combination of canal and bridge images.
- Add navigatable rivers (first of all it requires corresponding images).

I attached some files to test the new possibility
1) Render_1.zip contains:
- Game EXE and Patch Framework DLL files to be unpacked into %Conquests% directory
- PCX images in Art\Terrain folder to be unpacked into %Conquest%\Art\Terrain directory

2) Save files with canals applied.
Above screenshot was made during that saved game.
 

Attachments

  • Render_1.zip
    1.2 MB · Views: 80
  • _Test_Canals.SAV
    207.6 KB · Views: 64
Can you use this function to change the way railroad are working?
Maybe implement several levels of roads?
Like "roads" with brown graphics, and where speed is half of normal, and "paved roads" where it is 25%?

Absolutelly. New levels of roads requires new Overlays flags. And there are several unused ones, like 0x200 which is used now for land canals.

But new roads level means different weight in appropriate road graph being constructed every time a Unit makes an automatic move (it also happens when you're using Go To Action).

And haven't understant Trade Net working completelly.
 
Absolutelly. New levels of roads requires new Overlays flags. And there are several unused ones, like 0x200 which is used now for land canals.

But new roads level means different weight in appropriate road graph being constructed every time a Unit makes an automatic move (it also happens when you're using Go To Action).

And haven't understant Trade Net working completelly.
It may be easier to start with different levels of mine or farms then. So we can have more interest with several similar technologies (like crop rotation, fertilization, etc)
You don't have to worry to much with road graph.

How many unused overlays to you have available?
 
How many unused overlays to you have available?

Tile object contains 3 fields of terrain flags:
00000028 Overlays dd ?
0000002C SquareType dd ?
00000030 Terrain_Overlays dd ?

Overlays has the followings known flags:
0x01 - Road (0)
0x02 - Railroad (1)
0x04 - Mines (2)
0x08 - Irrigation (3)
0x10 - Fortress (4)
0x20 - Goody Hut (5)
0x40 - Pollution (6)
0x80 - Barbarian Camp (7)
0x100 - Craters (8)
0x10000000 - Barricade (28)
0x20000000 - Airfield (29)
0x40000000 - Radar tower (30 bit)
0x80000000 - Outpost (31 bit)

Other bits seem to be unused. (19 new flags)

SquareType stores real and base tile type ids in 2-nd byte (counting from 0). 0-th, 1-st and 3-rd bytes are unused. In theory it also can be used to store new flags. (24 new flags)

Terrain_Overlays has the followings known flags:
0x01 00 00 - Special_Resource (16)
0x10 00 00 - Mountain Snowcaps (20)
0x20 00 00 - Forest Pines (21)
0x20 00 00 00 - Landmark (29)
also bits 15, 17 - 19, 23 - 28 are used.
It seems first bits 0 - 14 are unsed too. (15 new flags).

Total: 58 new possible flags

There is another interesting field in Tile class:
0000001C Tile_BuildingID dw ?

It defines Id of the one of following game objects:
- Airfield, if Overlays has Airfield flag
- Radar Tower, if Overlays has Radar Towerflag
- Outpost, if Overlays has Outpostflag
- Colony, otherwise

Each Tile Building has its own object with some fields. For example Airfield object has bool field, responsible for being used status.

So new types of tile buildings can be provided.
 
Antal you made me finally register at Civfanatics after years of lurking.

I just have to say that you are doing some pretty amazing work. :)
 
I would say that limiting Railroad-movement must be an easy task for you Antal.

In present form you can cross the globe unlimited times if railroads are present.
If one could, like roads, direct how many squares a unit could move on a railroad line, and perhaps even have different levels later on. I say railroads from the 19th century was a bit different from today.

Consider that roads are perhaps even more important as resource connector than as truly roads. If different types of roads could be made, one might reflect that trading-links are different than paved roads.

I think you understand what I am talking about.

You have really uncovered a hidden strength in this CivIII and many possibilities are close at hand I think.
 
A very nice change also would be to prevent a unit from crossing the border if not at war, or not a hidden unit
That would be horrible and unrealistic, just like in Civ 4. :(
 
Every option is nice to have, especially when one can decide to turn it on or off via ini file.
 
Top Bottom