Currently Online

Latest Posts

Topic: Is there a list of units/names?

Zagdil
Avatar
Joined: 2020-05-28, 09:01
Posts: 6
Ranking
Pry about Widelands
Posted at: 2020-05-28, 11:26

Hi,

I'm Johannes, I found this game one week ago. I used to play around with Map Editors of OG Settlers2 and 3 and an awful lot with Starcraft:Broodwar and Warcraft3. But I have no actual experience with coding since the later two of those had powerful UIs for doing simple scripts. However I'm trying to fool around with some maps.

I was able to find the scripts for campaign maps and get the basic idea behind it and feel confident I would be able to copy&paste together what I'm trying to do. Just got one little problem: I can't find a table of names for all the buildings and units in the game.

For example:

p1:allow_buildings{
      "empire_well",
      "empire_farm",
      "empire_brewery",
      "empire_vineyard",
      "empire_winery",
      "empire_mill",
     ....

If I wanted to allow more buildings (but not all of them) I would need to add "empire_trainings_camp" to the string (right term?), but is "empire_trainings_camp" a name the game would recognize or is it instead "empire_trainingscamp" or "empire_training_s_camp"? I guess I could dig through other maps and look it up or use trial and error, but things would be much easier if there was some sort of list. Same goes for the Soldiers.

soldiers = {
      [{0,0,0,0}] = 30,
   }

I recon, this makes 30 soldiers without upgrades.

soldiers = {
      [{1,0,0,0}] = 2,
   }

and this makes 2 soliders with 1 Upgrade. But which upgrade is it? Are there some general guidelines for naming conventions? Also the upgrades probably need to match the tribe I'm giving them to? So I can't give Defense to a Barbarian or even create a 5,5,5,5 soldier.

PS: My first playthrough was on Build20 and now that I've upgraded: I'm loving the improvements I've seen so far.

Edited: 2020-05-28, 11:34

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 900
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-05-28, 11:36

Hi Zagdil and welcome to the forums face-smile.png

You can find a list of all units here: https://www.widelands.org/encyclopedia/
Just click on the link for the desired tribe and then activate the checkbox "Show names for scripting".
The names can also be found in the unit definitions in data/tribes/buildings/<typename>/<tribename>/<buildingname>/init.lua.

The values in the soldier descriptions are Health,Attack,Defense,Evade level (in this order). They all need to be within the tribe-specific bounds. This is also documented here: https://www.widelands.org/documentation/autogen_wl_map/#wl.map.HasSoldiers.get_soldiers

If you have more questions you're welcome to ask face-smile.png


Top Quote
Zagdil
Avatar
Joined: 2020-05-28, 09:01
Posts: 6
Ranking
Pry about Widelands
Posted at: 2020-05-28, 11:48

Thank you!

Wow, that was quick and surprisingly obvious, guess I was just looking in the wrong places -.-'


Top Quote
Zagdil
Avatar
Joined: 2020-05-28, 09:01
Posts: 6
Ranking
Pry about Widelands
Posted at: 2020-05-29, 14:14

I tried to do some tweaks to the second Empire scenario.

I already felt that this map was a bit too boring with the Barbarians being total pushovers. On the 3rd scenario on the other hand you got your hands full with seafaring and as an afterthought are told to build training sites, that are hard to supply on an island map with scattered production. Even if you get the training sites, you don't even really need them, since the enemy in scenario 3 only has evade and can be met with brute force just as well. Also with b21 scenario 3 has still plenty to teach with the new ferries, ports, colonies and cloth production. It also already nicely introduces Barriers and Outposts, so I think there is no reason to unlock them in scenario 2.

I figured it would be a better progression, to give the player in scenario 2 a bit of a challenge and also teach the importance of upgrades. So I added a bit of extra storyline for the map and gave the enemy 2 supersoldiers 3.5.0.0. and 0.5.0.2 named Olaf and Falo, but also made him unable to attack.

When playtesting I couldn't manage to luck my way through to those 2 units. As soon as you get some minor upgrades though, they are possible to beat in numbers. The player gets a calm enviroment to get familiar with the training sites and sees the devastating effects of upgrades first hand when the AI eats the first wave of 0,0,0,0 soldiers.

I initially intended to unlock gold and trainings sites when the first attack is launched, but couldn't get it to work, so I resorted to copying the building placement check and adjusted the dialogue. Cloth production is not unlocked, but the player should have a healthy stock of cloth for buildings and some upgrades.

My main reason for doing was practice. Playtested the final version twice and tried some different upgrade and amount of soldiers combinations. I think it's still very beatable, if you get lucky you could do it with just EV1/2 upgrades.

Anyone interested?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 900
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-05-29, 16:31

The first two empire missions are aimed at complete beginners so they shouldn't be too hard. I still remember how I was spectacularly defeated by the AI in that mission when I played it for the very first time face-grin.png

But with the new scenario difficulty feature, why not? Currently the first two empire scenarios (and also both barbarians and perhaps atl01) are aimed at beginners and are really boring for advanced players. We could have a second difficulty level that adds more challenges to these scenarios so they are still interesting for advanced players. For this I really like the idea of changing the scenario as you described face-smile.png

I initially intended to unlock gold and trainings sites when the first attack is launched, but couldn't get it to work,

Discovering attacks is tricky, we have no pre-made code for that. Perhaps you could try checking for enemy soldier movements in a certain area, like this:

function wait_for_attack()
for x = …,… do
   sleep(100)
   for y = …,… do
      local f = map:get_field(x,y)
      if f.owner == p2 then
         for i,bob in pairs(f.bobs) do
            if bob.descr.name == "empire_soldier" then
               return
            end
         end
      end
   end
end
end
Edited: 2020-05-29, 16:35

Top Quote
Zagdil
Avatar
Joined: 2020-05-28, 09:01
Posts: 6
Ranking
Pry about Widelands
Posted at: 2020-05-29, 17:21

The main reason for doing it was for getting a feel for the LUA, but I would be very happy if someone thinks its good enough to be in the game face-smile.png

I thought about it not being too hard for newer players. Thats why the AI can't attack. I'm a big fan of show, don't tell. The player is confronted with a solid brick wall and sees the challenge of trained soldiers. In my opinion S3 isn't doing a good job teaching you the training facilities. I played Settlers 2 a lot back in the day, but still struggled to get them to run properly until my second attempt at S4. I know it was not unusual for Settlers2, to make maps you can't really finish at first try, but from a level design perspective it's not great when your player sinks hours into a level and has to restart.

Facing off experienced soldiers is just another checkmark moved from one scenario to the other. Also I could lower the upgrades a little bit more, so players could power through without upgrades. Besides the current missions don't explain the new Attack UI. A roadblock like this could incentivise a player to use it (so the weaker soldiers don't get thrown into the meat grinder) without any boring explanation. I tried it on the my version and it worked pretty good. It's just a more safe learning environment than 3&4.

It depends on what you want the player to know going into S3. It definitely would make a cool difficulty setting.

That code looks a bit over my head, I was hardly able to copy&paste my way through objectives and dialogue face-grin.png Also I think it would make more sense to check for player soldiers as the AI soldiers might wander through the area by occupying a sentry. It's a workable version now. Only thing I would add are some camera pans for the messages.

Is there a way to upload a scenario? https://www.widelands.org/maps/upload/ doesn't want the wmf folder or the zip Do I need to convert something back?

Edited: 2020-05-29, 17:24

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 900
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-05-29, 17:56

Is there a way to upload a scenario? https://www.widelands.org/maps/upload/ doesn't want the wmf folder or the zip Do I need to convert something back?

The website only accepts compressed maps. So you'd need to ZIP-compress the .wmf folder and upload the resulting file (after renaming it back to .wmf).

Another way would be that you create a fork on GitHub with your changes (see https://widelands.org/wiki/GitPrimer/ in case you're not familiar with git) and incorporate your changes there. If they are to become part of the official game that will have to be done via a pull request on GitHub anyway.


Top Quote
Zagdil
Avatar
Joined: 2020-05-28, 09:01
Posts: 6
Ranking
Pry about Widelands
Posted at: 2020-05-29, 19:11

Ah I didn't know I need to change my W10 settings. :) It worked thanks. I'm trying to find a friend for a noob-test.


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 1687
Ranking
One Elder of Players
Location: North of Germany
Posted at: 2020-05-29, 22:21

@Zagdil: I've seen that you just posted your 5th post, this might be another reason why you could not upload anything. Now it should work, the 5th post unlocks uploading...

Zagdil wrote:

but from a level design perspective it's not great when your player sinks hours into a level and has to restart.

I agree!


Top Quote