[NoGo] CityDomination
Moderator: OpenTTD Developers
Re: [NoGo] CityDomination
Question and/or feature suggestion.
Is it possible for the game to be restarted through a script? As in, once a goal is reached (or a number of goals, which opens up so much more possibilities by the way) all the players get messages on who the winner is and the game/map restarts itself for people (who get reconnected automatically, in the ideal situation) to start over again?
Is it possible for the game to be restarted through a script? As in, once a goal is reached (or a number of goals, which opens up so much more possibilities by the way) all the players get messages on who the winner is and the game/map restarts itself for people (who get reconnected automatically, in the ideal situation) to start over again?
Re: [NoGo] CityDomination
Scripts can't control servers to restart. But they can send messages to the Admin port. So a game script in combination with a server admin program, can do that.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] CityDomination
FS#5035 reported a problem. The GoalTown constructor does always passes 0 as TownID, so the GUI always scrolls to the same town.
Code: Select all
- if(id == null) this.id = GSGoal.New(company, GSText(GSText.STR_GOAL_TOWN, town), GSGoal.GT_TOWN, 0);
+ if(id == null) this.id = GSGoal.New(company, GSText(GSText.STR_GOAL_TOWN, town), GSGoal.GT_TOWN, town);
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: [NoGo] CityDomination
Thanks for the report. I will get this fixed this weekend. I am not familiar what "FS#5035" is...FS#5035 reported a problem. The GoalTown constructor does always passes 0 as TownID, so the GUI always scrolls to the same town.
EDIT:
Found the flyspray bug

Re: [NoGo] CityDomination
Here is the tiny bugfix release for the goals issue. Any bug reports still welcome. No changes in english.txt if you would like to be a translator 

- Attachments
-
- CityDomination-7.tar
- (52 KiB) Downloaded 308 times
Re: [NoGo] CityDomination
Possibly a bug.
Began a small game that started with 2 towns. Although I got goals to dominate both towns, I didn't get the population target and I was completely unable to get ownership of either town. I guess the script needs a minimum of 3 towns to function?
Restarted and got a game with 3 towns. Got ownership immediately and a target of 5000 pop to dominate.
Began a small game that started with 2 towns. Although I got goals to dominate both towns, I didn't get the population target and I was completely unable to get ownership of either town. I guess the script needs a minimum of 3 towns to function?
Restarted and got a game with 3 towns. Got ownership immediately and a target of 5000 pop to dominate.
Re: [NoGo] CityDomination
Did you have a competitor in the game? Did the total population of the 2 towns exceed the amount of the goal?Possibly a bug.
Began a small game that started with 2 towns. Although I got goals to dominate both towns, I didn't get the population target and I was completely unable to get ownership of either town. I guess the script needs a minimum of 3 towns to function?
Restarted and got a game with 3 towns. Got ownership immediately and a target of 5000 pop to dominate.
Re: [NoGo] CityDomination
I was playing solo. I don't think the total population was high enough.
Another oddity from trying it again last night. A 256*256 game with 9 towns, solo play. I dominated all the towns except the last one. In my current 'goals' list I have to dominate this one town (where I can't get ownership at all) and two others where I'm already in control.
Something else that's bugging me...town growth for all towns is every 257 days regardless of whether I have a presence there or not. It does make trying to grow the towns much more difficult. My current game has a pop of 9,500 dominated with a target of 15,000 and I can't get the towns to grow. The only city I have is 3,500, lots of stations with trains and buses plus a goods supply but still only grows every 257 days.
Does this script NEED an opponent or two to make it function correctly?
Other than these small problems it is quite enjoyable...although I should have built a coal line or two first as a few passenger routes can't make enough money...
Using version 7 but the script complains that this version is older than the saved version which it isn't. (I think the version check hasn't been amended but that's a minor point).
Another oddity from trying it again last night. A 256*256 game with 9 towns, solo play. I dominated all the towns except the last one. In my current 'goals' list I have to dominate this one town (where I can't get ownership at all) and two others where I'm already in control.
Something else that's bugging me...town growth for all towns is every 257 days regardless of whether I have a presence there or not. It does make trying to grow the towns much more difficult. My current game has a pop of 9,500 dominated with a target of 15,000 and I can't get the towns to grow. The only city I have is 3,500, lots of stations with trains and buses plus a goods supply but still only grows every 257 days.
Does this script NEED an opponent or two to make it function correctly?
Other than these small problems it is quite enjoyable...although I should have built a coal line or two first as a few passenger routes can't make enough money...
Using version 7 but the script complains that this version is older than the saved version which it isn't. (I think the version check hasn't been amended but that's a minor point).
Re: [NoGo] CityDomination
OK, thanks for confirmingI was playing solo. I don't think the total population was high enough.

Did you make sure that you dominated the town for a full period of 3 months? The reason for the 3 month requirement is to make sure you have a solid domination of the town, if you know what I meanAnother oddity from trying it again last night. A 256*256 game with 9 towns, solo play. I dominated all the towns except the last one. In my current 'goals' list I have to dominate this one town (where I can't get ownership at all) and two others where I'm already in control.
You are correct. I will fix that bug over the weekend. Thanks for your reportSomething else that's bugging me...town growth for all towns is every 257 days regardless of whether I have a presence there or not. It does make trying to grow the towns much more difficult. My current game has a pop of 9,500 dominated with a target of 15,000 and I can't get the towns to grow. The only city I have is 3,500, lots of stations with trains and buses plus a goods supply but still only grows every 257 days.

It is recommended that you have competitors, mainly because this script is designed for multiplayer gameplay primarily, however, it should still operate correctly in single player as well.Does this script NEED an opponent or two to make it function correctly?
Thanks, thats another bug which I will fix soon (hopefully this weekend)Using version 7 but the script complains that this version is older than the saved version which it isn't. (I think the version check hasn't been amended but that's a minor point).

Re: [NoGo] CityDomination
New Release! CityDomination v8:
* Added complete cargo support
* Fixed all of 3iff's previously reported bugs
* Fixed a bug where building a station and not using it gives you perfect station ratings, which is not fair
As usual, CityDomination is also available on bananas.
* Added complete cargo support
* Fixed all of 3iff's previously reported bugs
* Fixed a bug where building a station and not using it gives you perfect station ratings, which is not fair

As usual, CityDomination is also available on bananas.
- Attachments
-
- CityDomination-8.tar
- (60 KiB) Downloaded 303 times
Re: [NoGo] CityDomination
I was delivering stuff for 6 months or more yet couldn't get any ownership.Did you make sure that you dominated the town for a full period of 3 months? The reason for the 3 month requirement is to make sure you have a solid domination of the town, if you know what I mean
I'll give the new version a thorough test and report back if there are issues.
Re: [NoGo] CityDomination
Oops, managed to break it again...
Solo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
So, once the TOTAL population reached 5000, I got the next target (15000) even though the HQ sign shows my domination population for the original 3 towns (excluding Mentstoke and St Nandean). Seems I'm not being credited with dominating those 2 towns for the HQ sign but I am getting credit for the overall population target. I also didn't get a message confirmation for getting those other 2 towns as they weren't on the goal list when I got them.
I have the savegame if you need it...and it's newgrf-free to make things easier.
(edit) Looks like the script has reset the dominated towns for the new goal of 15000. It now counts all 5 towns with the combined population total reporting correctly in the HQ sign.
Solo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
So, once the TOTAL population reached 5000, I got the next target (15000) even though the HQ sign shows my domination population for the original 3 towns (excluding Mentstoke and St Nandean). Seems I'm not being credited with dominating those 2 towns for the HQ sign but I am getting credit for the overall population target. I also didn't get a message confirmation for getting those other 2 towns as they weren't on the goal list when I got them.
I have the savegame if you need it...and it's newgrf-free to make things easier.
(edit) Looks like the script has reset the dominated towns for the new goal of 15000. It now counts all 5 towns with the combined population total reporting correctly in the HQ sign.
- Attachments
-
- Testing, 23rd Oct 1951.png (72.89 KiB) Viewed 9026 times
Re: [NoGo] CityDomination
Started a game with 4 computer players. Ran ok for a while but then it seemed to stop updating. I saved and quit then reloaded the game...the script crashed.
Savegame available if needed.
Savegame available if needed.
- Attachments
-
- Testing with AI, 30th Aug 1952.png (35.12 KiB) Viewed 9014 times
Re: [NoGo] CityDomination
A save file would be nice pleaseSolo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
So, once the TOTAL population reached 5000, I got the next target (15000) even though the HQ sign shows my domination population for the original 3 towns (excluding Mentstoke and St Nandean). Seems I'm not being credited with dominating those 2 towns for the HQ sign but I am getting credit for the overall population target. I also didn't get a message confirmation for getting those other 2 towns as they weren't on the goal list when I got them.
I have the savegame if you need it...and it's newgrf-free to make things easier.

The crash I will fix promptly as well, although I would like the save file for this one tooStarted a game with 4 computer players. Ran ok for a while but then it seemed to stop updating. I saved and quit then reloaded the game...the script crashed.
Savegame available if needed.
Re: [NoGo] CityDomination
Saves enclosed. The crash one might have involved a crashing AI...I'm not sure. Anyway, the game continued eventually (after another save/restart).
I also learned about what constitutes dominating a town...it's transporting all cargo in its zone...not just passengers.
Hope these files help...
One thing, the original target is 5000 then it jumps to 15000...is this correct?
I also learned about what constitutes dominating a town...it's transporting all cargo in its zone...not just passengers.
Hope these files help...
One thing, the original target is 5000 then it jumps to 15000...is this correct?
- Attachments
-
- Testing, 23rd Oct 1951.sav
- (27.54 KiB) Downloaded 271 times
-
- Testing with AI, 30th Aug 1952.sav
- (38.71 KiB) Downloaded 271 times
Re: [NoGo] CityDomination
Actually, its the cargo ratings for each station are added up, and whoever has the highest station ratings dominates (actually, I wanted to determine it by how much cargo is transported by each individual company, but that was not available on the API, so I decided the station ratings were the closest).I also learned about what constitutes dominating a town...it's transporting all cargo in its zone...not just passengers.
No, it is not. I think that I will add a new parameter which changes how far the population jumps with each new goalOne thing, the original target is 5000 then it jumps to 15000...is this correct?

And thanks for the saves

Re: [NoGo] CityDomination
Would it not be better to average the rating over the number of stations? Otherwise, a company could spam lots of stations getting 50% rating (say 10 @ 50% for 500) which would beat 4 stations at 100% but the 4 would surely be better than the 10. Alternatively, take the best 10 stations from each player in a town and total those. That at least gives a cutoff point to stop spamming dozens of stations and would make players focus on making some stations highly effective.Actually, its the cargo ratings for each station are added up, and whoever has the highest station ratings dominates (actually, I wanted to determine it by how much cargo is transported by each individual company, but that was not available on the API, so I decided the station ratings were the closest).
It might also help (if possible) to display the domination rating in the owner sign...something like...
Owner: 75% Jones Transport.
Then players would know how dominant an owner was.
-
- Engineer
- Posts: 3
- Joined: 03 Apr 2012 20:58
Re: [NoGo] CityDomination
Appears that player built towns can't be owned.
Re: [NoGo] CityDomination
I considered that, and to counter that, I ensured that the script will check to see if the station is actually transporting any cargo before counting it. This makes it much more difficult for a user to "spam the town, because he/she must actually continually use the stations in order for them to be counted. I also decided that more stations should transport more cargo typically than averaging all the stations, or else the user could just have 1 good station and win from that, even though another player could be transporting more cargo.Would it not be better to average the rating over the number of stations? Otherwise, a company could spam lots of stations getting 50% rating (say 10 @ 50% for 500) which would beat 4 stations at 100% but the 4 would surely be better than the 10. Alternatively, take the best 10 stations from each player in a town and total those. That at least gives a cutoff point to stop spamming dozens of stations and would make players focus on making some stations highly effective.
The cutoff I may consider, but for right now let me focus on other things

I think you are right! I will work on that too.Appears that player built towns can't be owned.
EDIT: One more question...
What is the owner rating you were talking about above the HQ 3iff?
Re: [NoGo] CityDomination
OK here we go... CityDomination v9:
* Added new AI option to control step size of population goals
* Fixed gamesave bug reported by 3iff
* Fixed CrazySquirrel's bug where player built towns are not added to the processed towns list
As usual, available on bananas

* Added new AI option to control step size of population goals
* Fixed gamesave bug reported by 3iff
* Fixed CrazySquirrel's bug where player built towns are not added to the processed towns list
As usual, available on bananas
I was unable to figure this one out... are you sure it wasnt a feature somehow? It takes 3 months after dominating the town for the goal to complete, in case you didnt knowSolo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.

- Attachments
-
- CityDomination-9.tar
- (60 KiB) Downloaded 427 times
Who is online
Users browsing this forum: No registered users and 18 guests