Search This Blog

Playing with Gravity to Learn CUDA: A 2-Body Simulation

In the last post of this series on learning CUDA through building a gravity simulation, we didn't actually do any CUDA. We focused on defining gravity and figuring out how we were going to actually simulate it with practical equations. Now it's time to put those equations to work and see if we can come up with a functioning simulation that uses CUDA. We'll start with the simple 2-body problem of the Earth orbiting around the Sun, and see if we can keep the Earth in orbit.

Earth in orbit around the Sun

Playing With Gravity to Learn CUDA: A Fundamental Force

We started out this series on learning CUDA by diving in and writing a couple CUDA programs that we then got up and running on an nVidia graphics card. That was a great start that gave us an immediate feeling of accomplishment, but to keep advancing toward our goal of building a multi-body gravity simulation, we're going to have to take a break from CUDA and make sure we understand gravity a bit more. Gravity can be modeled at different levels of complexity, so we'll want to decide at what level we want to model it. We'll certainly start simple, but it's still good to know enough about gravity to know where we could go if we wanted and where it's not worth it to explore.

Orbiting neutron stars with gravitational waves

Playing With Gravity to Learn CUDA: Hello, World

I have been interested in CUDA for a long time, and while I've read a few books on CUDA, I have not actually gotten my hands dirty with it, yet. It's time to remedy that situation with this new blog series where I explore CUDA programming with a purpose. The end goal is to create a CUDA program that runs a scalable, multi-body gravity simulation on my GPU. Maybe I'll even draw what's being simulated on the screen. I'm not sure at this point how big I'll be able to make this simulation, but I think it'll be a good way to dive into CUDA and see what it's all about. The real goal here is to experiment, fail, struggle, and learn while having some fun doing it.

Representation of Sun-Earth Gravity

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Dogfooding

This is it―the last post of this series on exploring the monster taming mechanics of Final Fantasy XIII-2 is finally here, and in it we're actually going to do what the title says. Now that we've integrated all of the tables of data that we extracted from the FFXIII-2 FAQs into a functional website, we're ready to use that website to explore how to optimize the monster taming as we play through the game. This exercise is known in the tech industry as dogfooding, where we proceed to eat our own dog food, so to speak, to see whether or not the product we're building is any good. During the course of using the website, we may find opportunities for improvement, missing features, and other things that could just be done better. It's an excellent way to iterate on a product to improve it.

Final Fantasy XIII-2 monster taming Odin

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Monster Characteristics

We've done something with just about all of the data we've extracted on monster taming in this series on exploring Final Fantasy XIII-2 monster taming mechanics—except for the monster characteristics. Last time we finally integrated the monster materials table into our website, so now we're ready to tackle the last orphaned data. But what should we do with these monster characteristics? They each consist of only a name and a description, so it seems kind of boring to just link their names in the monster table to the monster characteristics table. We should be able to do something more useful with them. Conveniently, Bootstrap has a tooltip component that would be a perfect use for this data, so we're going to explore that idea.

Final Fantasy XIII-2 Svarog

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Finding Monster Materials

We've started asking deeper questions of the monster taming data in this Exploring Monster Taming Mechanics series, but so far we've ignored the fact that these monsters can level up once we've tamed them. Their starting stats and abilities will not stay the same while the monsters develop, so we should take that into account when we're trying to find the strongest monsters. Monsters that can level up to higher levels are going to end up stronger than other monsters that may start out stronger but can't level up as much. And the way these monsters level up is by applying certain materials dropped by defeating other monsters in battle. We need to know when and where we can get those materials, so that is the subject of this post.

Final Fantasy XIII-2 Battle Scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Asking Deeper Questions

So far in this Exploring Monster Taming Mechanics series, we've parsed a bunch of data, built up database tables, and connected them together in a website with some filtering sprinkled in. This setup allows us to browse around the data pretty easily and ask some basic questions of the data. Now it's time to think about how we can ask deeper questions. Instead of just asking things like, "What monsters have the Auto-Bravery ability," we want to be able to ask, "Where is the earliest location where I can get a monster with the Auto-Bravery ability?" Sounds like a useful think to know, right? Let's figure it out.

Final Fantasy XIII-2 Narasimha tamed

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Filtering Monsters

We've finished building up views and controllers in the Rails MVC architecture for the various tables of monster data we have in this Final Fantasy XIII-2 monster taming mechanics series. However, some of the navigation for the latest monster details page and ability table pages is a bit clunky, so we're going to improve that today. First, when a link is clicked in the monster details page to go to the ability table, the clicked ability is highlighted, but the user needs to search through the table to find the highlighted row. We'll see how to go to the desired row directly. Then, we want to make the return trip from a link in the ability table take the user to a monster table that shows only the monsters that have that ability. Let's see how it's done.

Final Fantasy XIII-2 Battle Scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Viewing More Monster Data and Abilities

We've been building up views and controllers in the Rails MVC architecture for the various tables of monster data we have in this Final Fantasy XIII-2 monster taming mechanics series. We're now almost ready to finish off these table views with the ability tables, but before we do that, we need a place for the links to those ability tables to exist. The number of abilities for each monster is too much to put in the main monster table page, so we'll need to first build a details page for each monster before we can link up the monster abilities with the ability tables. Let's get started on that details page.

Final Fantasy XIII-2 Battle Scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Viewing the Monster Data

Last time in this Final Fantasy XIII-2 monster taming mechanics series, we continued building views and controllers in the Rails MVC architecture for the monster characteristics and game locations tables. Now it's time to tackle the main table of the site: the monster table. Once we have this monster table, we'll want to add links to the elements of the table so that we can jump directly to related tables of interest. We'll learn how to do that task as well, and we'll see just how easy Rails makes it.

Final Fantasy XIII-2 battle scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Viewing More Data

In the previous episode of this Final Fantasy XIII-2 monster taming mechanics series, we started looking at the view and controller parts of the Rails MVC architecture by building views of the monster material table and the site index. Now it's time to expand our views to some more of the simpler tables, and in so doing, we'll need to improve our site navigation so that we don't have to keep going back to the home page to get anywhere else. We'll build up the monster characteristics and game locations views so that we have something to fill out our navigation, and then we can see how easy it is to build a site-wide navigation bar using Bootstrap. Let's get started.

Final Fantasy XIII-2 battle scene with Cactuar and Chocobo

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Viewing Data

Rails apps are built on an MVC (Model, View, Controller) architecture. In the last few articles of this miniseries, we've focused exclusively on the model component of MVC, building tables in the database, building corresponding models in Rails, and importing the data through Rails models into the database. Now that we have a bunch of monster taming data in the database, we want to be able to look at that data and browse through it in a simple way. We want a view of that data. In order to get that view, we'll need to request data from the model and make it available to the view for display, and that is done through the controller. The view and controller are tightly coupled, so that we can't have a view without the controller to handle the data. We also need to be able to navigate to the view in a browser, which means we'll need to briefly cover routes as well. Since that's quite a bit of stuff to cover, we'll start with the simpler monster material model as a vehicle for explanation.

Final Fantasy XIII-2 Battle Scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: The Remaining Tables

Continuing this miniseries of exploring the monster taming mechanics of Final Fantasy XIII-2, we'll finish off the remaining database tables that we want for the data relevant to monster taming. In the last article, we filled in a second table of passive abilities and connected those abilities to the monsters that had them through references in the monster table that used foreign keys to the ability table. In the first article, we had identified four tables besides the monster table that we would need as well, these being abilities, game areas, monster materials, and monster characteristics. We did the passive abilities table, but we still need a table for role abilities. In addition to this role ability table, we'll finish off the game areas, monster materials, and monster characteristics tables. These tables are all small, so we should be able to get through them without much effort.

Final Fantasy XIII-2 Battle Scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Relational Data

In this next installment of the miniseries of exploring the monster taming mechanics of Final Fantasy XIII-2, we'll fill out another database table that we need in order to start connecting all of the monster data together. In the last article, we built the core monster table with hundreds of attributes for each of 164 monsters. In the first article, we had identified four other tables that we would need as well, these being abilities, game areas, monster materials, and monster characteristics. The data in these four tables is all related in one way or another to the monsters in the monster table. We'll start with the abilities table, which will end up being three tables because we actually have passive, command, and role abilities. Once the passive abilities table is complete, we'll see how to connect that data in the database so that we can later make inferences on the data.

Final Fantasy XIII-2 battle scene

Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Data Validation and Database Import

Continuing on with this miniseries of exploring the monster taming mechanics of Final Fantasy XIII-2, it's time to start building the database and populating it with the data that we collected from the short script that we wrote in the last article. The database will be part of a Ruby on Rails project, so we'll use the default SQLite3 development database. Before we can populate the database and start building the website around it, we need to make sure the data we parsed out of the FAQ is all okay with no typos or other corruption, meaning we need to validate our data. Once we do that, we can export it to a .csv file, start a new Rails project, and import the data into the database.


Exploring Monster Taming Mechanics in Final Fantasy XIII-2: Data Collection

The monster taming aspect of Final Fantasy XIII-2 is surprisingly deep and complex, so much so that I'm interested in exploring it in this miniseries by shoving the monster taming data into a database and viewing and analyzing it with a website made in Ruby on Rails. In the last article, we learned what monster taming is all about and what kind of data we would want in the database, basically roughing out the database design. Before we can populate the database and start building the website around it, we need to get that data into a form that's easy to import, so that's what we'll do today.

Exploring Monster Taming Mechanics in Final Fantasy XIII-2

Let's just get this out of the way. I'm a huge Final Fantasy fan. I adore the original game even today, Final Fantasy VI is definitely the best of the franchise, and I've found things to enjoy in every one that I've played, which is nearly all of the main-line games. (I still haven't managed to crack open FFIII, but I plan to soon.) Even each of the games in the Final Fantasy XIII trilogy had something that drew me in and kept me going through the game, wanting to learn more. These games get a lot of flack for being sub-par installments in the Final Fantasy franchise, and some of the criticism is warranted. The story is convoluted, and the plot is as confusing as quantum mechanics.

That debate, however, is not why we're here now. We're here to look at one of the great aspects of FFXIII-2: the monster taming and infusion system.


The Year in Review, Just the Leisure Time

Last January I did a review of how I spent my leisure time the previous year, and I set down a few expectations for the coming year, now past. It's time to look back and see how my actual activities stacked up to my expectations, and maybe learn something for the fresh year to come in 2020. I had big ambitions between reading, blogging, and playing, and not all of them were achieved. But, that's okay because it makes it easier to figure out what I want to do this year—some of what I didn't finish last year, and some new ideas and desires. How I spend my leisure time is very important to me. It should be at the same time relaxing and reinvigorating, enjoyable and enriching, soothing and stimulating. If one thing is obvious, it's that I still love to read because it hits all of those notes, and that is likely to continue in the year(s) to come.