Mega Tact relaunch

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Image

Hey, it's the same map again!

There are other maps in the game -- no, really -- but since I'm showing off the map rotation feature this time, we're looking at good ol' Zirekile again for the sake of comparison. The disjointed bridge is an excellent graphical representation of why I chose the original angle. There's also the yawning abyss at the bottom left, which gets even thicker if you rotate the map further. Map rotation was available in FFT but not Old MT, so I'm happy to say I can successfully perform a matrix transformation (though probably not under duress -- linear algebra was over a decade ago).

Not pictured but relevant: if you hover your cursor over a map cell, that cell pops to the top, allowing you to more clearly see partially-occluded cells. That feature is new as well.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6461
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

looking good.
Whens the official relaunch? I want to see this stuff in action!

Mogri wrote:partially-occluded cells.
nice [s]wordage[/s] phraseology
Last edited by Spoonweaver on Thu Jan 03, 2019 10:33 pm, edited 3 times in total.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

It will probably not launch for some time. Progress has been slow recently. Best guess is several months on the low end.

I can probably get a partial build live without much trouble, allowing you to view maps/reference and edit units.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6461
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Ah, did not understand the nature of these updates. They seemed to be mostly finished from how you showed and described them and I was honestly wondering why they weren't live already.
I see now this should be seen as a sequel of sorts and not a small update.
Last edited by Spoonweaver on Thu Jan 03, 2019 11:14 pm, edited 1 time in total.
User avatar
TheLordThyGod
Slime Knight
Posts: 218
Joined: Thu May 14, 2015 9:18 pm
Location: Muscle Shoals, AL, USA, Earth, Solar System, Milky Way, Known Universe
Contact:

Post by TheLordThyGod »

Following.
...spake The Lord Thy God.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

After another hiatus (I am good at those), I'm back to working on some Mega Tact. This week, I created the unit icon -- it looks a lot like the previous unit icon, but this one is SVG, so it is happy to be any size.

The previous unit icon was generated on the server side. It took parameters such as the unit's facing, job, and team and spat out a compiled image. For example, uicon.php?i=8&t=2&f=2&j=16 produced this icon:

Image

The advantage of that approach is that it produced every unit icon the game needed. The disadvantage was that each unit required an HTTP request and some relatively heavy server-side computation.

Now, as it happens, SVG can do some really fancy stuff these days. It used to be that you could only include SVGs via the <img> tag, as in <img src="myImage.svg">. You can still do that, but you can also just include SVGs directly in HTML:

Code: Select all

<div class="unit team1" unitid="A">
   <svg viewBox="-1 -1 52 52">
      <path d="M50,25 L30,42.32 A20,20 0 1 1 30,7.68 L50,25" stroke="#000" fill="#777"/>
   </svg>
</div>
The great thing about this is that you can then use CSS that alters the SVG properties:

Code: Select all

.unit.team1 path &#123;
   fill&#58; red;
&#125;

.unit&#58;&#58;after &#123;
  content&#58; attr&#40;unitid&#41;;
&#125;
Just like that, the unit icon in the HTML snippet above is colored red and labeled with an "A" based on the container's attributes. I don't have the job icons up and running yet, but then I'm probably going to redo those anyway.

But all of this so far is just lead-in to the problem that I wanted to tackle. You might remember that I added buttons to let you rotate the map. Well, it's no good to rotate the map if the units don't also rotate to reflect the map's new orientation.

As a quick aside: generally speaking, I don't care too much for frameworks, transpilers, and the like. Historically, I've enjoyed using jQuery, but even that is just sugar now that vanilla JS supports most of the features I was using jQuery for. However, for Mega Tact, I'm making an exception for Sass, a CSS preprocessor. It doesn't do anything you couldn't do in CSS, obviously, but it does let you do it with much less work. Take this map styling, for instance:

Code: Select all

  @for $i from 0 through 40 &#123;
    .h#&#123;$i&#125; &#123;
      z-index&#58; &#40;$i * 2&#41;;
      top&#58; &#40;$i * -3px&#41;;
      left&#58; &#40;$i * 0.75px&#41;;
    &#125;

    .h#&#123;$i&#125;_5 &#123;
      z-index&#58; &#40;$i * 2 + 1&#41;;
      top&#58; &#40;$i * -3px - 1.5px&#41;;
      left&#58; &#40;$i * 0.75px&#41;;
    &#125;
  &#125;
With that small block, I've got styling for all possible tile heights. I mention this because Sass also allows inheritance, which is very useful for what I need to do here. First, I define the style rules for all four facings:

Code: Select all

%faceRight &#123;
  svg &#123;
    transform&#58; rotate&#40;0&#41;;
  &#125;

  &&#58;&#58;after &#123;
    top&#58; calc&#40;50% - 10px&#41;;
    left&#58; 30%;
    right&#58; auto;
    bottom&#58; auto;
    width&#58; auto;
  &#125;
&#125;

%faceUp &#123;
  svg &#123;
    transform&#58; rotate&#40;270deg&#41;;
  &#125;

  &&#58;&#58;after &#123;
    width&#58; 100%;
    left&#58; 0;
    bottom&#58; calc&#40;30% - 3px&#41;;
    right&#58; auto;
    top&#58; auto;
    text-align&#58; center;
  &#125;
&#125;

/* and so on */
Then, I can easily apply rotation to every unit on the map:

Code: Select all

.rotate1 .unit &#123; @extend %faceUp; &#125;
.rotate1 .unit.f1 &#123; @extend %faceLeft; &#125;
.rotate1 .unit.f2 &#123; @extend %faceDown; &#125;
.rotate1 .unit.f3 &#123; @extend %faceRight; &#125;

.rotate2 .unit &#123; @extend %faceLeft; &#125;
.rotate2 .unit.f1 &#123; @extend %faceDown; &#125;
.rotate2 .unit.f2 &#123; @extend %faceRight; &#125;
.rotate2 .unit.f3 &#123; @extend %faceUp; &#125;

.rotate3 .unit &#123; @extend %faceDown; &#125;
.rotate3 .unit.f1 &#123; @extend %faceRight; &#125;
.rotate3 .unit.f2 &#123; @extend %faceUp; &#125;
.rotate3 .unit.f3 &#123; @extend %faceLeft; &#125;
When I rotate the map, I just add a rotateX class to the container, and all of the units will display appropriately.

Thank you for joining me in this extremely minor update with extremely major CSS geekery.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Time for some "exciting" UI updates.

Image

While I can't say I've been looking forward to this, exactly, I'm at a point in the development where I need to get the Create Battle UI working. So here we are.

To a large extent, this is going to resemble the old Mega Tact, but if you look closely, there's a new feature here. Do you see it?

It's those colored boxes! Are you excited yet? Well, the feature isn't just choosing your color; it's assigning multiple player slots to the same team. You can go 2v2 or 1v3 or 1v1v2 in addition to all of the old formats.

And that is 100% as exciting as I can make this sound. I do not particularly enjoy working on this portion of the application!
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

A MONTH AND A HALF LATER

Image

Hey, it's a Create Battle page.

Actually, this really isn't that different from the existing Create Battle page. The major addition is the Zodiac dropdown. Here are the settings you can play with:
  • As-is: Units will keep their assigned Zodiac signs.
  • No Serpentarius: Units with the Serpentarius sign will be assigned a different sign at random.
  • Flatten: All units will be given the same Zodiac sign, eliminating all Zodiac compatibility effects. Great for players who would rather not worry about compatibility.
  • Shift: Units' Zodiac signs are randomly shifted on a per-team basis. Any existing Zodiac compatibility within all players on a team is retained, but compatibility with opponents will be unreliable. This setting helps to limit Zodiac metagaming. Units with the Serpentarius sign are unaffected by Shift.
  • Standard: Combines Shift and No Serpentarius. This is the default selection.
  • Randomize: All units are assigned Zodiac signs at random from the 12 standard signs. Good luck!
It also bears mentioning -- though I may have said it upthread somewhere -- that units you register for a battle will automatically be adjusted to fit the battle requirements. In the case of equipment, this will often prove suboptimal, but it means you don't need to create 99 different Geomancers just so you have one for each possible level cap.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

I was out of town for about a month and a half during the summer (the joys of a fully remote job!), and I decided before I left that I wasn't going to work on Mega Tact during that time. My development environment is set up on a desktop computer, and I didn't want to go through the hassle of transferring it, especially since I would have to set things back up when I got back.

So things have been moving slowly recently, but I'm back on the wagon, and I'm happy to say you can now... almost create battles.

Which might almost sound like progress, but that's brushing aside a lot of really (I promise) important refactoring work that won't matter to anyone else. Besides that, there's plenty of validation surrounding battles, maps, formats, and so on that actually is working.

The intent when I first set out to relaunch was that I would do a bare minimum of refactoring, but that went out the window basically immediately. :)
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

The battle creation interface is finished. Up next, I need to allow users to accept and join battles.

While we wait for that, I'm happy to announce that Mega Tact has entered a limited release. Join up and create units, or just take a look around at the features I've been teasing over the past year. (The maps are really cool!)
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

The website looks good. But how to sign up? Only via Twitter?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I tried signing in with Twitter, but nothing happens when I click the button (maybe because I am on mobile?)
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Interesting. Google doesn't show up on mobile, and Twitter shows up but doesn't work. I'll do some digging -- of course, all my development and testing have been on actual computers.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Mogri wrote:Interesting. Google doesn't show up on mobile, and Twitter shows up but doesn't work. I'll do some digging -- of course, all my development and testing have been on actual computers.
Whoops! Apparently, I forgot to upload any JavaScript when I deployed. This would essentially mean nothing was working.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

I'm working on battle registration now. This will work very differently from the old Mega Tact -- I've talked about this a bit already. Here's the new flow:

When you create a battle, you can specify restrictions on level, items, unit types (e.g. "Generic Human" or "Generic Monster"), and more.

When you register for a battle, you select which units you're going to include in the battle from your full list of units, excluding only units of a type forbidden by the battle. Everyone else gets adjusted so that their level and equipment are legal for the battle. (This means, among other things, that the concept of "Teams" is absent from new Mega Tact.)

I've just finished with the equipment adjustment logic. In many cases, this is pretty uninteresting: sure, there's a huge list of Pareto-optimal equipment in the game, but when your preferred sword is banned, you'll just go for the strongest one available. Equipment is always swapped for the same type of equipment, so if you had a spear, you'll still have a spear (as long as there's at least one in the equipment pool).

However, things get a lot trickier when it comes to accessories. Unlike other equipment, there's no clear progression within accessories: if you can't have the Genji Gauntlet (MA+2, PA+2), does it get swapped for the Magic Gauntlet (MA+2), the Bracer (PA+3), or perhaps the Diamond Armlet (MA+1, PA+1, Immune: Slow)? What about perfumes such as Setiemson (Always: Haste, Initial: Transparent) for which there is no real substitute?

The answer really comes down to what the player was trying to do with the chosen accessory, and that's impossible to figure out programatically. The good news is that the auto-replacement algorithm is only intended to be "good enough," and we can achieve that. It looks at what parameters the intended accessory boosts and grabs the best choice for those parameters among the available accessories. In the case of oddball items like Feather Boots (Always: Float), there's no adequate replacement, and we default to the best available mantle for an evasion boost. If all else fails, we pick the most expensive option to break ties.

The algorithm is robust enough to keep working once custom equipment is introduced. The core item set is friendly enough to include only stat bonuses, though; custom equipment with tradeoffs could make the recommendations harder to swallow.
Post Reply