Latest Posts

Topic: Game crashes with custom tribe

Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-01-17, 18:16

Hello, I have created a new tribe for Widelands and now the game frequently crashes during the game. In the beginning I got an error message when I tried to start the game with my new tribe, but I fixed all mistakes and noew the game is playable. I have started a test game with my tribe and was rather successful, but after about an hour of playing, the game crashed for no apparent reason. This never happened until I started to experiment with custom wares/workers/buildings. I´m running Build 19 (release) and the window simply closed with no error message. Can anyone please give me some general advice what causes the problem and how to solve it?


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-01-17, 18:46

Hi and welcome to our forums face-smile.png

Would be nice to see some screenshots of the new tribe face-wink.png

Regarding to your problem:

  • Which OS do you use?
  • Try to get a debug build (instead of a release build). A debug build may give more output. See: Unofficial development builds
  • Depending on your OS see also the last two entries in our Technical Faq

Please provide as much information as possible face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-01-17, 19:29

I´m using Ubuntu Linux 16.10. I managed to get debug output and it ended with the following lines:

Fatal exception: [/build/widelands-iBrI7k/widelands-19/src/logic/map_objects/tribes/productionsite.cc:201] trainingsite has no program 'upgrade_soldier_evade_2' Game: Writing Preload Data ... Speicherzugriffsfehler (Speicherabzug geschrieben)

I realized there was a simple spelling mistake (I spelled the program "upgrade_soldier_evade_2" with a 3 instead of a 2), but after I corrected this, the game still crashes with the same message.

I´m afraid screenshots wouldn´t be too impressive yet... I mostly copied graphics from the other tribes; I want to fix those crashes before I improve their looks.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-01-17, 19:35

Does the game still crash when you start a new game rather than loading a savegame? The wrong data might already be part of a savegame.


Busy indexing nil values

Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-01-17, 19:52

Yes, it works now. There are still a couple of other issues, but I´ll probably be able to remove those without help. Thanks!


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-01-17, 22:06

If you are using linux (as you are) I suggest make yourself familiar with gdb, in fact the syntax is trivial and it can provide real backtrace, that can be used by developers. I can provide notes how to use gdb. You will need like 3 commands, not more....


Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-01-21, 11:36

After solving a number of trivial issues, I found a problem that seems hard to solve: I have my "SuperTribe" attack an enemy tribe´s military site. Shortly after my soldiers conquer the building, the game crashes with the following debug error:

Fatal exception: [/build/widelands-iBrI7k/widelands-19/src/ai/defaultai.cc:5317] AI warning: Unable to calculate strenght for player of tribe supertribe

I tried to use gdb and it lead me to the following source code line in defaultai.h:

enum class Tribes : uint8_t { kNone, kBarbarians, kAtlanteans, kEmpire };

Can this problem really be solved only by changing parts of the source code or are there data files which can be edited, like I did to solve all the other problems? I didn´t find anything that would make it work...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-01-21, 12:28

I have created a new branch that should solve the issue: https://code.launchpad.net/~widelands-dev/widelands/ai_for_mods

You will need to compile this yourself

https://wl.widelands.org/wiki/BzrPrimer/

https://wl.widelands.org/wiki/Building%20Widelands/

Let us know if this works for you, or if more changes are needed.


Busy indexing nil values

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-01-21, 21:12

This is but very ugly hack and should not get into trunk. The proper way is to add kBlabla into enum, and add own block of code with own constants into function for calculation of strength.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-01-21, 21:47

I'm wondering whether we can shift any tribe-dependent stuff to Lua in the future? I don't know how it affects your new genetic AI design though.

Edited: 2017-01-21, 21:47

Busy indexing nil values

Top Quote