Currently Online

Latest Posts

Topic: Game crashes with custom tribe

Tibor

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

AI (both old and new If it make it into trunk ever) are generally tribe-agnostic, only this single place - calculation of soldier strength is dependant on the tribe. But moving it out of AI code is doable. What would be challenging the calculation itself - how to calculate soldiers with various experiences and attributes to a "standardized units of measure". AI is doing it but I am sure a lot of experienced players would disagree with the way how it is calculated.


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

I'll have a look at the functions first though - looks like some of the constants in the formulas can be derived from the soldier config. I noticed that Atlanteans' values are calculated with =, the other tribes' values with +=. Bug?

ETA: Barbarian attack is the only odd man out, it assumes 700 instead of 850 for increase_per_level. I expect that this is caused by changes in the config that weren't reflected in the AI. So, all values can be deduced from the config, no Lua needed face-smile.png

Merge request: https://code.launchpad.net/~widelands-dev/widelands/ai_for_mods/+merge/315311

Edited: 2017-01-22, 13:45

Busy indexing nil values

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

This has been fixed in r8255. Thank you for reporting the bug, and let us know if you have any more issues face-smile.png


Busy indexing nil values

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

Hello, I have tried to get my custom tribe to run under debug-build bzr8264. If you´re interested: here are some screenshots of my tribe (most buildings don´t have their own graphics yet). But after some time of playing, the game crashes with the debug output:

widelands: ../src/economy/idleworkersupply.cc:89: virtual uint32_t Widelands::IdleWorkerSupply::nr_supplies(const Widelands::Game&, const Widelands::Request&) const: Assertion `req.get_type() != wwWORKER || worker_.owner().tribe().has_worker(req.get_index())' failed. Abgebrochen (Speicherabzug geschrieben)

The gdb stacktrace wasn´t any help...

Is this problem caused by my tribe or is it a bug in the source code?


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

Have you made sure that all workers that are used by a tribe's buildings have been added to data/tribes/<tribename.lua>?

So, this is going to be a modern tribe then? face-smile.png

Edited: 2017-01-27, 15:18

Busy indexing nil values

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

It was the new recruit system that did it, I wrote the .lua file when I was still using release-19 and didn´t include recruits. It works fine now! I wonder how long I need to test it before the next error pops up...

The 'Civilians' are supposed to be a highly advanced civilisation which combines modern technology ('Plastic Factory', 'Power Station', ...) with the 'older' world of Widelands. They´re quite strong – they can even build military buildings on mountains and train to some high levels. If everything works after some more testing, I´ll post a link so everyone who´s interested can download and test the 'Civilians' tribe.


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

I'm looking forward to it! face-smile.png


Busy indexing nil values

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

I have now added the download file to dropbox. Click here to view some more screenshots and download the tribe. There´s a readme file with information on how to install the tribe and more information on the 'Civilians', as I have decided to call them. Very few graphics have been drawn by me – mostly, the buildings and workers use graphics of the barbarians; some wares have strange icons. I will replace everything with new graphics eventually.

I didn´t test very much yet, but I don´t expect any more problems. I´d be pleased to hear some opinions – positive or negative, I´m open to criticism. I do hope you like my tribe!


Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2017-01-29, 17:52

Nordfriese wrote:

I´d be pleased to hear some opinions – positive or negative, I´m open to criticism. I do hope you like my tribe!

What should the package be compatible with? I tried both current trunk and b19, but got script errors with both.

Edit: Military sites build on mine slots probably break design ideas behind many maps.

Edited: 2017-01-29, 17:54

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

Custom tribes don´t work with build 19. I tested it on debug-build bzr 8264. The first version I uploaded contains a couple of bugs, sorry. I have just uploaded a new version that should fix those. I´m not sure about the Mountain Stronghold yet – I created it to make up for a strategical disadvantage with Quarries and Lumberjack´s Houses, but I´m thinking about removing it later. I hope the new version works now. If not, please say what errors occur – I got a lot of errors in the beginning, but the latest version seems stable. I apologize for the inconvenience.


Top Quote