JJSBlog

When 140 characters won't do.

NX is Switch

- Posted in Video Games by with comments

So today the NX was unveiled as the Nintendo Switch, and... it's pretty much exactly what the solid rumors of the last few months have said, so my previous post about why I was positive on NX still applies. There are a few things technically still up in the air. Like after the video, people started wondering why it never showed the screen used with touch? And relatedly, the split controllers were never explicitly shown to use motion controls, either. So was it an indication Switch has a regressive control scheme in order to make identical controls for home/go modes easy? I don't think so. The same solid set of rumors that were right about 90+% of everything so far also say it's got a multi-touch screen and motion controls similar to Wii Remote Plus, so why start doubting them now? It seems like Nintendo just wanted to push a simpler message today about playing the same games at home or on the go with a few standard control options, and didn't want to deviate into more specifics in a 3-4 minute video.

As is always the case, there is some doubt about whether the name is good. I'm a bit split on it. I don't think it's particularly awful, and don't think Switch is worse than Box, Cube, Station, or other things game systems have been named... except they haven't been ONLY named those things. Without some other word attached, Switch feels kind of like some regular dictionary word accidentally got promoted. Just Switch, not GameSwitch or XSwitch, or PlaySwitch or any other such thing. I could go for the DipSwitch myself, controlled by the Dip-Cons and the analog Dipstick.

One of the more interesting rumored/speculated things that turned out to be accurate is that the two controller halves (Joy-Cons) can each be used individually for simpler multiplayer control. A big question was how do you design something that works well both in tandem vertically and solo horizontally? The answer seems to be... well, you have to let one suck a bit more. The sideways mode definitely doesn't seem the way many would choose to play. The analog stick and buttons are cramped pretty close together, and depending on whether you're using Joy-Con L or R they're off-center to one side or the other. What are the shoulder/trigger buttons when played normally are still present, but will be located awkwardly to either the left or right side. Still, I see this as more of the emergency setup. If you're really planning on some multiplayer you'll get extra sets of Joy-Cons or Pro Controllers, but this is the way that you can be sure to NEVER be without a multiplayer option, and any two Switch owners who meet up are equipped to get four-player going.

There's been some concern about Nintendo saying it's first and foremost a home console. Buuuut this seems totally a PR thing, like back in 2004 when they were claiming the DS was a third pillar separate from GBA. In this case, the Wii U is much deader than the 3DS, so it needs replaced first. There's also that while neither price nor battery life has been announced yet it seems both will be notably worse than 3DS for now, so it's better to talk up its console side while 3DS is more slowly phased out over the next couple years. By that point Switch can be cheaper and have better battery life, either by way of larger battery or system revisions. Maybe even a smaller variant meant more for portable play, the opposite of the XL machines the DS and 3DS got. But it still seems clear Switch is the basket Nintendo intends to put all of its development eggs into if the public will let them.

One game I was very happy to see in the video was Skyrim! With the remaster coming it was one I hoped for as there was no technical reason not to, but feared that either due to western third parties' dismissive nature towards Nintendo machines and the hardware not being out for months after the remaster's October release it would be considered too late. But here it is. Some question why it's such a big deal for a port of an old game shown in a new console announcement video. I'd say the biggest thing is it shows Nintendo getting support from companies who traditionally haven't bothered with their hardware, and showing off a type of game that's never had a proper portable version is no little deal either.

There were snippets of some other Nintendo games in the trailers, but not a whole lot to tell about them from a few seconds of footage each. The 3D Mario platformer did interest me, though--with the camera angle used it didn't seem like a "3D World" style game, and nor did it seem to be based on planetoids like the Galaxy games. So it seemed most similar to the oldest 3D Marios, Super Mario 64 and even moreso Super Mario Sunshine--and by the time this one releases it might be 15 years since SMS's release.

GameMaker Arrays

- Posted in Uncategorized by with comments

So I wanted to continue working on the system of different asteroids for different sizes. My thought is I'll have an array (or series of parallel arrays) which will have information like minimum mass, maximum mass, sprite used, name of object. Then given a certain mass it can pick only from valid options. Both a minimum and maximum are because I figure it's more interesting if there's some overlap between types of objects, rather than a flat cutoff. Or it could even be possible to have rare objects that only exist in a very narrow range. Whatever. But before doing this I needed to see how arrays work in GameMaker, and it seems... kind of stupid. More a pain to use than in other languages I've dealt with.

Thing 1: Initializing arrays. In some languages, you can just give a specific size for an array. In other languages, it doesn't set limits, and you can even use words as keys for the array rather than just a series of integers. In GML, you need to initialize every spot in the array similar to declaring a variable, before the program is allowed to do anything with it. Like for Zenzenzen purposes if I wanted to keep track of the last 10 asteroids I merged with for whatever reason, I'd first have to do some sort of loop and set lastmerged[i]=0 as a default value or whatever.

Thing 2: Initializing the data in arrays. In PHP which I've used the most in recent years, if I want to set up an array with multiple values it can be as simple as $Names = array("Josh", "Zach", "Austin", "Luke"). In GML that isn't done. I'd need to have a line for name[0] = "Josh"; and another for every other value. It seems like unless you're dealing with a very small set of data it will be the sensible thing to set up a file with the data (or a string which can be made to be treated like a file) and read that into an array with a loop.

Asteroid types

- Posted in GameMaker by with comments

Asteroid types

One of the plans from the beginning was that as the player grew, they'd see different types of objects, while thus far I've just used the one asteroid shape. Well today I've added two more. Still crude placeholders and the code working them is also basically a crude placeholder, but now that the crude way is up and running I can replace bits of it at a time.

I added in new sprites for circle and diamond asteroids, each with the same number of color variations as the original. When an asteroid is created it checks its mass. If it's over 10000, it's a diamond. Otherwise if it's over 100, it's a circle. Otherwise, it's the regular asteroid. Regardless of sprite, behavior remains the same. Also added in that pressing X creates a random asteroid at a random location on the screen, with possible mass ranging from 1/10 to 100x the current ship mass.

Here's a shot from early on, with a few large circles in play.

And later having built the ship up, things look like this. If you look closely at the ship, you can see now-small circle asteroids layered on it.

Death of a scan bullet

- Posted in GameMaker by with comments

So I previously described my "scan bullet", which I thought was a pretty interesting way to get the results I wanted, but obviously flawed. With a bit of advice from folks at NeoGAF's GameMaker thread, though, I learned of a few tricks to do it better without an actual scan bullet object. As I said there, GameMaker's help system is very nice, but it can still be trouble to find if a certain type of function actually exists if you don't know quite what to search for. In this case I learned of a few important things.

The collision_line function can take a start point and end point, and return whether there would be a collision with a certain kind of object anywhere along that line segment. The problem is, if it would collide with multiple things along that line, it seems to just return information about one of them at random. So not perfect by itself for determining what is right in front of the ship.

Lengthdir_x and lengthdir_y are used for finding points a certain pixel distance away from a point at a certain angle. So knowing where the ship is located and what its angle is, this can check for what's 1 pixel in front of it, 2 pixels in front, and so on. So it's easy enough to do a loop of this and return information on the first asteroid (if any) it comes across.

It might be the case that there would be some computational savings from doing collision_line to see if there's any collision at all, then using a lengthdir loop to make sure the closest is found... but I'm not sure how much of a savings, and for my simple project where it's only being used to check one thing probably not worth the hassle, so I'll just put collision_line back on the shelf for now.

Pork Anus, continued

- Posted in Uncategorized by with comments

I know it wasn't a serious project, but I wanted to compile Pork Anus for Android so my buddy could see it run on the phone. However, keyboard controls are pretty much a no-go, so this did involve a little extra coding to add mouse/touch control. Pac-Man doesn't move any faster, but now if there's a mouse/finger press on the screen he moves directly towards that point, and is himself angled appropriately toward it. Also added in a Game Over for the unavoidable eventuality of getting 50 green anuses on screen at once, rather than just letting it freeze.

If you want to try the new and improved Android Pork Anus, here's the APK.

Loading images from the Internet

- Posted in GameMaker by with comments

Away from home today, so I decided to try something mostly unrelated to what I've done before--loading files from the Internet. Since online databases are one of the things I do, I think it might be interesting to draw info from them into a program made with GameMaker, either as a way to make a sort of custom app for accessing the information, or just pulling live information as an alternative to only using whatever data the game has been built with. In this case I used files from the DohBell database. Since the cover thumbnail images are stored in one directory with standardized naming and each single/album is guaranteed to at least have a Regular cover, then it is easy to get a valid cover image URL from a random number.

So I made a simple sprite and object for a button inviting myself to Click. When it's clicked it picks a random number from 1 to 600 and tries to load the regular cover JPEG for that number. When that's done it goes to a new image loaded event (since to just wait for it would cause the program to pause indefinitely) that assigns that loaded image to a new "rect" object. Then to make things a little less boring and more like some kind of screensaver, I made the rect object so it picks things like a random size (from quarter-size to full size), a random speed (1-3 pixels diagonal per frame), and made the images bounce off the edges of the window.

Result: it works. Though you'll just have to trust me that things were actually moving around.

Pork Anus

- Posted in GameMaker by with comments

Something a little different today. I wasn't sure whether to bother documenting this, but what the hell. I was showing off GameMaker to a friend of mine in person, showing how quickly one could get something simple with interesting effects going, and basing it loosely on some messages he'd sent me over Steam a few days before about transforming Zenzenzen into something called Pork Anus. So here's the rundown of how our Pork Anus ended up.

Player sprite is a straight-up Pac-Man ripoff with several frames of animation for mouth opening done roughly by me deleting parts of a circle. He moves in four directions by the arrow keys, with the sprite rotating for each. This does mean going left he appears to be upside down from the regular player's point of view.

"Pork Anus" object says that in text. Appears in a random location on screen, and every frame has a chance to move some a bit on the X and/or Y axis, which in practice means it moves in kind of a jerky diagonal. Whether he goes left or right, and up or down, is randomly determined at creation. Was having problems getting this to wrap around the screen edges correctly, so instead when it leaves the screen it gets destroyed and a new random one created. When Pac-Man collides with one of these he grows by a few percent, and a new random Pork Anus is created. Also when Pac-Man gets one of these a voice clip of me saying "Pork Anus" plays.

Second object is more of a graphical anus, but still very loosely. It is the more interesting thing in terms of trying out new ideas. It moves forward at a constant speed, with every frame a chance to alter its angle somewhat--in practice this means every several seconds it takes a slight turn and keeps moving that direction. When Pac-Man hits one of these he shrinks, but not evenly by X and Y, so he ends up more stretched with time. When one is destroyed by running into Pac-Man, one is always created to take its place, and there's a chance of a second--so as the game goes on they become more numerous and hard to avoid. Also, if they overlap with each other they start to grow. With increasing numbers and that, you get a situation where they start to get impossible to avoid, but this is not exactly a Balanced Game.

Working on that object actually did bring a lapse in my knowledge up. Instead of them growing, I originally wanted two that collided to become one larger one. However, since the collision event happened for BOTH of the colliding things, whatever I wrote in would happen twice. Destroy the other object? Both get destroyed. Grow large? Both grow large. I'm sure there are ways to work around this, and I can even guess at one. Instances of objects have a unique ID, so it should be possible to get those and declare the "greater" and "lesser" one to be treated differently, so even if the code ends up run twice they would both decide to resize A and destroy B. Hopefully there's an even better way I'll eventually learn, though.

Probably about an hour spent messing around with this.