Shop  •   Avatar  •   FAQ  •   Search  •   Memberlist  •   Usergroups  •   Profile  •   Log in to check private messages  •   Log in  •  Register 

realistic cannonball speeds
Post new topic   Reply to topic     Forum Index -> Customization & Modding Goto page Previous  1, 2, 3, 4, 5, 6  Next
View previous topic :: View next topic  
Author Message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Mon Mar 03, 2014 6:54 pm    Post subject: Reply with quote

Captain Teague wrote:
Does the fleet always have 3-4 ships? Because I play most of my games in 1680 and the fleet usually has only 2 ships.

The (greatly simplified) code looks like this:
Code:
void SpawnTreasureFleet()
{
  SelectNewTreasureShipCity();
  // rand()%2 is 0 or 1, so rand()%2+3 is 3 or 4
  for(int i=0; i < rand()%2 + 3; i++) CreateTreasureFleetShip();
}
CreateTreasureFleetShip() always creates a ship if there's a ship slot available. (The total number of ships is limited.) And as you say, the code is the law! :-) Though I don't claim perfect understanding.

Last edited by AdamMil on Tue Mar 04, 2014 1:45 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Captain Teague
Rigger
Posts: 1161



11805 Gold -

PostPosted: Mon Mar 03, 2014 9:07 pm    Post subject: Reply with quote

I see. So maybe something is picking off part of the fleet before I'm getting to it. Bloody pirates!
_________________
The Code is the Law.
Back to top
View user's profile Send private message
Roland
Boatswain
Posts: 2874



8310 Gold -

PostPosted: Mon Mar 03, 2014 11:11 pm    Post subject: Reply with quote

The final sheet (Pirates_Reference) of CGM3's Excel file, SM_Pirates_Expanded.xls (which can still be found in the mods section), describes the behavior of the Treasure Fleet. CGM3 says the Treasure Fleet consists of "3-5 Treasure Galleons (some get lost or captured on the way) with about 35 cannons and 180 men each". If his parenthetical comment is correct, this could account for the Treasure Fleet's being reduced to two vessels by the time it reaches the Caribbean.

CGM3's proposed route omits Santa Marta and replaces the second Puerto Cabello with the similarly named Puerto Bello.

I also checked Sashanan's FAQ. He says the Treasure Fleet normally appears in January of even-numbered years, but it can re-spawn sooner if the entire fleet is captured or sunk.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Tue Mar 04, 2014 1:06 am    Post subject: Reply with quote

Roland wrote:
CGM3's proposed route omits Santa Marta and replaces the second Puerto Cabello with the similarly named Puerto Bello.
Whoops, you're right about Puerto Bello. The two names looked the same to me. :-)

Roland wrote:
I also checked Sashanan's FAQ. He says the Treasure Fleet normally appears in January of even-numbered years, but it can re-spawn sooner if the entire fleet is captured or sunk.
I personally think it can spawn in any year, but I'm just looking at the code, not running the game! (Perhaps it normally takes the treasure fleet more than a year to make its run, so it just happens to spawn every other year, and the game starts on an even year so it tends to be even years...) I also think it spawns in February.

And it does seem to spawn only after the previous fleet is entirely gone, in contrast to what I said earlier about it trying to spawn every month. (It was related to the "condition that I haven't looked at much yet". After looking at it just now, I saw that it jumped over the code to spawn the fleet if there were any ships in the fleet.) And yeah, it checks once per year, not once per month. I missed an extra division. *ahem* That's what I get for trying to read code at 3AM.

Thanks for the corrections! Now back to the cannonball mod...
Back to top
View user's profile Send private message Visit poster's website
Pirate
Rigger
Posts: 1830



26563 Gold -

PostPosted: Wed Mar 05, 2014 4:02 am    Post subject: Reply with quote

Sorry to bother you fine folks again and don't quit your cannonball projects or any other goody goodies you may be busy with to respond to some poor idiot who thinks he's a pirate. Let me see if I am purt near close to getting this dang thing right. The Spanish cities have to come from a certain Id list so that means that any Spanish city in the wrong slot can't be including in the treasure ship spawns? Is the only thing needed for treasure fleets to spawn is that the city has to be in the right location or order in the list and that it is Spanish. Would any of you off the top of your noggins happen to have any idears on what tells the city how many pilgrims and soldiers thar be and how much the goodies are from the merchant? Dang! I gotta go now some dadburn critter is trying to get in my chicken house. See ya!
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Wed Mar 05, 2014 5:02 am    Post subject: Reply with quote

Pirate wrote:
Let me see if I am purt near close to getting this dang thing right. The Spanish cities have to come from a certain Id list so that means that any Spanish city in the wrong slot can't be including in the treasure ship spawns? Is the only thing needed for treasure fleets to spawn is that the city has to be in the right location or order in the list and that it is Spanish.
I think (but I'm not sure) that even if none of the cities in the list are Spanish, then the fleet will still spawn (going between the two "Europe" cities), but you won't receive any notifications about it. If you want the notifications, then at least one city in the list should be Spanish, but the more the better because if there's just one it would be randomly skipped over half the time. (Or preferably two right next to each other because it can't skip over both of them.) And yeah, what matters is the city slot/ID, not the name.

Pirate wrote:
Would any of you off the top of your noggins happen to have any idears on what tells the city how many pilgrims and soldiers thar be and how much the goodies are from the merchant? Dang! I gotta go now some dadburn critter is trying to get in my chicken house. See ya!
A chicken pirate, no doubt. :-P But I've done some work on this. Given the state of the economy I can tell you what the prices and amounts will be, but I haven't looked into how the economy evolves. (Things like trade ships, immigrants, and governors arriving or failing to arrive, as well as attacks and whatnot, all cause it to change, but it depends on certain flags that I don't all understand yet.) I can say that the rules for which cities specialize in which goods are all hard-coded. For instance "if the city ID is X, spice costs 50% more".

Do you raise chickens for eggs or meat?
Back to top
View user's profile Send private message Visit poster's website
Pirate
Rigger
Posts: 1830



26563 Gold -

PostPosted: Wed Mar 05, 2014 7:44 am    Post subject: Reply with quote

Thanks! No chickens just crazy at times. To be honest I don't know what's wrong with me but I am having fun so I guess I'm ok.
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Wed Mar 05, 2014 11:57 am    Post subject: Reply with quote

Pirate wrote:
Thanks! No chickens just crazy at times. To be honest I don't know what's wrong with me but I am having fun so I guess I'm ok.
If you aren't a bit crazy, then you're not normal in my opinion. Most people just hide it. :-P
Back to top
View user's profile Send private message Visit poster's website
Pirate
Rigger
Posts: 1830



26563 Gold -

PostPosted: Wed Mar 05, 2014 12:05 pm    Post subject: Reply with quote

Oh must people hide it? I am glad I am having more fun than must people then. Very Happy
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Sat Mar 08, 2014 5:25 am    Post subject: alpha version Reply with quote

Alright, so who wants to try it out?! I'm releasing an early version and hope to get feedback. Actually, I'm releasing two versions:
  • Pirates-10x.exe: The cannonballs move at 10x normal speed, which should be pretty close to real-world speeds. It's fairly awesome. One problem is that they move so fast that many cannonballs seem to pass through ships without impacting them (because the game only checks for intersection every so often). This might get worse with a lower framerate. Another problem is that the AI can't seem to aim that well. However, I think it actually produces a nice feel overall. Things are more dangerous, but they're not too deadly, so it makes the game more interesting without actually being so much harder. I feel like this version is a real improvement over the base game.
  • Pirates-5x.exe: The cannonballs move at 5x the normal speed. They still feel a bit slow, so it's not quite as awesome, but they're definitely too fast to dodge. Fewer of them will pass through the ship without impact and the AI seems to be able to aim better at this speed, so overall it seems more dangerous. I think this version comes closer to the goal of making the game more challenging.
Both versions require smarter sailing and more varied tactics than usual. They also need tuning and adjustment. What do you guys think? Is it fun? What should be changed?

Temporary download: http://www.adammil.net/tmp/CannonballModAlpha.zip
Back to top
View user's profile Send private message Visit poster's website
Pirate
Rigger
Posts: 1830



26563 Gold -

PostPosted: Sat Mar 08, 2014 7:35 am    Post subject: Iron Man Reply with quote

Is the Iron man added in this application?
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Sat Mar 08, 2014 8:06 am    Post subject: Re: Iron Man Reply with quote

Pirate wrote:
Is the Iron man added in this application?
No, I didn't combine the two, since it would hinder experimentation and testing the mod. (But I did combine them in my personal copy. ;-P)
Back to top
View user's profile Send private message Visit poster's website
Pirate
Rigger
Posts: 1830



26563 Gold -

PostPosted: Sat Mar 08, 2014 10:08 am    Post subject: Iron Man Reply with quote

No problem, I know how to edit it in.
Back to top
View user's profile Send private message
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Sat Mar 08, 2014 12:58 pm    Post subject: Reply with quote

Okay, I posted a new version. Changes:
  • The crew now aims the guns a bit higher. In the previous 10x version, the cannonballs often seemed to hit the water just before impact, and this helps with that. I suppose it's possible that they'll fire over the enemy ship now, but it seems better overall. This means the AI can hit you better too.
  • Chain shot has a higher arc. With the accelerated cannonball speed, chain shot appeared to hit the side of the ship, which looked wrong. Now it arcs a bit higher to hit the sails and mast. It looks a bit silly at extreme ranges because it rises and falls faster than would be expected but it looks better at the ranges in which it's normally used.
There's no 5x version here, since I like the 10x speed better.

Let me know what you think.


Last edited by AdamMil on Fri Mar 14, 2014 10:02 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
AdamMil
Cutthroat
Posts: 274



4481 Gold -

PostPosted: Sun Mar 09, 2014 11:02 am    Post subject: Reply with quote

I posted a new version. Changes:
  • When a cannonball damages a ship's sails, crew, or cannons, a small amount of hull damage may be done as well. This means that chain shot and grape shot can deal minor hull damage, so it's possible (but unlikely) that you can sink a ship with them.
  • It seems that in the base game, ships with copper plating take double damage to their sails. That seemed weird, so I replaced it with a consistent damage value halfway between the two values for having and not having copper plating. (Update: This was a mistake on my part!)
An earlier version of this file had a bug that could cause your crew to be cut down to 1 very quickly after being hit by a broadside. That problem should be fixed now (so you should redownload it). This version had relatively extensive code changes compared to the previous ones, so it needs a bit more testing...


Last edited by AdamMil on Fri Mar 14, 2014 10:02 am; edited 10 times in total
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Customization & Modding All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group