Unit Improvements

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Unit Improvements

Post by Elefant »

A few things I think would improve freeciv.

nation_req for units. A list of nations that would be the only ones that could build this unit
rbuild_req for units. A resource requirement that if not satisfied, would make it so that you cannot build the unit.
rmove_req for units. A resource requirement that if not satisfied, would make it so that the unit cannot move. For example, tanks would need oil to move

A ranged air combat style.
rebase action. Basically airlift, but can be done by an airplane from anywhere to an airbase, city, or carrier
intercept action. The air unit would fortify and try to stop enemy aircraft from carrying out their mission within its range. It would also try to shoot the attacker from the sky.
air_strike action. The air unit would attack ground and sea units, with a chance of causing damage to other units in the stack.
air_bomb_defences action. The air unit would attack a city and reduce it's defense bonus percentage by it's bombard value.
air_bomb_improvements action. The air unit would attack a city or a tile with an improvement and try to destroy a building or the tile improvement
air_battle action. The air unit would seek an air battle with enemy interceptors and try to shoot them from the sky.

air_range value for units. The range at which an air unit can attack.

I also think that bombard_range should be defined per unit type and not game wide
Last edited by Elefant on Tue Jun 07, 2022 4:29 pm, edited 1 time in total.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: Unit Improvements

Post by cazfi »

Elefant wrote:nation_req for units. A list of nations that would be the only ones that could build this unit
While there currently isn't a way to do this directly, with certain limitations you can make the required tech to be only in the tree of some players (tech root_req).
Elefant wrote:rmove_req for units. A resource requirement that if not satisfied, would make it so that the unit cannot move. For example, tanks would need oil to move
Movement is action enabler controlled in freeciv-3.1
Elefant wrote:I also think that bombard_range should be defined per unit type and not game wide
It might help you a bit that in freeciv-3.1 there's three bombard actions (made different from each other only by their action enablers and other ruleset side stuff), and you can define ranges separately for each.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: Unit Improvements

Post by cazfi »

It would be good if you could test those freeciv-3.1 features you are interested about, before they go to final freeze.
http://forum.freeciv.org/f/viewtopic.php?f=14&t=92260
vego
Veteran
Posts: 75
Joined: Thu May 26, 2022 10:49 am

Re: Unit Improvements

Post by vego »

And more ranged units... cavarly archers, crossbows, trebuchets, cannons, muskets, dragoons.
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Re: Unit Improvements

Post by Elefant »

The three different bombards help somewhat, but if you want different ranges for different units, you will run out pretty quick. As I think most people will use the three bombards to have different ranges, it might make more sense to have the range unit defined.
All that would have to be done (as far as I can tell. The AI would probably need to know too.) is to add something like this at line 2492 in server/ruleset.c

Code: Select all

      u->bombard_range = secfile_lookup_int_default(file, 0,
                                                   "%s.bombard_range", sec_name);
and then, whenever bombard_range is referenced, reference actor.utype.bombard_range instead.
It probably is much harder than this, but it would effectively increase the number of user bombard actions and what can be done with them.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Re: Unit Improvements

Post by Elefant »

As for making unique units by using a tech requirement, I hadn't considered adding a branch to the tech tree. Is it possible to make a player's nation a requirement for researching a tech? My solution was to give an non-researchable tech to a nation and have a building that required it, upon which the unit depended. Two problems were that the AI wouldn't build the building, building the generic unit instead, and that if you were on a team with a nation that had a UU, you would get the tech required to build it, too.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Re: Unit Improvements

Post by Elefant »

Making the movement requirement in the action enablers is a good idea. I just don't know if a requirement can be a resource (like oil or coal).
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
vego
Veteran
Posts: 75
Joined: Thu May 26, 2022 10:49 am

Re: Unit Improvements

Post by vego »

Making the movement required by resources is cool idea but difficult to do. For example your oil would add +1 movement to tanks, but Germany used gasoline, so the movement is rather -1, but probably attack +1. So you see its very difficult. I cant even imagine how to extract oil to gasoline in freeciv. But idea
Elephant wrote:A list of nations that would be the only ones that could build this unit
and provise this idea to Germany and special unit, for example tank Tiger... tiger didnt use a oil, and his movement was short, but initiative (attack) a big. So idea is cool but...if i know life...
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Re: Unit Improvements

Post by Elefant »

The idea would be that since oil is needed to make gasoline and diesel, all mechanized units would need oil to move at all. This way, if you have no oil, your tanks don't move and your airplanes don't fly. I enjoy the strategic resource aspect of civ 3 and civ 4, but it never made sense to me that when you lose oil, you can't make tanks, but they can still move.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Elefant
Hardened
Posts: 212
Joined: Sat May 28, 2022 3:55 am

Re: Unit Improvements

Post by Elefant »

To extract oil to gasoline, you would have a building called refinery and when you need gasoline you would check for oil and a refinery. If you have both, you have gasoline.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Post Reply