Whales and Whalingboat Development Thread

K, here is the latest upload. Here are the effects as of now...

When you command your fishing/whaling boat to fish it will change to the working unit. It will change back if you cancel mission or the job is done. If you try to move the unit its the same as canceling the mission. To move a unit while its working requires two steps... either cancel the mission or try to move the unit which will auto cancel it, then the unit can be moved as normal. I want to make it so that when you order the unit to move it will change its graphic then start to move all in one command but that will take some extra coding.

The problem with having two different units for normal and working is how the mission system is designed. Its tricky to get the units to continue their jobs after you convert a units graphic. You need an understanding of how the mission system works for one and I prolly forgot most of what I did know so it took me a bit to figure things out again.

Anyway, test out this new upload and let me know what you think.

K, while testing I had these ideas come to mind, some of these I may have mentioned before:

1. Should a fishing ship be able to sail to europe or be able to be automated? If not then the cost to build could be lowered sense ships like Caravel would still be used to transport to europe.

2. Should fishing be completely automated. Like you can go to a fishing spot then give the command to auto fish and the ship will then load to full, sail home to unload, then sail back to spot to refish.

3. Should fishing resources expire over time with new ones appearing elsewhere?

4. We could give Fishing Boats experience with each succesful fishing trip and then have promotions designed just for them that increase say cargo hold, or amount gained from fish resources, or other features.

5. Should the Whales bonus give Whale Oil and such in the form of Trade Goods as well as food. That would give the Whale bonus resource an extra benefit over all other fish resources and would fit with actuall history as they where used as food as well as other commoditys.

Still to do:

I would like to see the AI using whaling ships as well.. that of course would take some more programing.
 

Attachments

  • Whalingboat_v0.03.1c with Kailric's changes.rar
    2.4 MB · Views: 61
Hi, Kailric!

Let me comment some of your ideas.

K, while testing I had these ideas come to mind, some of these I may have mentioned before:

1. Should a fishing ship be able to sail to europe or be able to be automated? If not then the cost to build could be lowered sense ships like Caravel would still be used to transport to europe.
Absolutely not. "Fishing"/"Whaling"/etc. ships are only for See/Ocean resources harvesting. Traditionally, these ships (especially in the 16-18 centuries) are not intended for long voyage in the ocean.

2. Should fishing be completely automated. Like you can go to a fishing spot then give the command to auto fish and the ship will then load to full, sail home to unload, then sail back to spot to refish.
Automated fishing would be ideal, if it doesn't require too much time for programming and doesn't lead to new bugs in the game.

3. Should fishing resources expire over time with new ones appearing elsewhere?.
It is the right idea. If it can be implemented on Fish/Whale resources, then it can be applied to the mineral resources (gold, silver, etc.), too. And then the idea of "Geologist from Europe" may finally be realized.

4. We could give Fishing Boats experience with each succesful fishing trip and then have promotions designed just for them that increase say cargo hold, or amount gained from fish resources, or other features.
Why not?

5. Should the Whales bonus give Whale Oil and such in the form of Trade Goods as well as food. That would give the Whale bonus resource an extra benefit over all other fish resources and would fit with actuall history as they where used as food as well as other commoditys.
Absolutely true from a historical point of view. MultipleYieldsConsumed_v0.06 by Aymerick permits simultaneously produce two or more resource from the same bonus tile. In this case it may be Food (YIELD_FOOD) and Whaling Oil (YIELD_OIL).

Of course, Whaling Oil could be sold in Europe. But at the same time it could give a small bonus inside the city buildings. For example, in Schools, Colleges and Universities as a gain on Education (shorter education), or, in City Hall on the bells (better administration).

Few day ago I made a sketch of possible resources for the period of New World colonization. So called "Dream collection of resources" has about 45-47 positions. The maximum possible is 64 resources, thus we still have a lot of free vacancies.

Still to do:

I would like to see the AI using whaling ships as well.. that of course would take some more programing.
Maybe the most complicated part of work... Good luck in your development!
 
Hey Kailric, I think you forgot to update the SDK source files...

Here are my comments:

1. Should a fishing ship be able to sail to europe or be able to be automated? If not then the cost to build could be lowered sense ships like Caravel would still be used to transport to europe.

Well, there are some historical theories about european fishermen comming up to Newfoundland... So technicaly I think the could cross the ocean. Still, I think the fishing and whaling boat should not be used to transport other goods or work on trade routes. But if they can't cross the ocean this means they could only be built in colonies and not bought in Europe...

2. Should fishing be completely automated. Like you can go to a fishing spot then give the command to auto fish and the ship will then load to full, sail home to unload, then sail back to spot to refish.

Yes, but we should keep both options. I still want to manage it manualy, especially if a privateer is roming nearby...

3. Should fishing resources expire over time with new ones appearing elsewhere?

That could be a good idea, but maybe we should see that more like fish migrating then the ressource expirering... Also, woudn't it cause a problem if you completely automate them? It probably means it'll have to check if the ressource is still there and all...

4. We could give Fishing Boats experience with each succesful fishing trip and then have promotions designed just for them that increase say cargo hold, or amount gained from fish resources, or other features.

Yes! I especialy like the "greater amount gained". But for the cargo hold, like I said in #1, as long as it doesn't make a whaling ship become a transport....

5. Should the Whales bonus give Whale Oil and such in the form of Trade Goods as well as food. That would give the Whale bonus resource an extra benefit over all other fish resources and would fit with actuall history as they where used as food as well as other commoditys.

As we talked about, I think it's important that we make this Modcomp as portable as possible so that other modders can adapt it. For that, I think we should add a new tag in the CIV4UnitInfos.xml that specifies what yields the boat can or will gather. This way it'll also be easier to have other types of "ressource gathering units" like ones that works on land...

Let me take care of that part, I've got some experience with that... And don't forget the SDK files! ;)

Aymerick
 
K,

2. Well, we really need the AI using the fishing boats as well so I would have to create code for them which would basiclly be Auto Fishing so when thats done it would be an easy task to make the Fully Automate command work for Fishing Boats too.

3. Yeah your right about messing with the auto fish... I'll keep this idea on the back burner for now but just wondering is there code already in place for resources to expire. I know Civ4 had this but is it in Col?

4. Well, for game mechanics we could make the Fishing boats only able to transport goods it can gather. That way any Promotions want turn the ship into a Full Transport. If anyone knows whaling history and has ideas on Promotions and what they could be called feel free to share.

5. Sounds good Aymerick, looking forward to the addition.

And yeah, I left out the Source Code... I'll post it here real quick...there:)
 

Attachments

  • Whaling Source.rar
    265.6 KB · Views: 67
I was thinking an easy/clean way to allow both player and AI ships to harvest a temporary resource could be:

Have the resource randomly appear as a "Whale Pod" Terrain Feature on sea, then have an BUILD_WHALEHARVEST entry in units\civ4buildinfos.xml using <FeatureStruct> to remove the Feature when harvested and provide a given <Yield> in the nearest city. The whalingboat unit could be given UNITAI_WORKER and allowed only the BUILD_WHALEHARVEST command, it would hopefully then seek out and harvest the resource and not need any micromanagement to transport the yields. You could use python onturn to make Whale features randomly appear in the ocean, players would have to seek them out with their whaling fleets before others reach them, making sea power and control of naval borders more important. :cool:

I'd like to use something like that for Asteroid Mining in my mod, too, but for some reason can't get the Asteroids feature to display on the space terrain :sad::confused:
 
Hey guys,

I'm about to release a new version. I've added a new "whale oil" yield, a automate command as well as AI using whaling and fishing boats.

I've had so much trouble with the working unit convertion so I scraped that... Instead I made "working" professions. This way the graphic changes but the unit (and this pointer) isn't killed... Of course I made it so other units can't have those professions...

Now I was thinking about adding another new yield as fishes and, somewhat like you've done with "pirated goods" in your Privateer mod Kailric, you would be asked if you want to convert that fish yield into food when unloading or keep it as tradable...

I'm just tweaking so last AI stuff now and I'll upload late...

Aymerick
 
Hey guys,

I'm about to release a new version. I've added a new "whale oil" yield, a automate command as well as AI using whaling and fishing boats.

I've had so much trouble with the working unit convertion so I scraped that... Instead I made "working" professions. This way the graphic changes but the unit (and this pointer) isn't killed... Of course I made it so other units can't have those professions...

Now I was thinking about adding another new yield as fishes and, somewhat like you've done with "pirated goods" in your Privateer mod Kailric, you would be asked if you want to convert that fish yield into food when unloading or keep it as tradable...

I'm just tweaking so last AI stuff now and I'll upload late...

Aymerick

This sounds great Aymerick. Just thinking about a new "fishes" yield though, that may add a bit of unneeded complexity sense you added "whale oil" (which is totally cool btw) as a new tradeable yield. Sense gathering fish from boats is just an extension of the Fisherman profession it may seem a bit out of place that one adds a new yield and the other does not. Just some thoughts off the top of my head.

Looking forward to testing this out.
 
Here is the link to the new version :

http://www.filefront.com/16597299/Whalingboat_v0.04c.zip

Kailric, if you want to make changes, I've made tons of small modifications and rename alot of stuff so just start from scratch with the new version...

Also, I've removed the "Whaling and Unload to city" since the Automate now works but I could always put it back in...

version 0.4c changes :
- Can work bonus within Native village radius if Plot isn't being already worked.
- Now only gather from bonus yield change, not both terrain and bonus.
- Added new "Whale Oil" yield.
- Added new boats automation.
- AI now uses the boats.
- Boats Graphic Switch now works with profession.
- Removed "Fish and unload to city" mission.
- Boats now can't load units or cargo.

Todo :
- Tweak Boats explore AI for better results.
- Tweak Boats AI unit value for the AI to buy them, but not too much.

Let me know what you think,

Aymerick
 
Here is the link to the new version :

http://www.filefront.com/16597299/Whalingboat_v0.04c.zip

Kailric, if you want to make changes, I've made tons of small modifications and rename alot of stuff so just start from scratch with the new version...

Also, I've removed the "Whaling and Unload to city" since the Automate now works but I could always put it back in...



Let me know what you think,

Aymerick

Been testing this out, sweet work man. :goodjob:

My thoughts, bugs, or questions:

1. We could add the "Select Home Port" and "Return to Home Port" feature of my Privateer Mod. This feature would work for all Ships and wagon trains. That way you can select which town you want your Fishing ship to send the food too. Its also a good command to have anyway that way when your ship arrives from Europe you just hit "Return to Home Port" and it auto unloads at its selected city.

2. I noticed on Auto Fish the fishing ship does not go to "Coastal Fish".. it went to Crabs lots futher away but not to the Coastal Fish just out side city radius. Edit: I could however manual fish from Coastal Fish

3. I haven't checked your code yet but Do auto fish units "Explore" on their own or do they only go where they Know fish is? Just wondering about the process. If there is no spot to fish from the Unit should just explore until it finds one I am thinking, thats what it seems like it is doing.

4. There is a bug where if you have a Privateer on the map the Fishing boats just shut down. From what I seen they want move, just sit there. Didn't matter if the fishing boat could see the Privateer or not.

Anyway, thats what I have so far.
 
1. We could add the "Select Home Port" and "Return to Home Port" feature of my Privateer Mod. This feature would work for all Ships and wagon trains. That way you can select which town you want your Fishing ship to send the food too. Its also a good command to have anyway that way when your ship arrives from Europe you just hit "Return to Home Port" and it auto unloads at its selected city.

Thats what I had in mind. The automate command uses the "getHomeCity" function and if no home city is assigned, it just go and unload to the primary city.

2. I noticed on Auto Fish the fishing ship does not go to "Coastal Fish".. it went to Crabs lots futher away but not to the Coastal Fish just out side city radius. Edit: I could however manual fish from Coastal Fish

3. I haven't checked your code yet but Do auto fish units "Explore" on their own or do they only go where they Know fish is? Just wondering about the process. If there is no spot to fish from the Unit should just explore until it finds one I am thinking, thats what it seems like it is doing.

Basicaly, the boats will explore ocean (including europe tiles) and move toward the best known ressource. If on it's way it stops on a plot that has a bonus, then it will start gathering there, even if it's not the best place...

The best gatherable plot is mostly based on the bonus yield change, and just a little on distance... My main goal was for whaling boats to use primarly whale bonus so they can get whale oil and not just food...

All of that need to be reworked, I know it's not optimal...

4. There is a bug where if you have a Privateer on the map the Fishing boats just shut down. From what I seen they want move, just sit there. Didn't matter if the fishing boat could see the Privateer or not.

I did not get this problem... I'll try to reproduce it.

Also, did any AI player buy or build whaling or fishing boat? I think I need to rethink the AI value for those two... I wanted to make it dependent on food difference but it might not be enough... maybe it should be based on know gatherable bonuses?

Aymerick

Edit: I also noticed something's wrong with my GameFont, I'll make a new one...
 
I only tested things out I didn't play through a game to see if the AI built fishing boats. Thats easy enough though just make the AI autoplay.

Also, in that one bug with the privateer. What I did was give an AI player a fishing boat and a whaling boat and see what they would do. They seem to be working just fine. Then when I created a privateer next to one of the boats it just stoped working. I moved the privateer to the other AI boat and when I found it it stopped as well.
Edit: Then when I deleted the Privateer the boats started working again.

Are you sure Auto Fishing can find Coastal Fish cause the one Fishing boat kept ignoring the Coastal Fish just out side the city and going to the Crabs much further away?
 
I was trying to create a similar function in my mod without changing the SDK (which I don't know how to do :blush:), in my case making the ability for ships to clear an Asteroid terrain feature in the "ocean" and provide some resources to the nearest city.

I created a ship that can use BUILD_REMOVE_ASTEROID to clear FEATURE_ASTEROID, and made this Build command provide resources in the nearest city (like Workers clearing a Forest). It works pretty well for my purpose, except that the AI doesn't use it even when I give the unit UNITAI_WORKER. So I was wondering, is there some way I could adopt some of your code to make the AI use this Build command for ships? Or alternately to somehow use the existing Sea Worker unitai from Civ4?
 
I was trying to create a similar function in my mod without changing the SDK (which I don't know how to do :blush:), in my case making the ability for ships to clear an Asteroid terrain feature in the "ocean" and provide some resources to the nearest city.

I created a ship that can use BUILD_REMOVE_ASTEROID to clear FEATURE_ASTEROID, and made this Build command provide resources in the nearest city (like Workers clearing a Forest). It works pretty well for my purpose, except that the AI doesn't use it even when I give the unit UNITAI_WORKER. So I was wondering, is there some way I could adopt some of your code to make the AI use this Build command for ships? Or alternately to somehow use the existing Sea Worker unitai from Civ4?

Do you have a current version with this change in it that I can download? It maybe a simple fix and I'll look into it for ya.
 
Thanks Kailric; I've uploaded a pre-release beta version so you can take a peek at it.

http://www.megaupload.com/?d=0PN7ZXNI

BTW in recognition of all your work & contributions with your Techs Modcomp I have named one of the alien chieftains in your honor. ;) Also one after TC01 for his help on the mapscript. I'm still having the problem with Inventor's House sometimes not appearing in cities (and not being buildable), I can't seem to find what's causing that. I've seen some crashes that seem to occur only when exiting the game (ie after pressing Quit to Desktop); I haven't had problems with in-game crashes so far but haven't yet played a full-length game.
 
I only tested things out I didn't play through a game to see if the AI built fishing boats. Thats easy enough though just make the AI autoplay.

Also, in that one bug with the privateer. What I did was give an AI player a fishing boat and a whaling boat and see what they would do. They seem to be working just fine. Then when I created a privateer next to one of the boats it just stoped working. I moved the privateer to the other AI boat and when I found it it stopped as well.
Edit: Then when I deleted the Privateer the boats started working again.

Are you sure Auto Fishing can find Coastal Fish cause the one Fishing boat kept ignoring the Coastal Fish just out side the city and going to the Crabs much further away?

Hey Kailric,

I think I've fixed the Privateer problem.

Now for the Auto Fishing AI, which way should I go... Should the boats "remember" the last and/or best plot to fish on or should they always start anew after every completed mission?

Aymerick
 
Hey Kailric,

I think I've fixed the Privateer problem.

Now for the Auto Fishing AI, which way should I go... Should the boats "remember" the last and/or best plot to fish on or should they always start anew after every completed mission?

Aymerick

I would have them start anew. That way also if we add in the feature where resources appear and disappear if a new one appears that is better the AI will go for that one.
 
Allright, here's a new version :

http://www.filefront.com/16809599/Whalingboat_v0.04d.zip

I think I've fixed the Privateer stuff and AI now buy Whaling Boats (that still needs some tweaking because it won't buy Fishing Boat yet...)

I gave more weight to distance so Auto Fishing won't go gather Crabs further away...

Kailric, I'll let you do the "Return Home" stuff...

Aymerick
 
Top Bottom