Commit Graph

34 Commits

Author SHA1 Message Date
wagic.the.homebrew
9f3a42d0c6 - removed "image_name" variable from MTGCard. this should free roughly 200kB with the current amount of MTGCard objects we have. (Which counterbalances the "roughly 150kB in Introduced in CardP Primitives recently :( ) 2011-08-07 04:01:56 +00:00
wrenczes@gmail.com
ba07ca2334 Improvement on my last change for reducing the formatted text caching: chopped it out altogether. I ran some profiling to see how much time on the psp it took to process the formatting on the description text (ie word wrapping it into several lines to fit on a card), and it ends up taking an average of 0.14 ms per card. For context, 60 fps is 16 ms. So clearly the formatting time is not the bottleneck here, and we gain no real performance caching the text, but lose memory due to pooling. So I cut it out entirely of the base class and we format on the fly during renders.
I also profiled this after the fact, as we have an open bug on poor drawing performance on psp when in text mode - it turns out that in the AlternateRender() function, my numbers look like this: 10.2 seconds were spent in JBLFont::DrawString(); 0.5 seconds were spent in my new helper FormatText() call, so we know where the perf hit is now.

I compared before & after on the psp with this mod, and the difference really isn't perceptible.  (It's still juddery, but no worse than before.)  I'll look at the DrawString() call next to see if we can make it any faster, although at first glance it looks like a pain.
2011-04-23 09:54:19 +00:00
wrenczes@gmail.com
bd56723bc0 Checkpoint on a utility helper class. Basically, if you have a class that you want to count the numbers of instances, you do this:
class Foo
#ifdef TRACK_OBJECT_USAGE
      : public InstanceCounter<Foo>
#endif

Then, use this macro somewhere in the class body:
SUPPORT_OBJECT_ANALYTICS(Foo)

Lastly, add whatever information you want to trace out to the function ObjectAnalytics::DumpStatistics().

Here's a sample of the output of what I've instrumented so far:

-----------------------------------------------------------
Object Usage Stats

CardPrimitive current count: 7899
CardPrimitive current byte usage: 2053740
CardPrimitive max count: 7908
CardPrimitive max byte usage: 2056080

MTGCard current count: 13973
MTGCard current byte usage: 670704
MTGCard max count: 13982
MTGCard max byte usage: 671136

MTGCardInstance current count: 180
MTGCardInstance current byte usage: 172080
MTGCardInstance max count: 189
MTGCardInstance max byte usage: 180684

-----------------------------------------------------------
2011-04-23 05:16:53 +00:00
wrenczes@gmail.com
224b140f9f First pass at reducing the overall memory footprint: moved GetFormattedText() out of CardPrimitives and into MTGCard. The idea being, only keep the formatted text around for cards that are actually in use.
Also fixed a subtle memory pooling issue in the RenderCountersBig() routine:  if you're in regular card display mode, the idea is that formatted text is only fetched if you flip into alternate render mode.  However, in this function, if counters are being drawn, it would fetch the formatted text in order to determine where to draw the counters, EVEN IF the counters count was zero.  So it had nothing to draw, but it meanwhile pooled the formatted strings into memory anyway.
2011-04-22 16:04:41 +00:00
techdragon.nguyen@gmail.com
acd7bb1aa4 reformatting code according to guidelines defined at
http://wololo.net/forum/viewtopic.php?f=35&t=2235&start=10
2010-11-16 00:55:16 +00:00
wrenczes@gmail.com
e74c0fcc7c Moved a few more common shared includes into the precompiled header. 2010-10-24 06:55:40 +00:00
wrenczes
d5f3e4cfea Enabled precompiled headers for the build. This cuts the win compile time in debug by at least half on my laptop; on the psp compile, it shaves it down by ~ 45 seconds. I only did a cursory inspection of what to add to PrecompiledHeader.h, there's probably more that we can throw in there for more incremental speed improvements.
Also fixed the project includes so that we don't need to always use the indirect include path, ie:
#include "../include/foo.h" -> #include "foo.h"

I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too.  For future reference, here's the most straightforward link on the topic of adding pch support to make files:

http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project
2010-10-24 05:55:24 +00:00
omegablast2002@yahoo.com
8cb1f0cc7c moved the level varible from MTGcard to MTGprimitive. 2010-10-23 23:48:02 +00:00
omegablast2002@yahoo.com
a9e4c58af2 taught Ai how to use levelup creatures, taught Ai how to use Equip, taught Ai how to use prevent the cleric ability.
this is by no means absolutely perfect, i like it tho, and makes for some real good times with level up deck built with equips. 

you will notice i added a level=number...to the level up creatures, this has no effect on players, this is just a small hint to the Ai as to when it should stop investing mana in that creature. the chances are a little over half that ai will want to level a creature, increased ever so slightly with each level up.

for equipment, the Ai will now want to equip its best Creature(determined by power+toughness+convertedcost+how many abilities it has) and will want to equip these "better" cards atleast 2 times before it is reduced. same system for prevent damage, it will want to save its "better creature" more then a 1/1 token.

for both tho i added slight bonuses...
to equip, there is a higher chance that the ai will want to target a white creature, with an extra bonus if the creature is a 1/1 and nontoken. this is to encourage Ai to equip in white weenie decks

in prevent, there is a slight bonus if the creature is a 1/1 and the blocker/blockee has a power of 1. 

currently prevent damage treated this way is not coded for direct damage spell, sorry ! but for combat you will notice ai taking a stand and fighting back hard.
2010-10-23 22:34:07 +00:00
wagic.jeck
ab34fc16f9 Jeck - Added custom booster packs (see miki), numerous small fixes. Once we hit feature-freeze I'll be reviewing this stuff in depth, as again there's likely a lot of room for cleaning... just wanted to get it in first :).
I cut some bits out that weren't ready for SVN, hopefully I've committed everything correctly.
2010-02-11 18:32:44 +00:00
wagic.jeck
83e2b04547 Jeck - Added full filtering system to deck editor and shop. I've spent 24hours on pure debugging, but there are likely a couple bugs I've missed. So please, if you find something, make an issue of it! :P Also split OptionItem classes into separate files, and added support for mixed-set boosters (which I think are way, way cool). 2010-02-08 01:03:07 +00:00
jean.chalard
5a2bae75d5 J :
* Add newlines at end of files. This is for better portability.
* Fix a direct reference to g++ in the makefile
2010-02-02 10:19:43 +00:00
wagic.the.homebrew@gmail.com
05a72de5bc Erwan
- Card Primitives system. Check Royal Assassin in RV, 10E, M10
- Please review, is sets/primitives a good directory? Should we rename MTGCard into "CardPrint"? 
- Unfortunately for now it is not possible to "override" a Primitive. A card that links to a primitive but also defines new "values" will create its own data and ignore the data in the "linked" primitive for the time being. I hope to solve that at some point...
2009-12-27 12:14:36 +00:00
wagic.the.homebrew@gmail.com
512f649147 Erwan
- Adding cycling. Check Akroma's vengeance in ONS for an example. Note that this uses autohand instead of auto, this is important! You can also use autograveyard. 
- All "auto" activated abilities should work with autohand, so this is not only for cycling, but could be used for other abilities as well. For example autohand={3}:cycling can also be written autohand={3}{S}:Draw:1
2009-12-12 11:09:13 +00:00
wagic.the.homebrew@gmail.com
6c50c3d02a Erwan
-fix issue 219 (Tokens rarity)
2009-12-03 14:08:20 +00:00
wagic.the.homebrew@gmail.com
da9a82cff4 Erwan
- removed some unused code. Please review!
- Added protection from() auto keyword. It is still possible to use protection from [color] in abilities, but when it is not possible, please use protection from([target]) in auto=
2009-11-21 07:26:26 +00:00
wagic.jeck
37ad16d90e Jeck - Basic set metadata support. Also a minor improvement to WGuiImage.
* Metadata is currently only used in exactly one place: the set's "Pretty Name" is displayed when the set is first unlocked. 
* WGuiImage now has a function to set scaling.
2009-11-18 09:27:24 +00:00
wagic.the.homebrew@gmail.com
aa2121e4fa Erwan
- Fix issue 156 (artifact colors)
2009-11-14 13:15:22 +00:00
wagic.the.homebrew@gmail.com
273b0672e4 Erwan
- various optimization fixes
2009-10-19 11:37:47 +00:00
wagic.the.homebrew@gmail.com
59eb79fc47 Erwan
- fix issue 94 (enchant enchantments)
2009-10-01 13:33:40 +00:00
wagic.the.homebrew@gmail.com
78da055dd2 Erwan
-Adding "becomes(types,p/t,color abilities)" to the parser. Please do not use yet as it requires more testing
2009-09-30 12:28:50 +00:00
wagic.jeck
4b8d344bcd Jeck - Card ID collisions, cache fixes, cache deleted pooling.
* mtgid now defaults to 0.
 * TextScroller will not update when empty.
 * Cache now moves WCachedResources we're finished with to a garbage pool for later use (to reduce memory fragmentation). 
 * Demo still crashes... but I'm thinking that has to do with fragmentation, not a leak?
2009-09-19 01:48:42 +00:00
wagic.the.homebrew@gmail.com
163d296bb5 Erwan
- removed useless "color=" lines
- Added color override for cards such as crimson kobolds (note: color should be after the "mana" line to avoid side effects)
2009-08-28 13:40:14 +00:00
jean.chalard
3349f974f1 J :
* New interface.
* This breaks a lot of things. It is not feature-equivalent. It
  probably doesn't compile under windows and doesn't work on PSP.
* Damage is not resolved any more. This will have to be fixed.
* Blockers can't be ordered any more. This will have to be fixed.
* A lot of new art is included.
2009-08-22 05:59:43 +00:00
wagic.the.homebrew@gmail.com
71cc79b949 Erwan
- Replaced the BasicAbilities Array with a map. This reduces the size of MTGCard from >500 bytes to 392. Should be cool for people who have memory issues
2009-06-25 11:09:51 +00:00
wagic.the.homebrew@gmail.com
ab42e5db06 Erwan
- fixed card id collisions in Legends, Ravnica, Portal
- Changed Deck and Database structures with better design (a bit faster, hopefully a lot cleaner)
- updated Windows project file
2009-06-06 04:46:54 +00:00
wagic.the.homebrew
658ef1fb12 Erwan
- fixed a few bugs with the parser for subtypes
- fixed a bug for plague rats
- fixed a bug for P/T parser
- First release for the following sets: Mirrodin, Mirage, Lorwyn
2009-03-14 11:00:31 +00:00
wagic.the.homebrew
1251ef0096 Erwan
- Prevent TestSuite from crashing, by not showing big cards during the test suite
- Updated font size in game, to be readable
- WARNING!!! One test (brass man) not working anymore !!! High priority
2009-01-17 01:46:11 +00:00
jean.chalard
7f97862f5e J :
* Fix a couple warnings and a bug.
2009-01-06 13:22:29 +00:00
jean.chalard
3bb2c431c9 J :
* Split constants file to have them in a single place.
2009-01-06 13:07:28 +00:00
jean.chalard
3e9ff2b580 J :
* Change the name of debug.h into config.h and use the new RESPATH define.
2008-12-25 16:28:03 +00:00
wagic.the.homebrew
9dfc89815f Erwan
- Added Tokens (needs testing !!!)
- Added a few cards that create tokens
2008-12-16 14:20:03 +00:00
jean.chalard
c97dd1f260 J :
* Remove ^M's.
* Re-indent automatically.
* Remove whitespace at the end of lines.
2008-11-12 13:45:42 +00:00
wagic.the.homebrew
d45e3b101b 2008-11-02 09:50:16 +00:00