View Full Version : worm rider mechanics
davidlallen Jul 09, 2009, 10:29 AM I have some partly worked out design and implementation for worm riders, and I need design assistance to get something which is fun and usable by the AI.
As usual, it seems, I have been creating fun, dune-like mechanics, which the AI can't use. In some early version like 1.1.2, I added a thumper, which is an immobile unit dropped by units with the thumper promotion. If a sandworm sees this unit anywhere in its vision radius (2 tiles) it will immediately move towards it and destroy it. You can use this to control where sandworms go. There is code to create a sandworm if the thumper sits for 4 turns without being destroyed, but I don't think that part was actually working.
I have made some local changes to this. Now a thumper will actually cause a sandworm to appear. Also, and more importantly, I have added code for the case where a sandworm attacks a tile which has both, a thumper unit and any other unit with the thumper promotion. In this case a Worm Rider unit is generated, and the sandworm and thumper units are destroyed. The unit with the thumper promotion is unchanged.
I was hoping to use this as a way to create early game transport units for the Fremen civs. If the worm rider unit xml is changed to have transport capability, this will work for the human player. But the AI will not understand to (a) get the thumper promotion, and (b) send out the unit to generate the worm rider. Ideally, you would do this a few turns in advance of your amphibious attack so that the worms arrive just in time to be ridden.
There are some other ways the thumper promotion could be used. It would be possible to add code that if any unit in the stack has the thumper promotion, the worm will still attack but will be captured. Or that it won't be attacked at all. Then we can build a UU for the Fremen civs which is a scout that starts with the thumper promotion. The mid-game tech Thumpering would allow other civs to do this also. This way, Fremen will have a small advantage that their scouts never get eaten.
I was also thinking that instead of generating a worm rider unit, a sandworm attack on a thumper could give the unit a temporary promotion which allows fast movement. Say after 10 turns it expires, but during that time the unit has move 3 and cannot enter hills or peaks. Perhaps that would have to be implemented as temporarily switching to another unit type. This would also allow faster scouting.
I am not sure that is a strong benefit; it would be much better to find a way the AI could use early game transport built this way.
Any brainstorms welcome.
Deliverator Jul 09, 2009, 11:06 AM A few thoughts:
I think only the Fremen factions should be able to do this. It makes them more unique and it doesn't feel right for the Harkonnens (for example) to be able to do it. In FFH2 there is the concept of races so that all the units of each civ have a particular promotion. This is a nice idea. So the Fremen promotion is given to all Fremen, land based, human units. This promotion means that when attacked by a worm they have a chance to capture it and become a worm rider. This chance could increase with further promotions. Race promotions could be useful for other factions too.
I thought you had the worm AI moving towards units on the sand right? So why do we need the thumper unit? You could just have it so that units with the necessary promotion that get attacked by the worm have a chance to create a worm rider/get the temporary worm rider promotion. The thumper unit seems like another layer of complexity in the way of getting the AI to use this ability.
What promotions does the AI normally go for? Could we make it so that the chance of capturing a worm related to those. So the strength of the unit gives a better chance of capture for example.
It seems the hardest part of the problem is getting the AI to understand that it needs to go out onto the sand and try to capture a worm to transport its units around. Without writing a custom AI for the unit so that it has a worm capture mode where it searches around and then moves towards a worm, I've no idea how the achieve that.
You're temporary worm rider promotion idea is interesting. Kael and Dom Pedro II were talking about in this thread (http://forums.civfanatics.com/showthread.php?t=323988) about making units change appearance in certain circumstances or with certain promotions. However, I think it would not really work for the worm rider which will look very different from a human unit. I think the only realistic way is to use a different unit NIF while the unit is riding the worm (has the promotion). Is this possible?
davidlallen Jul 09, 2009, 11:48 AM I thought you had the worm AI moving towards units on the sand right? So why do we need the thumper unit?
It is a priority thing. Suppose there is a thumper unit two squares away, and a worker unit one square away in the other direction. The thumper draws the worm's attention so the worker will be safe. The concept is that one unit with the thumper promotion can protect a wide area by strategically dropping thumpers. Sometimes you are looking for a worm to ride, and sometimes you just want the worm to go away. "Dropping a thumper" seems to fit the theme, but maybe it is too complex.
You're temporary worm rider promotion idea is interesting. Kael and Dom Pedro II were talking about in this thread (http://forums.civfanatics.com/showthread.php?t=323988) about making units change appearance in certain circumstances or with certain promotions.
Swapping unit art based on promotions is certainly possible; the "ute" unit in Fury Road does this using python which I wrote. The problem with swapping art is that the number of models grows exponentially. If three units each have two possible promotions that is 12 different unit models needed. In Fury Road, it only applies to one unit and three promotions so 8 models were needed.
A single "worm travelling aboveground" unit art, or maybe just a new animation of the existing model, could be used to represent any number of foot units riding the worm. Because of the scale, you would not be able to see the people themselves. So in this case, perhaps one unit art would suffice for a large variety of riders.
EDIT: missed this point:
I think only the Fremen factions should be able to do this.
I agree. I am sure it will be possible to limit the promotion by civ, or by tech which is limited to civ, or a free building.
Deliverator Jul 09, 2009, 12:44 PM A single "worm travelling aboveground" unit art, or maybe just a new animation of the existing model, could be used to represent any number of foot units riding the worm. Because of the scale, you would not be able to see the people themselves. So in this case, perhaps one unit art would suffice for a large variety of riders.
I'm thinking the worm rider unit graphic will have a very small generic Fremen on top so it can be used for all worm riders.
Ahriman Jul 09, 2009, 04:06 PM I think the thumper-dropping mechanic is overly complex for little gain, and the AI will obviously never understand it.
I'd just make sandriders as buildable UU transports and warships for the Fremen.
davidlallen Jul 09, 2009, 04:54 PM Building a worm rider in a city seems to miss the theme altogether.
At the risk of making this too abstract, one very simple possibility is to make the Fremen have a UU set of worker, warrior, scout, settler which all have move 2 and a promotion allowing double move in desert waste or deep desert. This gives them a strong early game expansion. We can visualize them doing that by riding worms in our imagination, even if the game graphics do not show that.
This may be a little overpowered when combined with the existing Sietch UB which gives +1 movement. But we can try it.
Deliverator Jul 09, 2009, 05:13 PM Too abstract to be fun IMO.
Does the AI really need to understand how to create the Worm Riders anyway? It just means it won't play the Fremen very well. But it's something the human player will really enjoy. I'm sure that quite a few of the FFH2 spells aren't used properly by the AI, but they're in there because they're fun.
We should keep thinking about it. There's got to be a better way than building worm riders in cities, or abstracting them away to nothing.
Deliverator Jul 09, 2009, 05:30 PM How about this. You build an Unmounted Worm Rider unit in a city - just a human unit on its own. This unit can move across Deep Desert. As soon as it moves onto a Worm or is attacked by a Worm a Worm Rider is created. You can write basic AI for Units. Have a new AI for the Unmounted Worm Rider. This can be really simple. Move onto the coast/ocean desert and then move around until you see a worm. If you see a worm then move towards it. Then you've just got to ensure that the AI actually builds some of these units.
koma13 Jul 09, 2009, 06:24 PM I think building worm riders in cities is fine.
Lord Tirian Jul 09, 2009, 06:45 PM I think building worm riders in cities is fine.Hmmm... I have to throw in a "ditto" here - a lot of things here are going towards the thing that Kael described as "Flavour Trap".
I mean, flavour is good, but it shouldn't impinge too much on the core gameplay. I think altering the basic unit creation process for a single unit this much is highly irregular - for an unit that's not going to be an one-off/hero unit or so.
Unit building is pretty abstract already - it constitutes training, actual production and organisation. Just as some wonders are really more processes than anything else, explaining away the "production" of worm riders as seeking them out is fine. Perhaps add a pre-requisite building to it, like "Wormseeker Gathering" and make them national units to represent that only a few can be captured at the same time.
Gameplay-wise, this will almost be the same as the manual catching, just with waaay less micromanagement and unit-shuffling. I mean these concepts are neat and cute the first, perhaps the second time you play it - but after some while, the novelty wears off and it just becomes a bother to catch worms.
Cheers, LT.
Deliverator Jul 10, 2009, 03:31 AM I think building worm riders in cities is fine.
I've come around to this way of thinking too. If you think about vanilla, you can build mounted units by having access to Horses or War Elephants by having access to Ivory.
Let's just make it so the Fremen can build Worm Riders in coastal cities. The desert is the resource in effect. If you have the ability to catch and ride a worm it is enough just to have access to the open desert. The important thing is that Worm Riders are made and used by the Fremen. How they are built is not that important in the grand scheme of things. This way the AI will have no problem building and using them, which is enough of a reason in itself.
Will barbarian Worms be able to attach Worm Riders? That would seem a bit weird. And wars between Fremen and Sietch Tabr could be interesting.
koma13 Jul 10, 2009, 03:52 AM Let's just make it so the Fremen can build Worm Riders in coastal cities.
There are no non coastal cities in dw. Else you could build the all terrain transporter only in certain cities. ;)
I thought about spawning the worm rider in the desert after it is trained but we have to bear in mind that wr is a transport that has to be stationed in a city to be usefull for ai at all. :dunno:
Deliverator Jul 10, 2009, 04:04 AM Mmmmm, worm rider moving through rock is not a good look...
koma13 Jul 10, 2009, 04:21 AM I don't worry about sandworms moving through rock terrain, what me bothers more is having sandworms inside a city (do they follow traffic rules? :)). But if we assume that fremen cities are sietches (the only imagination I have of a sietch is from the first dune game for dos you mentioned), I think it's ok to have them in the same tile.
Btw, what is about new city sets? Current cities don't look very dunish.
Lord Tirian Jul 10, 2009, 04:28 AM Btw, what is about new city sets? Current cities don't look very dunish.How do you imagine they would look like, if they were more "dunish"?
Cheers, LT.
Deliverator Jul 10, 2009, 04:32 AM I'm the other way around, it's the moving through rock that'd bother me. Worms being in settlements I can live with. :)
Btw, what is about new city sets? Current cities don't look very dunish.
I'd like that too. I've not done citysets before, but something that looks like sietches in the early stages and then Arrakeen from the Children of Dune miniseries in the later stages would be great. But I have so much art to do right now, I'm struggling to prioritize. It would be great if one of the city set specialists like Geomodder could help us out. I think he's focused on Planetfall though. There may be something slightly better for us in his Ethnic Artstyles (http://forums.civfanatics.com/showthread.php?t=274830).
Edit: Hi LT, up for doing some citysets? I can probably get you some reference material...
Lord Tirian Jul 10, 2009, 04:36 AM Edit: Hi LT, up for doing some citysets? I can probably get you some reference material...Would be great. The city sets are bothering me a lot and they're a thing that's probably going to stay (units/improvement are in flux right now, so I'm not really touching that stuff until the next big patch comes out) - but I'm drawing a blank inspiration-wise, because "desert caves" and "desert industry" over and over again seems a bit... repetitive and bland.
Cheers, LT.
koma13 Jul 10, 2009, 04:40 AM How do you imagine they would look like, if they were more "dunish"?
No timbered houses with thatched roofs please. :)
Something like that would be cool:
http://img140.imageshack.us/img140/7051/city1x.jpg
Deliverator Jul 10, 2009, 04:41 AM OK, I can go through the Children of Dune DVDs and take some screengrabs of buildings. I think some sort of cave like dwellings for the early stages would be great. I'll post something in the Art Thread this evening since we are taking this thread off topic...
keldath Jul 10, 2009, 05:36 AM wowo finally!!!
i wanted for a lot of time new city art!!!
great gret work!
davidlallen Jul 10, 2009, 10:55 AM I don't worry about sandworms moving through rock terrain, what me bothers more is having sandworms inside a city (do they follow traffic rules? :)).
Returning to the thread topic, I think the problem is *wormsign* moving through rock terrain. I had thought about making worms only able to move on ocean and coast. But when a worm is ridden, it stays above ground. This seems clear from the books, where the Fremen attack cities riding worms up till the last minute. So I gave the worms TerrainImpassable for hills and peaks only.
At one time I thought about having two worm units, one for ocean and one for land. It would be a little complicated to swap them when the worm randomly moves from one terrain to another. Here is a new suggestion. Instead of having a worm and worm rider unit, have an underground worm and an aboveground worm. The underground worm uses the current art (wormsign plus popup attack) and can only travel in ocean/coast. The aboveground worm would travel like a snake, and have two little dots on top representing the rider itself. Actually we could skip the dots. That is what would be displayed for any type of ridden worm. Even in the desert, a ridden worm would still use this model. That way the only time we might swap units is in case we have a mechanic to capture a worm; capturing would involve swapping from the underground worm to the aboveground one.
I don't think the aboveground one would have an attack, although maybe it should have a "trample" attack. Hm, need to think about that, if the attack fails the worm loses its nerve and goes back underground, or berserks and tramples other units on the way back to the desert.
Deliverator Jul 10, 2009, 11:06 AM The reason why I think all worms ridden or otherwise should only be ocean and coast is that from my point of view the 'land' areas represent the rocky worm safe areas in the books.
It is not going to be possible to make a worm graphic that looks good on both land and ocean as they are at different heights. And I think the worms moving through the land areas is just going to look wrong. My vote is they function as ships, the only issue is that all cities are considered to be coastal - so how do you stop landlocked worms...
davidlallen Jul 10, 2009, 11:37 AM The reason why I think all worms ridden or otherwise should only be ocean and coast is that from my point of view the 'land' areas represent the rocky worm safe areas in the books.
To me, the "hills" and "peaks" areas represent these rocky worm safe areas. But you raise a good implementation point, that a "ridden worm" graphic will not work on both ocean and land. Suppose we limit worms to ocean and coast. Then the majority of units will be unthreatened by worms. Only spice harvesters and workers building them; scouts crossing water; and amphibious assault stacks would be vulnerable.
That leaves us with how to create ridden worms. Building them in cities just feels wrong to me, even though several others have disagreed; but if they cannot move on land, how do they get from the city to the coast? We no longer have the concept of "coastal city".
I think we are a little stuck.
Let me suggest again my idea that Fremen foot units have a promotion "Worm Rider" which simply gives double move in coast/ocean. Since only selected units can ride worms anyway, the "galley" idea does not seem to really help.
Deliverator Jul 10, 2009, 11:50 AM Suppose we limit worms to ocean and coast. Then the majority of units will be unthreatened by worms.
On an Archipegalo map or any map with lots of islands, naval superiority counts for a lot. The worms can attack any unit on the edge of the land now. If the worm riders have this ability they'll still be able to do plenty of damage to units that stray to the edge of the island and to coastal cities.
With the build-WR-in-cities option you are abstracting away the capture part which I can live with, particularly if you think of Fremen cities as sietches. With the worm rider promotion you are abstracting to much away in my opinion. The only obstacles to this is your dislike of the idea (which I do empathise with) and the fact that we'd need to find a way to prevent worm riders being built in landlocked tiles.
davidlallen Jul 10, 2009, 12:14 PM The worms can attack any unit on the edge of the land now. If the worm riders have this ability they'll still be able to do plenty of damage to units that stray to the edge of the island and to coastal cities.
In the existing mod, the sandworms can go anywhere except hills and peaks, so they could do damage almost anywhere. If we make some class of units which is only ocean/coast, they cannot damage cities; think of vanilla triremes. If the worm rider is like a galley, then it can carry soldiers which can do an amphibious assault anywhere.
With the build-WR-in-cities option you are abstracting away the capture part which I can live with, particularly if you think of Fremen cities as sietches. With the worm rider promotion you are abstracting to much away in my opinion. The only obstacles to this is your dislike of the idea (which I do empathise with) and the fact that we'd need to find a way to prevent worm riders being built in landlocked tiles.
Well, let's keep looking. I can think of a variant mechanic which uses capture; but the problem is that the AI looking to make an organized amphibious assault won't find it. Suppose we give Fremen foot units a Thumper promotion. As these units are walking around in the coast/ocean, they attract worms. If/when one comes, it gets automatically captured, and then all the units in the stack get a desert double move promotion for five turns. From the AI standpoint, it would send out groups of foot units normally but they would arrive at their destination unexpectedly fast.
Perhaps this would be good enough for early game and for raiding, and when the AI tries to set up amphibious assault it should be using hovers anyway. What do you think?
koma13 Jul 10, 2009, 12:19 PM That leaves us with how to create ridden worms. Building them in cities just feels wrong to me, even though several others have disagreed; but if they cannot move on land, how do they get from the city to the coast? We no longer have the concept of "coastal city".
I think we are a little stuck.
Try setting sandworm rider to domain sea, set bCanMoveAllTerrain to false and make sure unit isn't allowed to enter any terrain except deep desert and desert waste. Maniac suggested something like that when we had problems with the all terrain transporter. Unit should be spawned in next terrain possible (desert waste). This is similar to the situation where you have units in foreign territory and borders are closed.
Then the majority of units will be unthreatened by worms. Only spice harvesters and workers building them; scouts crossing water; and amphibious assault stacks would be vulnerable.
Somewhere on my todo list I want to make possible that you can harvest spice outside your territory. We could move all spice to deep desert. This is where the sandworm should be a threat, not next to your city.
davidlallen Jul 10, 2009, 12:57 PM Unit should be spawned in next terrain possible (desert waste). This is similar to the situation where you have units in foreign territory and borders are closed.
So the newly built unit teleports to the nearest available terrain. Since it is no longer in the city, does the amphibious assault AI still treat it as an available transport?
koma13 Jul 10, 2009, 01:08 PM I think ai will send empty transporters to next reachable city. There ai will use it as usual. Hm... doesn't make much sense. :)
EDIT: Wait... isnt that exactly what we want: a sandworm is spawned in the desert and then brought to nearest city for mounting/loading?
Ahriman Jul 10, 2009, 01:59 PM I would vote for worms that are strictly naval units. You never see worms actually going onto non-sand land masses and attacking cities. Worms should be transports and naval superiority units; you should still have to use infantry to actually attack and take cities. Easily done if you have enough city-raider promotion infantry.
If you keep them as going anywhere except hills and rocks, at least make them unable to enter tiles with the aquifer improvmeent (can you make them unable to enter tiles with fresh water access?).
I don't understand the gain from "spawning" Fremen controlled worms or whatever over just building them. The flavor gain is very small.
Why are there no longer coastal cities? Is that easy to put things back in without messing up trade routes?
davidlallen Jul 10, 2009, 02:59 PM Why are there no longer coastal cities? Is that easy to put things back in without messing up trade routes?
In order to make all terrain transports work, we made several changes to the sdk. This allows ocean transports using the flag "Can Move On All Terrain" to travel on land, and to be built in landlocked cities. As further background, the AI will make amphibious assaults using all terrain ocean transports; but if you give it all terrain land transport, it will not use that as any kind of transport. This capability was worked out in the original dev thread in late May.
One of the specific changes was to make the function "Is City Coastal" always return true, so that landlocked cities will build these all terrain transports. If we undo that then you can only build hovercraft in cities on the edge of the desert, which is undesirable.
If you keep them as going anywhere except hills and rocks, at least make them unable to enter tiles with the aquifer improvmeent (can you make them unable to enter tiles with fresh water access?).
That is a good point, independent of the rest of the discussion. I will add that.
Wait... isnt that exactly what we want: a sandworm is spawned in the desert and then brought to nearest city for mounting/loading?
What you proposed is that sandworms should not be allowed to move on land. So the unit is built in the city, but it is on invalid terrain so it teleports to the coast. Now it *can't get back* to the city because it is not allowed on land. So I do not think the AI would use that for amphibious assaults.
I think we all agree on one point, which is, the AI must be able to use worms for amphibious assaults. I have given one proposal which will allow at least early game assaults by Fremen, and it includes a capture mechanism:
Suppose we give Fremen foot units a Thumper promotion. As these units are walking around in the coast/ocean, they attract worms. If/when one comes, it gets automatically captured, and then all the units in the stack get a desert double move promotion for five turns. From the AI standpoint, it would send out groups of foot units normally but they would arrive at their destination unexpectedly fast.
Is there any objection to this? We do not have any art for "ridden worm" anyway, but if we had it, the appearance and disappearance of the promotion can trigger switching to this unit art.
Deliverator Jul 10, 2009, 03:12 PM Is it not possible to alter the SDK to have a truly coastal cities type that controls whether cities can build naval units? Having something like the promotion you describe which means the AI only uses it accidentally doesn't seem ideal.
davidlallen Jul 10, 2009, 04:25 PM Is it not possible to alter the SDK to have a truly coastal cities type that controls whether cities can build naval units? Having something like the promotion you describe which means the AI only uses it accidentally doesn't seem ideal.
Having the AI use it accidentally is better than not at all. To me, building a worm in a coastal city is just as un-theme-like as building it in a city far from the desert. I will probably try out my solution to see how it plays, but if we can all agree on another solution which the AI will succeed with, that would be fine also.
Ahriman Jul 10, 2009, 04:43 PM Building them in a non-coastal city and teleporting them to the coast seems ok, but slightly confusing to the player.
Can you not create two separate types of coastal city; all cities count as one type, and genuinely coastal cities count as the other.
I think it would be much simpler to give Fremen the ability to move faster in deserts rather than actually trying to attract the barbarian worm units.
I'd abstract from the process of capturing worms.
Deliverator Jul 10, 2009, 04:46 PM david, in your promotion idea, can the promotion (and associated graphic change) be triggered simply by moving onto a coast tile?
davidlallen Jul 10, 2009, 05:30 PM david, in your promotion idea, can the promotion (and associated graphic change) be triggered simply by moving onto a coast tile?
That is an interesting idea. Sort of like Clark Kent stepping into a phone booth. The good news is that there is a python hook I have used before for when a unit moves into a square. The bad news is, now we are verging into the area where python runtime *could* become a problem since that function is called large number of times per turn. It may be a good idea to *lose* the promotion upon stepping into any land plot, but I could go either way on *gaining* the promotion (stepping on coast, or actually attracting a worm).
I will try these out, hopefully this weekend.
koma13 Jul 10, 2009, 05:36 PM Hmm, I lost trail a little bit. What are you guys actually trying to achieve? You want to have sandworms to be limited to desert only but in the same time having amphibious assaults? :crazyeye:
davidlallen Jul 10, 2009, 05:47 PM We are trying to agree on a way for worm rider units to be created. There are at least four possibilities.
1. Build in cities. I "absolutely hate" the idea. Plus it has implementation problems if the worm can only move in sand.
2. I locally implemented a method the AI will never figure out; dropping a thumper unit.
3. I have proposed a new method where worms get captured sort of by accident as fremen units walk in the desert.
4. Deliverator has proposed a variant of #3 where worms magically appear as a fremen unit steps on the coast.
In #3 and #4 the worm appears as a variant graphic associated with a "double move in desert" promotion. We don't have the graphic, but we could.
koma13 Jul 10, 2009, 05:54 PM Well, if you want to use the worm as a transport you have to give it access to cities, else it will never load units.
Lord Tirian Jul 10, 2009, 05:54 PM 4. Deliverator has proposed a variant of #3 where worms magically appear as a fremen unit steps on the coast.By the way, Planetfall has some mechanic allowing land units to walk on water - and the interesting bit: Whenever they are on water, another unit graphic (a transport boat) appears next to them, similar to the way siege towers appear during attacks on cities.
You may be able to copy that bit and restrict it to the fremen/certain units, so a worm is "attached" to the graphic. If the worm is big enough, you won't really notice that the worm unit is just next to the unit.
But I have no clue how Maniac pulled that off, you'll have to ask him (or dig through Planetfall - but that would probably take way more time).
Cheers, LT.
davidlallen Jul 10, 2009, 06:06 PM Well, if you want to use the worm as a transport you have to give it access to cities, else it will never load units.
That is true. But it would only transport fremen foot units anyway. If those units get fast desert movement by a magic promotion with graphics, we do not need the worm to go to a city.
By the way, Planetfall has some mechanic allowing land units to walk on water - and the interesting bit: Whenever they are on water, another unit graphic (a transport boat) appears next to them, similar to the way siege towers appear during attacks on cities.
We are using some of the planetfall code for that. More specifically, Maniac explained his changes, and Koma implemented something almost identical. It does not create the siege tower effect, but the rest is the same.
koma13 Jul 10, 2009, 06:18 PM That is true. But it would only transport fremen foot units anyway. If those units get fast desert movement by a magic promotion with graphics, we do not need the worm to go to a city.
I think this is too complicated to implement and would slow down performance even more. Training a sandworm inside a city doesn't mean it is assembled there, it's just an abstract way of sending out some people catching a sandworm and bringing it back to city for further deployment.
davidlallen Jul 10, 2009, 06:46 PM I think this is too complicated to implement and would slow down performance even more. Training a sandworm inside a city doesn't mean it is assembled there, it's just an abstract way of sending out some people catching a sandworm and bringing it back to city for further deployment.
I will do a test implementation and measure any performance change.
koma13 Jul 10, 2009, 07:10 PM The problem with your idea imho is that it is 100% flavor only, it doesn't purpose any additional function over building worms inside a city. Yes, I read kael designing guide too. :)
I will do a test implementation and measure any performance change.
I don't want to offend you but python really is slower than sdk. I painfully had to learn this when making my last update for C4C's Europe screen. A good example for that is 'stepDistance'. In sdk you can iterate stepDistance over every plot on map without having any delay. If done in Python it will freeze you computer for several seconds.
Python is best used for interface changes. ;)
davidlallen Jul 11, 2009, 01:19 AM I agree that python should not be used for anything which is computationally intensive. But a good software designer knows that and chooses algorithms which are not computationally intensive.
Back to the topic. My experiment in the terrain double move promotion has failed. It seems that the name of the tag is a little misleading. It halves the terrain cost, unless the terrain cost is already 1. So a unit with move 2, and double move on desert, moves ... 2 squares on desert. Since the point of the project was to allow fremen foot units to move fast on desert, this experiment is a failure.
If somebody feels like it, they can make a "worm rider galley" and we can see how that plays.
koma13 Jul 11, 2009, 05:30 AM I agree that python should not be used for anything which is computationally intensive. But a good software designer knows that and chooses algorithms which are not computationally intensive.
Ok, this is true. But I often had the experience that you don't have many choices when doing something in python for civ4. This is not a general problem with python, it's due the limited api we have for access.
davidlallen Jul 19, 2009, 11:33 PM This thread had attracted some strong opinions. I now have a prototype working which has practically zero impact on runtime. I have added a Fremen UU, "Fremen Soldier", which is a duplicate of the normal soldier. Except, it can move into any desert terrain, and when it does so, it gets a unit art swap to Worm Rider Soldier. A Worm Rider Soldier has a movement of 3 and can travel on any terrain. When a Worm Rider Soldier steps on land terrain, it gets a unit art swap back to Fremen Soldier.
Effectively, the soldier is now a unit which can travel on desert at movement 3, plus the graphics are cooler. Right now, the unit art for Worm Rider Soldier just points to the basic sandworm, so you will see a wormsign sand dome. Someday we may have a "Ridden Worm" graphic where the worm travels above ground.
This requires two units to be added for each unit which will "convert". I will add the Fremen Settler, Worker and Scout, for four unique units. This should make the Fremen strong early game and raider units. I can add it for later Fremen units, as long as the list is not too huge. Probably these are the only UU that Fremen will need.
(The runtime issue I reported in the 1.3.6 release note was not due to graphics. I keep forgetting, and painfully relearning, that you should never kill or add units in the middle of the AI movement loop.)
Now that the performance issue is avoided, does anybody have any real objection to this? I like it a lot better than training Worm Riders in cities, especially now that I have changed the worm to disallow movement onto land in 1.3.7.
koma13 Jul 20, 2009, 02:17 AM But does it mean when i play the fremen and I send 20 soldier's through the desert, there will be 20 sandworms with strength 2 each? Isn't that completely devaluing the concept of wormriders? I always had the impression riding a sandworm was used for ritualistic reasons or powerful attacks. Now even the first combat thopter can easily kill them. :p
Deliverator Jul 20, 2009, 04:17 AM Maybe we can work towards a best-of-both-worlds solution...
If your graphic swapping is now working, why not make the unit an all-terrain transport with cargo space? When on land the unit can be called Worm Rider Team, and loading Fremen onto it represents assembling a posse ready to capture and ride the worm. When it moves onto the coast it changes into the Worm Rider unit.
This captures the idea of many Fremen riding the worm - you're solution basically is one worm per person which is not very true to the books/film.
The Worm Rider Team/Worm Rider has to be fairly tough or get bonuses against all the combat types that could take it out too easily. Also it should only transport people type units.
If this could be done, I'd prefer it.
Someday we may have a "Ridden Worm" graphic where the worm travels above ground.
Perhaps sooner than you think... ;)
Ahriman Jul 20, 2009, 07:25 AM David's idea sounds fine for the early game where the worms are just being used for transport, but I would definitely want buildable high strength attack-worms for the late game - Fremen should be naval superiority fighters (the british empire of arrakis ;-) whose desert units are better than those of others, but are weaker or slower land.
However, I also don't see the problem with just having worms as naval transports.
But I don't see how these ideas conflict.
a) early game worm riders who are using small worms as transports but can't make them fight, as in David's implementation
b) mid-game worm transports replacing hover transports; higher strength, higher movement, no resource requirement, but unable to move on land tiles. Buildable in cities.
c) late-game attack worms with high strength and decent movement, but unable to move on land tiles. Buildable in cities.
Is it just the lack of coastal cities that is an issue for b) and c)?
davidlallen Jul 20, 2009, 09:54 AM you're solution basically is one worm per person which is not very true to the books/film
This is only visible when the units move, not when they are stationary. When a stack of vanilla tanks move, you see the units moving kind of overlapped, like a convoy. I think that would look nice for a stack of Fremen, actually.
Now even the first combat thopter can easily kill them. :p
I have no problem with a thopter flying by and shooting the fremen off the top of the worm. There might be no damage to the worm itself. I was thinking of making them defensive only when in worm form, but maybe something like, cannot be attacked by foot units? They still need to be able to pillage improvements and they should not be blocked by foot units.
However, I also don't see the problem with just having worms as naval transports.
We already had about a dozen posts discussing this earlier in this thread. Now we have all agreed that worms cannot move on land. So landlocked cities cannot use this unit for transport. They can build the unit and it will teleport away to the nearest deep desert, and the AI will forget it is there.
Sure, changing this in the SDK would be nice; but the AI code is the most complex thing in the game, and the chances of changing this and getting it to work well seem small. If somebody puts in the work and gets the AI to perform amphibious assault even when the transport unit has teleported out of the city, we can certainly switch over to that solution.
Deliverator Jul 20, 2009, 10:00 AM We already had about a dozen posts discussing this earlier in this thread. Now we have all agreed that worms cannot move on land. So landlocked cities cannot use this unit for transport. They can build the unit and it will teleport away to the nearest deep desert, and the AI will forget it is there.
What about the all terrain transport Worm Team/Worm Rider approach I outlined?
Ahriman Jul 20, 2009, 10:07 AM Another way to get Fremen to be Desert Superiority fighters; even if you can't get the worms to actually work as naval-only units, why not just give them big combat bonuses in desert waste and deep desert tiles? Like 50%?
davidlallen Jul 20, 2009, 11:14 AM If your graphic swapping is now working, why not make the unit an all-terrain transport with cargo space? When on land the unit can be called Worm Rider Team, and loading Fremen onto it represents assembling a posse ready to capture and ride the worm. When it moves onto the coast it changes into the Worm Rider unit.
That is an interesting idea. I am not quite sure how it would work. If we use it to carry troops on an amphibious assault, there are three movement stages: (a) travel to the desert (maybe only a few squares), (b) travel in the desert, and (c) travel after leaving the desert. If it is an all terrain vehicle, what does it look like during (a) and (c)? Are they riding "inside" the worm during (a) and (c)? Or are the units all walking individually, using their own defense strength? It seems complicated to make a transport which doesn't really exist especially for (c).
Deliverator Jul 20, 2009, 11:32 AM It is only an all terrain vehicle in terms of the mechanic. Graphically, for your three states, it is:
(a) a group of Fremen soldiers.
(b) a groups of Fremen soldiers on a worm.
(c) a group of Fremen soldiers.
The Fremen move around and attack en masse in general. You could call the on-land state Fremen Troop (the term used in the book is troop). So you build a Fremen Troop which then 'carries' other units, when it is on sand it switches to the troop riding on a worm.
davidlallen Jul 20, 2009, 11:41 AM It is only an all terrain vehicle in terms of the mechanic. Graphically, for your three states, it is:
(a) a group of Fremen soldiers.
(b) a groups of Fremen soldiers on a worm.
(c) a group of Fremen soldiers.
The Fremen move around and attack en masse in general. You could call the on-land state Fremen Troop (the term used in the book is troop). So you build a Fremen Troop which then 'carries' other units, when it is on sand it switches to the troop riding on a worm.
So in (a) and (c), the combat strength of the transport is used when the stack is attacked. If this is small, then the stronger units are at risk. If this is large, then the unit is very effective when empty. What stats should we use for the land version?
Ahriman Jul 20, 2009, 11:54 AM Make the unit unable to attack, give it medium combat strength, and give it a strength bonus when in desert wastes and deep desert.
So its never an effective attacker (its a transport - carryalls should probably also be unable to attack), and its not a very good defender on land, but its an excellent defender in deserts.
So its basically a carryall, but with lower movement on land, lower defense on land, but higher defense on desert, and only carries infantry.
davidlallen Jul 20, 2009, 12:30 PM I think it would be misleading to draw this transport unit as one foot unit stacked with several other foot units, when it is on land. So I will discard the idea of unit art swapping. It will appear as a worm both on land and desert. The unit itself will still have to swap, in order to get the higher desert movement rate; I wish there was some other way to accomplish this effect. It is highly likely that unit swapping a transport will unload the cargo, which is a fatal problem, so I will probably have to write more code for that.
Ahriman Jul 20, 2009, 12:33 PM Why don't you try asking the FFH people how they got double moves in terrain X to work differently from how it does in vanilla?
Thats the mechanic you want really; something that travels faster in the ocean than on land.
Maniac Jul 20, 2009, 12:36 PM You could make worms capturable. See FfH animals and Planetfall native life.
davidlallen Jul 20, 2009, 12:37 PM I will put this project back onto my list, only lower. What we have now is a transport unit which moves slower on land.
EDIT: posted for ideas on sdk/python subforum, this link (http://forums.civfanatics.com/showthread.php?t=328560).
Deliverator Jul 20, 2009, 12:43 PM I think it would be misleading to draw this transport unit as one foot unit stacked with several other foot units, when it is on land. So I will discard the idea of unit art swapping.
I can see if there's a good way to represent a troop of Fremen without it looking like a stack of Fremen.
Maniac Jul 20, 2009, 12:44 PM Why don't you try asking the FFH people how they got double moves in terrain X to work differently from how it does in vanilla?
Thats the mechanic you want really; something that travels faster in the ocean than on land.
That's how the dropship works in Planetfall. It requires SDK changes in cvplot::movementcost or cvunit::movementcost or something.
davidlallen Jul 20, 2009, 12:50 PM You could make worms capturable. See FfH animals and Planetfall native life.
Please read earlier in the thread to catch up on the discussion for this. The AI would never use capturable transport for amphibious assault.
That's how the dropship works in Planetfall. It requires SDK changes in cvplot::movementcost or cvunit::movementcost or something.
It is a spaceship. It moves faster over one kind of land, than another?
Maniac Jul 20, 2009, 01:15 PM Please read earlier in the thread to catch up on the discussion for this. The AI would never use capturable transport for amphibious assault.
Can't find the exact post about this, but if the reason is that captured worms don't have UNITAI_ASSAULT_SEA, you can always change the AI upon capture.
davidlallen Jul 20, 2009, 01:54 PM The AI looks to build up an amphibious assault force all together in its coastal city, and then launch it. If the transport is a capturable animal, the AI will not realize this. A human would put together a bunch of ground forces, walk them to the "coast", capture the transport, and go along. But the AI will never plan that way.
So capturable transport, without an extensive AI change, seems to give the human player an unfair advantage.
Ahriman Jul 20, 2009, 02:01 PM I agree with David that captureable barbarian units aren't the right way to go.
koma13 Jul 20, 2009, 03:11 PM As far as I know AI will retreat empty transports back to a city.
davidlallen Jul 20, 2009, 03:57 PM That's good. But still the AI would need to know that it can create a transport via capture, so if it needs transport it should send a capturing unit. Without that piece of AI, the AI player will never use this type of transport.
davidlallen Jul 20, 2009, 09:00 PM Thats the mechanic you want really; something that travels faster in the ocean than on land.
Thanks for the push. In this post (http://forums.civfanatics.com/showpost.php?p=8283749&postcount=7) and associated thread I have at least understood why the "double move in deep desert" promotion does not work. With an sdk change, it should be possible to make a deep desert double move promotion work. Then we can take a much simpler approach and give all the Fremen foot units this promotion by default, perhaps instead of the existing stillsuit promotion which gives +1 move.
Ahriman Jul 20, 2009, 09:56 PM I would strongly support this as an optimal solution.
davidlallen Jul 22, 2009, 11:57 PM OK, that is working. Thanks to code borrowed from Maniac, and a new sdk built by keldath, I now have a promotion to grant double move on desert waste and deep desert. I will add this into the stillsuit promotion and give Fremen a UU set for scout, settler, soldier, worker. These UU are same as the standard units except for they get the double move for free. Moving on desert waste requires exploration tech, moving on deep desert requires stillsuit tech.
Also, I can modify the worm AI to ignore stacks containing only units with this promotion, same as they ignore thopter/hornet unitcombats.
This will make the Fremen early game raiders. I think this is enough for now. If we get a worm rider graphic, I can put the unit art swapping on; it won't affect the unit abilities, only the art.
If somebody wants to put a sandworm transport unit, that is fine too.
(EDIT: added considerably afterwards: Adding a set of UU for this seems redundant. Instead, I will add a few lines of python for onUnitBuilt which adds the promotion to any unit of the appropriate unitcombat for either Fremen civ. So, no more UU for that.)
keldath Jul 23, 2009, 10:35 AM hey david,
happy to know the code works :)
AstralDream Jul 24, 2009, 04:13 AM You can make a worm resource visible/usable only for fremen and allow them to bulid improvement like worm rider camp or worm rider training ground, then bulid wormriders in a city but make something that they will appear on improvement...
davidlallen Aug 05, 2009, 01:31 AM This is now working in version 1.4.2 at this link (http://forums.civfanatics.com/showpost.php?p=8333976&postcount=78). All the Fremen related units have a Sandrider promotion, double move in desert. See also around post 190 in the art thread for a prototype sandworm rider unit.
Deliverator Aug 05, 2009, 06:34 AM Here's a link (http://forums.civfanatics.com/showpost.php?p=8324876&postcount=239) to the art prototype.
|
|