1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-16 01:28:29 +02:00
VVVVVV/desktop_version/src/Finalclass.cpp

2619 lines
200 KiB
C++
Raw Normal View History

2020-01-01 21:29:24 +01:00
#include "Finalclass.h"
#include "Game.h"
#include "Entity.h"
#include "MakeAndPlay.h"
#include "UtilityClass.h"
const short* finalclass::loadlevel(int rx, int ry)
2020-01-01 21:29:24 +01:00
{
int t;
t = rx + (ry * 100);
const short* result;
2020-01-01 21:29:24 +01:00
warpx = false;
warpy = false;
roomname = "Untitled room ["+help.String(rx) + "," + help.String(ry)+"]";
2020-01-01 21:29:24 +01:00
switch(t)
{
#if !defined(MAKEANDPLAY)
2020-01-01 21:29:24 +01:00
case rn(50,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,259,259,259,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,
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
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(163, 32, 12, 168); // (vertical gravity line)
obj.createentity(99, 32, 12, 168); // (vertical gravity line)
obj.createentity(227, 32, 12, 168); // (vertical gravity line)
obj.createentity(35, 32, 12, 168); // (vertical gravity line)
obj.createentity(291, 32, 12, 168); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
warpx = true;
roomname = "1954 World Cup Vinyl";
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[] = {
0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,180,218,98,220,740,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,218,98,220,740,
0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,218,98,220,740,
0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740,
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,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,218,98,220,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 116, 11, 40); // (horizontal gravity line)
obj.createentity(48, 116, 11, 184); // (horizontal gravity line)
obj.createentity(32, 88, 10, 1, 51500); // (savepoint)
obj.createentity(32, 128, 10, 0, 51501); // (savepoint)
obj.createentity(256, 88, 10, 1, 51502); // (savepoint)
obj.createentity(256, 128, 10, 0, 51503); // (savepoint)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "The V Stooges";
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[] = {
0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,260,49,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,
0,0,0,0,178,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,180,0,0,0,0,
0,0,0,0,218,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,220,0,0,0,0,
0,0,0,0,258,259,260,49,0,0,0,0,0,0,0,0,50,258,259,259,259,259,260,49,0,0,0,0,0,0,0,0,50,258,259,260,0,0,0,0,
0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,50,178,179,179,180,49,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,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,50,218,98,98,220,49,0,0,0,0,0,0,0,0,50,218,98,98,220,49,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(-8, 116, 11, 40); // (horizontal gravity line)
obj.createentity(288, 116, 11, 32); // (horizontal gravity line)
obj.createentity(64, 116, 11, 64); // (horizontal gravity line)
obj.createentity(192, 116, 11, 64); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "glitch";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(48,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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, 116, 11, 40); // (horizontal gravity line)
obj.createentity(48, 116, 11, 224); // (horizontal gravity line)
obj.createentity(288, 116, 11, 32); // (horizontal gravity line)
obj.createentity(56, 88, 1, 3, 10); // Enemy
obj.createentity(248-16, 128, 1, 2, 10); // Enemy
obj.createentity(272, 168, 10, 0, 51480); // (savepoint)
obj.createentity(32, 48, 10, 1, 51481); // (savepoint)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "glitch";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(47,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,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,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,218,220,0,0,0,0,0,0,218,220,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, 148, 11, 104); // (horizontal gravity line)
obj.createentity(-8, 84, 11, 80); // (horizontal gravity line)
obj.createentity(176, 116, 11, 144); // (horizontal gravity line)
obj.createentity(128, 96, 10, 0, 51470); // (savepoint)
obj.createentity(128, 56, 10, 1, 51471); // (savepoint)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "change";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(46,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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, 328); // (horizontal gravity line)
obj.createentity(-8, 148, 11, 328); // (horizontal gravity line)
obj.createentity(96, 120, 1, 2, 4); // Enemy
obj.createentity(144, 96, 1, 2, 4); // Enemy
obj.createentity(192, 120, 1, 2, 4); // Enemy
obj.createentity(240, 96, 1, 2, 4); // Enemy
obj.createentity(288, 120, 1, 2, 4); // Enemy
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "change";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(45,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,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,218,220,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,218,220,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
};
2020-01-01 21:29:24 +01:00
obj.createentity(248, 84, 11, 72); // (horizontal gravity line)
obj.createentity(224, 148, 11, 96); // (horizontal gravity line)
obj.createentity(176, 56, 10, 1, 51450); // (savepoint)
obj.createentity(176, 96, 10, 0, 51451); // (savepoint)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "change";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(44,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,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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(64+32-8, 32-16, 1, 0, 7, 0, -48, 320, 312); // Enemy, bounded
obj.createentity(96+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded
obj.createentity(128+32-8, 32-16, 1, 0, 7, 0, -40, 320, 320); // Enemy, bounded
obj.createentity(160+32-8, 32-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded
obj.createentity(192+32-8, 32-16, 1, 0, 7, 0, -64, 320, 336); // Enemy, bounded
obj.createentity(64+32-8, 64-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded
obj.createentity(64+32-8, 96-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded
obj.createentity(64+32-8, 128-16, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded
obj.createentity(64+32-8, 160-16, 1, 0, 7, 0, -56, 320, 320); // Enemy, bounded
obj.createentity(192+32-8, 128-16+8, 1, 0, 7, 0, -64, 320, 320); // Enemy, bounded
obj.createentity(192+32-8, 160-16+8, 1, 0, 7, 0, -80, 320, 320); // Enemy, bounded
obj.createentity(192+32-8, 192-16+8, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded
obj.createentity(192+32-8, 192+24, 1, 0, 7, 0, -80, 320, 304); // Enemy, bounded
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "Vertigo";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(43,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,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,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,218,98,220,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(155, 24, 12, 184); // (vertical gravity line)
obj.createentity(120, 152, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded
obj.createentity(104, 136, 1, 1, 8, 0, -64, 320, 296); // Enemy, bounded
obj.createentity(88, 120, 1, 1, 8, 0, -56, 320, 312); // Enemy, bounded
obj.createentity(72, 104, 1, 1, 8, 0, -56, 320, 296); // Enemy, bounded
obj.createentity(56, 88, 1, 1, 8, 0, -48, 320, 328); // Enemy, bounded
obj.createentity(176, 56, 1, 0, 8, 0, -64, 320, 288); // Enemy, bounded
obj.createentity(192, 72, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded
obj.createentity(208, 88, 1, 0, 8, 0, -72, 320, 296); // Enemy, bounded
obj.createentity(224, 104, 1, 0, 8, 0, -56, 320, 296); // Enemy, bounded
obj.createentity(240, 120, 1, 0, 8, 0, -48, 320, 296); // Enemy, bounded
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "The Voon Show";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(42,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,260,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,218,98,220,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(168, 72, 10, 0, 51420); // (savepoint)
obj.createentity(24, 60, 11, 120); // (horizontal gravity line)
obj.createentity(24, 148, 11, 120); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "glitch";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(41,51):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,220,218,98,220,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,
179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179,
98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,
259,259,259,259,260,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259,
0,0,0,178,180,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,218,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
0,0,0,258,260,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,
179,179,179,179,180,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,178,179,179,179,179,
98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,98,98,
98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,0,218,98,98,98,98,
98,98,98,98,220,0,0,0,0,0,218,220,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98,
259,259,100,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
740,740,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,218,220,178,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,218,98,220,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(280, 120, 10, 1, 51410); // (savepoint)
obj.createentity(40, 28, 11, 192); // (horizontal gravity line)
obj.createentity(96, 204, 11, 88); // (horizontal gravity line)
obj.createentity(144, 156, 11, 88); // (horizontal gravity line)
obj.createentity(96, 92, 11, 88); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
warpx = true;
roomname = "1950 Silverstone Grand V";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(41,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
179,179,140,98,220,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,260,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,740,740,740,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,740,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,180,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,220,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,100,98,220,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,218,98,220,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(264, 168, 10, 1, 52410); // (savepoint)
obj.createentity(152, 112, 20, 1); // (terminal)
2020-01-01 21:29:24 +01:00
if(!obj.flags[72])
2020-01-01 21:29:24 +01:00
{
if (game.intimetrial || game.nocutscenes)
{
obj.createblock(1, 152 - 4, 112, 20, 16, 85);
}
else
{
obj.createblock(5, 152 - 4, 112, 20, 16, 13);
}
}
warpx = true;
warpy = true;
roomname = "DIY V Repair";
result = contents;
2020-01-01 21:29:24 +01:00
break;
};
2020-01-01 21:29:24 +01:00
case rn(42,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259,259,259,259,
740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,99,259,259,259,259,259,259,259,259,100,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,218,98,220,218,98,220,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
roomname = "Party Time!";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(43,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,
218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,218,98,98,220,218,98,98,220,
218,98,98,220,218,98,98,220,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,0,0,0,0,258,259,259,260,218,98,98,220,218,98,98,220,
218,98,98,220,218,98,98,220,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,258,259,259,260,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,218,98,98,220,218,98,98,220,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,218,98,98,220,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,178,179,179,180,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,
178,179,179,180,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,178,179,179,180,0,0,0,0,0,0,0,0,
218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0,
218,98,98,220,218,98,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,
218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,0,0,0,0,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,
218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,178,179,179,180,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,
218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,
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
218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,
};
2020-01-01 21:29:24 +01:00
obj.createentity(264, 176, 10, 1, 52430); // (savepoint)
obj.createentity(96, 180, 11, 96); // (horizontal gravity line)
obj.createentity(160, 52, 11, 96); // (horizontal gravity line)
obj.createentity(240, 136, 1, 2, 8); // Enemy
obj.createentity(96, 88, 1, 3, 8); // Enemy
obj.createentity(72, 32, 10, 0, 52431); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "Upstairs, Downstairs";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(44,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,178,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,218,98,98,
179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
179,179,179,179,179,179,180,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,
98,98,98,98,98,98,220,218,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,
98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,
98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,
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
98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(64, 112, 2, 11, 4); //Big Threadmill, <<<<<<
obj.createentity(128, 112, 2, 11, 4); //Big Threadmill, <<<<<<
obj.createentity(192, 112, 2, 11, 4); //Big Threadmill, <<<<<<
obj.createentity(32, 112, 2, 9, 4); //Threadmill, <<<
obj.createentity(0, 104, 2, 10, 4); //Big Threadmill, >>>>>>
obj.createentity(64, 104, 2, 10, 4); //Big Threadmill, >>>>>>
obj.createentity(128, 104, 2, 10, 4); //Big Threadmill, >>>>>>
obj.createentity(192, 104, 2, 8, 4); //Threadmill, >>>
obj.createentity(80+8, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded
obj.createentity(128+16, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded
obj.createentity(176+24, 128, 1, 0, 5, 0, 120, 320, 200); // Enemy, bounded
//obj.createentity(224, 168, 1, 1, 5, 0, 120, 320, 200); // Enemy, bounded
obj.createentity(24, 184, 10, 1, 52440); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "Timeslip";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(45,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740,
98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,218,98,98,98,220,218,98,220,740,740,740,740,740,740,
259,259,259,259,259,259,259,260,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,258,259,259,259,260,218,98,139,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,7,7,7,7,7,218,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,
0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
179,179,179,180,0,0,0,0,218,98,139,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
259,100,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,740,740,6,6,740,740,6,6,740,740,6,6,178,179,179,179,179,180,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,258,259,259,260,7,7,740,740,7,7,740,740,7,7,740,740,258,259,259,259,259,260,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,
740,218,98,220,178,179,179,179,179,179,179,180,0,0,0,0,0,740,0,0,0,0,0,0,740,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,
740,218,98,220,218,98,98,98,98,98,98,220,6,6,6,6,6,740,6,6,6,6,6,6,740,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,
740,218,98,220,218,98,99,259,259,100,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,99,259,259,259,259,259,259,259,
740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,
740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,
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
740,218,98,220,218,98,220,740,740,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(40, 176, 10, 1, 52450); // (savepoint)
obj.createentity(80, 156, 11, 176); // (horizontal gravity line)
obj.createentity(128, 88, 10, 1, 52451); // (savepoint)
obj.createentity(160, 76, 11, 96); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
roomname = "Three's Company";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(47,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,218,98,220,218,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,218,98,220,258,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,178,179,179,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,
740,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,
740,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,6,6,6,6,6,6,6,6,6,218,220,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,178,179,179,179,179,179,179,179,180,218,220,178,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,
740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,
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
740,218,98,220,218,98,98,98,98,98,98,98,220,218,220,218,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(68-4, 56, 2, 11, 4); //Big Threadmill, <<<<<<
obj.createentity(132-4, 56, 2, 9, 4); //Threadmill, <<<
obj.createentity(44, 192, 3); //Disappearing Platform
obj.createentity(92, 104, 3); //Disappearing Platform
obj.createentity(120, 192, 2, 3, 6); // Platform
obj.createentity(264, 48, 2, 2, 6); // Platform
2020-01-01 21:29:24 +01:00
roomname = "Cosmic Creepers";
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[] = {
98,98,220,218,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,
98,98,220,258,259,259,259,259,259,259,259,259,259,260,218,98,220,258,259,259,259,259,259,259,259,259,259,259,260,218,98,98,98,98,98,98,98,98,98,98,
259,259,260,7,7,7,7,7,7,7,7,7,7,7,258,259,260,7,7,7,7,7,7,7,7,7,7,7,7,258,259,259,259,259,259,259,259,259,259,259,
179,180,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179,179,179,179,179,179,179,179,179,
98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,
98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,99,259,259,259,259,259,259,259,
98,220,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740,
259,260,49,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740,
7,7,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,7,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,180,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,259,259,259,100,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,
740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,178,179,
740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,
740,740,740,740,740,740,218,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,
179,179,179,179,179,179,140,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,
98,98,98,98,98,98,98,98,220,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,
259,259,259,259,259,259,259,259,260,49,0,0,0,0,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,0,0,50,258,259,
179,179,179,179,179,179,179,179,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,180,6,6,6,6,6,6,6,6,6,6,6,6,178,179,179,
98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,220,178,179,179,179,179,179,179,179,179,179,179,180,218,98,98,
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
98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,220,218,98,98,98,98,98,98,98,98,98,98,220,218,98,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(16, 112, 10, 1, 52480); // (savepoint)
obj.createentity(67, 24, 12, 96); // (vertical gravity line)
obj.createentity(243, 112, 12, 104); // (vertical gravity line)
obj.createentity(288, 104, 10, 0, 52481); // (savepoint)
obj.createentity(187, 24, 12, 80); // (vertical gravity line)
obj.createentity(123, 128, 12, 88); // (vertical gravity line)
2020-01-01 21:29:24 +01:00
roomname = "The Villi People";
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[] = {
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,220,740,740,740,740,740,740,740,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,139,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,218,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,218,220,258,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,
6,6,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,0,0,0,6,6,6,6,6,6,6,
179,180,0,0,0,218,220,0,0,0,178,179,179,179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,180,0,0,0,178,179,179,179,179,179,179,
98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,220,0,0,0,218,98,98,98,98,98,98,
98,220,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,260,0,0,0,218,98,98,98,98,98,98,
259,260,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,178,180,0,0,0,258,259,259,259,259,259,259,
0,0,0,0,0,218,220,0,0,0,218,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,218,220,0,0,0,178,180,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,258,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,258,260,0,0,0,218,220,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,
0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,
179,179,179,179,180,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,178,179,
98,98,98,98,220,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,218,98,
259,259,259,259,260,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,258,259,
0,0,0,0,0,178,179,179,179,179,180,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,220,0,0,0,0,0,
0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,220,0,0,0,0,0,
0,0,0,0,0,218,98,98,98,98,220,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,100,98,220,218,220,0,0,0,0,0,
0,0,0,0,0,218,98,98,98,98,220,178,179,179,179,179,179,180,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,220,0,0,0,0,0,
0,0,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,258,260,0,0,0,0,0,
179,180,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,178,179,179,179,179,179,179,
98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,
98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,
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
98,220,0,0,0,218,98,98,98,98,220,218,98,98,98,98,98,220,218,98,220,740,740,740,740,740,740,740,740,740,218,98,220,218,98,98,98,98,98,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(192, 56, 10, 1, 53500); // (savepoint)
obj.createentity(288, 104, 10, 0, 53501); // (savepoint)
2020-01-01 21:29:24 +01:00
obj.createentity(168, 96, 1, 0, 5); // Enemy
obj.createentity(184+2, 104, 1, 0, 5); // Enemy
obj.createentity(200+4, 112, 1, 0, 5); // Enemy
2020-01-01 21:29:24 +01:00
obj.createentity(88, 176-4, 1, 1, 5); // Enemy
obj.createentity(104+2, 168-4, 1, 1, 5); // Enemy
obj.createentity(120 + 4, 160 - 4, 1, 1, 5); // Enemy
2020-01-01 21:29:24 +01:00
warpx = true;
roomname = "change";
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[] = {
98,220,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
98,220,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,
98,220,0,0,0,740,740,7,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,740,740,740,740,7,7,7,7,7,7,7,7,7,7,218,98,
98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,740,740,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,7,7,0,0,0,0,0,0,0,50,740,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,7,740,49,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,50,740,49,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,218,98,
179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,0,0,0,0,218,98,
98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,740,740,0,0,0,0,218,98,
259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98,
740,740,740,740,740,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,218,98,
740,740,740,740,740,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,740,740,740,0,0,0,0,218,98,
179,179,179,179,179,140,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,
98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,
259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(24, 88, 10, 1, 54500); // (savepoint)
obj.createentity(280, 184, 10, 1, 54501); // (savepoint)
obj.createentity(56, 44, 11, 56); // (horizontal gravity line)
obj.createentity(131, 72, 12, 64); // (vertical gravity line)
obj.createentity(144, 36, 11, 48); // (horizontal gravity line)
obj.createentity(211, 80, 12, 56); // (vertical gravity line)
obj.createentity(224, 52, 11, 80); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
warpx = true;
roomname = "change";
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[] = {
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,7,7,7,7,7,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,7,7,7,0,0,0,0,0,0,7,7,7,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,7,740,740,740,740,740,740,740,740,7,7,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,6,6,0,0,0,0,0,6,6,6,6,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,6,6,6,6,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(16, 48, 10, 1, 53520); // (savepoint)
obj.createentity(96, 144, 3); //Disappearing Platform
obj.createentity(128, 144, 3); //Disappearing Platform
obj.createentity(160, 144, 3); //Disappearing Platform
obj.createentity(208, 80, 3); //Disappearing Platform
obj.createentity(240, 80, 3); //Disappearing Platform
obj.createentity(272, 80, 3); //Disappearing Platform
obj.createentity(304, 80, 3); //Disappearing Platform
2020-01-01 21:29:24 +01:00
roomname = "The Last Straw";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,
740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,740,740,740,740,7,740,740,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,740,
740,740,740,740,7,0,0,0,7,740,740,740,740,740,740,740,740,740,7,0,7,740,740,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,740,740,
740,740,740,7,0,0,0,0,0,7,740,740,740,740,740,740,740,7,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,0,0,7,740,740,740,740,
740,740,7,0,0,0,0,0,0,0,7,740,740,740,740,740,7,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,0,0,7,740,740,740,
740,7,0,0,0,0,0,0,0,0,0,7,740,740,740,7,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,0,0,7,740,740,
7,0,0,0,0,0,0,0,0,0,0,0,7,740,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,
0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,6,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
6,6,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,
740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,6,740,
740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,0,0,0,0,6,740,6,0,0,0,0,0,6,740,740,
740,740,740,740,740,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,6,0,0,0,0,0,0,0,6,740,740,740,6,0,0,0,6,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,6,0,0,0,0,0,6,740,740,740,740,740,6,0,6,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,6,0,0,0,6,740,740,740,740,740,740,740,6,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,6,0,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(0, 80, 3); //Disappearing Platform
obj.createentity(288, 88, 3); //Disappearing Platform
obj.createentity(32, 80, 3); //Disappearing Platform
obj.createentity(64, 136, 3); //Disappearing Platform
obj.createentity(96, 136, 3); //Disappearing Platform
obj.createentity(224, 144, 3); //Disappearing Platform
obj.createentity(192, 144, 3); //Disappearing Platform
obj.createentity(256, 88, 3); //Disappearing Platform
obj.createentity(128, 88, 3); //Disappearing Platform
obj.createentity(160, 88, 3); //Disappearing Platform
2020-01-01 21:29:24 +01:00
roomname = "W";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,53):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
6,6,6,6,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,6,6,6,6,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,6,6,6,6,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(0, 88, 3); //Disappearing Platform
obj.createentity(32, 88, 3); //Disappearing Platform
obj.createentity(64, 88, 3); //Disappearing Platform
obj.createentity(120, 128, 9, 19); // (shiny trinket)
2020-01-01 21:29:24 +01:00
roomname="V";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
roomname = "VV";
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[] = {
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
roomname = "VVV";
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[] = {
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
roomname = "VVVV";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
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
740,740,740,740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
roomname = "VVVVV";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,48):
{
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,
740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,
740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,
740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,
740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
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
740,740,740,740,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createblock(0, 0, 0, 5, 240);
obj.createblock(0, 315, 0, 5, 240);
if(game.intimetrial)
{
obj.createblock(1, 0, 0, 320, 120, 82);
}
else
{
obj.createblock(1, 0, 0, 320, 120, 3500); //Game complete
}
roomname = "VVVVVV";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(46,54):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,218,220,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,218,220,0,258,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,258,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,178,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,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
98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,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
warpy = true;
roomname = "Temporary Fault...";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(47,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
warpy = true;
roomname = "Do Not Adjust the V-hold";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(48,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,218,98,220,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,180,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740,
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,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,218,98,220,740,740,740,740,740,740,
};
2020-01-01 21:29:24 +01:00
obj.createentity(264, 32, 10, 0, 54480); // (savepoint)
2020-01-01 21:29:24 +01:00
/*if(!game.nocutscenes && !obj.flags[71]){
2020-01-01 21:29:24 +01:00
obj.createblock(1, 72, 0, 320, 240, 49);
}*/
warpy = true;
roomname = "Regular Service Will Return Shortly";
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[] = {
98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740,
98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,220,740,740,740,
98,98,98,98,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,258,259,260,0,0,218,220,0,0,218,98,220,740,740,740,
259,259,259,259,259,260,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740,
0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740,
0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740,
0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,218,98,220,740,740,740,
0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,258,260,0,0,218,98,220,740,740,740,
179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,0,0,0,0,258,260,0,0,0,0,178,179,179,179,179,179,180,0,0,218,98,220,740,740,740,
98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,7,7,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740,
98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,220,0,0,218,98,220,740,740,740,
259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,260,0,0,218,98,220,740,740,740,
179,179,179,179,179,180,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,178,179,180,0,0,0,0,0,0,218,98,220,740,740,740,
98,98,98,98,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,220,740,740,740,
259,259,259,100,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,139,179,179,179,
740,740,740,218,98,220,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,218,98,98,98,98,98,
740,740,740,218,98,220,0,0,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,0,0,0,0,258,259,259,259,259,259,
740,740,740,218,98,220,0,0,178,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179,
740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98,
740,740,740,218,98,220,0,0,218,98,98,98,98,98,220,0,0,0,0,6,6,0,0,0,0,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98,
740,740,740,218,98,220,0,0,258,259,259,259,259,259,260,0,0,0,0,178,180,0,0,0,0,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259,
740,740,740,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,178,180,0,0,0,0,0,0,0,0,
740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,
740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,
740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,
740,740,740,218,98,220,0,0,218,220,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,178,179,179,179,179,179,
740,740,740,218,98,220,0,0,218,220,0,0,178,179,180,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98,
740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98,
740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98,
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
740,740,740,218,98,220,0,0,218,220,0,0,218,98,220,0,0,0,0,218,220,0,0,0,0,218,98,220,0,0,218,220,0,0,218,98,98,98,98,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(120, 116, 11, 80); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "Origami Room";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
//Tower Hallways from here
case rn(108,109):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
12,12,12,12,13,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,21,7,7,9,7,7,7,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,21,28,28,0,28,28,28,20,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,
12,12,12,12,21,28,28,0,28,28,28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,
12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,14,12,12,12,12,12,12,
12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,
12,12,12,12,21,28,28,0,28,28,28,20,21,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,22,23,23,23,23,23,23,
23,23,23,23,24,28,28,0,28,28,28,20,21,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,28,28,
0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28,
0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,28,28,
0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,28,28,
0,0,0,28,28,28,28,0,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28,
0,0,0,28,17,18,18,19,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,28,28,28,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,17,18,18,18,18,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,22,14,12,12,12,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,28,28,0,20,12,12,12,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,0,0,0,0,28,28,0,28,28,0,28,28,0,22,14,12,12,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,20,12,12,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,0,28,28,0,28,28,0,28,22,14,12,
0,0,0,28,20,12,12,21,28,28,28,20,21,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,0,28,28,20,12,
0,0,0,28,20,12,12,21,28,28,28,22,24,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12,
18,18,18,18,16,12,12,21,28,28,28,0,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,0,28,28,20,12,
12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,0,28,28,20,12,
12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12,
12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,0,28,28,20,12,
12,12,12,12,12,12,12,21,28,28,28,0,28,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,28,20,12,
12,12,12,12,12,12,12,21,28,28,28,0,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,20,12,
12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
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
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};
2020-01-01 21:29:24 +01:00
obj.createentity(40, 80, 10, 1, 50500); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "Teleporter Divot";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(110,104):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
28,28,28,28,28,28,28,28,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
18,18,18,18,18,18,18,19,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,21,28,28,28,28,20,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,21,28,28,28,28,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,21,28,28,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,0,0,28,28,28,28,0,0,
12,12,12,12,12,12,12,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
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
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};
2020-01-01 21:29:24 +01:00
obj.createentity(16, 112, 10, 1, 50520); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "Seeing Red";
if(!game.intimetrial)
{
if(game.companion==0 && !obj.flags[8] && !game.crewstats[3]) //also need to check if he's rescued in a previous game
2020-01-01 21:29:24 +01:00
{
obj.createentity(264, 185, 18, 15, 1, 17, 0);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 26*8, 0, 32, 240, 36);
}
}
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(111,104):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,13,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,14,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
12,12,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,18,18,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,12,12,
18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,16,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
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
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
};
2020-01-01 21:29:24 +01:00
obj.createentity(128-16, 80-32, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
roomname = "Building Apport";
if(game.intimetrial)
{
obj.createblock(1, 40, 0, 32, 240, 82);
}
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
//Intermission level 2
case rn(53,48):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,178,179,179,179,179,180,178,180,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,258,259,259,259,259,260,218,220,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,180,0,0,0,0,218,220,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,258,260,0,0,0,0,258,260,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,180,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
179,179,179,179,179,180,178,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,
98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,
259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,
179,179,180,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,178,179,179,179,179,179,179,
98,98,220,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,
259,259,260,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,258,259,259,260,258,259,259,259,259,259,259,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,258,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,258,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
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
98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
};
2020-01-01 21:29:24 +01:00
roomname = "Whee Sports";
warpx = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,49):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,100,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,178,179,179,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,178,179,180,178,179,179,179,179,179,179,180,178,179,180,0,218,98,98,
219,219,219,219,219,219,219,218,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98,
179,179,179,179,179,179,179,140,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,258,259,259,259,259,259,259,260,218,98,220,0,218,98,98,
98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,258,259,260,0,218,98,98,
259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,179,179,180,0,0,0,0,0,0,0,258,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,178,180,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,220,0,218,220,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,220,0,258,260,0,0,0,0,0,178,179,180,0,178,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,220,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98,
259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,0,0,0,0,218,98,220,178,179,179,179,179,179,179,180,218,98,220,0,218,98,98,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,220,218,98,98,98,98,98,98,220,218,98,220,0,218,98,98,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,258,259,260,258,259,259,259,259,259,259,260,258,259,260,0,218,98,98,
179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,
98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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
roomname = "Whizz Down The Shaft";
warpx = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53, 50):
{
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,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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-32, 11, 328); // (horizontal gravity line)
obj.createentity(-8, 148 + 32, 11, 328); // (horizontal gravity line)
2020-01-01 21:29:24 +01:00
obj.createblock(1, -10, 84 - 16, 340, 32, 10); //create the second line!
roomname = "The Gravitron";
warpx = true; //warpy = true;
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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,178,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,99,259,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,
179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,
219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,218,98,220,0,0,0,0,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(264, 176, 10, 1, 51530); // (savepoint)
2020-01-01 21:29:24 +01:00
if(game.companion==0) //also need to check if he's rescued in a previous game
{
if (game.lastsaved == 2)
{
obj.createentity(112, 169, 18, 14, 0, 17, 1);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 22 * 8, 16*8, 32, 240, 37);
}
else if (game.lastsaved ==3)
{
obj.createentity(112, 169, 18, 15, 0, 17, 1);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 22 * 8, 16*8, 32, 240, 38);
}
else if (game.lastsaved == 4)
{
obj.createentity(112, 169, 18, 13, 0, 17, 1);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 22 * 8, 16*8, 32, 240, 39);
}
else
{
obj.createentity(112, 169, 18, 16, 1, 17, 1);
2020-01-01 21:29:24 +01:00
obj.createblock(1, 22 * 8, 16*8, 32, 240, 40);
}
}
roomname = "Tunnel of Terror";
warpx = true;
game.swnmode = false;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,52):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,218,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,218,98,220,0,0,0,0,178,179,180,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,218,98,220,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,258,259,260,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,
179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,
259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,180,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,220,219,219,219,219,219,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,100,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity((22 * 8)+4, (9 * 8) + 4, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
roomname = "House of Mirrors";
warpx = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
//Intermission 1
case rn(41,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
259,259,259,259,259,259,259,259,259,260,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
179,179,179,179,179,179,180,178,180,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
259,259,259,259,259,259,260,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,218,220,0,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,139,179,179,179,179,179,
179,179,180,178,179,180,0,218,220,0,258,259,260,0,218,98,98,220,0,258,259,259,259,260,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98,
98,98,220,258,259,260,0,258,260,0,0,0,0,0,258,259,259,260,0,7,7,7,7,7,0,218,98,98,98,98,220,0,258,259,259,259,259,259,259,259,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,7,7,7,7,7,7,7,7,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,220,178,179,180,0,178,179,179,179,179,180,0,6,6,6,6,0,178,179,179,179,180,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,
259,259,260,258,259,260,0,218,98,98,98,98,220,0,178,179,179,180,0,218,98,98,98,220,0,6,6,6,6,6,6,0,218,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,258,259,259,259,259,260,0,258,259,259,260,0,258,259,259,259,260,0,178,179,179,179,179,180,0,258,259,259,259,259,259,259,259,
179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,260,0,0,0,0,0,0,0,0,0,
259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,180,0,178,179,179,180,0,178,179,179,179,180,0,178,179,179,179,179,180,0,0,0,0,0,0,0,0,0,
98,98,98,98,98,98,98,98,98,98,98,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,178,179,179,179,179,179,179,179,
259,259,259,259,259,259,259,259,259,259,100,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,98,98,98,98,98,98,
219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,99,259,259,259,259,259,
219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,218,98,220,0,218,98,98,220,0,218,98,98,98,220,0,218,98,98,98,98,220,0,218,98,220,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
//obj.createentity(164, 96, 10, 1, 56410); // (savepoint)
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "Now Take My Lead";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(42,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179,
179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,
98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259,
259,259,259,259,259,259,259,260,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,180,178,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,220,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,260,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,258,259,260,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 0, 0, 32, 240, 41); //scene 2
obj.createblock(1, 280, 0, 32, 240, 12); //scene 2
}
roomname = "What Are You Waiting For?";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(43,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,180,0,0,0,0,178,179,179,179,
0,0,0,0,0,0,0,0,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,220,6,6,6,6,218,98,98,98,
0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,98,220,178,179,179,180,218,98,99,259,
0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219,
0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219,
0,0,0,0,0,0,0,0,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,258,259,259,260,218,98,98,220,218,98,220,219,
179,179,179,179,179,179,179,180,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219,
98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,220,219,
98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,139,179,
98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,218,98,98,98,
259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,258,259,259,259,
0,0,0,0,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,218,98,98,220,0,0,0,0,
0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,258,259,259,260,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 20, 0, 32, 240, 13); //scene 2
}
obj.createentity(104, 120, 1, 0, 3); // Enemy
obj.createentity(168, 176, 1, 1, 3); // Enemy
obj.createentity(232, 120, 1, 0, 3); // Enemy
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "Don't Get Ahead of Yourself!";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(44,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(144, 40, 10, 1, 56440); // (savepoint)
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 200, 0, 32, 240, 42); //scene 3
}
roomname = "Very Good";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(45,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219,
98,98,98,98,98,98,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,218,98,220,219,219,219,219,219,
259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,179,
219,219,219,219,219,218,98,220,0,0,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,98,98,98,98,98,
219,219,219,219,219,218,98,220,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,178,179,179,180,178,179,179,180,178,179,179,179,179,179,179,180,178,179,179,180,178,179,179,179,180,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,218,98,98,220,258,259,259,260,218,98,98,98,98,98,98,220,258,259,259,260,218,98,98,98,220,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,178,179,179,179,179,179,179,
179,179,179,179,179,140,98,220,218,98,98,220,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98,
98,98,98,98,98,98,98,220,218,98,98,220,0,0,0,0,258,259,259,259,259,259,259,260,0,0,0,0,218,98,98,98,220,218,98,98,98,98,98,98,
259,259,259,259,259,259,259,260,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,258,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(104, 152, 1, 0, 3); // Enemy
obj.createentity(200, 152, 1, 0, 3); // Enemy
2020-01-01 21:29:24 +01:00
roomname = "Must I Do Everything For You?";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(46,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(56, 192, 10, 1, 56460); // (savepoint)
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 200, 0, 32, 240, 43); //scene 3
}
roomname = "Now Stay Close To Me...";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(47,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,0,0,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,6,6,6,6,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,100,98,220,178,179,179,180,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(144, 64, 2, 0, 2, 144, 64, 176, 216); // Platform, bounded
2020-01-01 21:29:24 +01:00
roomname = "...But Not Too Close";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(48,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,180,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,260,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,220,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,218,98,139,179,179,179,179,179,179,179,179,179,179,179,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,180,0,0,0,50,218,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,50,258,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,6,6,6,6,6,6,6,6,258,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
warpy = true;
roomname = "Don't Be Afraid";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(49,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(152, 176, 10, 1, 56490); // (savepoint)
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 200, 0, 32, 240, 44); //scene 3
}
warpy = true;
roomname = "Do as I Say...";
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(50,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,218,98,220,178,179,179,180,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,218,98,220,218,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,218,98,220,258,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,179,179,179,179,180,178,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,98,220,218,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,260,218,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
179,179,179,179,179,179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,
259,259,259,259,259,259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,180,218,98,
219,219,219,219,219,219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,98,220,218,98,
219,219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,98,220,218,98,
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
219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,
};
2020-01-01 21:29:24 +01:00
obj.createentity(88, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded
obj.createentity(136, 136, 2, 0, 4, 88, 128, 216, 208); // Platform, bounded
obj.createentity(184, 200, 2, 1, 4, 88, 128, 216, 208); // Platform, bounded
2020-01-01 21:29:24 +01:00
roomname = "...Not as I Do";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(51,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,98,220,218,98,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,260,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(192, 136, 10, 1, 56510); // (savepoint)
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 80, 0, 32, 240, 45); //scene 3
}
warpy = true;
roomname = "Mind Your Head";
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[] = {
219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,
219,218,98,220,7,7,7,7,7,178,180,7,7,7,7,7,7,7,178,180,7,7,7,7,178,179,179,180,7,7,7,7,7,7,7,7,218,98,220,219,
219,218,98,220,0,0,0,0,0,218,220,0,0,0,0,0,0,0,218,220,0,0,0,0,218,98,98,220,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,258,260,0,0,0,0,0,0,0,258,260,0,0,0,0,258,259,259,260,0,0,0,0,0,0,0,0,218,98,139,179,
219,218,98,220,0,0,0,0,0,7,7,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7,7,7,0,0,0,0,0,0,0,0,218,98,98,98,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,179,179,179,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,
259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,99,259,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
179,179,179,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
259,100,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,
219,218,98,220,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,218,98,220,219,
219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,220,219,
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
219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(48, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(80, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(112, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(144, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(176, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(208, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
obj.createentity(240, 200, 2, 1, 6, 48, 48, 272, 208); // Platform, bounded
2020-01-01 21:29:24 +01:00
roomname = "Do Try To Keep Up";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(53,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
179,179,179,179,179,179,179,180,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,0,0,218,98,220,219,219,219,219,219,
98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,218,98,220,219,219,219,219,219,
259,259,259,259,259,100,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,219,
219,219,219,219,219,218,98,220,0,0,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,218,98,139,179,179,179,179,179,
219,219,219,219,219,218,98,220,0,0,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,98,98,98,98,98,98,
219,219,219,219,219,218,98,220,0,0,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,258,259,259,259,259,259,259,259,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
219,219,219,219,219,218,98,220,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
219,219,219,219,219,218,98,220,218,98,99,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity(72, 72, 10, 1, 56530); // (savepoint)
2020-01-01 21:29:24 +01:00
roomname = "You're Falling Behind";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
case rn(54,56):
{
2020-01-01 21:29:24 +01:00
static const short contents[] = {
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,139,179,179,179,179,179,179,179,179,179,179,179,140,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,218,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,258,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
219,219,219,219,219,219,219,219,219,219,219,219,219,218,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
179,179,179,179,179,179,179,179,179,179,179,179,179,140,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,220,219,219,219,219,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,139,179,179,179,179,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,218,98,98,98,98,98,98,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,259,259,259,259,259,259,
179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98,
259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
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
219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,
};
2020-01-01 21:29:24 +01:00
obj.createentity((18 * 8) + 4, (10 * 8) + 4, 14); //Teleporter!
2020-01-01 21:29:24 +01:00
if(!game.nodeathmode)
{
obj.createblock(1, 104, 0, 32, 240, 46); //scene 3
}
roomname = "Class Dismissed!";
warpy = true;
result = contents;
2020-01-01 21:29:24 +01:00
break;
}
2020-01-01 21:29:24 +01:00
#endif
2020-01-01 21:29:24 +01:00
default:
{
static const short contents[1200] = {0};
2020-01-01 21:29:24 +01:00
roomname = "Outer Space";
//game.test = true;
//game.teststring = "ERROR: Map not found in Final Area";
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
}