New Video Card and Replay System in GM

Posted by Castypher on June 4, 2011, 9:24 p.m.

Ever since my new computer with the accidental Radeon 5450 video card, I've been looking forward to a new one for quite some time. I spent a few hours today doing some research. Before, I was looking at an nVidia card, then a bunch of ATI ones with slightly lower performance but much lower cost. In the end I paid quite a bit regardless for something I hope will last me a while.

Radeon 6870

Thoughts? Should I cancel it before I'm charged or do you think this'll suffice for mid-to-high-level game graphics?

Also, a screw on the back of my computer feels electrified. I may be sending the computer in since I'm pretty sure it shouldn't do that. But every time I touch it, it's like a watered-down effect of putting your tongue on a 9-volt. Really, it's faint, but electricity surging through the case?

Finally, I've talked lately with Purianite about a replay system in GM, along with random seeding. He actually says that doing a shoot-em-up without random seeding is horribly unfair, and it made absolutely no sense to me why until I tested it.

Random seeding is fucking cool.

Anyway, with random seeding, you can create a replay system in a shoot-em-up (since numbers aren't purely random, the playback-controlled player won't just happen to collide with one). So I decided to try my hand at it using a keylogging technique.

What you should know:

- There are seven keys: left, right, up, down, Z, X, and C

- Each key is toggled on or off

- The system works by checking which keys are pressed at a specific frame

- The game runs at 60 FPS

The first attempt was using an array with the current frame as its index. However, arrays are limited to 32000, which at 60 FPS is 533 seconds, which is just under nine minutes. Some of my stages are intended to be fifteen or so, so that plan wouldn't work.

The next attempt was to make the array based on the number of times said key was pressed, so leftOn[500]=4324 means that the 500th time left was pressed was at frame 4324. This works. However, playback is forced to loop through the entire array, since GM can't check array length, and looping 32000 times each step is VERY slow. It would also break if some ass mashed the same key 32000 times.

Regardless of speed, the playback still works.

The third option has to do with using a queue data structure. However, since multiple keys can be pressed at once, this may not work. So I thought of having a queue for each key, which would be seven queues. However, if I estimate the player could press the key ten times a second tops (more than five is possible, so it has to be idiotproof), that's 600 times a minute, which is 12000 times in 20 minutes (max stage duration). Running seven queues with 12000 entries might be just as slow.

Help. =(

Comments

Ferret 13 years, 4 months ago

But how are you recording the keys? My system is very nice about recording multiple keys :(

Castypher 13 years, 4 months ago

Well Ferret, I had no idea what (10*released) was supposed to be used for. Up until now I thought I could do without it (as right now I have trigger variables to tell what keys are being held).

In fact, it ONLY registers multiple keys for some reason.