SWY1985 / CivOne

An open source implementation of Sid Meier's Civilization.
http://www.civone.org/
Creative Commons Zero v1.0 Universal
244 stars 49 forks source link

Crash on starting game #382

Closed AlexFolland closed 7 years ago

AlexFolland commented 7 years ago

I could not reproduce this every time, but I reproduced it 3 times very quickly just by trying to start new games with various configurations. Here is the full console output from 2 of those times.

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Game Start
Setting Loaded - FullScreen: 0
Setting Loaded - Scale: 4
Setting Loaded - AspectRatio: 0
Setting Loaded - DebugMenu: 1
Setting Loaded - CursorType: 0
Loaded e:\games\civone\data\sp257.pic
Warning: Character width larger than bytes per character. (ID: 95, Width: 9)
Loaded e:\games\civone\data\iconpg2.pic
Loaded e:\games\civone\data\iconpg3.pic
Loaded e:\games\civone\data\iconpg6.pic
Loaded e:\games\civone\data\iconpg5.pic
Loaded e:\games\civone\data\iconpg1.pic
Loaded e:\games\civone\data\iconpg4.pic
Loaded e:\games\civone\data\iconpg8.pic
Loaded e:\games\civone\data\iconpg7.pic
Loaded e:\games\civone\data\citypix2.pic
Loaded e:\games\civone\data\sp299.pic
Loaded e:\games\civone\data\sp257.pic
Warning: Character width larger than bytes per character. (ID: 95, Width: 9)
Loaded e:\games\civone\data\birth0.pic
Loaded e:\games\civone\data\birth1.pic
Loaded e:\games\civone\data\logo.pic
Checking data files...
- Done, all files exist
Checking data files...
- Done, all files exist
Civilopedia: Preloading articles...
Loaded e:\games\civone\data\iconpg4.pic
Loaded e:\games\civone\data\sp299.pic
Loaded e:\games\civone\data\iconpg5.pic
Loaded e:\games\civone\data\iconpg8.pic
Loaded e:\games\civone\data\iconpg6.pic
Loaded e:\games\civone\data\iconpg1.pic
Loaded e:\games\civone\data\iconpg3.pic
Loaded e:\games\civone\data\iconpg2.pic
Credits: "A MICROPROSE PRESENTATION"
Loaded e:\games\civone\data\iconpg7.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Civilopedia: Preloading done!
Main Menu: Start a New Game
Map instance created
Generating map (Land Mass: 1, Temperature: 1, Climate: 1, Age: 1)
Map: Stage 1 - Generate land mass
Map: Stage 2 - Temperature adjustments
Map: Stage 3 - Merge elevation and latitude into the map
Map: Stage 4 - Climate adjustments
Map: Stage 5 - Age adjustments
Map: Stage 6 - Create rivers
Map: Calculate continent and ocean sizes
Loaded e:\games\civone\data\birth1.pic
Map: Creating poles
Map: Placing goody huts
Map: Calculating land value
Map: Ready
Loaded e:\games\civone\data\birth2.pic
Loaded e:\games\civone\data\birth3.pic
Loaded e:\games\civone\data\birth4.pic
Loaded e:\games\civone\data\birth5.pic
Loaded e:\games\civone\data\birth6.pic
Loaded e:\games\civone\data\birth7.pic
Loaded e:\games\civone\data\birth8.pic
Intro: "In the beginning,"
Loaded e:\games\civone\data\diffs.pic
Difficulty: Emperor (toughest)
Competition: 7 Civilizations
Loaded e:\games\civone\data\slam2.pic
Tribe: Aztec
Game instance created (difficulty: 4, competition: 7)
- Player 0 is Atilla of the Barbarians
- Player 1 is Caesar of the Romans
- Player 2 is Shaka of the Zulus
- Player 3 is Napoleon of the French
- Player 4 is Montezuma of the Aztecs (human)
- Player 5 is Mao Tse Tung of the Chinese
- Player 6 is Alexander of the Greeks
- Player 7 is Genghis Khan of the Mongols
Adding starting units...
48
15
4
17
32
34
76
Calculate players handicap...
Apply players bonus...
Turn 0: 4000 BC
Montezuma, you have risen
to become leader of the
Aztecs. May your reign
be long and prosperous.
The Aztecs have knowledge
of Irrigation, Mining,
and Roads.
Unhandled Exception: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
   at CivOne.Screens.CityName..ctor(String cityName) in e:\games\civone\src\Screens\CityName.cs:line 58
   at CivOne.Tasks.Orders.CreateCity(Player player, Int32 x, Int32 y) in e:\games\civone\src\Tasks\Orders.cs:line 112
   at CivOne.Tasks.Orders.CreateCity() in e:\games\civone\src\Tasks\Orders.cs:line 164
   at CivOne.Tasks.Orders.Run() in e:\games\civone\src\Tasks\Orders.cs:line 229
   at CivOne.GameTask.Finish(Object sender, EventArgs args) in e:\games\civone\src\GameTask.cs:line 75
   at CivOne.GameTask.EndTask() in e:\games\civone\src\GameTask.cs:line 90
   at CivOne.Tasks.Turn.Step() in e:\games\civone\src\Tasks\Turn.cs:line 32
   at CivOne.GameTask.Update() in e:\games\civone\src\GameTask.cs:line 49
   at CivOne.Screens.GamePlay..ctor() in e:\games\civone\src\Screens\GamePlay.cs:line 432
   at CivOne.Screens.NewGame.HasUpdate(UInt32 gameTick) in e:\games\civone\src\Screens\NewGame.cs:line 232
   at CivOne.Window.<get_HasUpdate>b__24_2(IScreen x) in e:\games\civone\src\Window.cs:line 108
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source, Func`2 predicate)
   at CivOne.Window.get_HasUpdate() in e:\games\civone\src\Window.cs:line 108
   at CivOne.Window.OnUpdateFrame(FrameEventArgs args) in e:\games\civone\src\Window.cs:line 318
   at OpenTK.GameWindow.RaiseUpdateFrame(Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchUpdateAndRenderFrame(Object sender, EventArgs e)
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at CivOne.Program.Main(String[] args) in e:\games\civone\src\Program.cs:line 36
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Game Start
Setting Loaded - FullScreen: 0
Setting Loaded - Scale: 4
Setting Loaded - AspectRatio: 0
Setting Loaded - DebugMenu: 1
Setting Loaded - CursorType: 0
Loaded e:\games\civone\data\sp257.pic
Warning: Character width larger than bytes per character. (ID: 95, Width: 9)
Loaded e:\games\civone\data\iconpg2.pic
Loaded e:\games\civone\data\iconpg3.pic
Loaded e:\games\civone\data\iconpg6.pic
Loaded e:\games\civone\data\iconpg5.pic
Loaded e:\games\civone\data\iconpg1.pic
Loaded e:\games\civone\data\iconpg4.pic
Loaded e:\games\civone\data\iconpg8.pic
Loaded e:\games\civone\data\iconpg7.pic
Loaded e:\games\civone\data\citypix2.pic
Loaded e:\games\civone\data\sp299.pic
Loaded e:\games\civone\data\sp257.pic
Warning: Character width larger than bytes per character. (ID: 95, Width: 9)
Loaded e:\games\civone\data\birth0.pic
Loaded e:\games\civone\data\birth1.pic
Loaded e:\games\civone\data\logo.pic
Checking data files...
- Done, all files exist
Checking data files...
- Done, all files exist
Civilopedia: Preloading articles...
Loaded e:\games\civone\data\iconpg4.pic
Loaded e:\games\civone\data\sp299.pic
Loaded e:\games\civone\data\iconpg5.pic
Loaded e:\games\civone\data\iconpg8.pic
Loaded e:\games\civone\data\iconpg6.pic
Loaded e:\games\civone\data\iconpg1.pic
Loaded e:\games\civone\data\iconpg3.pic
Credits: "A MICROPROSE PRESENTATION"
Loaded e:\games\civone\data\iconpg2.pic
Loaded e:\games\civone\data\iconpg7.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpge.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgb.pic
Loaded e:\games\civone\data\iconpgd.pic
Loaded e:\games\civone\data\iconpgc.pic
Loaded e:\games\civone\data\iconpga.pic
Loaded e:\games\civone\data\iconpgb.pic
Civilopedia: Preloading done!
Main Menu: Start a New Game
Map instance created
Generating map (Land Mass: 1, Temperature: 1, Climate: 1, Age: 1)
Map: Stage 1 - Generate land mass
Map: Stage 2 - Temperature adjustments
Map: Stage 3 - Merge elevation and latitude into the map
Map: Stage 4 - Climate adjustments
Map: Stage 5 - Age adjustments
Map: Stage 6 - Create rivers
Map: Calculate continent and ocean sizes
Map: Creating poles
Map: Placing goody huts
Map: Calculating land value
Map: Ready
Loaded e:\games\civone\data\birth1.pic
Loaded e:\games\civone\data\birth2.pic
Loaded e:\games\civone\data\birth3.pic
Loaded e:\games\civone\data\birth4.pic
Loaded e:\games\civone\data\birth5.pic
Loaded e:\games\civone\data\birth6.pic
Loaded e:\games\civone\data\birth7.pic
Loaded e:\games\civone\data\birth8.pic
Intro: "In the beginning,"
Loaded e:\games\civone\data\diffs.pic
Difficulty: Emperor (toughest)
Competition: 7 Civilizations
Loaded e:\games\civone\data\slam2.pic
Tribe: French
Game instance created (difficulty: 4, competition: 7)
- Player 0 is Atilla of the Barbarians
- Player 1 is Caesar of the Romans
- Player 2 is Hammurabi of the Babylonians
- Player 3 is Napoleon of the French (human)
- Player 4 is Montezuma of the Aztecs
- Player 5 is Abe Lincoln of the Americans
- Player 6 is Elizabeth I of the English
- Player 7 is Genghis Khan of the Mongols
Adding starting units...
37
4
39
37
93
35
147
Calculate players handicap...
Apply players bonus...
Turn 0: 4000 BC
Napoleon, you have risen
to become leader of the
French. May your reign
be long and prosperous.
The French have knowledge
of Irrigation, Mining,
Alphabet, and Roads.
Unhandled Exception: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
   at CivOne.Screens.CityName..ctor(String cityName) in e:\games\civone\src\Screens\CityName.cs:line 58
   at CivOne.Tasks.Orders.CreateCity(Player player, Int32 x, Int32 y) in e:\games\civone\src\Tasks\Orders.cs:line 112
   at CivOne.Tasks.Orders.CreateCity() in e:\games\civone\src\Tasks\Orders.cs:line 164
   at CivOne.Tasks.Orders.Run() in e:\games\civone\src\Tasks\Orders.cs:line 229
   at CivOne.GameTask.Finish(Object sender, EventArgs args) in e:\games\civone\src\GameTask.cs:line 75
   at CivOne.GameTask.EndTask() in e:\games\civone\src\GameTask.cs:line 90
   at CivOne.Tasks.Turn.Step() in e:\games\civone\src\Tasks\Turn.cs:line 32
   at CivOne.GameTask.Update() in e:\games\civone\src\GameTask.cs:line 49
   at CivOne.Screens.GamePlay..ctor() in e:\games\civone\src\Screens\GamePlay.cs:line 432
   at CivOne.Screens.NewGame.HasUpdate(UInt32 gameTick) in e:\games\civone\src\Screens\NewGame.cs:line 232
   at CivOne.Window.<get_HasUpdate>b__24_2(IScreen x) in e:\games\civone\src\Window.cs:line 108
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source, Func`2 predicate)
   at CivOne.Window.get_HasUpdate() in e:\games\civone\src\Window.cs:line 108
   at CivOne.Window.OnUpdateFrame(FrameEventArgs args) in e:\games\civone\src\Window.cs:line 318
   at OpenTK.GameWindow.RaiseUpdateFrame(Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchUpdateAndRenderFrame(Object sender, EventArgs e)
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at CivOne.Program.Main(String[] args) in e:\games\civone\src\Program.cs:line 36
SWY1985 commented 7 years ago

I could reproduce this by starting a game with any player but white, where the AI players already created cities. There was a null reference issue, it has been solved.