patchFreeciv - Patches: patch #4409, Script-defined achievements

 
 
Show feedback again

patch #4409: Script-defined achievements

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat 04 Jan 2014 09:33:10 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 11 Jan 2014 11:05:13 AM UTC, comment #2:

> How to handle achievement messages? Currently they're hardcoded
> in the server.


That's intermediate version just to get achievements implemented. They should be moved to new strings.ruleset I have been planning for years (my first notes for alien ruleset back in 2008 mention that it's a requirement for properly working alien ruleset...)

Marko Lindqvist <cazfi>
Project Administrator
Sun 05 Jan 2014 01:57:13 AM UTC, comment #1:

I've had the idea about requirement type "Lua" for years, where lua script would be consulted if requirement is fullfilled or not.

It would be available for more things (all requirement ranges, for starters) than having such req only via "Achievement", "Lua_nn", "Player", and taking a bit more scripting code everything that could be done with Lua achievement, should be doable with existing interfaces + that Lua req.

Marko Lindqvist <cazfi>
Project Administrator
Sat 04 Jan 2014 09:33:10 PM UTC, original submission:

Another one from the half-bakery.

The new achievements we have on trunk come from a small set hardcoded in the server (Map_Known, Spaceship, Multicultural).

However, it strikes me that you really want to be able to define ruleset-specific conditions that we (developers) wouldn't have thought of, which looks like a fine application for Lua scripting.

How would this work?

  • Could use achievement type of "None" or "Script" which is never true in the core achievements code.
  • To signal achievement, should script call into server, or vice versa (or both)?
    • If scripted achievements are to follow the existing tie-break resolution arrangements, that suggests server sends a signal to script saying "has this player achieved this achievement" in the achievement checking phase. (Script probably shouldn't change game state here.)
  • How to handle achievement messages? Currently they're hardcoded in the server.
    • Even without scripting, there's an argument these should be ruleset-defined; for example, if the alien ruleset had achievements, it would say "You're the first one to launch spaceship towards Alpha Centauri!" which seems unlikely to be the obvious destination starting at Deneb. The existing messages use format strings but this would be unnecessary, as they only have values substituted that are also ruleset-defined.
Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup