1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 14:38:30 +02:00
VVVVVV/desktop_version/src/Labclass.cpp

2101 lines
162 KiB
C++
Raw Normal View History

2020-01-01 21:29:24 +01:00
#include "Labclass.h"
#include "Game.h"
#include "Entity.h"
#include "MakeAndPlay.h"
#include "UtilityClass.h"
const short* labclass::loadlevel(int rx, int ry)
2020-01-01 21:29:24 +01:00
{
int t;
rx=rx-100;
ry=ry-100;
if(ry<5)
{
rx+=50-2;
ry+=54; //lab
}
else
{
rx+=50-2;
ry+=50-16; //lab
}
t = rx + (ry * 100);
const short* result;
2020-01-01 21:29:24 +01:00
rcol = 0;
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):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,363,364,365,0,0,0,403,283,405,0,0,0,363,364,365,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,443,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
444,444,444,444,444,444,285,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,285,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
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
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283,
};
2020-01-01 21:29:24 +01:00
obj.createentity(232, 24, 10, 0, 250500); // (savepoint)
2020-01-01 21:29:24 +01:00
if(game.intimetrial)
{
obj.createblock(0, 0, 0, 8, 240);
}
rcol=1;
roomname = "Get Ready To Bounce";
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[] = {
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,441,442,0,0,0,0,0,0,440,441,441,441,441,282,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,281,442,64,64,0,0,0,0,0,0,64,64,64,64,64,440,282,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
63,63,63,63,63,63,63,63,63,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
361,361,361,361,361,361,361,361,361,361,361,361,362,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,
280,280,280,280,280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,
280,280,280,280,280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(112, 180, 11, 192); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 0;
roomname = "It's Perfectly Safe";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,414,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,71,71,71,71,71,71,71,71,71,
292,414,0,0,0,0,0,0,0,60,413,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,307,308,308,308,308,308,308,349,373,373,373,373,
292,414,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,71,71,71,0,0,0,0,0,71,71,71,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,
292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,412,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,
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
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,412,292,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(96, 124, 11, 120); // (horizontal gravity line)
obj.createentity(248, 48, 10, 0, 251490); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 4;
roomname = "Rascasse";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,406,286,286,286,286,
286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,447,447,447,447,447,447,447,288,286,286,287,447,448,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,68,68,68,68,68,68,406,286,286,408,68,68,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,446,447,447,448,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,68,68,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,
367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,366,367,367,368,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,328,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,406,286,286,408,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,408,67,67,67,67,67,67,67,67,406,286,286,408,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,327,367,367,367,367,367,367,367,367,328,286,286,327,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
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
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
obj.createentity(248, 136, 10, 1, 252490); // (savepoint)
obj.createentity(16, 68, 11, 64); // (horizontal gravity line)
obj.createentity(112, 68, 11, 64); // (horizontal gravity line)
obj.createentity(64, 164, 11, 64); // (horizontal gravity line)
obj.createentity(160, 164, 11, 64); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 2;
roomname = "Keep Going";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(48,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,
289,289,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289,289,411,70,70,70,70,70,70,70,70,70,70,70,70,70,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,
289,290,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,
289,411,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,411,0,0,0,0,0,0,0,0,0,369,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,370,370,
289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,411,69,69,69,69,69,0,0,0,0,0,69,69,69,69,69,409,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,330,370,370,370,370,371,0,0,0,0,0,369,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,330,370,370,370,370,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
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
289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
};
2020-01-01 21:29:24 +01:00
obj.createentity(280, 136, 10, 1, 252480); // (savepoint)
obj.createentity(48, 52, 11, 104); // (horizontal gravity line)
obj.createentity(192, 52, 11, 104); // (horizontal gravity line)
obj.createentity(152, 196, 11, 40); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=3;
roomname = "Single-slit Experiment";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(48,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456,
295,417,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,417,74,74,74,74,74,74,74,74,74,74,74,74,74,74,
295,417,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
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
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
};
2020-01-01 21:29:24 +01:00
obj.createentity(32, 128, 10, 1, 253480); // (savepoint)
obj.createentity(187, 88, 12, 56); // (vertical gravity line)
obj.createentity(107, 88, 12, 56); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol = 5;
roomname = "Don't Flip Out";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
444,444,444,444,444,285,283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,284,444,444,444,444,
66,66,66,66,66,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,66,66,66,66,
0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,443,444,444,444,444,444,444,444,444,444,445,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,363,364,364,364,364,
283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,283,283,283,
283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,403,283,283,283,283,
283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,325,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
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
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
};
2020-01-01 21:29:24 +01:00
obj.createentity(43, 88, 12, 56); // (vertical gravity line)
obj.createentity(123, 88, 12, 56); // (vertical gravity line)
obj.createentity(203, 88, 12, 56); // (vertical gravity line)
obj.createentity(283, 88, 12, 56); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
obj.createentity(156, 128, 20, 1); // (terminal)
2020-01-01 21:29:24 +01:00
obj.createblock(5, 156-8, 128, 20, 16, 19);
rcol = 1;
roomname = "Shuffled Hallway";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,70,70,70,70,70,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
70,70,70,70,70,70,70,70,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,450,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,371,0,0,0,0,0,0,0,0,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,69,69,69,69,69,69,69,69,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,370,370,370,370,370,370,
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
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
};
2020-01-01 21:29:24 +01:00
obj.createentity(96, 192, 10, 1, 253500); // (savepoint)
obj.createentity(163, 32, 12, 168); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol = 3;
roomname = "Double-slit Experiment";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,287,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
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
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
obj.createentity(264, 104, 10, 1, 253510); // (savepoint)
obj.createentity(131, 120, 12, 96); // (vertical gravity line)
obj.createentity(187, 16, 12, 96); // (vertical gravity line)
obj.createentity(40, 112, 10, 0, 253511); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 2;
roomname = "They Call Him Flipper";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
453,453,453,453,453,453,294,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
72,72,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,293,453,453,453,294,292,293,453,453,453,294,292,293,453,453,453,294,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,412,414,0,0,0,0,0,0,412,414,72,72,72,412,292,414,72,72,72,412,292,414,72,72,72,412,292,292,292,292,292,292,292,292,
373,374,0,0,0,0,412,414,0,0,0,0,0,0,452,454,0,0,0,452,453,454,0,0,0,452,453,454,0,0,0,452,453,453,453,453,453,453,294,292,
292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,414,0,0,0,0,412,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,71,0,0,0,412,292,
292,414,0,0,0,0,452,454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,307,309,0,0,0,412,292,
292,414,0,0,0,0,72,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,0,0,0,412,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,
292,333,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,372,373,373,373,374,0,0,0,0,0,372,373,373,373,373,373,373,373,373,334,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,414,71,71,71,71,71,412,292,292,292,414,71,71,71,71,71,412,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,333,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,334,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
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
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(24, 184, 10, 1, 253520); // (savepoint)
obj.createentity(64, 164, 11, 200); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 4;
roomname = "Three's a Crowd";
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[] = {
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,288,286,286,286,286,286,
68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
367,367,367,367,367,367,367,351,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,312,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,406,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
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
286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
obj.createentity(195, 24, 12, 80); // (vertical gravity line)
obj.createentity(195, 128, 12, 80); // (vertical gravity line)
obj.createentity(80, 120, 10, 0, 252520); // (savepoint)
obj.createentity(80, 96, 10, 1, 252521); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 2;
roomname = "Hitting the Apex";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,281,442,64,64,64,64,64,64,64,64,64,64,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,281,441,441,441,441,442,51,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,281,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,440,282,280,281,442,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,440,344,442,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,464,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,361,361,361,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,280,280,280,280,280,280,280,
280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(24, 188, 11, 224); // (horizontal gravity line)
obj.createentity(280, 96, 10, 1, 252510); // (savepoint)
2020-01-01 21:29:24 +01:00
obj.createentity(204, 32, 20, 0); // (terminal)
2020-01-01 21:29:24 +01:00
obj.createblock(5, 204-8, 32, 20, 16, 20);
rcol=0;
roomname = "Square Root";
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[] = {
292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,293,454,72,72,72,72,72,72,72,72,72,72,72,72,72,72,452,294,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,452,319,454,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,467,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,387,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,372,347,374,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
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
292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(24, 44, 11, 112); // (horizontal gravity line)
obj.createentity(176, 180, 11, 112); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 4;
roomname = "Thorny Exchange";
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[] = {
283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,
283,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,405,53,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,364,
283,283,405,53,0,0,0,0,54,403,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,443,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,363,365,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,324,365,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,325,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
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
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,283,
};
2020-01-01 21:29:24 +01:00
obj.createentity(32, 28, 11, 296); // (horizontal gravity line)
obj.createentity(32, 196, 11, 112); // (horizontal gravity line)
obj.createentity(128, 100, 11, 160); // (horizontal gravity line)
obj.createentity(88, 112, 10, 0, 250510); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "Brought to you by the letter G";
rcol = 1;
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[] = {
447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,
68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
367,367,367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,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
286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,0,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(-8, 28, 11, 336); // (horizontal gravity line)
obj.createentity(32, 72, 10, 1, 250520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol=2;
roomname = "Free Your Mind";
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[] = {
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
280,280,280,280,280,280,280,280,321,362,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,
280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(80, 180, 11, 248); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=0;
roomname = "I Changed My Mind, Thelma...";
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[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,414,59,0,0,0,0,0,0,0,0,0,0,
71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,333,374,71,71,71,71,71,71,71,71,71,71,
373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,333,373,373,373,373,373,373,373,373,373,373,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
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
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 180, 11, 208); // (horizontal gravity line)
obj.createentity(240, 180, 11, 88); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=4;
roomname = "Indirect Jump Vector";
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[] = {
456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,
74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,396,73,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,375,356,377,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,417,61,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,62,415,295,417,61,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 28, 11, 336); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=5;
roomname = "In a Single Bound";
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[] = {
444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,284,444,444,444,444,444,444,444,444,444,
66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66,66,66,66,443,285,283,284,445,66,66,66,66,66,66,66,66,66,
0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,443,359,445,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,66,473,66,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,65,393,65,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,363,353,365,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,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,54,403,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,53,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 28, 11, 80); // (horizontal gravity line)
obj.createentity(112, 28, 11, 96); // (horizontal gravity line)
obj.createentity(248, 28, 11, 80); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=1;
roomname = "Barani, Barani";
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[] = {
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,446,399,448,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,68,470,68,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,67,390,67,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,366,350,368,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,56,406,286,408,55,0,0,0,0,0,0,0,0,0,
67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67,67,67,67,366,328,286,327,368,67,67,67,67,67,67,67,67,67,
367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367,367,367,367,328,286,286,286,327,367,367,367,367,367,367,367,367,367,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
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
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 180, 11, 80); // (horizontal gravity line)
obj.createentity(112, 180, 11, 96); // (horizontal gravity line)
obj.createentity(248, 180, 11, 80); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=2;
roomname = "Safety Dance";
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[] = {
450,450,450,450,291,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
70,70,70,70,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,449,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,69,0,0,0,0,0,0,69,369,331,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,369,371,0,0,0,0,0,0,369,331,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,409,411,0,0,0,0,0,0,409,289,289,289,
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,58,409,411,0,0,0,0,0,0,409,289,289,289,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 28, 11, 40); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=3;
roomname = "Heady Heights";
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[] = {
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,296,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,417,0,0,0,0,0,0,0,0,0,62,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
456,457,0,0,0,0,0,0,0,0,0,62,455,456,456,456,456,456,456,456,456,456,456,456,456,297,296,456,456,456,456,456,456,456,456,456,456,456,297,295,
0,0,0,0,375,376,377,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
0,0,0,0,415,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
376,376,376,376,337,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,61,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,377,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,296,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
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
295,295,295,295,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,415,295,
};
2020-01-01 21:29:24 +01:00
obj.createentity(160, 176, 10, 0, 249550); // (savepoint)
obj.createentity(224, 68, 11, 72); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
//obj.createentity(224, 192, 10, 0, 249550); // (savepoint)
2020-01-01 21:29:24 +01:00
if(!game.intimetrial) obj.createentity((12 * 8)-4, (6 * 8) + 4, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
rcol = 5;
roomname = "Entanglement Generator";
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[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,402,0,0,0,0,0,0,400,280,280,280,
63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,360,322,402,0,0,0,0,0,0,400,280,280,280,
361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,402,0,0,0,0,0,0,400,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,400,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 180, 11, 224); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 0;
roomname = "Exhausted?";
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[] = {
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,293,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,294,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,0,0,0,0,0,0,0,0,0,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
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
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,414,59,0,0,0,0,0,0,0,60,412,292,414,0,0,0,0,0,0,412,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(32, 64, 9, 10); // (shiny trinket)
obj.createentity(120, 72, 10, 1, 252550); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 4;
roomname = "The Tantalizing Trinket";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
283,283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,445,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,284,445,66,66,66,66,66,66,66,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,325,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,444,444,285,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,393,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,439,314,314,314,314,315,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,433,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,54,473,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,0,0,403,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,363,364,364,364,364,325,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,443,444,444,285,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,324,365,65,65,65,65,65,65,65,65,0,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,365,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
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
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,53,0,0,0,0,0,0,0,54,403,283,405,0,0,0,0,0,0,403,283,283,283,
};
2020-01-01 21:29:24 +01:00
obj.createentity(272, 144, 10, 1, 253550); // (savepoint)
obj.createentity(152, 116, 11, 56); // (horizontal gravity line)
obj.createentity(139, 16, 12, 72); // (vertical gravity line)
obj.createentity(139, 144, 12, 72); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol=1;
roomname = "The Bernoulli Principle";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(55,54):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,297,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,61,0,0,0,0,0,0,0,62,415,295,417,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,0,0,0,0,0,0,0,0,0,455,456,457,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
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
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
};
2020-01-01 21:29:24 +01:00
obj.createentity(216, 144, 10, 1, 254550); // (savepoint)
obj.createentity(-8, 60, 11, 136); // (horizontal gravity line)
obj.createentity(-8, 172, 11, 136); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol = 5;
roomname = "Standing Wave";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,54):
{
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,406,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,446,288,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,446,447,447,447,447,447,447,447,447,447,447,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,68,68,68,68,68,68,68,68,68,68,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,67,67,67,67,67,67,67,67,67,67,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,366,367,367,367,367,367,367,367,367,367,367,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,
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,406,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 60, 11, 336); // (horizontal gravity line)
obj.createentity(-8, 172, 11, 336); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=2;
obj.fatal_top();
roomname = "Topsy Turvyism";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,54):
{
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,369,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,370,370,370,370,371,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,450,291,289,289,411,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,70,70,70,70,0,0,0,0,0,0,70,70,70,70,70,70,449,450,450,451,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,369,370,370,371,69,69,69,69,69,69,0,0,0,0,0,0,69,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,409,289,289,330,370,370,370,370,370,371,0,0,0,0,0,0,369,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,449,450,450,450,450,450,450,450,450,451,0,0,0,0,0,0,449,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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(-8, 60, 11, 120); // (horizontal gravity line)
obj.createentity(-8, 172, 11, 40); // (horizontal gravity line)
obj.createentity(264, 72, 10, 0, 254530); // (savepoint)
obj.createentity(40, 144, 10, 1, 254531); // (savepoint)
obj.createentity(160, 60, 11, 48); // (horizontal gravity line)
obj.createentity(288, 60, 11, 40); // (horizontal gravity line)
obj.createentity(112, 172, 11, 48); // (horizontal gravity line)
obj.createentity(208, 172, 11, 120); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=3;
obj.fatal_top();
roomname = "Spike Strip Deployed";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,54):
{
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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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(-8, 60, 11, 336); // (horizontal gravity line)
obj.createentity(-8, 172, 11, 336); // (horizontal gravity line)
obj.createentity(72, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded
obj.createentity(232, 64, 1, 0, 8, 72, 64, 248, 168); // Enemy, bounded
obj.createentity(152, 152, 1, 1, 8, 72, 64, 248, 168); // Enemy, bounded
2020-01-01 21:29:24 +01:00
obj.fatal_top();
roomname = "Vibrating String Problem";
rcol = 5;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,54):
{
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,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,443,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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(176, 60, 11, 152); // (horizontal gravity line)
obj.createentity(176, 172, 11, 152); // (horizontal gravity line)
obj.createentity(-8, 84, 11, 160); // (horizontal gravity line)
obj.createentity(-8, 148, 11, 160); // (horizontal gravity line)
obj.createentity(160-4, 120, 10, 1, 254510); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol=1;
obj.fatal_top();
roomname = "Merge";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,54):
{
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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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(-8, 84, 11, 336); // (horizontal gravity line)
obj.createentity(-8, 148, 11, 336); // (horizontal gravity line)
obj.createentity(88, 96, 1, 3, 3); // Enemy
obj.createentity(40, 120, 1, 3, 3); // Enemy
obj.createentity(136, 120, 1, 3, 3); // Enemy
2020-01-01 21:29:24 +01:00
rcol = 0;
obj.fatal_top();
roomname = "Kids His Age Bounce";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,54):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,287,448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,310,352,368,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,406,408,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,310,392,448,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,470,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,390,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,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
286,286,286,286,408,55,0,0,0,0,0,0,56,430,55,0,0,0,0,0,0,56,430,55,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(264, 84, 11, 64); // (horizontal gravity line)
obj.createentity(240+4, 96, 10, 0, 254490); // (savepoint)
obj.createentity(48, 28, 11, 192); // (horizontal gravity line)
obj.createentity(120, 148, 11, 208); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
rcol=2;
roomname = "I'm Sorry";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,55):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,468,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,428,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,60,427,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,60,467,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,373,373,373,373,373,373,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,414,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,412,292,292,292,292,292,292,292,
292,292,292,292,333,374,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,372,334,292,292,292,292,292,292,292,
292,292,292,292,292,333,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,334,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
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
292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
};
2020-01-01 21:29:24 +01:00
obj.createentity(48, 156, 11, 200); // (horizontal gravity line)
obj.createentity(216, 56, 10, 0, 255490); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol=4;
roomname = "Please Forgive Me!";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,55):
{
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,
364,364,364,364,364,364,364,364,364,354,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,355,364,364,
283,283,283,283,283,283,283,283,283,405,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,443,444,444,
444,444,444,444,444,444,444,444,444,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
364,364,364,364,364,364,364,364,364,365,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283,283,283,283,283,283,283,283,283,405,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,363,364,364,
283,283,283,283,283,283,283,283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
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
283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
};
2020-01-01 21:29:24 +01:00
obj.createentity(131, 48, 12, 152); // (vertical gravity line)
obj.createentity(179, 48, 12, 152); // (vertical gravity line)
obj.createentity(227, 48, 12, 152); // (vertical gravity line)
obj.createentity(275, 48, 12, 152); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol=1;
roomname = "Playing Foosball";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,55):
{
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,
376,376,376,376,376,357,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,358,376,376,376,376,
456,456,456,456,456,457,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,455,456,456,456,456,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,62,416,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
376,376,376,376,376,377,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,375,376,376,376,376,
295,295,295,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
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
295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
};
2020-01-01 21:29:24 +01:00
obj.createentity(91, 168, 12, 32); // (vertical gravity line)
obj.createentity(139, 80, 12, 120); // (vertical gravity line)
obj.createentity(235, 104, 12, 96); // (vertical gravity line)
obj.createentity(187, 144, 12, 56); // (vertical gravity line)
obj.createentity(43, 48, 12, 152); // (vertical gravity line)
obj.createentity(91, 48, 12, 112); // (vertical gravity line)
obj.createentity(139, 48, 12, 24); // (vertical gravity line)
obj.createentity(187, 48, 12, 88); // (vertical gravity line)
obj.createentity(235, 48, 12, 48); // (vertical gravity line)
obj.createentity(283, 48, 12, 152); // (vertical gravity line)
obj.createentity(8, 48, 10, 0, 255510); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol=5;
roomname = "A Difficult Chord";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,55):
{
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,
361,361,345,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,345,305,305,305,305,305,346,361,361,361,361,361,361,361,361,
441,441,442,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,344,442,64,64,64,64,64,440,282,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,52,424,51,0,0,0,0,0,64,464,64,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,0,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,0,384,0,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
0,0,0,0,0,0,0,0,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,424,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,
361,361,361,361,361,361,361,361,479,362,63,63,63,63,63,360,466,51,0,0,0,0,0,52,465,362,63,63,63,63,63,360,322,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,321,361,361,361,361,361,322,402,51,0,0,0,0,0,52,400,321,361,361,361,361,361,322,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(16, 184, 10, 1, 255520); // (savepoint)
obj.createentity(131, 88, 12, 96); // (vertical gravity line)
obj.createentity(208, 180, 11, 40); // (horizontal gravity line)
obj.createentity(67, 56, 12, 80); // (vertical gravity line)
obj.createentity(195, 56, 12, 80); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol = 0;
roomname = "The Living Dead End";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
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
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,411,57,0,0,0,0,0,58,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
};
2020-01-01 21:29:24 +01:00
rcol=3;
roomname = "AAAAAA";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,57):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,287,447,447,447,288,286,286,286,286,286,
286,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,286,408,68,68,68,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,446,288,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,287,448,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,68,406,286,286,286,286,408,55,0,0,0,0,0,56,406,286,286,286,286,408,68,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,446,447,447,447,447,448,55,0,0,0,0,0,56,446,447,447,447,447,448,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,68,68,68,68,68,68,0,0,0,0,0,0,0,68,68,68,68,68,68,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,366,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,366,367,367,328,286,286,286,286,286,286,286,327,367,367,368,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,446,447,288,286,286,286,286,286,286,286,286,286,287,447,448,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,408,0,0,0,0,0,0,68,68,446,447,288,286,286,286,286,286,287,447,448,68,68,0,0,0,0,0,0,406,286,286,286,286,286,
286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,68,68,446,447,288,286,287,447,448,68,68,0,0,0,0,0,0,0,366,328,286,286,286,286,286,
286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,68,68,446,447,448,68,68,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,
286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,68,68,68,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,327,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,328,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,327,367,368,0,0,0,0,0,366,367,328,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
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
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,408,0,0,0,0,0,406,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
};
2020-01-01 21:29:24 +01:00
rcol = 2;
roomname = "Diode";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
281,441,441,441,441,282,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,282,280,280,
402,0,0,0,0,400,402,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,440,282,280,
402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,400,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,440,442,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
321,361,361,361,361,361,361,361,361,362,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,360,361,361,361,345,306,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,384,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,63,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,384,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,0,0,424,0,0,0,0,0,0,0,0,0,0,424,0,0,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,402,63,63,424,63,63,63,63,63,63,63,63,63,63,424,63,63,400,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,321,361,361,479,361,361,361,361,361,361,361,361,361,361,479,361,361,322,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,402,51,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,281,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,385,306,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,400,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,360,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,322,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,402,0,0,0,0,0,400,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
obj.createentity(267, 24, 12, 184); // (vertical gravity line)
obj.createentity(16, 24, 9, 9); // (shiny trinket)
obj.createentity(187, 24, 12, 64); // (vertical gravity line)
obj.createentity(104, 124, 11, 80); // (horizontal gravity line)
obj.createentity(48, 72, 10, 1, 252500); // (savepoint)
obj.createentity(224, 72, 10, 1, 252501); // (savepoint)
obj.createentity(99, 24, 12, 80); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
rcol=0;
roomname = "Young Man, It's Worth the Challenge";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,55):
{
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,
367,367,367,367,367,367,368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,360,361,362,372,373,374,0,0,0,0,0,0,0,0,0,0,
286,286,286,286,286,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0,
447,447,447,447,288,286,408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,280,402,412,292,414,0,0,0,0,0,0,0,0,0,0,
364,364,364,365,406,286,408,0,0,0,0,0,0,0,0,0,0,360,361,362,0,0,0,0,400,280,402,452,453,454,0,0,0,0,366,367,367,368,0,0,
283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,400,280,321,361,361,362,0,0,0,0,406,286,286,408,0,0,
283,283,283,405,406,286,408,0,0,0,0,0,0,0,0,0,0,400,280,402,0,0,0,0,440,441,441,282,280,402,0,0,0,0,406,286,286,408,0,0,
283,283,283,405,406,286,408,0,0,0,0,369,370,371,360,361,361,322,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0,
283,283,283,405,406,286,408,0,0,0,0,409,289,411,400,280,280,280,280,402,0,0,0,0,0,0,0,400,280,402,0,0,0,0,406,286,286,408,0,0,
283,283,283,405,446,447,448,0,0,0,0,409,289,411,440,441,441,441,441,442,0,0,0,0,0,0,0,440,441,442,0,0,0,0,406,286,286,408,0,0,
283,283,283,324,364,364,365,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,
283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,406,286,286,408,0,0,
283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,363,364,364,364,364,365,0,0,0,0,406,287,447,448,0,0,
283,283,283,283,283,283,405,0,0,0,0,409,289,411,0,0,0,0,0,0,0,0,0,0,443,444,285,283,283,405,0,0,0,0,406,408,375,377,0,0,
444,444,444,444,444,444,445,0,0,0,0,409,289,411,0,0,0,369,370,370,370,370,370,370,370,371,403,284,444,445,0,0,0,0,406,408,415,417,0,0,
373,373,373,373,373,373,374,0,0,0,0,409,289,411,0,0,0,409,289,290,450,450,450,450,450,451,403,405,0,0,0,0,0,0,406,408,415,417,0,0,
292,292,292,292,292,292,414,375,376,376,377,409,289,411,0,0,0,409,289,411,363,364,364,364,364,364,325,405,0,0,0,0,0,0,406,408,415,417,0,0,
292,292,292,293,453,453,454,415,295,295,417,409,289,411,0,0,0,449,450,451,443,444,444,444,444,444,444,445,0,0,0,0,0,0,446,448,415,336,376,376,
292,292,292,414,360,361,362,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,295,295,295,
292,292,292,414,400,280,402,415,295,295,417,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,
292,292,292,414,400,280,402,455,456,456,457,409,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,
292,292,292,414,400,280,321,361,361,361,362,409,289,330,370,370,370,370,370,370,370,370,370,370,371,375,376,376,376,376,376,337,295,295,295,295,295,295,295,295,
292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,290,450,450,450,450,451,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,375,376,376,376,376,337,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
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
292,292,292,414,400,280,280,280,280,280,402,409,289,289,289,289,289,289,289,411,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
};
2020-01-01 21:29:24 +01:00
rcol = 6;
roomname = "Anomaly";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,55):
{
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,415,295,295,295,295,295,295,295,295,417,412,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,295,295,417,412,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,296,456,457,412,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,295,295,417,372,373,334,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,296,456,457,412,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,417,372,373,334,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,296,456,457,412,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,417,372,373,334,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,296,456,457,412,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,372,373,334,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,457,412,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,372,373,334,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,360,361,361,361,361,362,0,0,0,0,0,366,368,412,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,
0,0,0,0,0,0,0,0,0,0,0,400,280,280,280,280,402,0,0,0,0,0,406,408,452,453,453,453,294,292,292,292,292,292,292,292,292,292,292,292,
370,370,370,371,366,367,367,368,363,364,365,440,282,280,280,281,442,363,364,365,366,367,328,408,369,370,370,371,452,453,294,292,292,292,292,292,292,292,292,292,
289,289,289,411,406,286,286,408,403,283,324,365,440,282,281,442,363,325,283,405,406,286,286,408,409,289,289,330,370,371,452,453,294,292,292,292,292,292,292,292,
289,289,289,411,446,288,286,408,443,285,283,324,365,440,442,363,325,283,284,445,406,286,287,448,409,289,289,289,289,330,370,371,452,453,294,292,292,292,292,292,
289,289,289,330,371,446,288,327,368,443,285,283,324,364,364,325,283,284,445,366,328,287,448,369,331,289,289,289,289,289,289,330,370,371,452,453,294,292,292,292,
289,289,289,289,330,371,406,286,327,368,443,444,285,283,283,284,444,445,366,328,286,408,369,331,289,289,289,289,289,289,289,289,289,330,370,371,452,453,294,292,
289,289,289,289,289,411,446,288,286,327,367,368,443,444,444,445,366,367,328,286,287,448,409,289,289,289,289,289,289,289,289,289,289,289,289,330,370,371,452,453,
289,289,289,289,289,330,371,446,447,288,286,327,367,367,367,367,328,286,287,447,448,369,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,330,370,370,
289,289,289,289,289,289,330,370,371,406,286,286,286,286,286,286,286,286,408,369,370,331,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
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
289,289,289,289,289,289,289,289,411,406,286,286,286,286,286,286,286,286,408,409,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
};
2020-01-01 21:29:24 +01:00
obj.createentity(104, 128, 9, 11); // (shiny trinket)
2020-01-01 21:29:24 +01:00
rcol = 6;
roomname = "Purest Unobtainium";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(52,58):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,296,456,456,456,456,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,456,456,456,456,297,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,375,376,376,376,376,377,0,0,0,0,0,375,376,376,376,376,376,376,376,376,376,377,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,295,295,295,417,0,0,0,0,0,415,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,296,456,456,457,0,0,0,0,0,455,456,456,456,456,456,456,456,297,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,375,377,0,0,0,0,0,375,376,376,376,376,376,377,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,456,456,456,297,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,376,377,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,455,456,297,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,396,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,476,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,0,0,415,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,415,295,417,0,415,417,0,0,0,0,0,375,376,337,417,0,415,417,0,415,295,417,0,415,295,295,295,295,
456,456,456,456,456,457,0,455,456,456,457,0,455,456,457,0,455,457,0,0,0,0,0,455,456,456,457,0,415,417,0,415,295,417,0,415,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,417,0,415,295,417,0,415,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,337,417,0,415,295,417,0,415,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,456,456,456,456,456,457,0,415,295,417,0,415,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,417,0,415,295,295,295,295,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,375,376,376,376,376,376,376,376,337,295,417,0,415,295,295,295,295,
376,376,376,376,376,377,0,375,376,376,377,0,375,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,295,295,295,295,295,417,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,417,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,415,295,295,295,295,
295,295,295,295,295,417,0,415,295,295,336,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,337,295,295,295,295,
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
295,295,295,295,295,417,0,415,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,
};
2020-01-01 21:29:24 +01:00
obj.createentity(112, 184, 10, 1, 258520); // (savepoint)
2020-01-01 21:29:24 +01:00
rcol = 5;
roomname = "I Smell Ozone";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,58):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
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
280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,
};
2020-01-01 21:29:24 +01:00
rcol=0;
if(!game.intimetrial)
{
if(game.companion==0 && !obj.flags[9] && !game.crewstats[5]) //also need to check if he's rescued in a previous game
2020-01-01 21:29:24 +01:00
{
obj.createentity(32, 177, 18, 16, 1, 17, 1);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 24*8, 0, 32, 240, 33);
}
}
roomname = "Why So Blue?";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,58):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,290,450,450,450,450,450,450,450,450,450,291,289,289,289,290,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,291,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,369,331,289,289,289,330,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,449,450,450,450,450,450,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,369,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,330,370,370,370,331,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,290,450,450,450,291,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,449,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,409,289,289,289,289,289,289,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,449,450,450,450,450,450,450,
289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,411,0,0,0,0,0,0,0,0,369,370,370,370,370,370,371,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,411,0,0,0,0,0,0,0,0,449,291,289,289,289,290,451,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,411,0,0,0,0,0,0,0,0,0,409,289,289,289,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
289,289,289,330,370,370,370,370,370,370,370,370,370,331,289,289,289,330,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
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
289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
};
2020-01-01 21:29:24 +01:00
rcol=3;
obj.createentity((10 * 8)-4, (8 * 8) + 4, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
if(game.intimetrial)
{
obj.createblock(1, 280, 0, 32, 240, 82);
}
roomname = "Philadelphia Experiment";
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};
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
}