1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-16 16:09:42 +01:00
VVVVVV/desktop_version/src/WarpClass.cpp

1142 lines
84 KiB
C++
Raw Normal View History

2020-01-01 21:29:24 +01:00
#include "WarpClass.h"
#include "MakeAndPlay.h"
#include "Game.h"
#include "Entity.h"
#include "UtilityClass.h"
const short* warpclass::loadlevel(int rx, int ry)
2020-01-01 21:29:24 +01:00
{
int t;
rx -= 100;
ry -= 100;
rx += 50 - 14;
ry += 49; //warp
t = rx + (ry * 100);
const short* result;
2020-01-01 21:29:24 +01:00
rcol = 0;
warpx = false;
warpy = false;
roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]";
2020-01-01 21:29:24 +01:00
switch(t)
{
#if !defined(MAKEANDPLAY)
2020-01-01 21:29:24 +01:00
case rn(50,50):
{
static const short contents[] = {
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
161,161,161,161,161,161,161,161,161,161,161,161,161,122,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,160,161,161,161,161,161,161,162,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,80,80,80,80,80,80,202,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
241,241,241,241,241,241,241,241,241,241,241,241,241,82,80,202,200,80,80,80,80,80,80,202,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,200,80,80,80,80,80,80,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,240,241,241,241,241,241,241,242,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
};
2020-01-01 21:29:24 +01:00
obj.createentity(288, 168, 10, 1, 50500); // (savepoint)
2020-01-01 21:29:24 +01:00
if(game.intimetrial)
{
obj.createblock(0, 0, 0, 8, 240);
}
rcol = 0;
warpy = true;
roomname = "This is how it is";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,50):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,86,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
167,167,167,167,167,168,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,166,167,167,167,167,167,167,167,167,168,166,167,167,167,167,167,167,
247,247,247,247,247,248,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,246,247,247,247,247,247,247,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,87,247,247,247,247,88,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,206,86,208,126,126,126,126,206,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,127,167,167,167,167,128,86,208,0,0,0,0,0,0,0,
167,167,168,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,86,86,86,86,86,86,86,208,0,0,0,0,166,167,167,
247,247,248,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247,247,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,206,86,86,86,86,208,0,0,0,0,206,86,208,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,246,247,247,247,247,248,0,0,0,0,246,247,248,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,206,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,
247,247,247,88,86,208,0,0,0,0,0,0,0,0,0,0,206,86,87,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
126,126,126,206,86,208,0,0,0,0,166,167,167,167,167,168,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
126,126,126,206,86,208,0,0,0,0,206,86,86,86,86,208,206,86,208,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,
};
2020-01-01 21:29:24 +01:00
rcol = 2;
warpx = true;
roomname = "A Bisected Spiral";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,
164,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,165,0,0,0,0,0,0,0,0,163,164,164,164,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,244,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,243,244,244,245,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,165,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,83,205,0,0,0,0,0,0,0,0,203,83,83,83,
244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,245,0,0,0,0,0,0,0,0,243,244,244,244,
164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
};
2020-01-01 21:29:24 +01:00
obj.createentity(248, 80, 10, 1, 51510); // (savepoint)
obj.createentity(136, 128, 1, 3, 3, 128, 120, 288, 152); // Enemy, bounded
obj.createentity(104, 192, 10, 1, 51511); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 1;
warpy = true;
roomname = "Take the Red Pill";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
95,95,95,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,
256,256,256,256,256,257,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176,176,176,176,176,176,176,176,176,177,175,176,177,0,0,0,0,175,176,177,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
256,256,256,256,256,256,256,256,256,257,215,95,217,0,0,0,0,215,95,217,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176,176,176,176,176,177,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,175,176,176,177,175,176,176,176,177,175,176,176,176,176,176,176,
95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95,
95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95,
95,95,95,95,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,215,95,95,95,217,215,95,95,95,95,95,95,
256,256,256,256,256,257,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,255,256,256,256,257,255,256,256,256,256,256,256,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,215,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,255,256,257,0,0,0,0,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,
176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,255,256,257,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,
256,256,256,256,256,256,256,256,256,256,97,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,96,256,256,256,256,256,256,256,256,256,256,256,256,256,
135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
135,135,135,135,135,135,135,135,135,135,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
135,135,135,135,135,135,135,135,135,135,215,95,217,175,176,176,176,176,176,176,176,176,176,177,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
135,135,135,135,135,135,135,135,135,135,215,95,217,215,95,95,95,95,95,95,95,95,95,217,215,95,217,135,135,135,135,135,135,135,135,135,135,135,135,135,
};
2020-01-01 21:29:24 +01:00
obj.createentity(32, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded
obj.createentity(96, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded
obj.createentity(160, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded
obj.createentity(224, 24, 1, 3, 4, -56, -40, 384, 312); // Enemy, bounded
obj.createentity(232, 152, 10, 1, 51520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 5;
warpx = true;
roomname = "Short Circuit";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,50):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,252,254,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,7,7,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,253,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
213,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,173,
213,212,92,214,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,6,6,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
213,212,92,214,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
};
2020-01-01 21:29:24 +01:00
obj.createentity(32, 16, 10, 0, 50520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 4;
warpy = true;
roomname = "As you like it";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,50):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
250,250,250,250,250,250,251,0,0,0,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,169,170,170,170,170,170,170,170,171,169,171,169,170,170,170,170,170,170,170,170,170,170,170,170,170,
250,250,250,250,250,250,250,250,250,251,209,211,0,0,0,249,250,250,250,250,250,250,250,251,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,171,169,171,0,0,0,209,211,169,170,170,170,170,170,170,170,170,171,0,0,209,211,0,0,169,170,170,170,170,170,170,170,170,170,170,170,
89,89,89,89,211,209,211,0,0,0,209,211,209,89,89,89,89,89,89,89,89,211,0,0,209,211,0,0,209,89,89,89,89,89,89,89,89,89,89,89,
250,250,250,250,251,209,211,0,0,0,209,211,249,250,250,250,250,250,250,250,250,251,0,0,209,211,0,0,249,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,169,171,0,0,209,211,0,0,169,171,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,169,171,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,169,171,169,170,170,170,170,
89,89,89,89,211,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,209,211,0,0,209,211,0,0,0,209,211,209,89,89,89,89,
250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,249,251,0,0,209,211,0,0,0,209,211,249,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,0,209,211,0,0,0,209,211,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,209,211,169,170,170,170,170,171,209,211,0,0,0,209,211,0,0,0,169,170,
250,250,250,250,250,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,251,249,250,250,250,250,251,249,251,0,0,0,209,211,0,0,0,249,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,211,169,170,170,170,170,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,211,209,89,89,89,89,
};
2020-01-01 21:29:24 +01:00
obj.createentity(16, 120, 10, 1, 50530); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 3;
warpx = true;
roomname = "Maze With No Entrance";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,
126,126,126,126,206,86,208,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,166,167,168,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,
126,126,126,126,206,86,208,166,167,167,167,167,168,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,166,167,
126,126,126,126,206,86,208,206,86,86,86,86,208,6,6,6,6,206,86,208,6,6,6,6,6,6,6,6,6,6,6,206,86,208,6,6,6,6,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,166,167,167,168,206,86,208,166,167,167,168,166,167,168,166,167,167,168,206,86,208,166,167,167,168,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,208,206,86,86,208,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86,208,246,247,247,248,246,247,248,246,247,247,248,206,86,
126,126,126,126,206,86,208,206,86,86,86,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86,208,7,7,7,7,7,7,7,7,7,7,7,206,86,
126,126,126,126,206,86,208,246,247,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,246,247,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
126,126,126,126,206,86,208,0,0,0,166,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,
126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,
};
2020-01-01 21:29:24 +01:00
obj.createentity(64, 152, 10, 0, 49530); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 2;
warpy = true;
roomname = "As we go up, we go down";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
80,80,80,202,200,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80,
241,241,241,242,200,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,202,240,241,
0,0,0,0,200,202,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,7,7,200,202,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,0,0,240,242,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
161,161,161,161,161,162,0,0,0,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,161,161,161,161,161,
80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,160,161,161,162,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,200,80,80,202,0,0,0,0,0,0,0,200,80,80,202,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,240,241,241,242,0,0,0,0,0,0,0,240,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,200,80,80,80,80,80,
80,80,80,80,80,202,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80,
241,241,241,241,241,242,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,0,0,0,0,0,0,0,160,161,161,162,0,0,0,0,0,0,0,0,0,160,162,0,0,
0,0,0,0,0,0,0,0,0,0,200,202,0,0,0,0,6,6,6,6,6,6,6,240,241,241,242,6,6,6,6,6,6,6,6,6,200,202,0,0,
161,161,161,161,161,161,161,161,161,162,200,202,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,200,202,160,161,
80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
80,80,80,80,80,80,80,80,80,202,200,202,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80,
};
2020-01-01 21:29:24 +01:00
obj.createentity(296, 64, 10, 1, 49540); // (savepoint)
obj.createentity(152-4-15+8, 32, 1, 0, 6, 128, 32, 288, 200); // Enemy, bounded
obj.createentity(240-4-15+8, 186, 1, 1, 6, 128, 32, 288, 200); // Enemy, bounded
obj.createentity(296, 152, 10, 0, 49541); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 0;
warpx = true;
roomname = "Time to get serious";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,50):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,247,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,167,168,166,167,167,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,248,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,166,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,246,247,247,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
};
2020-01-01 21:29:24 +01:00
if(!game.intimetrial)
{
obj.createentity((7 * 8) + 4, (6 * 8), 14); //Teleporter!
2020-01-01 21:29:24 +01:00
}
rcol = 2;
warpy = true;
roomname = "Wheeler's Wormhole";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,50):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,
212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,
252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,252,253,253,254,
0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,252,253,253,254,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,0,0,0,0,212,92,92,214,0,0,0,0,
0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,
172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,
252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,252,253,253,254,
0,0,0,0,252,253,253,254,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,0,0,0,0,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,253,254,172,173,173,174,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,
172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,
212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
212,92,92,214,212,92,92,214,212,92,92,214,172,173,173,174,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,0,0,0,0,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
};
2020-01-01 21:29:24 +01:00
obj.createentity(96, 72, 1, 3, 8, 64, 56, 256, 152); // Enemy, bounded
obj.createentity(240, 120, 1, 2, 8, 64, 56, 256, 152); // Enemy, bounded
obj.createentity(72, 16, 10, 0, 50550); // (savepoint)
obj.createentity(264, 176, 10, 1, 50551); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 4;
warpx = true;
roomname = "Ascending and Descending";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,
244,244,244,245,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,203,83,
0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
0,0,0,0,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
164,164,164,165,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,243,245,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,7,7,7,7,7,7,7,7,163,165,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,0,0,0,0,0,0,0,0,243,245,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,163,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,245,6,6,6,6,6,6,6,6,243,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,164,165,163,164,164,164,164,164,164,164,164,164,164,164,164,165,163,164,165,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,205,203,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,243,244,245,243,244,244,244,244,244,244,244,244,244,244,244,244,245,243,244,245,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,203,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,
};
2020-01-01 21:29:24 +01:00
obj.createentity(280, 24, 1, 2, 3, 128, 16, 304, 216); // Enemy, bounded
obj.createentity(136, 192, 1, 3, 3, 128, 16, 304, 216); // Enemy, bounded
obj.createentity(40, 8, 1, 0, 10, 24, -56, 120, 280); // Enemy, bounded
obj.createentity(88, 8, 1, 0, 10, 24, -40, 120, 272); // Enemy, bounded
obj.createentity(256, 128, 10, 1, 51550); // (savepoint)
obj.createentity(136, 32, 10, 1, 51551); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 1;
warpy = true;
roomname = "Shockwave Rider";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,
250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,
250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,209,89,89,211,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,0,0,0,209,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,0,0,0,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,
250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,0,0,0,209,89,89,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,211,0,0,0,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,0,0,0,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,
250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,0,0,0,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,169,170,170,171,169,170,170,170,170,170,170,170,170,171,0,0,0,0,169,170,170,170,
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,211,0,0,0,0,209,89,89,89,
};
2020-01-01 21:29:24 +01:00
obj.createentity(296, 32, 10, 1, 51540); // (savepoint)
obj.createentity(184, 192, 1, 18, 48, -800, -24, 4000, 264); // Enemy, bounded
obj.createentity(88, 136, 1, 17, 48, -800, -32, 4000, 272); // Enemy, bounded
obj.createentity(184, 80, 1, 18, 48, -800, -32, 4000, 272); // Enemy, bounded
2020-01-01 21:29:24 +01:00
obj.createentity(8, 32, 20, 1); // (terminal)
2020-01-01 21:29:24 +01:00
obj.createblock(5, 8-8, 32, 20, 16, 17);
rcol = 3;
warpx = true;
roomname = "Sweeney's Maze";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,215,95,95,95,
256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,255,256,256,256,
176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256,
176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,175,176,176,176,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,217,0,0,0,0,215,95,95,95,
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,215,95,95,95,
};
2020-01-01 21:29:24 +01:00
obj.createentity(288, 200, 10, 1, 52540); // (savepoint)
obj.createentity(48, 16, 1, 1, 10, 0, -40, 320, 296); // Enemy, bounded
obj.createentity(64, 16+8+4+2, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded
obj.createentity(80, 16+16+8+4, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded
obj.createentity(96, 16+24+12+6, 1, 1, 10, 0, -40, 320, 304); // Enemy, bounded
obj.createentity(112, 16+32+16+8, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded
obj.createentity(128, 16+40+20+10, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded
obj.createentity(144, 16+48+24+12, 1, 1, 10, 0, -56, 320, 296); // Enemy, bounded
obj.createentity(160, 16+56+28+14, 1, 1, 10, 0, -48, 320, 288); // Enemy, bounded
obj.createentity(176, 16+64+32+16, 1, 1, 10, 0, -48, 320, 296); // Enemy, bounded
obj.createentity(192, 16+72+36+18, 1, 1, 10, 0, -40, 320, 280); // Enemy, bounded
obj.createentity(208, 16+80+40+20, 1, 1, 10, 0, -48, 320, 280); // Enemy, bounded
2020-01-01 21:29:24 +01:00
rcol = 5;
warpy = true;
roomname = "Mind The Gap";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,246,247,247,248,206,86,
207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,0,0,0,0,206,86,
167,167,167,167,167,167,167,167,167,167,167,167,167,128,86,208,206,208,0,0,0,0,206,208,206,86,127,167,167,167,167,128,86,208,0,0,0,0,206,86,
86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,208,206,208,0,0,0,0,206,208,206,86,86,86,86,86,86,86,86,208,0,0,0,0,206,86,
247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,248,0,0,0,0,246,247,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,168,166,168,0,0,0,0,166,168,
247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,206,208,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
166,168,0,0,0,0,166,168,166,167,167,167,167,167,167,168,206,208,0,0,0,0,206,208,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,248,246,248,0,0,0,0,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 200, 10, 1, 52530); // (savepoint)
obj.createentity(248, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(152, 48, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(152, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(56, 96, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(104, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(200, 144, 1, 3, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(280, 16, 9, 12); //Shiny Trinket
2020-01-01 21:29:24 +01:00
obj.createentity(24, 200, 20, 1); // (terminal)
2020-01-01 21:29:24 +01:00
obj.createblock(5, 24-8, 200, 20, 16, 18);
rcol = 2;
warpx = true;
roomname = "Edge Games";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,
0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,
164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,
83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,
83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,
244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,
0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,
0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,
0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,
0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,
0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,0,
0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,
0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,
0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,0,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,0,
164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,163,165,0,0,0,0,163,164,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,83,
244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,243,245,0,0,0,0,243,244,
164,164,165,0,0,0,0,163,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,165,0,0,0,0,163,165,0,0,0,0,163,164,164,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
2020-01-01 21:29:24 +01:00
rcol = 1;
warpx = true;
warpy = true;
roomname = "The Brown Gate";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,252,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,254,0,0,
6,6,172,173,174,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,172,173,174,6,6,
173,174,212,92,214,0,0,0,0,0,0,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,0,0,0,0,212,92,214,172,173,
253,254,252,253,254,0,0,0,0,0,0,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,0,0,0,0,252,253,254,252,253,
0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,173,174,0,0,0,0,172,173,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,172,173,173,174,0,0,0,0,0,212,92,92,214,0,0,0,0,212,92,92,214,0,0,0,0,0,172,173,173,174,0,0,0,0,0,
6,6,6,6,6,252,253,253,254,6,6,6,6,6,252,253,253,254,0,0,0,0,252,253,253,254,6,6,6,6,6,252,253,253,254,6,6,6,6,6,
173,173,173,173,173,173,173,173,173,173,173,173,173,174,172,173,174,0,0,0,0,0,0,172,173,174,172,173,173,173,173,173,173,173,173,173,173,173,173,173,
92,92,92,92,92,92,92,92,92,92,92,92,92,214,212,92,214,0,0,0,0,0,0,212,92,214,212,92,92,92,92,92,92,92,92,92,92,92,92,92,
253,253,253,253,253,253,253,253,253,253,253,253,253,254,212,92,214,0,0,0,0,0,0,212,92,214,252,253,253,253,253,253,253,253,253,253,253,253,253,253,
7,7,172,173,174,7,7,7,7,7,7,7,7,7,212,92,214,0,0,0,0,0,0,212,92,214,7,7,7,7,7,7,7,7,7,172,173,174,7,7,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,172,173,173,173,173,174,212,92,214,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,252,253,253,253,253,254,252,253,254,0,0,0,0,0,0,0,0,0,252,253,254,0,0,
0,0,172,173,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,173,174,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,0,0,0,0,172,173,173,173,173,173,174,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,0,0,0,0,252,253,253,253,253,253,254,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
obj.createentity(152, 152, 10, 0, 49550); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 4;
warpx = true;
warpy = true;
roomname = "To The Batcave!";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6,6,6,6,6,6,6,6,0,0,0,0,0,0,6,6,
170,170,170,170,170,170,170,170,171,169,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169,170,170,170,170,170,170,171,0,0,0,0,0,0,169,170,
89,89,89,89,89,89,89,89,211,249,250,250,250,250,250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,250,251,0,0,0,0,0,0,209,89,
89,89,89,89,89,89,89,89,211,7,7,7,7,7,7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,0,0,0,0,0,0,209,89,
250,250,250,250,250,250,250,250,251,0,0,0,0,0,0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,250,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,170,170,170,170,170,170,171,0,
6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,211,6,6,6,6,6,6,6,6,6,6,6,6,6,6,209,89,89,89,89,89,89,211,6,
170,171,169,170,170,170,170,170,170,171,209,89,89,89,89,89,211,169,170,170,170,170,170,170,170,170,170,170,170,170,171,209,89,89,89,89,89,89,211,169,
250,251,209,89,89,89,89,89,89,211,249,250,250,250,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,250,250,250,250,251,249,
7,7,209,89,89,89,89,89,89,211,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
0,0,249,250,250,250,250,250,250,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
obj.createentity(136, 40, 10, 1, 52550); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 3;
warpx = true;
warpy = true;
roomname = "This will make you flip";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,175,176,176,177,0,0,0,0,0,0,0,0,0,0,
176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,215,95,95,217,0,0,0,0,0,0,0,0,175,176,
95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,136,176,176,176,176,137,95,217,215,95,95,217,0,0,0,0,0,0,0,0,215,95,
95,95,217,6,6,6,6,6,6,6,6,6,0,0,0,0,215,95,95,95,95,95,95,95,95,217,215,95,95,217,6,6,6,6,6,6,6,6,215,95,
95,95,217,175,176,176,176,176,176,176,176,177,0,0,0,0,255,256,256,256,256,256,256,256,256,257,215,95,95,217,175,176,176,176,177,175,176,177,215,95,
256,256,257,255,256,256,256,256,256,256,256,257,0,0,0,0,175,177,7,7,7,7,7,175,176,177,215,95,95,217,215,95,95,95,217,255,256,257,255,256,
176,177,0,0,0,0,0,0,0,175,176,177,0,0,0,0,255,257,0,0,0,0,0,215,95,217,215,95,95,217,215,95,95,95,217,7,7,7,175,176,
256,257,0,0,0,0,0,0,0,215,95,217,0,0,0,0,7,7,0,0,0,0,0,255,256,257,255,256,256,257,255,256,256,256,257,0,0,0,255,256,
0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,175,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176,177,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,0,0,0,175,176,176,176,176,176,176,
95,217,0,0,0,0,0,0,0,255,256,257,0,0,0,0,0,0,0,0,0,0,0,215,95,217,0,0,0,0,6,6,6,215,95,95,95,95,95,95,
95,217,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,215,95,217,0,0,0,0,175,176,177,215,95,95,95,95,95,95,
256,257,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,6,6,6,6,6,255,256,257,0,0,0,0,255,256,257,255,256,256,256,256,256,256,
7,7,7,7,7,7,7,7,7,175,176,176,176,176,176,177,175,176,176,176,176,176,176,176,176,177,0,0,0,0,175,176,176,177,7,7,7,7,7,7,
0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,217,215,95,95,95,95,95,95,95,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,257,215,95,96,256,256,256,256,97,95,217,0,0,0,0,215,95,95,217,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,255,256,256,257,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
obj.createentity(288, 120, 10, 1, 52520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 5;
warpx = true;
warpy = true;
roomname = "Twisty Little Passages";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,165,163,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
244,244,244,244,244,244,244,244,244,244,244,244,244,245,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,244,244,244,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,165,49,50,163,164,165,163,164,
83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,203,83,83,83,83,83,83,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83,
244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,205,49,50,203,83,205,243,244,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,163,164,165,0,0,0,0,203,83,205,49,50,203,83,205,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,163,164,164,165,203,83,205,49,50,203,83,205,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,203,83,83,205,203,83,205,49,50,203,83,205,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,243,244,244,245,203,83,205,49,50,203,83,205,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,0,0,
164,164,164,164,164,164,165,49,50,163,165,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,163,164,
83,83,83,83,83,83,205,49,50,203,205,0,0,0,203,83,205,0,0,0,0,0,0,203,83,205,0,0,0,0,203,83,205,49,50,203,83,205,203,83,
244,244,244,244,244,244,245,49,50,243,245,0,0,0,203,83,205,0,0,0,0,0,0,243,244,245,0,0,0,0,243,244,245,49,50,243,244,245,243,244,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,165,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
164,164,164,164,164,164,164,164,164,164,164,164,164,165,203,83,205,163,164,164,164,164,164,164,164,165,0,0,0,0,163,164,164,164,164,164,164,164,164,164,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,245,243,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,163,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
obj.createentity(24, 128, 10, 1, 52510); // (savepoint)
obj.createentity(56, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded
obj.createentity(264, 48, 1, 0, 10, -16, -16, 336, 256); // Enemy, bounded
obj.createentity(152, 48, 1, 2, 8, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(152, 176, 1, 2, 8, -24, -16, 344, 256); // Enemy, bounded
2020-01-01 21:29:24 +01:00
rcol = 1;
warpx = true;
warpy = true;
roomname = "That's Why I Have To Kill You";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
247,247,247,247,247,248,0,0,0,0,246,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,248,0,0,0,0,246,247,247,247,247,247,
7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,7,7,
6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,6,6,6,6,6,6,
167,167,167,167,167,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,168,0,0,0,0,166,167,167,168,166,167,
86,86,86,86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,208,206,86,
86,86,86,86,86,208,166,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,246,247,247,248,206,86,
247,247,247,247,247,248,246,248,49,50,246,248,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,7,7,7,7,246,247,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
167,167,167,167,167,167,167,168,49,50,166,168,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,206,208,0,0,0,0,166,167,167,167,167,167,
247,247,247,247,247,247,247,248,49,50,206,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,208,0,0,0,0,246,247,247,247,247,247,
0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,
6,6,6,6,166,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,168,6,6,6,6,
167,167,167,168,206,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,208,166,167,167,167,
247,247,247,248,246,248,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,246,248,246,247,247,247,
167,167,167,167,167,168,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,166,167,167,167,167,167,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 112, 13);
obj.createentity(248, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(64, 16, 1, 0, 10, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(200, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(152, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(104, 56, 1, 2, 5, -24, -24, 344, 256); // Enemy, bounded
obj.createentity(152, 152, 10, 0, 49520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 2;
warpx = true;
warpy = true;
roomname = "I Love You";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,205,203,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,203,83,83,83,205,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,163,164,164,164,164,164,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,
244,244,245,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,84,244,244,244,244,244,244,244,244,244,85,83,205,0,0,0,0,0,243,244,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,205,123,123,123,123,123,123,123,123,123,203,83,205,0,0,0,0,0,0,0,
164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,124,164,164,164,164,164,164,164,164,164,125,83,205,0,0,0,0,0,163,164,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,164,164,164,165,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,163,164,164,164,164,164,164,164,164,165,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
83,83,205,0,0,0,0,0,203,83,83,83,205,203,83,83,83,83,83,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
};
2020-01-01 21:29:24 +01:00
rcol = 1;
warpy = true;
roomname = "Green Dudes Can't Flip";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,
176,176,176,177,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,175,176,176,176,
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,
256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,256,256,256,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176,176,176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176,176,176,
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,95,95,
256,256,256,257,0,0,0,0,0,0,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,0,0,0,0,0,0,255,256,256,256,
0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,217,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,257,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
warpx = true;
warpy = true;
rcol = 5;
obj.createentity(14 * 8, (8 * 8) + 4, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
if(game.intimetrial)
{
obj.createblock(1, 20, 0, 32, 240, 82);
}
roomname = "Murdering Twinmaker";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,121,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,
80,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,160,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,200,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,160,161,161,161,161,161,162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80,202,0,200,202,0,200,202,0,240,241,241,241,241,241,242,0,0,0,0,0,0,0,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
80,202,0,200,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,
80,202,0,200,202,0,160,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,81,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
80,202,0,200,202,0,240,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,240,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,160,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,202,0,240,241,241,241,241,241,241,241,241,241,241,241,242,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
241,242,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
Add and draw one more row to all rooms with roomnames Since translucent roomname backgrounds were introduced in TerryCavanagh/VVVVVV#122, it exposes one glaring flaw with the game that until now has been kept hidden: in rooms with room names, the game cheapens out with the tile data and doesn't have a 30th row, because the room name would hide the missing row. As a result, rooms with room names have 29 rows instead of 30 to fill up the entire screen. And it looks really weird when there's nothing but empty space behind the translucent room name background. To remedy this, I added one row to each room with a room name in the level. First, I had to filter out all the rooms with no room names. However, that's actually all contained in Otherlevel.cpp, the Overworld, which contains 221 rooms (8 of which are the Secret Lab, 6 more of which are the Ship, so 207 are the actual Overworld, right? Wrong, 2 of those Overworld no-roomname rooms are in the Lab, so there are actually 205 Overworld rooms). The remaining level data files all contain rooms with room names. But the process wasn't that easy. I noticed a while ago that each room contains 29 `tmap.push_back()`s, one for each row of the room, and each row is simply a string containing the 40 tiles for that row, concatenated with commas. However, I decided to actually check my intuition by doing a grep on each level file and counting the number of results, for example `grep 'push_back' Labclass.cpp | wc -l`. Whatever number comes out should be divisible by 29. That particular grep on Labclass.cpp returns 1306, which divided by 29 is 45 with a remainder of 1. So what does that mean? Does that mean there's 45 rooms each, and 1 leftover row? Well, not exactly. The extra row comes from the fact that Outer Space has 30 rows instead of 29. Outer Space is the room that comes up when the game finds a room is non-existent, which shouldn't happen with a properly-working game, except in Outside Dimension VVVVVV. In fact, each level file has their own Outer Space, and every single Outer Space also has 30 rooms. So really, this means there are 44 rooms in the Lab and one Outer Space room. (Well, in reality, there are 46 rooms in the Lab, because 2 of them use the Outside tileset but have no room names, so they're stored in Otherlevel.cpp instead.) We find the same result for the Warp Zone. `grep 'push_back' WarpClass.cpp | wc -l` returns 697, which is 24 remainder 1, meaning 23 rooms of 29 rows and 1 room of 30 rows, which corresponds with 23 rooms in the Warp Zone and one Outer Space room. However, Outside Dimension VVVVVV + Tower Hallways and Space Station 1 and 2 are both odd curiosities. Finalclass.cpp contains Outside Dimension VVVVVV, (which is Intermission 1 and 2 and the Final Level), but also the Tower Hallway rooms, i.e. the auxiliary Tower rooms that are not a part of the main tower. Spacestation2.cpp contains both Space Station 1 and 2, so don't be deceived by the name. `grep 'push_back' Finalclass.cpp | wc -l` returns 1597, which is actually 55 remainder 2. So... are there two rooms with 30 rows? Yes, in fact, The Gravitron and Outer Space both contain 30 rows. So there are actually 55 rooms stored in Finalclass.cpp (not including the minitowers Panic Room and The Final Challenge), 54 rooms of actual level data and one Outer Space room, and breaking down the 54 rooms even further, 51 of them are actually in Outside Dimension VVVVVV and 3 of them are Tower Hallways. Of the 51 Outside Dimension VVVVVV rooms, 14 of those are Intermission 1, 4 of them are Intermission 2, and the rest of the 33 rooms are the Final Level (again, not including the minitowers). `grep 'push_back' Spacestation2.cpp | wc -l` returns 2148, which is 74 remainder 2. Are there two rooms with 30 rows again? No; one of those counted 2148 rows is a false-positive, because there's an if-else in Prize for the Reckless that replaces the row with spikes with a row without spikes if you are in a time trial or in No Death Mode. So there's 73 rooms in Space Station 1 and 2, and one Outer Space room. With all this in mind, I decided to duplicate the current last row of each room, the 29th row, to add a 30th row. However, I wasn't going to do this automatically! But neither was I going to write some kludge-y code to parse each nightmare of a level file and duplicate the rows that way. Enter: Vim macros! (Er, well, actually, I use Neovim.) I first did `/push_back`, so that pressing `n` would keep going to the next `push_back` in the file. Then I went to the 29th row of the first room in the file, did a `Yp`, and then started my macro with `qq`. The macro went like this: `30nYp`, which is simply going to the 29th row of the next room over and duplicating it. And that's all there was to it. However, I had to make sure that (1) my cursor was before the `push_back` on the line of the 29th row of the room, and (2) that I didn't skip rooms, both of which were problems I encountered when pressing Ctrl+Z a given invocation of the macro (the Ctrl+Z is just a metaphor, you actually undo by typing `u` in Vim). And also I had to make sure to be careful around the extra lines of `push_back`s in Prize for the Reckless and The Gravitron, and make sure I didn't run past the end of the file and loop back around. Thankfully, all Outer Space rooms are at the end of each file. But first, I had to increase the number of rows drawn in Graphics.cpp by 1 in order to compensate for this, and do the same when reading the tile data in Map.cpp. I had to change fillcontent(), drawmap(), drawfinalmap(), drawtowermap(), and drawtowermap_nobackground(). Funnily enough, the tower functions already used 30 rows, but I guess it's an off-by-one due to the camera scrolling, so they now draw 31 rows each. Then, I went in-game to make sure that the row behind each room name looked fine. I checked EVERY single room with a room name. I turned on invincibility mode and added a temporary line to hardreset() that always turned on game.nocutscenes for a smoother playtesting experience. And to make sure that rooms which have entirely empty bottom rows actually still have 30 rows, instead of having 29 and the game assuming that the 30th row was empty (because that sounds like it could lead to Undefined Behavior), I added this temporary debugging line to the start of mapclass::fillcontent(): printf("(%i,%i) has %i rows\n", game.roomx, game.roomy, (int) tmap.size()); Everywhere I checked - and I made sure to check all rooms - every room had 30 rows and not 29 rows. Unfortunately, some rooms simply couldn't be left alone with their 29th row duplicated and had to be manually edited. This was because the 29th row would contain some edge tiles because the player would be able to walk somewhere on the 28th, 27th, and 26th rows, and if you duplicated said edge tiles behind the room name, it would look bad. Here's a list of rooms whose 30th rows I had to manually edit: - Comms Relay - The Yes Men - Stop and Reflect - They Call Him Flipper - Double-slit Experiment - Square Root - Brought to you by the letter G - The Bernoulli Principle - Purest Unobtainium - I Smell Ozone - Conveying a New Idea - Upstream Downstream - Give Me A V - $eeing Dollar $ign$ - Doing Things The Hard Way - Very Good - Must I Do Everything For You? - Now Stay Close To Me... - ...But Not Too Close - ...Not as I Do - Do Try To Keep Up - Whee Sports - As you like it This is actually a strange case where it looked bad because of the 29th row, instead of the 30th row, and I had to change the 29th row instead of the 30th row to fix it. - Maze With No Entrance - Ascending and Descending - Mind The Gap Same strange case as "As you like it" (it's the 29th row I had to change that was the problem, not the 30th). - 1950 Silverstone Grand V - The Villi People I found that Panic Room and The Final Challenge also looked strange behind the roomname background, but I can't do much about either because towers' tile data wrap around at the top and bottom, and if I added another row to either it would be visible above the room name. I've considered updating the development editors with these new level tiles, but I decided against it as the development editors are already pretty outdated anyway.
2020-02-03 22:24:30 +01:00
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
};
2020-01-01 21:29:24 +01:00
rcol = 0;
warpy = true;
if(!game.intimetrial)
{
if(game.companion==0 && !obj.flags[11] && !game.crewstats[4]) //also need to check if he's rescued in a previous game
2020-01-01 21:29:24 +01:00
{
obj.createentity(255, 121, 15, 0);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 215, 0, 160, 240, 35);
}
}
roomname = "It's Not Easy Being Green";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
#endif
2020-01-01 21:29:24 +01:00
default:
{
static const short contents[1200] = {0};
2020-01-01 21:29:24 +01:00
//roomname = "Outer Space";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
}
return result;
2020-01-01 21:29:24 +01:00
}