Macrociv ruleset for Freeciv

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
diligentcircle
Posts: 8
Joined: Fri Aug 24, 2018 8:14 pm
Contact:

Re: Macrociv ruleset for Freeciv

Postby diligentcircle » Sun Nov 24, 2019 7:03 pm

Yeah, I do like the look of Retire_Pct, but it has a hardcoded limit imposed where it won't take effect if there are enemy units nearby, so it won't have predictable results.

Though, if you want my two cents – I don't think some random chance to lose an entire boat and everything on board is a good idea. I recall that being incredibly frustrating, way back in the day. It's just too big of a random effect IMO.

That's fair. I was thinking more a case of "you probably don't want to hang out in the sea for long" so I wouldn't want that to be there until a boat has been in the deep ocean for a while, which is also not currently possible. Eh, a fuel like system would probably be better.

If it's "possible but difficult invasions" you're after, have you considered giving those terrain types a negative defense bonus? Would make it easier for defenders to fend off the invading force, assuming they get a hit in.

I did briefly consider it, but I never tried it out. The problem I have with that is it makes the danger entirely dependent on other civilizations. I also do want these natural barriers to limit exploration, and it wouldn't do that unless you could guarantee barbarian presence at all times. :/

There is a way actually – it's a bit hacky though. You can't turn specific terrain into refuel points, but you can make an (invisible, unbuildable, unpillageable) extra native to your land units that serves as a refuel point, with requirements that mean it can only exist on non-difficult land.
Now, the difficult part is getting that extra everywhere. From 3.0 on you could just give it the "Appear" cause and an appear chance of 100%, but in 2.6 you'll have to use Lua script (here's where it gets hacky): Since there isn't a terrain change signal, you'll have to run a routine every turn (turn_started signal in 2.6, turn_begin from 3.0 onward) to iterate over the entire map (whole_map_iterate()) and place the extra (edit.create_extra(tile, name)) on every tile. The following code in script.lua might work for 2.6 (haven't tested it in the slightest):

Huh, that's real interesting! I'll have to look into that. Thanks! (Probably will be a no-go in 2.6 since as you said that method is bound to be massively inefficient, but this just might solve the problem for v3.0.)

User avatar
Caedo
Elite
Posts: 480
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Macrociv ruleset for Freeciv

Postby Caedo » Sun Nov 24, 2019 8:47 pm

diligentcircle wrote:I was thinking more a case of "you probably don't want to hang out in the sea for long" so I wouldn't want that to be there until a boat has been in the deep ocean for a while, which is also not currently possible. Eh, a fuel like system would probably be better.

In 3.0, there's the "Coast" unit type flag, which makes all tiles next to the coast refuel points. That might be what you're looking for. It'd also realistically capture the notion of needing to restock supplies every now and then.

diligentcircle wrote:
If it's "possible but difficult invasions" you're after, have you considered giving those terrain types a negative defense bonus? Would make it easier for defenders to fend off the invading force, assuming they get a hit in.

I did briefly consider it, but I never tried it out. The problem I have with that is it makes the danger entirely dependent on other civilizations. I also do want these natural barriers to limit exploration, and it wouldn't do that unless you could guarantee barbarian presence at all times. :/

Try animals. I don't think any animal graphics are shipped with tilesets currently, but there are some discussions over in the Art and Tilesets subforum.
~S.C. L.

diligentcircle
Posts: 8
Joined: Fri Aug 24, 2018 8:14 pm
Contact:

Re: Macrociv ruleset for Freeciv

Postby diligentcircle » Sun Nov 24, 2019 9:59 pm

Ooh, the "Coasts" flag sounds perfect!

Actually, I'm wondering something, does the AI actually handle fuel properly in v3.0? My experiments with implementing a fuel system in v2.6 seemed to cause the AI to just never send out units at all (I wasn't doing anything too crazy, just giving boats around 10-20 fuel). Maybe an old shortcoming (since I'm currently on v2.6 after all)?

Try animals. I don't think any animal graphics are shipped with tilesets currently, but there are some discussions over in the Art and Tilesets subforum.

I thought of that too, but to my understanding animals only spawn once at the beginning, right? So it would be a temporary threat. (Also I don't think you can stop a unit from going onto a tile with an oasis or river.)

I'd certainly like to put animals in; the only reason I didn't yet is because so far as I could tell v2.6 doesn't have any stock animal graphics, unless I just missed them?

diligentcircle
Posts: 8
Joined: Fri Aug 24, 2018 8:14 pm
Contact:

Re: Macrociv ruleset for Freeciv

Postby diligentcircle » Sun Nov 24, 2019 11:53 pm

Sad news: I just tested out the fuel solution and surprisingly it ran perfectly fine for the most part, but the AI is even worse with it. AI players just refuse to do anything with the newly fueled units (at least in v2.6).

I actually also noticed that the "goto" command was acting funky too (I assume because of assumptions made about how fuel works).

Anyway, worthwhile experiment. I pushed those changes to a separate branch here:

https://github.com/onpon4/macrociv/tree/fueltest

User avatar
Caedo
Elite
Posts: 480
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Macrociv ruleset for Freeciv

Postby Caedo » Mon Nov 25, 2019 8:56 am

Yeah, AI (and thus goto) does funky things with fuel. I assume the reason AI doesn't send out those units at all is because it doesn't use fueled units for exploration – in most supplied rulesets, planes only have fuel for a turn or two, so that makes sense. The more general thing with goto is that it'll try to find refuel points along the way, and won't allow you to send a unit somewhere where it can't get to another refuel point in time.

Thus, again, my suggestion for ruleset modding: Forget the AI. Alternatively, get familiar with C and the AI code; then you can start to make it better. AI actually needs a lot of changes to keep up with modern ruleset capabilities.
~S.C. L.

Ignatus
Hardened
Posts: 258
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Macrociv ruleset for Freeciv

Postby Ignatus » Mon Nov 25, 2019 7:08 pm

Caedo wrote:Yeah, AI (and thus goto) does funky things with fuel.

The goto path automatically include refuel points (intristically, pathfinding advisor mostly considers the unit having fuel 1 and n times more movepoints, and finishes its planned turns on safe locations only excluding the last one. Unit order sequences for such paths include very powerful "Wait full mp" orders (that with tweaked clients can be sent to any units). What is wrong with the whole pathfinder is that the unit does not avoid any invisible enemies amd will just stop hitting into one (AI sees all but is so dumb otherwise that it does not help much). In CivIII units remember the enemies they have seen this turn and will try bypass ways, but that seems to be not done very effective; the general rule is "move manually where there is any miser chance to run into an enemy".

Moreover about automation, a unit that hangs out in turn change with ending fuel will automatically try to use its remaining mp to get fuel anywhere.