carlfoxmarten: (Default)
I don't know if it was just due to good customer service, or the fact that I'd backed the project, but the person I was dealing with sent me a replacement Xtron Pro device, no charge. And it arrived today.

I immediately plugged it into my computer, uploaded the latest firmware file, then added the latest version of my project that I had on hand. Which crashed the device, but nowhere near as badly as last time. This time, I was able to restart it back into the menu program instead. So I was able to properly delete the old file, then generate a new file from my project and drop that onto the device, where it's been working perfectly ever since.

It's finished charging now, too, so I'll be able to fiddle around with it as much as I want. Though I'll need to remember to properly delete the old files whenever I add a newer version of my project. I don't want a rehash of this incident to happen again...

Now, I get to fiddle with how the whole game feels. For example, the time it takes to lower the falling block one row is a bit fast. Which is something I never thought I'd say. Either it's not taking enough time to move, or it's waiting too long between each rendered frame.

It's all a balancing act, now. Though I still haven't done anything with regards to scoring...
carlfoxmarten: (Default)
Well, that broke faster than I expected.
=>.<=

Basically all of my testing has been with the web-based Xtron Pro emulator built into the Xmaker MakeCode Editor, so it appeared that it was working properly.

Fortunately, I'd managed to get my code to the point of actually having a minimally-playable game, so I wanted to get it onto the actual device so I could play around with it in my hands and see how it performed, and what needed to be improved.

Unfortunately, I ran into problems right away. My file manager defaulted to "trashing" the old file instead of straight-up deleting it, which means that it created a "trash" folder. Which turned out to be full of garbage files and folders. And when I started my new code, it ran for a bit (long enough to land one block to the bottom), then it crashed with a system-level error message.

And refused the boot again after that.

It'll vibrate the pager motor and flash the low-battery LED at appropriate times, but it won't show up as a thumbdrive, nor will the screen light up again.

Oh, and yes, I am in contact with the company that made this device. They're not sure what happened either, and since it's using a microcontroller I don't have debug kit for, I can't do any debugging myself just yet.
(if it was an Espressif brand microcontroller, I'd have the tools, but it's an STM32-series chip, so I can't without their specific programming and debugging tools)

I have been assured that they'll work with me to get it fixed, or replaced if it can't be fixed, but there's a bunch of testing we'll both need to do before that's possible.

I've sent them the file I'd put on the device in the first place, so if there's an error with that, they'll be able to see what might need to be fixed. Otherwise, it would be an issue directly with my module, and I don't know how that all would work.

For the moment, however, it's purely a waiting game. Which isn't helped by the fact that, relative to my timezone, the person I'm working with is usually only on at 4am...
carlfoxmarten: (Default)
Apparently, I don't have many friends on here that have come over from LJ, so it's been less than encouraging to post here. I'm going to try posting again, and will see what happens.

Here, I'm going to comment on some of the many and varied projects I'm working on, in no particular order.

#1: "Xtris", a Tetris clone for the "Xtron Pro"


I'm quite interested in hand-held devices I can program myself, and one Kickstarter I'd backed years ago was for the "PocketStar" keychain-sized "retro" gaming device. Programming them is as easy as setting your Arduino development environment (IDE) for the device and hitting "Compile". I'd enjoyed this one enough, and broke mine through my own fault, so had ordered a pair of replacements, though they don't have anything larger from that company.

So I backed something that was larger, and advertised a relatively simple programming interface. It turned out to be called the "Xtron Pro", and isn't actually intended for the "average" retro gamer or retro game programmer. No, it's intended for kids learning to program. Which has some really frustrating limitations. For example, it uses a 16-colour palette. For the entire screen. As in, you can't show more than that many colours on the screen at a time. And the default colour palette isn't all that great, though you can change that at run-time. But not in the built-in image editor. So you have to know what you're doing when building your images.

Yes, I am still trying to do this, but it's slow going. Another problem is that you can't write C or C++ programs for it, at least not with the systems it comes with. Instead, you can use JavaScript or Python, both of which I'm familiar with as languages, but the API you're supposed to use is painfully poorly documented.

But it's coming along, and I've got the majority of the immediately important visuals already completed. Up next is the actual interactive parts, including all the animations I'll want to use. Though, with how much I'm having to learn about this platform as I go, it is in deed slow going.

#2: Remote Temperature Sensors


I know such things already exist commercially, but the problem I've run into actually started with the limitations of two such cheap commercial units. I bought a sensor/base station set by Le Crosse, which turned out be rather useful and quite accurate at our last house, because the shed had a tarp on one side which protected the sensor from direct sunlight. When we moved into this house, we didn't have anywhere near as useful a place to stick the sensor, and during a summer we had questions about how hot the garage was getting (as we store a second fridge and two upright freezers in there), so my temperature sensor got moved down there and never moved again.

After which I bought a second, different model of sensor/base station pair from the same brand. And they started to interfere with each other. Turns out, it's a serious limitation of the protocol (as someone has reverse-engineered it and published the information online), and there's nothing I can do about it at all. So I bought second one, from a different brand, which has worked well enough so far.

But, you know, there's other features I'd like to have. Given how difficult it is to have entirely reliable temperature sensors that are not influenced by direct sunlight, or sunlight heating up the grass below the sensors, I kind of want to have at least one sensor to the east of the house, another to the west, and maybe incorporate another one for the one in the garage. And, of course, three doesn't need to be a solid limitation. Plus, I'd like to be able to tell how humid it is outside, as I don't have any way to tell that right now.

So I have an idea of how to do it, but there's some limitations, and I'll want to do at least a few posts on how that's coming.

#3: USB-connected Media Remote keyboard


Unlike every other Android device I've ever had, the two Asus ZenPad 10 tablets I have don't like having BlueTooth on at the same time as the WiFi connection going. With both on at the same time, at some point in the future the WiFi connection is going to hang, right up until BlueTooth is turned off again. Which means I can't use already-existing media remotes, like I do with my phone. I should probably comment on my experience with those at some point, too.

Anyway, you can buy loads of cheap USB-capable microcontrollers, which are very easy to write code for, and already have a variety of modules that should be useful.

The problem comes in that the vast majority of USB-capable microcontrollers use USB-to-serial-port chips, that cannot be told to act like a keyboard. And while the ones I'm using right now don't have those chips, they instead talk directly to the computer over directly-controlled pins (using a low-speed USB communications protocol), the libraries available for these modules can't actually handle the media control scan codes.

I'm currently conversing with someone on the forum for the brand of microcontroller I'm using, but we're not getting anywhere very quickly due to how vastly complicated the USB specification is. Hopefully I'll get somewhere useful sooner rather than later...

#4: FM Radio in old PC speakers


Before I bought my current set of Altec Lansing speakers, I'd previously had a couple of older PC speakers. Combine this with how difficult it is to find FM radios with digital tuners, and how cheaply you can find moderately decent ones from China, I now want to put a small, credit card sized, single board FM radio tuner module into a pair of PC speakers.

In theory, it would be as simple as cutting a hole into the front of one of the speakers, but the front side of the speaker won't hold the LCD screen in place (due to me fiddling with it over the time I've had it), and I'm currently trying to figure out (with my extremely limited experience) what exactly I want it to look like when it's actually built.

One problem, for example, is that, even with all the things I know will need to go into the "main" speaker, it won't be heavy enough to hold it against the simple act of pressing any of its buttons. I could add an extra heavy weight to the bottom, but it would be simpler to either mount the buttons so they're pressed downwards, or (as the module I'm using has its own buttons already attached) use levers to convert downwards pressure to sideways pressure on the existing buttons. Which is a very interesting challenge all on its own.

Another is that, given that it doesn't take all that much energy, I want the backlight to be on all the time. Which wouldn't be too much of a problem, except that the default LED colour it came with was blue, and I'd rather have almost any other colour. Do you have any idea how hard it is to solder wires directly to surface-mount LEDs!?

#5: Monitor Stand


Not everything on this list is digital and/or electronics, though this directly relates to a hardware thing. I'd picked up a random LCD monitor off the street a few months ago, and had to figure out how to squeeze it onto my desk, given that my desk here is stuck inside my bedroom's closet.
(this is a bad idea, don't do it. I no longer have a random place to toss things while I figure out how to store it!)

Anyway, I'd inherited a variety of pieces of plywood from my last grandparent to pass away, so was able to put my main monitor (which, it turns out, was too high for how high I sit in my chair) on a single roll of 3D printing filament (obtained from one of the two 3D printers I still haven't used for that purpose yet) and a piece of plywood. Ideally, I'm supposed to have added a leg to each side of the plywood platform already, but it's so easy to overlook (since I'm always looking at the thing above it) that I just haven't done anything about it yet.

Plus, there's the problem with the mousepad for my laptop intersecting with a corner of where the stand will go, so I haven't been sure how to proceed on that front yet. I have enough tools that I should be able to do it, it just takes effort to pull off.

I can't move my main monitor pretty much anywhere but where it's currently sitting either. It can't move left, as it's already slightly obscuring the secondary monitor in that direction. It can't move right, because I have two pencil stands blocking it (which are also being blocked by other things on the desk so they can't move to the right either), as well as the shallow shelf I have behind it on the desk. It can't move up because that would cause more neck strain. And it can't move down because the stand the secondary monitor sits on is a small fraction of an inch below its left edge.

Once the stand is built, I'll be able to move my desktop USB power supply under there, reconnect the LED underlighting that I had on the previous setup, and add a bit of extra storage under there.

#6: Small plywood box


Turns out, one of the dollar store chains in my area has "craft" sized plywood. Technically five-ply, though the outer two layers are paper thin, so effectively three-ply. One size is square, four-and-a-half inches per side, and not actually anywhere near square. The other is about seven inches long by not quite three inches wide, and both are five pieces for about two bucks.

The square ones are close enough to the right size for drinks coasters, so I didn't have much to do with the long, thin ones. Until I realized that I had a use for a small box to fit under the phone stand on my desk. Thus far, I'm storing things inside the stand, and when I'm charging my phone, the cable bends too tightly and/or takes up too much space on the desk in front, so if I stood it up on a small box, it wouldn't be as much of a problem.

Now, while I have the tools to deal with smaller pieces of balsa wood (courtesy of the passing of my grandfather who used to build his own RC planes) and larger pieces of wood (due to the mitre box I'd bought a while ago), I don't really have tools sized to this scale in the middle.

Fortunately, all I want is a butt-joint, not a 45° mitre-joint, but even then I'm more than a little nervous about this. I am going to see this every day, so any obvious mistake is going to be entirely frustrating each and every time I look at it.

-----

Anyway, that's just some of the things I'm working on. And forgetting about. There's probably lots more, but I don't remember what they are right now. If I had a master list of them, I'd want to work on all of them, but it's simply not possible. Plus, I'd feel ridiculously guilty that I'm not working on any of them...
carlfoxmarten: (Default)
I never realized just how much knowing about different programming languages would affect my knowledge of other programming languages.

For instance: I learned C, Java and C++ before I attended university, where I learned more about them and programming in general.

While at university, I learned that the above languages were all the same type of language, namely, they're all Imperative languages, which means you give the processor a list of instructions that it executes pretty much directly.

I also learned about two more types of programming languages, such as Logic Programming, which is where you construct a solution to a problem and let the built-in logic solver solve the problem itself, without specifying the exact sequence of instructions, as well as Functional Programming, which is similar to Imperative Programming, without giving you any form of global state, which means that every function returns the exact same result when given the exact same parameters.
(Functional Programming is often used for low-level systems programming, such as for low-level Operating System functions and BIOSes)

I learned about these programming language types by learning about programming languages that implement these types, such as Prolog and Erlang.

While designing the Event system for my Tetris Power project, I started to realize just how using a Logic Programming language would simplify the core of the system.

For instance, many events more-or-less directly trigger other events, like a "block_land" event might trigger a "row_full" event, which itself triggers a "score_add" event, which then has to add a floating score to the screen.

Theoretically, it should be relatively easy to do something like this if I use Prolog (the only Logic Programming language I know at present), though it could be a little awkward in places, due to the extra layer between the game logic and the rendering system.

I'm going to be examining this more fully and even starting a new branch to work on this to see what happens in practice.

More will be posted as I learn about it.
carlfoxmarten: (Default)
Well, I'd said that I was going to post information about my event system for my Tetris-Power project, so here it is.

The main idea behind this is a simple means for defining and detecting achievements.
If everything done in the game can be represented by a large list of events, you can simply scan the list for a matching sequence to see if an achievement has been matched.

In this case, everything really does mean everything, including keyboard commands, block motions, rows filled, rows removed, scores added, the advancement of time, error and warning messages for the log, and so on and so forth.

The overall structure of the modules then is heavily involved with the event system, with messages getting passed to the events system instead of directly calling other system, and each system that needs to read messages registers with the event system for the types of messages they're interested in.
(for example, if the logging system were enabled, it would read log_info, log_warning, and log_error message types)

This should greatly simplify the overall structure of the code so that not everything would need to know about everything else.
One of the main issues I have right now is that too many systems need to know about each other, which overly complicates my code.

So far I haven't actually added any code yet, as I'm still working on the concept itself.
Once I have that figured out, I'll have to rewrite large swathes of code to use the events system instead of directly calling.
Supposedly, it should be possible to gradually move over to the events system, starting with adding in code to trigger events, having each module listen for appropriate events, actually using the event listeners instead of the function calls as used now, then removing the functions used previously, then refactoring code to simplify things.

I hope it doesn't break while I switch over, but you can't tell until you start what might happen.
carlfoxmarten: (Default)
I've fixed the issue I'd been having with Tetris-Power's old font engine (it was as simple as an array being too small to fit the information necessary), as well as managing to fix a bug where the current block disappearing due to some values becoming NaNs.

It's been a good evening for bug-fixing.

Now I need to figure out how to approach writing the new font engine.

The old engine made it fairly easy to parse in a long, thin image with a single row of characters as long as necessary, but I can't do the same thing with the new engine.
With the old engine, I chopped up the image into a single character's worth of bits for each symbol and stored each one in the computer's memory.
With the new engine, I'll need to store the image, unprocessed, in the graphics card's memory, which means that the images have to be square and a power of 2 wide and high.
(ie, 128x128 pixels or 256x256 pixels, or larger)

This new engine with allow me to rotate characters as I wish, without getting limited by the screen resolution.

I don't think it's going to be an easy thing to write...
carlfoxmarten: (Default)
So I tried working on my Tetris-Power project again, only to find out why I'd dropped it last time: It was full of bugs.
(if it was literally full of bugs, it'd be easier to fix)

Something I'd done when upgrading the font system seems to have caused major bugs to show up elsewhere in the code, and even rolling back the font system doesn't seem to have fixed everything.

I'm racking my brains trying to find out what the problem could possibly be, but I'm not having much success just yet.

If I can remember how, I'll try to roll it back several versions to see where I went wrong, but chances aren't so good that it'll be that easy to fix.
(plus, there are some beneficial changes I've made since then, so there's no telling if I'll be able to undo all the damage I've done to it)

Though if I can't get anywhere with this, I'd hesitate a lot before I rewrite the whole thing from scratch...
(maybe I'll remember to put in more debug stuff and lots more comments)


Incidentally, I'm starting to work on my graduation application so I can get out of university for a bit.
Currently, I'm working on an appeal to use an arts course for one of my liberal arts credits, and need to find information dating all the way back to the Spring of 2005, which was less than a year after I got my very first "proper" computer, which means that I didn't have a good system set up for making backups.
(I'd had an old 286 with 1MB of RAM running Windows 3.11 and something like MS-DOS 6, so an upgrade to Windows 98SE was a huge jump)

However, I've still found time to try fixing Kathy's site under Internet Explorer (after about six months to a year, that is), and I just might be onto something, I'm just not sure if it works completely.
carlfoxmarten: (Default)
What good is a game if it doesn't move?
For that matter, what kind of game doesn't have at least some kind of background imagery?

Now, if your backgrounds have lots of bushes, trees, waterfalls and the like, and they kind of slide or swing into place, wouldn't it make sense for them to wobble back and forth a little bit?

There will need to be more than one animation type, as one type is terribly easy to do and another that I know I'll need will be a bit more difficult.

The easy one will be used for swaying objects, such as trees and bushes, and is accomplished by a simple and oft-used 3D transformation called "shear".
(shearing is like pushing a stack of CD cases over so they form a stair-like structure, with each case offset the same distance from the one previous. This means I have no need to modify the actual model, and can change it very easily on the fly)

The hard one I haven't quite figured out yet.
It'll be used for stuff like the water in waterfalls, and will depend on what the waterfalls look like when I finally design them.
(at least, the specific usage will highly depend on it, the implementation behind it just might be generic enough for more uses than that)

So, the upshot of all this is that I am still thinking about Tetris-Power, the only issue is managing to have spare time for other things, most notably all the homework I have, as well as playing some games.
(currently, LEGO Indiana Jones 2 with my brother and Team Fortress 2)
carlfoxmarten: (Default)
So, as I'm bored today (at least until I start making dinner, then going over to Grandpa's to watch the hockey game), I've decided to rewrite my font engine.

The current font engine I have for Tetris-Power is strictly based on bitmaps which are used to directly affect the screen pixels, which means that if I need a different font size, I have to create, load and track another font file, which is not a recommended practice.

So, I need a polygon-based font engine that allows me to specify a size for each line of text without needing a new font for each point-size I need.

This will need to be almost a complete rewrite of the engine from the ground up, as my previous font engine used a vertically short and horizontally long image to represent the font, and graphics cards like square images to work with.

Another reason I need this rewrite is that when a row gets removed, the score you get floats up from the vanishing row, which means that I needed to figure out exactly where in pixels I had to start the score, when the rows exist in three dimensions. With the new engine, I'll be able to specify the location of the score text by simply taking the 3D position of the row and moving it closer to the viewer, so much simpler and with even less chance for mistakes.
(also, it makes graphical effects like spinning text SO much easier to do, and it even gives me anti-aliased text for nearly free, too!)
carlfoxmarten: (chair)
To help me get more interested in starting up work again on Tetris-Power, I've decided to compile a list of all the modules I've written so far and what they do and support.
Large amount of geekery behind cut )
It's also looking like I might need to switch to a more event-driven approach sometime, as what I'm currently doing will require a fair bit of work to connect certain things together.
carlfoxmarten: (Default)
I thought I'd post some of what's on my current TODO list for the tetris project:
  • Add a background:
    Should include a sky and some ground, but levels can be indicated by the following:
    • Trees
    • Bushes
    • Flowers
    • Hills
    • Clouds
    • Cliffs (towards later levels)
    • Waterfalls (usually off the sides of cliffs. May have some trouble animating them)
  • Add an Options screen:
    I'm not yet sure what to put here, but something about background music, enabling sound effects, graphics detail, etc. would be a good idea.
  • Add sound effects:
    A light thud for blocks landing gently, a slightly heavier thunk for blocks dropped from a higher height, some kind of explosion for when a row gets removed (or maybe a cool disappear sound, I'm not sure), etc.
  • Add background music:
    A friend has offered to make me a Techno remix of the original Tetris background music, but you can be sure that if I include that, I'll provide an alternative option as well as the choice of turning it off...
  • Add an in-game menu:
    To pause the game and let the user change settings without having to restart their game.
  • Add levels of difficulty:
    Because one level isn't challenging enough.
  • Add a highscore list:
    To record how well you've done. I'll probably use SQLite to keep things relatively simple.
  • Tweak or rewrite the font engine:
    To add multiple brightness levels. Right now, fonts don't look that great and could use some extra zing.
  • Write a shaders module:
    To allow me to use shaders on a variety of platforms and even on some lower-end systems, including low-end Intel graphics cards.


Current status is that things look and play fairly well, but certain aspects could be greatly improved, such as block textures (I'd like to use a bump map, but that requires I use a shader so far as I know, thus the need for a shaders module).
I also seem to have lost some of my enthusiasm for work on this project, partly due to finally fixing textures (now I don't have a big challenge staring me in the face, just a bunch of smaller ones).

I want something big and difficult! Not small and difficult!
(sounds weird, I know)

Finally!

Aug. 23rd, 2009 06:51 pm
carlfoxmarten: (Default)
Textures work now! Woohoo!

Man, I really do prefer Java to C++, but since I've been using C++ more recently, I'm having to relearn things I took for granted with Java.

For instance, in Java, everything is not referenced directly, so when you create an object, you pass around a pointer to the object instead of passing around the object itself. However, in C++, you pass around copies of the object itself instead of pointers (unless you choose to work with the pointers, that is).

I'd created a class to help with textures by providing a simple interface for applying and disabling textures.
One of its features was a "destructor" that would tell OpenGL to drop the enclosed texture when any copy of the object was destroyed. Simply passing the texture to a sub-function or method would make a second copy that would destroy the texture when that method was finished...

Fortunately, if I don't delete the textures myself, it seems to delete them when my program is finished anyway, so removing the delete code has fixed the most elusive problem.

Now that textures are working, I can use them now to full potential, and my rounded-border stuff is working okay.
(it doesn't quite look right yet)
carlfoxmarten: (Default)
From the "Why aren't they doing that?" file:

Personal Radio Recorder:
Most of us are familiar with Personal Video Recorders (PVRs) that let you pause, rewind and record live TV, but doing the same thing for radio would be a Very Good Idea™! It would also be fairly easy, and wouldn't require much of an interface.
(you might get away with a programmable MP3 player with a radio built-in. And no, I don't think an iPod would suffice...)


In other news, I haven't done much in the progress of Tetris-Power, I've still been thinking about it.

In regards to indicating levels, I've been thinking about a cartoony landscape that rotates sideways to hide the old level scene and show a new one.
(imagine that the background is a very large disk who's center point is a bit below the screen)

I'm not sure I want to change how the blocks look yet, but I should probably do something about realism with some kind of shadows...
The simple kind of shadows are when you draw everything twice, the first time you draw surfaces, while the second time you change how drawn objects are transformed so they fall flat onto a plane, which requires that you know where your lights and your plane are and where they're pointed. The disadvantage of this technique is that it works fairly well for projecting shadows onto a flat surface only, and to shadow other surfaces requires rendering everything once for every plane or polygon you want shadows on!
The other kind of shadows also require drawing things twice, but the first time is for shadows (looking from the position of the light, so it works best for sun and spot lights) and the data from that is used to render the actual surfaces. Which would actually require me to figure out how to do that...

I'm currently figuring out exactly how to draw nicely curved objects with OpenGL, and so far I think that a semi-circle texture is the simplest way to go. So far with a test program, this has proven very satisfactory, though I'll need to fine-tune a few things on it...

This, however, brings me right back to the problem of textures not actually showing up in the project... D:
I may have to cut the project apart and sew it back together again, adding pieces until textures no longer appear, assuming they show up again in the first place...

Not fun.

I've cut out the loading system to see if it's causing some problems (so far nothing), so I'll look for other stuff that doesn't make sense (which could be a lot of stuff).

Anybody know OpenGL or know somebody who knows OpenGL that would like to contribute to an open-source project and likes debugging? Anybody? Anyone at all?
carlfoxmarten: (Default)
Well, it's starting to feel more like a game now...
(translation: I've been able to play it for minutes on end now)

Rows are now removed (as per my last entry), and the blocks fade out (a rather cool-looking effect) as well as spin and shrink, after which the above rows fall.

Colours are now completely random, as are block orientations, and you even get to see the next block before you get it.

Requisite screenshot:

(not cut, to generate interest)

What I need to do next:
  • Add score-keeping
  • Add a background (probably ground and sky-type stuff)
  • Add the Options screen
  • Add sound effects and music
  • Add an in-game menu (to allow pausing the game)
  • Add different levels of difficulty
  • Add a highscore list
  • Make sure absolutely everything is animated (a very tough job, by the way)


I'm sure there's more I'm missing, but those are the high points.

Lotta work ahead of me...
carlfoxmarten: (Default)
Yay! Rows can be removed now!
(though textures still don't work)

Now, on to animating the removal...
carlfoxmarten: (Default)
It looks so simple on paper and in the online tutorials, but why, oh why is it so difficult in my code?!

I've downloaded one or two sample code projects that demonstrate texture-mapping in OpenGL and have successfully modified them to use my textures, but haven't had any success making my own code display textures...

I guess I just need to Grep through my code to see where I'm enabling and disabling things to see if I've stepped on my own toes somewhere.

Now my code seems to be even less stable, for some strange reason...
Think it's time for a recode? I should at the very least have a thorough look through things to see exactly what I'm doing where and why, and if there's a better reason to do things another way.


And to ensure that this isn't entirely about programming...

I was in an Office Depot today, and it was very dangerous.

You see, I happen to like the better quality writing instruments, and if I find a set that looks good, isn't terribly expensive, and appears to work how I like it to, I'll pick it up. And sometimes, if I think I'd like it enough, the price matters even less.

Staedtler's Triplus line (those long pens with the triangular barrels) are one of my favourites, and I have a small variety set consisting of a highlighter, a pencil, a roller-ball pen, and a fine-pointed felt-tip pen. Both the roller-ball and the pencil have seen a lot of use (the fine-liner - as it's called - and the highlighter, not so much), so I may need to replace the pen sometime, which means I'm technically in the market for a replacement.

As I was browsing the writing instruments section of the store, I found out that Staedtler is now also making gel pens in their Triplus brand for about CAD$13. It was very difficult, but I did resist the temptation to buy the set of eight colours.

They also had an actual replacement for the pen that I have, but it would cost about CAD$3, not a good price for just the one pen. Though if I wanted a fineliner (the fine-tipped felt pen), it would only be CAD$4 for three of them. (guess which one is cheaper to make?)

Oh, and unrelatedly: I need to find a good emoticon set to use here on LJ...
carlfoxmarten: (Default)
First, I now own a half-interest in a second-hand EeePC.
Tiny little thing (7-inch screen, 4GB drive), most of what I've been doing are updates (I finally found Synaptic, a Linux package manager), and trying to do web-browsing on the small screen.

If there'd been one available, I'd have chosen a 9-inch model, but anything is better than nothing.
(and a small, lightweight model like the EeePC is better than a four-pound, widescreen model for portability)


Anyway, so far I've tweaked how the grid stores blocks to make it easier to check when a row is full, swapped out the 118KB cube (1248 faces, 1250 vertices) for a 26-face, 24-vertex, 3.3KB version with texture coordinates in the hope that I can map a texture on it to simulate a more complex cube.

So far, however, all my texture efforts have been in vain.

The image is loading fine, but none of my efforts have been able to pass the texture data over to OpenGL, and most of the documentation I've found is slightly incomplete. The missing part is how to separate loading the image into OpenGL and rendering with it.

The confusing part is that the same function call is used to set up the texture for loading and use it for rendering, so I'm not sure if I'm calling it the right way each time.

Anybody have any suggestions for OpenGL texture tutorial or reference sites? I'm a little stumped...
carlfoxmarten: (Default)
I've reached one of the next steps in Tetris-Power development recently, that of a slightly-playable game.

So far I have the loading screen, the menu screen, and the play screen. The play screen will let you play the game, including moving the block around the screen (and automatically dropping by a row about once a second) and dropping them to the bottom (which still needs to be animated), and it will even give you a new, random shape after it lands.
(it won't yet remove rows, I need to rewrite how the cubes are stored first)

Current problem is that my development computer is getting a little bogged down by rendering as the number of blocks on the screen increases, which means that I need to drop the number of polygons some more.

You can find my current block shape here (for those of you who can read Wavefront Object files). Current file size is 118KB, which is probably a bit large. I'm open to suggestions for replacements or tweaks to reduce the number of polygons to a more manageable level.

Requisite screenshot not yet available.

Yet to come are the block preview windows, score-keeping, timing (if I decide to include it), the in-game menu, the options screen (if I have any options to change), randomizing each new block's colour, better graphics, the power-ups, and etc to the power of ten.

I suspect my problem with the frame-rate is that it's using software for non-fullscreen windows, and will let you use hardware for fullscreen windows.
I hope I'm wrong...

Current line count is over 4100 raw lines.
(I suppose I should look for a linecount metric tool to count how many statements I have sometime)
carlfoxmarten: (Default)
One of the things I said I was going to work on next was position interpolation stuff.
(i.e., the stuff that makes things move smoothly)

I'm currently taking a course on Numerical Analysis (basically doing math on computers and how to make it easier and/or more accurate).

What are the odds that I just learned about doing this sort of thing this last week?

Very high, apparently.

I'm using a variation of what's called Bezier curves, equations that are governed by two endpoints and two control points that determine the shape of the curve, and generate a smooth curve between the endpoints.
It's a variation because the original definition works in two dimensions, but the two sets of equations do not depend on each other, so are completely independent and can be used separately.
This simplified the code somewhat, as I only had to deal with one curve at a time, so could just use two instances to control the two dimensions separately.

Testing has been very satisfactory, as any change in direction is taken into account when generating the new equation set, by taking the current position and velocity and using them as the starting point for the next equations.

Overall, I'm not quite sure what's next. Several things need doing, such as the grid system (potentially a lot of work) and designing and displaying the backdrop behind and around the game-grid (needs a lot of thought).

Sometime after that, I need to redesign how the buttons, progressbars, etc., look, start work on the power-up system, add scoring and timing (including deciding on game modes. Especially the part about endurance versus timed modes, and if I should just include them all), all the particle and otherwise effects, then the final graphics redesign.

I should probably also stop working until midnight because I was up late due to working late the night before...
carlfoxmarten: (Default)
...No news at all for the programming world...

Seriously, though, I've reached yet another major milestone in the development of Tetris Power: I now have a block I can move around the screen.

Despite the fact that I have no bounds and no other blocks for it to bump into (and the colour doesn't seem to be properly random), it's still an important step.

Next milestone should be in a couple of weeks when I add the bounds and the landed blocks. Then it'll almost be playable, but still far from complete.
(the landed blocks will be very tricky as I'll need to be able to drop not just an entire row, but also individual blocks due to powerups)

Currently, I have 19 source files (one of which is currently empty, and the matching header needs to be rewritten), and a total of 3572 lines in those files.
Current Linux executable is 180KB in size, with approximately half a Megabyte of data to load during run-time.

I think I'm still having fun writing this, as each small piece set in place is its own reward.
I should be working on smoothing the shape's motion next, then implementing the block randomization system, and finally fixing the colour problem before moving on to the grid system.

It's still a lot of work, but since I'm doing this a bit at a time, and ensuring that it works at each step of the way, I'm not getting bogged down!

Profile

carlfoxmarten: (Default)
Carl Foxmarten

August 2023

S M T W T F S
  12 345
6789101112
13141516171819
20212223242526
2728293031  

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 8th, 2025 07:21 am
Powered by Dreamwidth Studios