Brainstorming With Transpose

Sometimes I get stuck and look for a way to think about a problem a different way. There are some problems that you can view in the form of a matrix/table. The structure looks like this:

A B C D E
1 A1 B1 C1 D1 E1
2 A2 B2 C2 D2 E2
3 A3 B3 C3 D3 E3
4 A4 B4 C4 D4 E4
5 A5 B5 C5 D5 E5

There are rows and columns, and I'm trying to work on the cells. Let's try an example from a simple game:

Attack Defend Special
Fighter sword armor slam
Mage fireball reflect freeze
Thief dagger dodge disarm

The rows are the character classes: Fighter, Mage, Thief.

The columns are the types of actions: Attack, Defend, Special.

The matrix contains all the code to handle each of these types of actions for each of the types of characters.

What does the code look like? The usual thing to do is to organize this into three modules:

  1. Fighter will contain code to handle sword attacks, damage reduction from armor, and slam special attacks.
  2. Mage will contain code to handle fireballs, damage reflect, and freeze special attacks.
  3. Thief will contain code to handle dagger attacks, damage avoidance from dodge, and disarm special attacks.

Sometimes it's useful to transpose the matrix. I can organize along the other axis:

Fighter Mage Thief
Attack sword fireball dagger
Defend armor reflect dodge
Special slam freeze disarm
  1. Attack will contain code to handle sword attacks, fireball attacks, and dagger attacks.
  2. Defend will contain code to handle damage reduction, damage reflect, and damage avoidance.
  3. Special will contain code to handle slam, freeze, and disarm.

I was taught that the one style is "good" and the other style is "bad". But it's not obvious why this should be so. The reason is that there is an assumption that we will often add more character classes (nouns) but rarely add more types of actions (verbs). That way I can add more code with a new module, without touching all the existing ones. It may or may not be true for this game. By looking at the transpose, it makes me aware of the assumption, and I can question it. I'll then think about what kind of flexibility I want, then decide on the code structure.

Let's consider another example.

In programming language implementations, there are different types of nodes corresponding to the primitives: constants, operators, loops, branches, functions, types, etc. I need to generate code for each of these.

Generate Code
Constant
Operator
Loop
Branch
Function
Type

Great! I can have one class for each type of node, and they can all derive from a superclass Node. But this is based on the assumption that I will often add more rows and rarely add more columns. What happens in an optimizing compiler? We add more optimization passes. Each one is another column.

Generate Code Data flow Constant folding Loop fusion
Constant
Operator
Loop
Branch
Function
Type

If I want to add a new optimization pass, I would need to add a new method to each class, and all the code for an optimization pass is spread out all over the place. This is the situation I was trying to avoid! So some systems will add another layer on top of this. Using "visitors" I can keep all the loop fusion code in one module instead of splitting it up among lots of files.

If I look at the transpose of the matrix, it reveals another approach:

Constant Operator Loop Branch Function Type
Generate code
Data flow
Constant folding
SSA
Loop fusion

Now instead of classes with methods, I can use tagged unions with pattern matching (not all languages support this). This keeps all the code for each optimization pass together without requiring the indirection of visitors.

It's often useful to look a a problem in terms of a matrix. Applied to the object-oriented structure that everyone thinks about, it might lead me to use something different, such as an entity-component-systems, relational databases, or reactive programming.

It's not just for code. Here's an example of applying the idea to products. Let's suppose there are people with various interests:

Nick Feng Sayid Alice
cars X X
politics X X
math X X
travel X X

If I were designing a social web site, I might let people follow other people. Nick might follow Alice because they're both interested in cars and Feng because they're both interested in travel. But Nick would also get Alice's math posts and Feng's politics posts. If I consider the transpose of this matrix, I might let people follow topics. Nick might join a cars group and also a travel group. Facebook and Reddit started around the same time, but they're transposes of each other. Facebook lets you follow people; Reddit lets you follow topics.

When I get stuck, or when I'm wanting to consider alternatives, I look at the problem to see if there are multiple axes of organization. Sometimes approaching the problem from a different direction can yield a better approach.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

(22MB) Download Subway Surfers For Free

(22MB) Download Subway Surfers for Free


SCREENSHOT




System Requirements Of Subway Surfers Download For Free

  • Tested on Window 7 64 Bit
  • Operating System: Window XP/ Vista/ Window 7/ Window 8 and 8.1/10
  • CPU: 2.0 GHz Intel Pentium 4 or later
  • RAM: 512 MB
  • Setup size: 22 MB
  • Hard Disk Space: 200 MB









  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Book Review - The Italian Wars Part 1 Helion Publishing


Something I've not done before, a Book Review, Yarkshire Gamer is turning into Radio 4 I hear you cry !

To make life easier the extensive Production Crew at Yarkshire TV have done a little 5 minute feature on the book.


The book can be purchased direct from the publisher on the link below, £19.95 including post and packing,

https://www.helion.co.uk/military-history-books/the-italian-wars-volume-1-the-expedition-of-charles-viii-into-italy-and-the-battle-of-fornovo.php


There are 128 pages with black and white illustrations throughout and colour plates (example above) in the centre.

It contains everything you would expect from a Book of this type, history, armies involved, battle description etc, I particularly liked the modern day photos of the field and also the "orbat" in the Appendix.


So in short everything I needed a year ago when I started my army ! Is there a conspiracy 🤔 plenty of new ideas for units going ahead. Definitely Recommended


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Independence Day 2020


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

We Are Back RPG - Republic Of PC Games With More Games With Installation...

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Press Release: Robot Fight Club - KICKSTARTER LAUNCHING 10Th MARCH 2020

Robot Fight Club
A game of card-fueled customisable combat where schoolkids in a retro-futuristic setting repurpose abandoned robots and launch a thrilling new combat sport.

KICKSTARTER LAUNCHING 10th MARCH 2020
Needy Cat Games, the game design team behind titles like Hellboy: the Board Game, Blitz Bowl, Devil May Cry: the Bloody Palace and Adeptus Titanicus, is excited to announce its first solo project: Robot Fight Club! The game will be hitting Kickstarter on the 10th of March, and we are mecha excited! (Sorry.) 

The game is set in a retro-futuristic world where a group of schoolkids have snuck into an abandoned robotics academy, and started up a secret fighting league with a bunch of renovated robots. Robot Fight Club is a two-player arena combat game which offers fast-paced, action-packed gameplay that rewards strategic thinking, forward planning and a healthy dose of risk taking. 

A session of play starts with both players choosing a character and building a team of two robots, each equipped with a range of system upgrades. Each of the six robots available in the core game has its own unique set of capabilities and control cards, and with 36 upgrade cards available, no two teams will be the same! With their teams built, players take to the arena, trying to win the best of three bouts and be crowned the champion. Bouts usually last 15-20 minutes, so a full play session can be completed in around an hour. 

The action during a bout features grid movement and simultaneous action selection, with players choosing from their limited (and ever-dwindling!) Control Decks to move around the arena, bring their systems online and deal some damage to the other team. You each have two robots in the arena but can only activate one at a time, and as your deck starts running low you'll have to decide whether to Reset, sacrificing a round of play to reclaim your discarded cards. 

Damaged robots drop scrap tokens into the arena, where they can be collected by either side. They act as a currency in the game – but do you spend them on rule-bending Innovation Cards during the bout, or save them for the post-bout refit where you can buy and install new upgrades? 

There's a whole heap of gameplay in the core game, but the After School Special and Extra Credit expansions add more robots and upgrades, arena hazards, support for three and four player games, and much more. 

"Robot Fight Club is a really special project for us. First up, it's our first indie game – we're doing this for ourselves for once! More importantly it brings together a lot of things we love to see in board games: a fun setting, a bevy of interesting decisions and a bunch of robots beating the oil out of each other. What's not to love?" – James M. Hewitt, game designer

So come and join the club. Fight for thrills, fight for glory, but most of all, fight for fun – because robot fighting is awesome!

Robot Fight Club is the first game published independently by Needy Cat Games and has been designed by James M Hewitt (Hellboy: The Board Game, Devil May Cry: The Bloody Palace, Blitz Bowl, Adeptus Titanicus, Warhammer Quest: Silver Tower, Gorechosen) and Sophie Williams (Hellboy: The Board Game, The League of Infamy, Bonefields: Ancient Grudges). 

About Needy Cat Games
Needy Cat Games is a small board game design studio run by James M Hewitt and Sophie Williams, based in Nottingham, UK. They've been designing games under the Needy Cat name since 2017 but James previously worked as a game designer for Games Workshop, where he worked on a number of bestselling titles. And yes, they do have a very needy cat. His name is Helo, and he is the worst. 

Key details and links
Number of Players: 2 (Expansion pack allows for 3 and 4 player games)
Time Required: 60-90 minutes.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Anyone Want To Go To GDC???





So you're a student with limited funds, your University can't send you, or you just want to lend a hand. Whatever the reason, you may still be able to attend this premiere event by becoming a Conference Associate. Are you willing to earn your attendance (and a little extra money) by doing about 25 hours of on-site work? Apply to be a Conference Associate (CA)!

Click here for more information about becoming a GDC CA!

If you still have questions after visiting that link, you can contact our CA Manager, Ian MacKenzie, at camanager@calounge.com.
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS