Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#2521) general effects framework
Home

[Freeciv-Dev] (PR#2521) general effects framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2521) general effects framework
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Mar 2003 21:03:17 -0800
Reply-to: rt@xxxxxxxxxxxxxx

version 3 is here! (version 2 was internal, you didn't miss it).

DONE:
o defines for EFR_ALL and EFT_ALL
o remove ERF_NONE
o effect and effect_defn lists are now effect and effect_defn vectors.
o added a SPECVEC_FOO(_vector_copy) to specvec_c.h
o rewrote the effects-handling code in rulesets.c/packets.c/packhand.c
  (more sane)
o added delete_*_effects() specific functions
o made bools in struct effect a bitfield
o removed MAX_EFFECTS
o can successfully define and add effects for
  nations/governments/techs/improvements.
o added hooks for unit effects (can define but not add)
o fixed bugs.
o rewrote iterator code: removed range ORs
o added I_DEMOLISHED Impr_Status to keep track of effects that survive
  improvement destruction (transfer to client)
o added savegame code for I_DEMOLISHED.
o added effect classes EFC_* helps error correction in ruleset.c and other
  things.
o added support for the server telling the client what other player's
  global effects are. 

TODO/BUGS:
o .outside which Ben wants and I agree we need I haven't done yet. I don't
  know if this should go in the patch now or after commit. Probably should
  figure out how it's going to work in case it's going to screw stuff up.
o there's a memory leak that's not going to be easy to fix. global effect
  definitions from other players are not freed. It's small though. When I
  figure out how to fix it, I will.
o unit effects. problem here: it would be fabulous if we could work the 
  paratrooping flag into an effect. The problem is that the flag has three
  subfields. effect definitions only have one value field to work with.
  Suggestions are welcome. the patch itself will be post-commit, but if the 
  defintion itself needs to be reworked, that needs to be done first.
o remove all the extra debugging code. a last step.
o the client seems to attempt to add effects too often handle_player_info().
  not quite sure why yet.
o add_government_effects() is screwed up for the client because of
  package_player_info in plrhand.c I'm fairly sure it sending the wrong value.
  maybe the tipoff is the /* FIXME: temporary kludge */ comment there :)
o lot's more testing. you can help too!

NOT HAPPY WITH:
o client global effects. The problem is that a client isn't required to add
  effects that it's player doesn't own. This is because things like
  improvements, techs, etc are sent to the client, not effects. This means
  that the client doesn't know about other players global effects. This takes a 
  
  significant chunk of code to deal with. Ben's suggestion was to just let the 
  client fry. I can't live with that so here's my solution (it seems ideal): 
  whenever a global effect is added and is active, the server sends that effect 
  to the client which adds it. Whenever a global effect is deleted or it
  changes from active to not active, the server tells the client to delete
  that effect. If someone can offer an equivalent solution that requires
  fewer lines of code or is more elegant, tell me.

o client global effects. The effects framework was really quite elegant (if
  I do say so myself) until this POS came along. I feel dirty.

If someone could please give me the low-down on | and & versus || and &&
I'd appreciate it. I ran into a problem with the bitfields and &&: it
evaluated to zero no matter the arguments.

I put a version of the patch without the client/global stuff on RT as a
comment. A buildings ruleset which I use to test is also there.

This is shaping up to be fairly close to what is going into CVS. please
look it over.

-mike

Attachment: effects3.diff.bz2
Description: effects3.diff.bz2


[Prev in Thread] Current Thread [Next in Thread]