Difference between revisions of "EasyCoding"

From The Battle for Wesnoth Wiki
(GUI2 related features: Remove a tasks, which easy part has been done)
(AI EasyCoding)
Line 47: Line 47:
 
See [[FutureWML]]; some ideas there are easier than others.
 
See [[FutureWML]]; some ideas there are easier than others.
  
== Improvements to FormulaAI ==
+
== Improvements to AI ==
  
Add new formula functions, or minor improvements to the formula language. Make it easier to debug the formula language.
+
Fix some todos, add new formula functions, or do minor improvements to the formula language. Make it easier to debug the formula language, add more ai components.
  
Please discuss these with Dragonking, Sirp or Boucman
+
Please discuss these with Crab, Dragonking, Sirp or Boucman
  
Use [[AI_Arena]] for testing custom formulas.
+
=== AI Batch testing ===
  
=== Poisoning Improvement ===
+
Finish patch #1169 [https://gna.org/patch/?1169]
  
Writing a formula that will make units with poison attacks prioritize their targets to spead poison as much as possible, avoiding already poisoned units and other useless targets
+
=== Terrain Filter ===
 +
add a const static terrain_filter::match_nothing_terrain_filter which matches nothing (constructor parameter is 'config cfg("not")' )
 +
replace all places which construct that match_nothing_terrain_filter on the fly to use the new static filter.
  
=== About to level formula ===
+
=== Add new generic observers to ai::manager ===
  
Writing a formula that would handle units with only a few XP left to level and have them fight accordingly (most likely to kill or hit depending on XP needed, taking into account target's level)
+
add an observer of 'time of day has changed' event
 +
add an observer of 'minor gamestate changed' event
  
=== Healer improvements ===
+
=== Relocate code ===
 +
find a new home for config_value_translator and
 +
variant_value_translator template classes. (currently they are in src/ai/composite/aspect.hpp)
 +
They should be in the separate file.
  
Handle units with healing power, moving them at places where they can provide the most healing
+
=== A small rename ===
 +
rename paths::step::move_left to paths::step::move_cost
 +
See r34430 for more details
  
 +
=== Allow ai to use teleports ===
 +
to do that, add needed parameter to a_star_search in move_result::test_route (src/ai/actions.cpp )
  
=== Leader improvements ===
+
=== Add more ai actions ===
  
A bit more complicated : special handling of units with leadership to have them support units. Only do it if it actually is usefull (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)
+
Add an ai action (and add formula_ai function to do that) to set a goto on a unit
  
 +
Add an ai action (and add formula_ai function to do that) to send a chat message to a player
  
=== Berserker improvements ===
+
Add an ai action to set formula ai variable (convert existing code from formula_ai)
  
The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition
+
Add an ai action to set formula ai unit variable (convert existing code from formula_ai)
  
=== Debugging help ===
+
=== write a (fai or c++) candidate action for leader control ===
  
<s>* provide a way for a formula to have a text float over hex (for debugging purpose).</s> done by [[SummerOfCodeProposal_AI_Improvement_Crab|Crab]], patch submitted [https://gna.org/bugs/?13230]
+
=== write a (fai or c++) candidate action for using leadership/illuminate  ===
* in debug mode, have all AI move print their name in the log
+
special handling of units with leadership to have them support units. Only do it if it actually is useful (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)
  
=== New type of candidate moves : Global ===
+
=== write a (fai or c++) candidate action for healer control ===
+
Handle units with healing power, moving them at places where they can provide the most healing
to be called only once with no implicit variable
+
 
 +
=== berserker improvement ===
 +
The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition
  
 
== GUI related features ==
 
== GUI related features ==

Revision as of 20:29, 26 August 2009

Foreword

This page is here to document easy to do coding tasks. It is not here to double the feature request database, and should only be filled by people that know the code well enough to judge the difficulty of a given task.

If you are such a person, you should feel free to edit this page.

If you're not, you should post a feature request and discuss your idea on the forum or IRC. A coder with better knowledge of the code might give you the green light to add your feature here.

Anybody should feel free to add "clues" to any tasks, that is entry points, traps to avoid, person to contact to discuss and so on.

If you plan to work on a feature, write your name at the bottom of the feature, with the date. Note that if you are too long at working on a feature I'll "free" it back (that is if you're not working on it. If you have problems implementing it, just tell us....)


--Boucman 20:48, 3 October 2006 (CEST)


Since bugs are sometimes a good opportunity to get a first idea of the code, i will add some here that are easy to fix as soon as i stumble upon them (the one i had in mind is fixed already ;-).

--Yogi Bear, 28 February 2008

MP related features

Use different font for in-game chat

Since commas and dots are apparently hard to tell apart. As per FR #7470 [1]

WML related features

WML configurable village income / upkeep

Preferably as a [scenario], [side] or [campaign] keys. As per FR #6301 [2]. Patch submitted: [3] (gabba)

Add support of [if] for [scenario]

As per FR #4539 [4]

Make [have_unit] optionaly use full SUF

[have_unit] by default uses SUF but does not apply it to recall list. Introduce an optional key that will allow to lift that limitation.

Side-specific results

Giving result=defeat or result=victory for specific sides. (FR #4960) -- dlr365 -- patch submitted [5]

Support for leaderless multiplayergames

Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. (FR #8106)

Support for standalone multiplayer scenarios

There used to be support for standalone scenarios in the userdata tree, in reorganising the trees this feature got lost and an add-on is now required to add a scenario. Re-add this feature. It is probably a good idea to mirror the mainline multiplayer tree.

Other Ideas

See FutureWML; some ideas there are easier than others.

Improvements to AI

Fix some todos, add new formula functions, or do minor improvements to the formula language. Make it easier to debug the formula language, add more ai components.

Please discuss these with Crab, Dragonking, Sirp or Boucman

AI Batch testing

Finish patch #1169 [6]

Terrain Filter

add a const static terrain_filter::match_nothing_terrain_filter which matches nothing (constructor parameter is 'config cfg("not")' ) replace all places which construct that match_nothing_terrain_filter on the fly to use the new static filter.

Add new generic observers to ai::manager

add an observer of 'time of day has changed' event add an observer of 'minor gamestate changed' event

Relocate code

find a new home for config_value_translator and variant_value_translator template classes. (currently they are in src/ai/composite/aspect.hpp) They should be in the separate file.

A small rename

rename paths::step::move_left to paths::step::move_cost See r34430 for more details

Allow ai to use teleports

to do that, add needed parameter to a_star_search in move_result::test_route (src/ai/actions.cpp )

Add more ai actions

Add an ai action (and add formula_ai function to do that) to set a goto on a unit

Add an ai action (and add formula_ai function to do that) to send a chat message to a player

Add an ai action to set formula ai variable (convert existing code from formula_ai)

Add an ai action to set formula ai unit variable (convert existing code from formula_ai)

write a (fai or c++) candidate action for leader control

write a (fai or c++) candidate action for using leadership/illuminate

special handling of units with leadership to have them support units. Only do it if it actually is useful (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)

write a (fai or c++) candidate action for healer control

Handle units with healing power, moving them at places where they can provide the most healing

berserker improvement

The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition

GUI related features


Note at the moment Mordante is working on a new GUI system, these changes will probably affect the way these items need to be implemented. Contact Mordante on IRC before starting to work on these.

--SkeletonCrew 14:04, 9 March 2008 (EDT)


Theme Changes

  • allow custom themes to display values of WML variables (FR #6209)
  • hide the hourglass item from the statusbar when there is no timer

Widget Changes

  • show side number, name and team association information in the status table
  • make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud)
  • input history (chat, commands, ..) - note: rujasu is working on this feature

GUI2 related features

GUI2 is the new gui engine Mordante/SkeletonCrew is working on.

Some tasks need the --new-widgets since the code is only shown in the experimental mode. Tasks which need this switch have the * in the title.

* Savegame dialog

This is a new dialog to write and requires the minimap code to be fixed first. The dialog should mimic the current dialog. Sorting of a listbox and the proper alignment of the columns is not important (the engine doesn't support this yet). The code should only be used when --new-widgets is used as start switch since we're in a feature freeze at the moment.

Arrow keys for the slider

There's a new slider widget, but it doesn't support the keyboard yet. gui/widgets/slider.[c|h]pp

Clicking on the widget should capture the keyboard and then arrow left/right should move one step even if not all steps are visible.

Slider sizing

There are some issues with the sizing of a slider. gui/widgets/slider.[c|h]pp

In a layout step it needs to try to shrink itself, not entirely sure where or how yet, best ask mordante on irc.

Savegame related stuff

consistent player information

At the moment, the [player]-section for a campaign savegame will appear in two places: The root level of the savegame and the [replay_start]-section. This was due to a last-minute fix for 1.6 that was designed to be the least intrusive. The [player]-section should only be written to [replay_start] (and of course read from there as well). Patch submitted: [7] -grantwu

fix bug #13268 (save corruption through undo/redo of recalls [8]

Miscellaneous

More powerful village naming

Adding mountain names and other features to village names, having a second random name in village names

Currently the village naming engine has a very good structure that could allow more powerfull names to be generated. Understanding how it works should be quite easy, and a few usefull improvements could be added.

  • Currently villages can use lake names and river names, this should be extended to other features like bridges, swamps, mountains etc...
  • It would be nice to have a separate list of "first sylabus" and "last sylabus" for naming. That's not really needed in english, but some translations could use it
  • Again, it is common to have villages with more than one "random" word in them. having a $name2 variable would be nice

Euschn 24/03/2009

Debug Mode

  • New debug command functionality (setting additional status.variables, possibly terrain)


Bugs

See Also

NotSoEasyCoding