New Settlers era

It's not easy creating an entire faction or era. Post your work and collaborate in this forum.

Moderator: Forum Moderators

shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

I uploaded my modifications to addons server as New Settlers lua mod 2.99.0. It was based on 2.2.0.5.7.7.8 but I merged both 2.2.0.5.7.8 and 2.2.0.5.7.9 to my local development branch.

Game play changes include:
- Village upgrades and conversion follow build rules
- Ships have changes stats and they can now advance to next level
- Research speeds have been modified making it harder to research harvest improvements
- Ranged attacks can't shoot over impassable hexes
- Ranged attacks can now counterattack even if there is adjacent enemy
- Ranged attacks now select automatically the best weapon based on enemy
- Leadership affects ranged attacks
- Walls and towers don't give increased hitpoints

UI changes:
- Boat boarding and unloading follow now similar rules as ranged attacks
- Improved indicators for transportation and ranged attacks

MAP changes:
- Added modified version of mainline Team Survival
- Small Europe map was manually balanced. It should be playable without setting adding rough terrains randomly
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: New Settlers era

Post by enclave »

Hi Shrieker1, thats great news!
I will be happy to watch and follow how your add-on is developing!
Many add-ons have their clones and it's always been nice to watch the differences etc, for example conquest, conquest+, conquest- :) WC II etc etc etc
I may steal something nice from your add-on in some future, who knows :)

Just to let you know why your add-on will never be a part of my New Settlers, at least in the way that you were offering it to be.
1) Your level of coding is much above my level of coding and 2 people like that just phisically can not create a mixed code together.
1.1) If we tried to make it work then I would not understand your codes inside my codes and would not be able to make changes easily.
1.2) imagine after 6 months you had a lot of work and would have to leave wesnoth for some time, look point 1.1, - it would mean that I would be left with broken code that I can not modify, make changes, so would not be able to fix the bugs or update with new features, my todo list is thousands of lines, enough for whole my life to implement into NS, but everything would stop from the moment you leave the project.
1.3) it happened to me at least once in my life, when you allow somebody else to control something that you were building, it just gets destroyed.
2) I disagree with some of your ideas and while you may find them great or a total breakthrough, I have opposite thoughts, which is normal.. we are all different.
2.1) Because I have been watching this mod growing for about couple of years, I have some clues on what is working and what is not.
2.2) Because I have future ideas on my todo list, regarding currently implemented ideas and if I change current things somewhere it will cancel the other potential improvements based on these current things. Example is, - I have future ideas on ranged attacks, that's why units cant shoot if enemy adjacent. While I could always create an option for host to choose what he prefers more, block shooters or not, if I really felt that it is exactly what is worth my time, instead of some other valuable feature from my thousands of lines of my todo list.
2.3) Your ideas are based on survival maps, I watched a lot of 1v1 games and New Settlers is not only a survival mod, every day it used to have some 3 1v1 games where it was important for walls and towers to give more benefits than just resistances. Also a thing which could be adjusted in prestart options by a host if he would prefer so, instead of forcing the change without discussing it with players who spent a lot of time with NS.
2.4) I may just not like them, for things not related to point 2.1, 2.2 and 2.3, this is my baby and there is no reason for me to agree with you, I'm not trying to tell you how you should refurbish your house or change your garden, what color carpet you should have or how many taps of water and what is the perfect temperature and humidity in the bedroom :)
3) Maintaining add-on is a big work.. It's not just to appear out of nowhere, change things and let it be.. It involves advertising, watching games, making changes, trust me if you disappear from Wesnoth for some time your add-on will most probably be forgotten too, and nobody will move it into 1.14 when everyone moves to another server. And I can not accept all of your ideas and most importantly your codes into my NS for a reason listed in point #1, I can see the future of it very clearly. The only way we could work together is if you requested a feature and I would implement it my way, or if you showed me your code and I would accept it as readable and added it my way, or if I asked you to write a code for a feature, or if you created scenario where all your codes would be inside the scenario and not affect mainline code while I could make some changes in mainline to not interfair with your scenario codes. I'm quite an understanding type of person, I was always trying to fulfil my player's requests when they asked me something, I would definitly find time to change everything what you thought needs changing, at least as an option for a host to decide, but I can not accept somebody to change my codes in his own way even if they are 100 times more efficient, it would be the day when new settlers died.

If i had all time in the world it might have been easier to rewrite NS from scratch, but I have work, life and other things to code in my free time, not only new settlers or not only wesnoth. That's why in new settlers some changes may look needed but I don't change them, because I feel that other things on my todo list are currently more important, or maybe i'm not sure what exactly needs to be changed and how to balance things or whether it would really be a better way than the current one to justify the time spent, or maybe I'm just in the mood to code something else right now..

I hope you understand my reasons better now. I'm really happy for your branch of new settlers, I wish you best of luck and hopefully people will not be confusing these 2 versions when they want to download some particular one, that's my only tiny concern. Thank you very much for all the bugs that you helped me to fix!
I also started working on it after orginal developer left.. It was once a Dovolente's Settlers from 1.10 server as part of his Dov XP mod, you may have a look at it if curious. I liked it very much when I found it and felt that it needs changes to become playable. I never coded wesnoth before, so that's how New Settlers appeared and it was my first wesnoth project, that's why code is so messy/differenciated and complicated to read, I was learning new things through time and the code reflects it all.

So, congratulations on your New Settlers lua mod 2.99.0.!!!
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

enclave wrote: 1) Your level of coding is much above my level of coding and 2 people like that just phisically can not create a mixed code together.
1.1) If we tried to make it work then I would not understand your codes inside my codes and would not be able to make changes easily.
There is good reason why big projects have strict coding style requirements that everyone follows.
I try to create code that would fit to most coding styles without major issues.
Also commenting code helps. I try to remember to comment the code but I know I still do it too rarely.

Points why current NS code doesn't pass those coding style requirements.
  • Code and data is mixed (Separated code is easier to read and separated data is easier to extend and add)
    I think reason for this is wml+macro preprocessor makes it relatively simple way of starting coding for Wesnoth
  • There is copy-paste code (duplicate code makes it harder to find bugs and easier to cause new ones)
    I know copy-paste coding feels easy. I often notice trying to do it. But in long run maintaining copy-paste code is much harder than structuring code to avoid duplicating code.
  • Code indention is quite random (Indention makes code and data much faster to search for relevant bits to read)
    Often editors designed for programming do good job automatically indenting the code. But even my editor (vim) doesn't have good indent module for wml. So I ended up manually indenting everything. But manual indention has descent support in the vim so it was fairly easy for me to do manually. But I don't think vim would be a good editor for you. It has very steep learning curve. But I did learn it long time ago and I like how I can customize it to work the way I want. If I was going to write a lot wml code then I could take a bit time and write an extension to handle indention automatically.
  • You are using directory structure as version control (normal way is to use tool for version control and structure files into directories based on module/package that it belongs to)
    I learned version controls only later. I still think that cvs felt horrible and I didn't actually want to use it for anything. But soon I met subversion and it felt much easier to use and useful tool. I even started keeping my own local subversion server for my personal projects. After that I have moved to using git for everything if possible. Git offer much more features than svn but there is a lot more to learn before one can use it effectively. I haven't ever tested tortoise git but my guess is that it could hide some of complexity from git making it easier to use.
I first converted build system using wml to try to fix above issues in coding styles. That is stored in build subdirectory. But I still felt that wml is not a good programming language. It is more like data declaration language that is extended to include coding features. That made me learn lua and convert other core parts to lua. But I still tried not to make game play changes unless I felt they would improve game play even for human vs human play. But of course there can be some unintended changes.

I don't think that my code would be too advanced for you. It is just a code base you are not familiar with so reading it is very hard because you don't know what most of functions and variables actually do. But with better commenting and documentation from me it should be something that you can understand and modify without problems. At least some parts of your most recent changes show me that you have advanced enough understanding of programming. The changes that you have made aren't simple and most of addons don't do anything similar.
enclave wrote: 2.2) Because I have future ideas on my todo list, regarding currently implemented ideas and if I change current things somewhere it will cancel the other potential improvements based on these current things. Example is, - I have future ideas on ranged attacks, that's why units cant shoot if enemy adjacent. While I could always create an option for host to choose what he prefers more, block shooters or not, if I really felt that it is exactly what is worth my time, instead of some other valuable feature from my thousands of lines of my todo list.
True. All modules must work well together.

I actually kept limit that offensively ranged attacks are still blocked by enemies. I only removed blocking from defense. As I earlier pointed out it can be exploited to kill strong ranged units for free. I feel that exploitable rule needs to be checked if it needs a change. To me the simplest fix for exploit is to remove the adjacent enemy blockage when defending with ranged.

A bit more complex idea could be that adjacent enemy would reduce attack damage when defending. But completely losing counter attacking ability with adjacent enemy feels somewhat wrong with current values. It wouldn't be such a big issue if ranged attacks were clearly weaker than melee attacks. Wesnoth has about equal damage potential for both units which makes it important that both have equal defensive properties.

Another more complex solution that I can think of would be having unblocked ranged units counter if any are in range. Then effective ranged attack defense would require careful formation setup to allow ranged units defend front line units from behind them. But I would have to test that before I would have any idea how it affects game play balance.

What kind of solution you would like?

I agree that this shouldn't be something that host can select.

I think that the some of preload options could be removed or merged to more generic ones. One idea would be to have a single host controlable setting for ZA settings. There would be one drop down menu with difficulty levels. Then all current internal settings would be set based on difficulty setting and maybe based on some map parameters if exact same settings don't work well for everything. example Isar's cross might need much less initial zombies because players are very close.
enclave wrote:2.3) Your ideas are based on survival maps, I watched a lot of 1v1 games and New Settlers is not only a survival mod, every day it used to have some 3 1v1 games where it was important for walls and towers to give more benefits than just resistances. Also a thing which could be adjusted in prestart options by a host if he would prefer so, instead of forcing the change without discussing it with players who spent a lot of time with NS.
I mostly dropped hp bonus because I felt isn't working perfectly and is a bit redundant.

The additive hp bonus is unbalanced for different units. Changes to current hp for harmed units would also need some improvements like I have said earlier. It is possible to convert hp bonus to multiplicative is possible. But my next point explains why I left the hp bonus out completely

hp and resistances are basically same thing as a bonus. Of course they interact a bit differently with healing but that is only difference between adding hp or resistances. My view on this is that only giving resistance bonuses it keeps code&data simpler and easier to balance for different units.

I can see why defensive buildings must be very strong. New Settlers needs much more static border than standard Wesnoth game play but units are pretty much same as standard. That makes units favor mobile warfare that can be bad for resource collection.
I haven't actually had any balanced human vs human matches. All human vs human games that I have played have resulted me gaining huge economic advantage making battles too unbalanced. Even hugely strong walls couldn't stop someone with over two times more income. That is reason why I wanted to tweak harvest research speeds. I feel that they currently give too much bonuses for too little cost.

Civilization is trying to solve making money with money issue by giving big penalties for growing quickly. Solution is expensive military maintenance and minor penalty to research speed per city. That makes growing too fast very expensive because new areas produce much less than old areas but they still require protection. Civ 5 made the limit softer than older version after splitting gold and research economy to separate systems. In older Civs I have managed to hit the growth limit so hard that my research stopped completely.

This actually makes me understand why ranged strikes were reduced after moving too much. It tried to make games more static than standard Wesnoth. I guess I was thinking there too much in terms of standard Wesnoth game play that heavily builds around ideas that the best defense is mobile offensive strength that can over power enemy in one part of map without losing more in other parts of map. If more static game play is better then I think all units could use some tweaking. They probably should have less movement and mode HP/resistance compared to their attack.
enclave wrote:3) Maintaining add-on is a big work.. It's not just to appear out of nowhere, change things and let it be.. It involves advertising, watching games, making changes, trust me if you disappear from Wesnoth for some time your add-on will most probably be forgotten too, and nobody will move it into 1.14 when everyone moves to another server. And I can not accept all of your ideas and most importantly your codes into my NS for a reason listed in point #1,
I understand. It can be hard to read and learn new code structure. Even if it would be easier to maintain and extend later on. My code is aiming to be easy to maintain and extend later. As my earlier point I tried to separate data and code. Also making data private to specific module makes it easier to change later if new features requires data structure changes to work well.

I guess I should improve comments and write a description how code works and how modules interact. That would maybe make it easier for you to understand. But as I said earlier I'm not good at commenting and documenting the code when I write it. I will try to improve comments and then you can check if it helps understanding how it works.

Then the last but very important point: I would have to convert back any game play changes that you think are wrong. I just wanted to experiment with rules that I felt could improve game play.
Some of changes were part of reducing code duplication (like merging village upgrades and conversion to build system). It hopefully also shows how the changed code structure is very easy to extend with new features. Village conversion and upgrades are now only a few entries in build/description.cfg instead of completely separate system.

I didn't actually think you would take over 2.99.0 or any version soon after. There is still quite some work until I have managed to implement everything But maybe 3.0 could be a version when I have managed to implement all game play rules according to your wishes. Also document and comment code well enough that you can understand it. At that point I could handle over the control for you so you can have full control over what goes in and what doesn't. I'm just trying to follow rule "release early and release often".
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

I uploaded some updates.

I tried to add indicators to enemies that will counter a ranged attack. But I'm not entirely happy with the image that I managed to make for it.

Code: Select all

local bowhalo = "items/bow-crystal.png~BLIT(projectiles/spear-ne.png~FL(horiz)~SCALE(40,40),6,7)"
local enemybowhalo ="misc/blank-hex.png~BLIT("..bowhalo.."~SCALE(60,60),6,6)"
That is the image path I used to combine bow-crystal.png and spear-ne.png trying to make it indicate this enemy would shoot back. I feel it could be better but I just can't figure out what is the exact problem with that on top of enemy. I guess I will have to return to tomorrow to see if fresh eyes can improve it.

But I have a few questions:

* Should peasants, goblins and elvish civilians lose their build and gather abilities when leveling up?

They currently keep their abilities even after level up.

* Should Troll whelp lose research ability if it level ups to Troll or Rocklobber?

I added code to remove the research ability.

* What is interest for other terrains versus basic only terrain?

My current version is still missing proper support for basic terrain variant. My first aim was to make the other terrain to work first to make work. Then later on I was planing to add support for basic terrain option. Lua init code just has to replaces terrain filters and both settings should work fine. I have now started wondering if that option could be removed from host settings to make the game setup simpler.

But I just pushed 2.99.2 to addons servers it includes fixes for bugs introduced in 2.99.0 and some UI improvements.
- Added an indicator for units that will counter attack if using extended ranged attack
- Added an indicator to display where offensive ranged attack won't be possible when ranged
unit is selected for a move
- Fixed unit research cost to match existing values
- Added missing Elvish Champion recruitment option
- Fixed orc research
- Fixed zero research mode
- Fixed science project completion
- Fixed unit filters preventing workers and mounted units from fortifying
- I added to the name "(experimental changes)" so players won't confuse it to be game play wise stable or balanced.
User avatar
Zap-Zarap
Posts: 159
Joined: March 16th, 2015, 2:18 pm

Re: New Settlers era

Post by Zap-Zarap »

Hello enclave and shrieker1.

I am still dreaming my dream of a (New?) Settlers SP-campaign.
And, yes, i somehow feel the need of restructuring the code, like shrieker1 does.

I wouldn't like to start a third fork of New Settlers for my project, but maybe that will be necessary to do. Confusion (for players) is very probable then (just as enclave said). This is a bit problematic, i think.

How could brainpower and development effort be united, at least partially?
I like beavers.
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

Zap-Zarap wrote:How could brainpower and development effort be united, at least partially?
Same way like Wesnoth core. We would need a code repository in a site like github.
User avatar
Zap-Zarap
Posts: 159
Joined: March 16th, 2015, 2:18 pm

Re: New Settlers era

Post by Zap-Zarap »

You're right, i think. I've heard a lot about git, from many people using it, but i never tried to use it myself so far.

I am still at the very beginning of learning Lua/WML, you, shrieker1, seem to know a lot already, which makes me a little afraid. :) Just like enclave said before, i'll probably not understand, what you are doing.

But some of the things you said above i did understand, i often thougt the same, when reading enclaves's code. E.g. concerning directory structure and duplicate copy/paste code. And options for terrain. And other stuff. Like "code and data is mixed, but shouldn't be". All true somehow.
I like beavers.
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

Zap-Zarap wrote:I am still at the very beginning of learning Lua/WML, you, shrieker1, seem to know a lot already, which makes me a little afraid. :) Just like enclave said before, i'll probably not understand, what you are doing.
If you don't understand what my code is doing then you can blame me. I should make it easy enough to read that it should be enough to look LuaWML documentation and my comments to understand what is happening. I'm not the best at writing code comments so there is some parts that are missing important comments. I try to improve comments all the time too. If you try to read the code and don't understand it I want to hear about problematic part so I can improve comments.

I upload a new version that has some basic explanation how lua loading happens in core/load_lua.cfg and core/main.lua. Other important change in 2.99.3 is that there is now income indicators when selecting a worker. Too bad that change was a bigger refactoring so I may have broken something. I'm again a bit unhappy about my first indicator icon attempt. Specially forest and wood icon have very similar colours making indicator practically invisible.

PS. I added [ns_fire_event] tag that automatically forwards all event parameters (x1,y1,weapons etc). That could reduce a few variable parameters to existing function like event handlers. But I didn't try to remove parameters that aren't any more required. I think that tag can be useful for wml code trying to avoid wml duplication using events instead of macros.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: New Settlers era

Post by enclave »

Hello Shrieker and Zap-Zarap!

I have missed this conversation, so a bit hard to do quote-reply now.. Will try anyway :D otherwise I will forget to mention half of it..
There is good reason why big projects have strict coding style requirements that everyone follows.
That's one of the problems, I'm not ready to learn strict coding style or anything similar for something that I do for leasure and relaxation..
I understand that my codes in NS don't pass even a basic level of how things should be.. And I also often have difficulties because of that. I plan to restructure everything at some point, when I'm ready for it.. And it's not before humans start to follow same coding style as orcs and elves, with similar macros, which I will also start changing into lua at some point.
I first converted build system using wml to try to fix above issues in coding styles. That is stored in build subdirectory. But I still felt that wml is not a good programming language. It is more like data declaration language that is extended to include coding features. That made me learn lua and convert other core parts to lua.
Current NS is slow in many places because of WML speed, but nothing is too major, while of course it could be much better with lua.
The hugest current disadvantage is the save file size and delay before turn begins due to most probably WML research code in both cases.
Your version of NS is taking around 5-10 times less space when you save game, which is great. Means I can achive similar size in future updates.
From the other side, again, it's not critical.. my NS savefile size would be nearly on the border of maximum allowed to be able to reload the saved game, which is not too bad, as long as everything works, there is no major problem..
Another more complex solution that I can think of would be having unblocked ranged units counter if any are in range. Then effective ranged attack defense would require careful formation setup to allow ranged units defend front line units from behind them. But I would have to test that before I would have any idea how it affects game play balance.

What kind of solution you would like?
in my more or less ideal point of view (which I'm not 100% confident) the unit NS_ranged attack and defense would be halved or even 3 times lowered if there is enemy unit adjacent, while "wesnoth" style ranged attack would be deleted completely. Who knows if this would be the best way.. I don't, it's just my point of view.
For this reason I don't understand why would you want to stick to my point of views or even listen to them, you have many nice ideas, you have right skills and time to make them, I have 100% nothing against you making your branch of New Settlers as long as you remove my nickname from it and put yours instead to avoid confusions for others on which version they should download or what exactly they are currently playing.
I haven't actually had any balanced human vs human matches. All human vs human games that I have played have resulted me gaining huge economic advantage making battles too unbalanced. Even hugely strong walls couldn't stop someone with over two times more income. That is reason why I wanted to tweak harvest research speeds. I feel that they currently give too much bonuses for too little cost.
the balance in new settlers is a huge problem.. balance everywhere.. in new settlers is a complete nightmare. All the time I was trying to change things and it's still far far away from being right.
Problem #1: economy matters more than anything.. Tried to solve it with barracks or with larger distance between villages or with 1 recruit per turn per village or with walls that need fortifying instead of walls-units (walls-units were helping economy to win strategy even more, 1 player could build 50 cavaleries and send it to another player who has 0 military units but stronger economy, and would nearly 100% lose because he would just use peasants to build 1000 walls and stop everything, summon 30 units to counter within just 1 turn.. and game over) and other rules (peasants have weakness to cavs for same reason, they were easily stopping any rush).. Nothing is ideal.
I assume that either adding gold or food support per each military unit or any unit would help.. or increasing the cost of peasants some 3-4 times would help (which would not make logical sense and maybe would not solve anything either, just slow game 3-4 times instead.. it all needs time and coding to change and experiment.. and probably would also not work perfect, like everything else I tried). I mean these 2 might be the most efficient, but not the only ones possible...
Problem #2: if 2 guys with same economy meet each other they would create so many units that none of them would be able to advance even 1 hex, which makes game not interesting for me from that point of time.. there is no strategy involved.. so ranged attacks were the most efficient solution so far, but again, didn't really change anything more than some 20%... which is not enough, there would still be walls of units now with ranged or without.. barracks are the other most efficient solution to that, but also not a huge one and very far from being perfect.. 2 big guys can easily buy barracks in each village.. when fight begins.
Ideal would be to add upkeep to units I assume.. I dont know. Not worrying about this too much to be honest.. Sooner or later something will come to my mind.. and something will change.. I'm not coding NS as some kind of startup presentation for 1 million dollars award...
That is reason why I wanted to tweak harvest research speeds. I feel that they currently give too much bonuses for too little cost.
They give bonuses to both players.. so who knows why would it matter at all if both players do the same thing. You probably could decrease amounts of harvesting and would achieve similar effect.. or increase prices of units.. not even sure what exactly you are trying to achieve with that :P
But sometimes I had similar thoughts in different way.. was thinking to remove scholars.. but before scholars nobody was using research at all :) benefits were dubious to even try them (while it most probably be really worth it)
I understand. It can be hard to read and learn new code structure. Even if it would be easier to maintain and extend later on. My code is aiming to be easy to maintain and extend later. As my earlier point I tried to separate data and code. Also making data private to specific module makes it easier to change later if new features requires data structure changes to work well.

I guess I should improve comments and write a description how code works and how modules interact. That would maybe make it easier for you to understand. But as I said earlier I'm not good at commenting and documenting the code when I write it. I will try to improve comments and then you can check if it helps understanding how it works.

Then the last but very important point: I would have to convert back any game play changes that you think are wrong. I just wanted to experiment with rules that I felt could improve game play.
Some of changes were part of reducing code duplication (like merging village upgrades and conversion to build system). It hopefully also shows how the changed code structure is very easy to extend with new features. Village conversion and upgrades are now only a few entries in build/description.cfg instead of completely separate system.
I don't have any strict opinion on what is better and why.. It doesn't make much sense to me, somebody will find it better, others will think the opposite.. People are different and whatever you make, will work.. something will of course work better for more people, but it's not worth fighting or arguing about it.. You should just make your ideas come to life in your branch of New Settlers by Shrieker, and I would love to watch games with your mod version, to see what works better in your version or why people prefer your version. This way NS could be improved much better.. Monopoly is bad, competition is great :D
Regarding your code restructurisation etc, I may be wrong, but I'm quite sure your version would require download to join your game, which will work fine in 1.14, but not work at all in 1.12 like you probably will never see some kind of BOB space game played, while it's actually a really cool add-on, but nobody is playing it for an obvious to me reason. I hope I'm wrong, but I don't see how your codes would not require add-on, that would surprize me.
Regarding village conversion and upgrades, it may be either cool or annoying or both :) Same as with ship unboarding arrows, I really liked them, but I can not tell for sure if it's better or worse, I would need to watch people playing it and play it myself too. How can I agree or disagree on these features if I am 50/50 about whether it is right or wrong.. I strongly voting for you to go separate branch, it will be better for everyone, and I would be happy too, because I don't really want to let anyone into my project, discuss something and argue about anything ;)
A long time ago my room-mate decided to paint walls in one of the rooms into different color and she said something like "of course nobody minds, why would anyone mind if you change things for better?!" The only problem in this sentence is that we are all different, for her it was indeed better color.. so she assumes it is automatically better for everyone else (I guess the people who painted the walls in that room into that color before - were complete idiots?)
I seriously would prefer to see your separate branch of NS for just 1 million of reasons..
But maybe 3.0 could be a version when I have managed to implement all game play rules according to your wishes. Also document and comment code well enough that you can understand it. At that point I could handle over the control for you so you can have full control over what goes in and what doesn't. I'm just trying to follow rule "release early and release often".
it would be a mistake to limit your ideas to my wishes, plus I just avoid arguing where I can, I would never want to tell you what I want and what I don't. Just work on it without me, it's the best thing to do. And if you really want to know my opinion, I would always be here to let you know what I think based on my experience and point of view. There is no need to hand a control back and forth or adjust to anybody.
That is the image path I used to combine bow-crystal.png and spear-ne.png trying to make it indicate this enemy would shoot back. I feel it could be better but I just can't figure out what is the exact problem with that on top of enemy. I guess I will have to return to tomorrow to see if fresh eyes can improve it.
That would probably look nice, I'm not sure if you mean that you replace red highlight completely or just add bow on top of it.
One of million ways could be to draw this bow and also change the color of highlight. Really a lot of ways possible.
When I was making ranged system I wasn't even sure if it would work well or everyone would hate it.. It worked well to the best of my knowledge:) Not heard any bad comments at all..
* Should peasants, goblins and elvish civilians lose their build and gather abilities when leveling up?
in my opinion they should lose abilities, apart from goblins.. dont ask me why :) just my opinion.
Peasants most probably dont lose just text about ability, while in reality they don't gather or build anymore, their old code was based on unit type, not on ability id, while elfs might be still gathering... not sure.
Edit: I remembered now, elfs should get their normal image back when they level into archer or fighter..
My idea was to remove the BLIT thing when they level.. Some day will do it, nobody complained, so I never worried about it...
Usually as soon as somebody mentions or requests a change I do it.. Otherwise it's not worth time.
* Should Troll whelp lose research ability if it level ups to Troll or Rocklobber?
I think yes it should, but from another side I'm not sure if whelp shaman should be able to level into anyone except troll shaman.. and not sure if all whelps shouldn't be able to research and not sure about anything really.. Does he become more stupid when he levels so he can't research anymore? Too many doubts here for me, so I left it as it is :) Until somebody gives me a great idea what to do ;) not even being sarcastic here.. only the truth.
Would be happy to hear your opinion ;)
* What is interest for other terrains versus basic only terrain?
not sure what exactly you mean here.. if you mean building farms then I am "kind of" against it, if NS becomes too complicated it may lose it's charm, it might be an option for some new race or something.. I think add-on called wescraft or something has a lot of buildings and it's just too overcomplicated to attract any players to it.
If you mean something like Ss^Fet then I'm even more confused on why we need it :)
Would be nice to have some extra decoration terrains, but in my opinion there is not much need of anything more than that.
If you mean villages inside castles like Ket^V.. or whatever then it is in my todo list where you could build walls inside villages etc..
But it won't happen for ages in my branch, there are other much more interesting things that can be done.
I have now started wondering if that option could be removed from host settings to make the game setup simpler.
My opinion on that is that there are default settings which just work out of the box without any thinking of any settings.. A player doesn't have to adjust anything, he hosts the game and it starts working without any problems.. If he becomes full of ideas of what could work better for him, he is notified that there are preload options and he can adjust them to his liking.. nobody forces him to deep his head into them if he doesn't require any changes..
I plan to remove in-game settings, just leave 45 resources default.. because the rest is not really important.
What I could suggest is that with your level of knowledge you could help developers code 1.13, so they could make UI in preload settings more attractive, where you could draw your own frames and make settings more readable, not like they are now.. chaotically listed where you hardly can understand what is related to what.. some kind of frames would really be great.
- Added missing Elvish Champion recruitment option
if elvish champion is not a leader-recruiter then it's a bug and I need to look into it to add it as well..
- Fixed zero research mode
nobody ever ever ever played this.. but I like the idea of it being there.. but since nobody cares, I never cared either.. not sure how well it works with elfs and orcs.. maybe doesn't
I wouldn't like to start a third fork of New Settlers for my project, but maybe that will be necessary to do. Confusion (for players) is very probable then (just as enclave said). This is a bit problematic, i think.
I dont think there would be any confusion.. I'm 100% happy and also suggest you! that you remove my name from authors or anywhere at all, you may have a 1 tiny text saying that it is based on enclave new settlers which was based on Dovolente Settlers :D if yo like. Doesn't make any difference to me.
We can even all discuss how we change the name of it, I could name my NS into "New Settlers Original" :) your could be "New Settlers Single Player" :)
objectives saying the authors names which would be all different.. so nobody would confuse anything..
It would be nice to hear what people say when they try 2 different versions.. what they like and what they don't.. so both versions could benefit from it and improve.
I upload a new version that has some basic explanation how lua loading happens in core/load_lua.cfg and core/main.lua.
That might be the reason why it might need add-on to be able to join your game, if only I'm right, because I might be wrong about it, I didn't try, but I suggest you to try it.
PS. I added [ns_fire_event] tag that automatically forwards all event parameters (x1,y1,weapons etc). That could reduce a few variable parameters to existing function like event handlers. But I didn't try to remove parameters that aren't any more required. I think that tag can be useful for wml code trying to avoid wml duplication using events instead of macros.
that's an interesting idea for my future optimisation.. I will think about it and maybe start doing it too.. that could make life much easier..
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

enclave wrote:the balance in new settlers is a huge problem.. balance everywhere.. in new settlers is a complete nightmare. All the time I was trying to change things and it's still far far away from being right.
Problem #1: economy matters more than anything.. Tried to solve it with barracks or with larger distance between villages or with 1 recruit per turn per village or with walls that need fortifying instead of walls-units (walls-units were helping economy to win strategy even more, 1 player could build 50 cavaleries and send it to another player who has 0 military units but stronger economy, and would nearly 100% lose because he would just use peasants to build 1000 walls and stop everything, summon 30 units to counter within just 1 turn.. and game over) and other rules (peasants have weakness to cavs for same reason, they were easily stopping any rush).. Nothing is ideal.
I assume that either adding gold or food support per each military unit or any unit would help.. or increasing the cost of peasants some 3-4 times would help (which would not make logical sense and maybe would not solve anything either, just slow game 3-4 times instead.. it all needs time and coding to change and experiment.. and probably would also not work perfect, like everything else I tried). I mean these 2 might be the most efficient, but not the only ones possible...
Problem #2: if 2 guys with same economy meet each other they would create so many units that none of them would be able to advance even 1 hex, which makes game not interesting for me from that point of time.. there is no strategy involved.. so ranged attacks were the most efficient solution so far, but again, didn't really change anything more than some 20%... which is not enough, there would still be walls of units now with ranged or without.. barracks are the other most efficient solution to that, but also not a huge one and very far from being perfect.. 2 big guys can easily buy barracks in each village.. when fight begins.
Ideal would be to add upkeep to units I assume.. I dont know. Not worrying about this too much to be honest.. Sooner or later something will come to my mind.. and something will change.. I'm not coding NS as some kind of startup presentation for 1 million dollars award...
That is reason why I wanted to tweak harvest research speeds. I feel that they currently give too much bonuses for too little cost.
They give bonuses to both players.. so who knows why would it matter at all if both players do the same thing. You probably could decrease amounts of harvesting and would achieve similar effect.. or increase prices of units.. not even sure what exactly you are trying to achieve with that :P
But sometimes I had similar thoughts in different way.. was thinking to remove scholars.. but before scholars nobody was using research at all :) benefits were dubious to even try them (while it most probably be really worth it)
I agree that economy is problematic. I was thinking that problem is how fast it can grow without any growth speed limit. I tried to solve the problem that harvest research is very cheap long way into game and I could keep getting new levels for food and gold every turn. That allows me in turn get income very high. Something like 500 food and 500 gold each turn is pretty quickly possible and it just keeps growing from there.

But I suppose slowed researched speed won't alone help here. I need to think about it some more.
enclave wrote:You should just make your ideas come to life in your branch of New Settlers by Shrieker, and I would love to watch games with your mod version, to see what works better in your version or why people prefer your version. This way NS could be improved much better.. Monopoly is bad, competition is great :D
Ok. We can figure out later if we want to merge some efforts
enclave wrote:Regarding your code restructurisation etc, I may be wrong, but I'm quite sure your version would require download to join your game, which will work fine in 1.14, but not work at all in 1.12 like you probably will never see some kind of BOB space game played, while it's actually a really cool add-on, but nobody is playing it for an obvious to me reason. I hope I'm wrong, but I don't see how your codes would not require add-on, that would surprize me.
Only debug mode uses wesnoth.dofile for all lua files. But nearly everyone runs wesnoth in normal mode and then my NS_LUA_DOFILE macro inlines all lua code into wml. That can be then downloaded directly from the server when joining the game. I enable lua reloading also in normal mode but that is only enabled if all sides have local controller. If it is network game then loading a newer version of lua would break the game.

I was actually just now testing network play on my "Lan server". I noticed that I had made a few UI code errors where I forgot to check for controller before executing the code. That resulted to later lua errors because state wasn't there that should have been for human controller side. But now it looks like working in my local testing.
enclave wrote:Regarding village conversion and upgrades, it may be either cool or annoying or both :) Same as with ship unboarding arrows, I really liked them, but I can not tell for sure if it's better or worse, I would need to watch people playing it and play it myself too. How can I agree or disagree on these features if I am 50/50 about whether it is right or wrong.. I strongly voting for you to go separate branch, it will be better for everyone, and I would be happy too, because I don't really want to let anyone into my project, discuss something and argue about anything ;)
I was thinking to add Tutorial indicators which then have options dialog to disable for experienced players. Those options would be nice to have persistent storage like the preferences of wesnoth. But I don't think there is anyway to store addon preferences.

One way that I tough about presistent settings would be user renaming an lua file to ~add-ons/New_Settler.conf and then lua could load it if it is present. But copying a file and editing isn't something that average player would do so it would be pretty pointless to implement. Even when implementing something like that needs only a few lines of lua code.
enclave wrote:
* What is interest for other terrains versus basic only terrain?
not sure what exactly you mean here.. if you mean building farms then I am "kind of" against it, if NS becomes too complicated it may lose it's charm, it might be an option for some new race or something.. I think add-on called wescraft or something has a lot of buildings and it's just too overcomplicated to attract any players to it.
If you mean something like Ss^Fet then I'm even more confused on why we need it :)
Would be nice to have some extra decoration terrains, but in my opinion there is not much need of anything more than that.
If you mean villages inside castles like Ket^V.. or whatever then it is in my todo list where you could build walls inside villages etc..
But it won't happen for ages in my branch, there are other much more interesting things that can be done.
I was talking about NS_preload_options_other_terrains if it could be removed. I don't know if anyone wants to play without other terrains enabled. To me it feels like setting could be removed while keeping only the other terrain enabled version of build filters.
enclave wrote:
- Added missing Elvish Champion recruitment option
if elvish champion is not a leader-recruiter then it's a bug and I need to look into it to add it as well..
It was just my fault in 2.99.0. I had forgot to copy Elvish Champion. I only noticed it was missing after I added some extra checks for my unit table.
enclave wrote:
- Fixed zero research mode
nobody ever ever ever played this.. but I like the idea of it being there.. but since nobody cares, I never cared either.. not sure how well it works with elfs and orcs.. maybe doesn't
Again something that I broke because I forgot to remove some setup code that I had replaced with lua code. That made my lua code partially see zero research mode and partially not. But I think zero research mode has a problem that harvest research benefits much more than new unit types compared to how much turns they require. Even in normal mode I only research ships and mages. Then just harvest improvements to make economy stronger.

Something similar to zero research mode could work much better if research would borrow ideas from Civ. I think research tree is probably the best designed part of that game. It allows a bit choice between military and economy but if one track tries to advance too much then it forces research into other track.
enclave wrote:
PS. I added [ns_fire_event] tag that automatically forwards all event parameters (x1,y1,weapons etc). That could reduce a few variable parameters to existing function like event handlers. But I didn't try to remove parameters that aren't any more required. I think that tag can be useful for wml code trying to avoid wml duplication using events instead of macros.
that's an interesting idea for my future optimisation.. I will think about it and maybe start doing it too.. that could make life much easier..
[/quote]

Then creep wars have a clever way of passing parameters in the primary weapon. I didn't know that was possible until looked into creep war today to figure out if I could make gold properly synchronized with the creep shop.

But you can find wesnoth.wml_actions.ns_fire_event from core/main.lua. I suppose that could be improved if it would accept optional primary_weapon child tag to replace the weapon context with custom parameters like Creep War does.

Code: Select all

macros/utils.cfg:112:
#define CW_FIRE EVENT_NAME PARAMETERS
[fire_event]
	name={EVENT_NAME}
	[primary_attack]
		{PARAMETERS}
		[/primary_attack]
	[/fire_event]
#enddef
That allows CW_FIRE pass parameters to $weapon as attributes and WML child containers.

I actually made Creep war integration automatic with following bits of lua. I don't think Wesnoth specifies anywhere what is call order if events have same name. This assumes that NS event registered after CW event gets executed later too.

Code: Select all

function P.get_resources(player)
	return {
		food = wesnoth.get_variable("player[".. player .. "].food"),
		wood = wesnoth.get_variable("player[".. player .. "].wood"),
		stone = wesnoth.get_variable("player[".. player .. "].stone"),
		gold = wesnoth.get_variable("player[".. player .. "].gold")
	}
end

-- Default [ns_sync_gold] make sure that Wesnoth side gold information is same
-- as ns gold.
function wesnoth.wml_actions.ns_sync_gold(cfg)
	-- Only show gold for human controlled side
	local player = cfg.side or wesnoth.current.side
	if wesnoth.sides[player].controller ~= "human" then
		return
	end
	local gold = wesnoth.get_variable("player[".. player .. "].gold")

	wesnoth.sides[player].gold = gold
end

--- Helper to update resrouce information for a player
function P.set_resources(player, res)
	wesnoth.set_variable("player[".. player .. "].food", res.food)
	wesnoth.set_variable("player[".. player .. "].wood", res.wood)
	wesnoth.set_variable("player[".. player .. "].stone", res.stone)
	wesnoth.set_variable("player[".. player .. "].gold", res.gold)
	-- Synchronize gold always when resources are set
	wesnoth.wml_actions.ns_sync_gold({side=player})
end

--- Helper to increase resource with income
function P.resources_collect(res, income)
	return {
		food = res.food + income.food,
		wood = res.wood + income.wood,
		stone = res.stone + income.stone,
		gold = res.gold + income.gold
	}
end

-- A wml tag that helps to keep compatible with old macro system
function wesnoth.wml_actions.ns_add_resources(cfg)
	local tag = "[ns_add_resources] "
	local player = tonumber(cfg.side) or ns.WH.wml_error(tag .. "missing required side number attribute")
	local food = tonumber(cfg.food) or ns.WH.wml_error(tag .. "missing required food number attribute")
	local wood = tonumber(cfg.wood) or ns.WH.wml_error(tag .. "missing required wood number attribute")
	local stone = tonumber(cfg.stone) or ns.WH.wml_error(tag .. "missing required stone number attribute")
	local gold = tonumber(cfg.gold) or ns.WH.wml_error(tag .. "missing required gold number attribute")

	local income = {
		food=food,
		wood=wood,
		stone=stone,
		gold=gold,
	}

	ns.debug(tag, income.food,"f", income.wood, "w", income.stone, "s", income.gold, "g")

	local res = P.get_resources(player)
	res = P.resources_collect(res, income)
	P.set_resources(player, res)
end

-- Handle creep war get item event and insert ns_add_resources tag to update ns
-- gold state when creep war shop is used.
function wesnoth.wml_actions.ns_creep_war_item(cfg)
	local tag = "[ns_creep_war_item]"
	local weapon = ns.WH.get_child(wesnoth.current.event_context,"weapon")

	-- Creep war passes event parameters in the primary weapon.
	if not weapon.active then
		return
	end

	-- Find the output command variable
	local commands = wesnoth.get_variable(weapon.var..".command")
	-- Append NS resource modification tag
	table.insert(commands,
		     ns.WT.ns_add_resources {
			     side=wesnoth.current.side,
			     food=0,
			     wood=0,
			     stone=0,
			     gold=-wesnoth.get_variable(weapon.item..".price"),
		     })
	-- Replace the creep war commands with our extended list
	wesnoth.set_variable(weapon.var..".command", commands)
end


	if wesnoth.get_variable("cw_shop") then
		ns.WA.chat {
			speaker="New Settlers",
			message="Creep wars detected. Attempting to synchronize gold with creep war shop.",
		}
-- Reloading lua code requires manual event removal to replace events with possible new content.
		local id = "ns_resource_sync"
		ns.remove_events(id)

		ns.WA.event {
			name="cw_shop_event_get_item",
			id="ns_resource_sync",
			first_time_only=false,

			ns.WT.ns_creep_war_item {}
		}
	end

enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: New Settlers era

Post by enclave »

I was talking about NS_preload_options_other_terrains if it could be removed. I don't know if anyone wants to play without other terrains enabled. To me it feels like setting could be removed while keeping only the other terrain enabled version of build filters.
some people don't like other terrains (the ones who played NS for a year or more and NS just didn't have them when it was beginning to develop).. but to be honest, it's not a big deal removing them.. some of NS random maps don't have them anyway..
But still.. :)
I was thinking to add Tutorial indicators which then have options dialog to disable for experienced players.
Good tutorial is very important, it's on my todo list, but it would consume a lot of time to code and design it as I would like it to be quite perfect, otherwise there is no point to do it at all.. changing bad into another bad would be only a waste of time.
Those options would be nice to have persistent storage like the preferences of wesnoth. But I don't think there is anyway to store addon preferences.
The easiest way that came to my mind straight away would be to give choice of leaders for each race, for example human Sergeant lvl2 would remove all help, while Sergeant lvl1 would have tutorial. If they could have this description would be cool, but I don't think you can add any text to leader choice.
Im not that advanced to figure out whether there is any other, "proper" method..
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: New Settlers era

Post by Ravana »

Those options would be nice to have persistent storage like the preferences of wesnoth. But I don't think there is anyway to store addon preferences.
https://wiki.wesnoth.org/PersistenceWML
I use that to only show ageless changelog popup once per version per player.
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

Ravana wrote:
Those options would be nice to have persistent storage like the preferences of wesnoth. But I don't think there is anyway to store addon preferences.
https://wiki.wesnoth.org/PersistenceWML
I use that to only show ageless changelog popup once per version per player.
Thanks Ravana!
enclave wrote:Good tutorial is very important, it's on my todo list, but it would consume a lot of time to code and design it as I would like it to be quite perfect, otherwise there is no point to do it at all.. changing bad into another bad would be only a waste of time.
I agree. I'm actually hoping that my indicators can work as a partial tutorial because players would clearly see that some units have special abilities. But still finding right click menus can be surprising hard for a new player.
Save sizes
But then back to save game sizes. I just noticed from inspector that there is diplomacy and some game mode events that are left into persistent game state even when disabled. Removing them from persistent game state reduces initial compressed save about 10% (Isar with zombies). After That I looked what big there still is and figured this kind of list:
  • All active event handles are declared twice in the save. First in snapshot state and then in replay state.
  • All declared but not active events are left into replay once. Total for both event types is maybe 50-70% of uncompressed save
  • Zombies take a lot space because all variants are stored twice. This is about 10-15% of uncompressed save size for Isar with all factions present
  • ns_oos_1.all_units is stored in replay and takes about 10% uncompressed space
But I don't see that much code left which generates huge wml events. Most of save size reduction were possible from recruit and research parts of code. Other parts seem to have relatively little duplication that could be remove with lua or refactored wml. But there is still speed and feature advantage for using lua instead of wml.

That leaves me wondering how did the random map generator manage to generate different units. Is there some parameters that are known to reproduce it?

Of course having the 10% in initial save isn't that much when later replay and units will take much more space making that insignificant in side. I would expect that later game save would be 50-80% units and replay.
Creep Wars
I noticed that there is much simpler Creep War integration method. Just override default wesnoth.wml_actions.gold. That allows much simpler implementation. It also works correctly for kill gold without any other aditions. Implementing gold handler is simple because it is just SSF with amount attribute added. That means it can be just forwarded to wesnoth.get_sides() and then for loop to handle the amount.

The tag override has an advantage that same integration trick could be used for other scenarios which have shops that use gold tag.
NS economy
I has some idea today that maybe workers should be removed from recruit list. They would be automatically generated based on resources collected around a village. The required resource amount would grow each time a village produces a worker. This could make it much less likely that one player gains a huge economic advantage over others. But I would have to actually test this kind of system to see if it can be balanced with unit prices and possible unit maintenance.
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: New Settlers era

Post by enclave »

That leaves me wondering how did the random map generator manage to generate different units. Is there some parameters that are known to reproduce it?
I didn't understand the question, sorry =]
https://wiki.wesnoth.org/PersistenceWML
I use that to only show ageless changelog popup once per version per player.
Wow, Ravana that's so cool! ;)

All active event handles are declared twice in the save. First in snapshot state and then in replay state.
All declared but not active events are left into replay once. Total for both event types is maybe 50-70% of uncompressed save
Zombies take a lot space because all variants are stored twice. This is about 10-15% of uncompressed save size for Isar with all factions present
ns_oos_1.all_units is stored in replay and takes about 10% uncompressed space
regarding ns_oos_1.all_units, yeah I need to clear a lot of variables at some point.. when I was starting to code I didn't care about them and now there is a mess of variables, not cleared the ns_oos_1 for some bad habbit reason.. trying to clear the variables in my new codes.. but chasing old ones is a big work.. and a risk to clear something that is not intended for clearing.. so it's in my todo list, but I don't know when it will happen.
Regarding the things that are declared twice in the save, I have no idea how to fix it.. no clue at all.

PS. I tried to observe your game with Shriker1 and Shrieker0 today on europe, but when I do it I only get a black screen and nothing happens, looks like something is loading but never finish. Maybe its because I have older version of your lua NS, I don't know.
shrieker1
Posts: 21
Joined: August 7th, 2017, 5:53 pm

Re: New Settlers era

Post by shrieker1 »

enclave wrote:
That leaves me wondering how did the random map generator manage to generate different units. Is there some parameters that are known to reproduce it?
I didn't understand the question, sorry =]
There was comment that ns_oos_1.all_units was fix for oos when generating large random maps. I was just wondering if you have recorded somewhere parameters which could reproduce the issue.

enclave wrote:
All active event handles are declared twice in the save. First in snapshot state and then in replay state.
All declared but not active events are left into replay once. Total for both event types is maybe 50-70% of uncompressed save
Zombies take a lot space because all variants are stored twice. This is about 10-15% of uncompressed save size for Isar with all factions present
ns_oos_1.all_units is stored in replay and takes about 10% uncompressed space
regarding ns_oos_1.all_units, yeah I need to clear a lot of variables at some point.. when I was starting to code I didn't care about them and now there is a mess of variables, not cleared the ns_oos_1 for some bad habbit reason.. trying to clear the variables in my new codes.. but chasing old ones is a big work.. and a risk to clear something that is not intended for clearing.. so it's in my todo list, but I don't know when it will happen.
ns_oos_1.all_units is cleared correctly. But because it is MP oos fix and used in wesnoth.synchronize_choice it is stored also in replay. Basically anything returned from the synchronize choice will be stored in the replay part of the save.

I have removed a lot variables from my version. It makes inspector much easier to use if wanting to check game state.87
enclave wrote:Regarding the things that are declared twice in the save, I have no idea how to fix it.. no clue at all.
You can't do anything about it. It is required to make replays work and save games quick reload. It is Wesnoth code decision to save everything twice to saves.
Idea is that there is first a snapshot that stores only active events and all current variable values. The snapshot can be used to load a save quickly.
Replay part has complete initial state stored which includes all declared events. The replay continues to store all game action making it possible to watch afterwards what happened in a game. It would be possible to just store replay and load any position between begin and the save moment but the playback is too slow to make it practical to load saves from replay. I hope that explains why Wesnoth duplicates a lot stuff in save file.

But to reduce the implact of duplication scenario and era can remove all unnecessary events. That makes at least snapshot smaller.
Post Reply