Modifying mouvement costs (and other things)

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
hermestrismi
Posts: 612
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Modifying mouvement costs (and other things)

Post by hermestrismi »

After developing many scenarios and campaigns (some of them are published as UMC already), I noticed that the game coding will probably be much easier if :
1) altering the movement cost by both editor group alias (forest, flat, ...) and terrain type (Gs, ..).
2) to make it possible to track all tags (sound source, ...) by inspection (as inspection show for variables and stats,
3) to make it possible to clear are variables by a simple macro like (clear_variables all).
.
I don't know how much is it possible
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Modifying mouvement costs (and other things)

Post by Pentarctagon »

Clearing *all* variables is a very destructive thing and would likely break all sorts of content that's relying on variables existing.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Modifying mouvement costs (and other things)

Post by gfgtdf »

If you want however you can put all the variables you use in a container, this is easily done by prefixing all your variables with for example her. like her.my_variable, then you can just delete the container her {CLEAR_VARIABLE her}
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
hermestrismi
Posts: 612
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Modifying mouvement costs (and other things)

Post by hermestrismi »

gfgtdf wrote: March 16th, 2023, 2:19 am If you want however you can put all the variables you use in a container, this is easily done by prefixing all your variables with for example her. like her.my_variable, then you can just delete the container her {CLEAR_VARIABLE her}
That's a brilliant idea. I have to try it
User avatar
hermestrismi
Posts: 612
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Modifying mouvement costs (and other things)

Post by hermestrismi »

Pentarctagon wrote: March 16th, 2023, 2:03 am Clearing *all* variables is a very destructive thing and would likely break all sorts of content that's relying on variables existing.
You are right but I mean variables added by me not those already configured by the engine
And the other two propositions? Are they worthy? Are they possible, impossible or hard to achieve?
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Modifying mouvement costs (and other things)

Post by Pentarctagon »

For (1): is this not already possible? Filtering on terrain codes allows for partial matches.

For (2): I'm not really sure what's being suggested.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
hermestrismi
Posts: 612
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Modifying mouvement costs (and other things)

Post by hermestrismi »

Pentarctagon wrote: March 16th, 2023, 4:40 am For (1): is this not already possible? Filtering on terrain codes allows for partial matches.

For (2): I'm not really sure what's being suggested.
1) I mean the mouvement_type tag. I think it only accept groups of terrain, not id of a specific terrain_type
2) I mean when you enter inspect mode, some information are inaccessible such as sound source
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Modifying mouvement costs (and other things)

Post by Pentarctagon »

For (1): that sounds like it'd result in game play being significantly more complex since there would be a lot more movement cost variations.

For (2): isn't that already available just by looking into your code though?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
hermestrismi
Posts: 612
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Modifying mouvement costs (and other things)

Post by hermestrismi »

Pentarctagon wrote: March 16th, 2023, 3:02 pm For (1): that sounds like it'd result in game play being significantly more complex since there would be a lot more movement cost variations.
I know but also it give the developer more options regarding the movements . For example, certain units will be able to move fast in certain castles but not ruined or snowed ones, ...
It can be added as another tag or an optional sub-tag
For (2): isn't that already available just by looking into your code though?
Many tags are related to variables and not clear if the value of the variable is what you are excepting.
In my case, for example, when I want to use a [sound_source] inside [random_placements], the variable $random_placement must be cleared and so you cant found it in the --inspect (if you didn't clear it, you will finish by storing all the map) . In this case, [sound_source] can't be inspected since it's $loc is cleared.
It will be very useful if their is a window for the active tags (just like) events
(I don't know if my english is able to explain what I am thinking. loool)
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Modifying mouvement costs (and other things)

Post by Pentarctagon »

I don't think (2) is really possible, since there aren't really "active" tags.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Ravana
Forum Moderator
Posts: 2952
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Modifying mouvement costs (and other things)

Post by Ravana »

(1) is also solution for https://github.com/wesnoth/wesnoth/issues/4831
(3) is possible by iterating wml.variables to remove WML variables and _G to remove Lua variables. And as mentioned before, do not do that.

(2) you could try check if savefile contains the information you need.
Post Reply