Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Snarky

#202
As suggested by Stupot+, we're trying an AGS book club. The first pick is the 2012 mystery/thriller Gone Girl by Gillian Flynn, which we'll be reading in September and discussing as we go along.

                  GONE GIRL

               
                Amazon

                    Who are you?
What have we done to each other?


Nick and Amy are a seemingly perfect couple, until the day Amy disappears, and Nick becomes the number-one suspect in whatever has happened to her. Told in alternating points of view and possibly unreliable flashbacks (with excerpts from Amy's diary telling her side), this thriller explores a marriage where the cracks were growing long before it shattered so dramatically.

Some background:



Gone Girl is the third novel by Gillian Flynn, after Sharp Objects (2006) and Dark Places (2009). Each of her books is a standalone mystery/thriller, and each touches on some wider issues: self-cutting and factory farming (descriptions of which made me a vegetarian for some 4 years) in Sharp Objects, the 80s Satanic ritual abuse hysteria in Dark Places (apparently; I haven't read it), and marriage and gender roles in Gone Girl. All of her books have been successful, particularly this latest one, which was a big 2012 hit. They've all been optioned as movies, with David Fincher mentioned to direct Gone Girl.

Flynn (b. 1971) earned her masters degree in journalism from Northwestern. After giving up the idea of becoming a crime reporter, she was a film and TV writer and critic for Entertainment Weekly (I recently came across her negative review of It's Always Sunny in Philadelphia; she really liked The Wire, though, so we're good) for ten years before getting laid off. (Sources: Wikipedia, gilllian-flynn.com)
#214
I came across something that might interest some of you. I think I mentioned at one point that Spirou & Fantasio is one of my favorite comics. Well, the magazine where it's published is launching a tablet version/spin-off later this year: Spirou.Z. It will have digital comics, games and other interactive features, and will be available in French and English. (There's a demo issue on the iTunes app store if you have an iPad; otherwise you can check out some samples in French on the web site.)

And interestingly, they're looking for contributors. (They already signed up one web comic guy.)

[embed=560,315]<iframe width="560" height="315" src="http://www.youtube.com/embed/CQwqrLq11fc" frameborder="0" allowfullscreen></iframe>[/embed]

We're always talking about how tablets are a natural home for adventure games. This could be an opportunity to get them out there. (They'd probably have to be pretty casual and simplistic, and I would imagine you can't use AGS, but there might be some interesting comic/adventure game hybrid you could do, maybe.) I don't know anything about the deals they're offering or if they'd even be interested in AGS-type games, but if you think your games might fit in with a monthly digital comic magazine, it might be worth a shot!

(And if you're interested in Spirou news, may I recommend Spirou Reporter)
#218
So, Disney is closing down LucasArts.

For many of us, I'm sure, this was the company that introduced us to adventure games. They may have been only a shadow of their former self, but it's sad to see them go.
#219
I'm looking for some advice about how to work around the AGS limitations on object-oriented code.

I'm trying to code up a module for RPG-style combat. The problem seems naturally suited for an object-oriented approach, since it involves a number of entity types (characters, monsters, weapons, armor, equipment, spells, etc.) each with a bunch of different properties and possible actions. And in fact, the explanations of structs in the manual use RPG scenarios as examples.

But very quickly I run into problems because AGS doesn't allow pointers to custom structs, or arrays of structs inside structs. For (a simplified) example:

Code: AGS

struct RpgWeapon{
  String name;
  int damage;
};

struct RpgSpell{
  String name;
  int mpCost;
  int damage;
};

struct RpgChar{
  String name;
  // ...
  RpgSpell spells[10];        // ILLEGAL!
  RpgWeapon* currentWeapon;   // ILLEGAL!
  import int attack(RpgChar* target); // ILLEGAL!
  // ...
};


This complicates things a lot. I need to be able to refer to particular characters, weapons, spells etc. in other data structures and to pass them as arguments to methods. Otherwise, they're not much use.

My current workaround is to create global "master-arrays" for each struct, and store a "pointer" to a struct as an integer index into the array (with -1 for null):

Code: AGS

struct RpgChar{
  String name;
  // ...
  int spells[10];        // entries index into RpgSpells
  int currentWeapon;   // indexes into RpgWeapons
  import int attack(int target); // target indexes into RpgChars
  // ...
};

RpgWeapon RpgWeapons[RPGWEAPONS_MAX];
RpgSpell RpgSpells[RPGSPELLS_MAX];
RpgChar RpgChars[RPGCHARS_MAX];


This works, but it has a number of drawbacks: You have to keep track of the contents of each array yourself (which is OK if you define all the weapons, spells, characters and so on all in one place, like at game start; but if you want to make new ones dynamically it could get messy), you have to think very carefully about how to deal with multiple instances of "the same" struct (e.g. two characters who both have the same weapon; one or two entries in RpgWeapons?), and it adds a step every time you want to dereference a struct. And of course, the arrays take up memory, though I'm not sure that (apart from empty slots in the array) they take any more memory than you would use anyway.

In addition, because the master-arrays store the actual structs rather than pointers, I've found I've had to write methods to "clone" an instance from the array or into it (by going through every field and assigning the same value), though that might be because I haven't been completely disciplined in always using the arrays.

So, am I going about this the wrong way around, trying to force AGS into a programming style it doesn't fit? Is there a better way? If I use this workaround, do you have any tips for how to make it as smooth and non-error-prone as possible? (For example, writing this post made me consider whether I should use Hungarian notation to identify the pseudo-pointers, so instead of "spells[]", "currentWeapon" and "target" it would be "psSpells[]", "pwCurrentWeapon" and "pcTarget".) Should I create an API to manage the master-arrays? Should I have separate arrays for "permanent" and "ephemeral" instances (e.g. for monsters, have one arrays of the "monster prototype" and one of individual monster instances)?
SMF spam blocked by CleanTalk